Analog-to-digital converter libraries and utilities. Main docs: https://pigweed.dev/pw_analog.
|
int32_t | pw::analog::AnalogInput::Limits::min |
| The minimum of the sample range.
|
|
int32_t | pw::analog::AnalogInput::Limits::max |
| The maximum of the sample range.
|
|
int32_t | pw::analog::MicrovoltInput::References::max_voltage_uv |
| Microvolts at AnalogInput::Limits::max .
|
|
int32_t | pw::analog::MicrovoltInput::References::min_voltage_uv |
| Microvolts at AnalogInput::Limits::min .
|
|
◆ GetLimits()
virtual Limits pw::analog::AnalogInput::GetLimits |
( |
| ) |
const |
|
pure virtual |
- Returns
- The range of the ADC sample. These values do not change at runtime.
◆ TryReadFor()
Blocks until the specified timeout duration has elapsed or the ADC sample has been returned, whichever comes first.
This method is thread safe.
- Returns
embed:rst:leading-asterisk
*
* .. pw-status-codes::
*
* OK: Returns a sample.
*
* RESOURCE_EXHAUSTED: ADC peripheral in use.
*
* DEADLINE_EXCEEDED: Timed out waiting for a sample.
*
* Other statuses left up to the implementer.
*
*
◆ TryReadMicrovoltsFor()
Blocks until the specified timeout duration has elapsed or the voltage sample has been returned, whichever comes first.
This method is thread-safe.
- Returns
embed:rst:leading-asterisk
*
* .. pw-status-codes::
*
* OK: Returns a voltage sample in microvolts (uV) on success.
*
* RESOURCE_EXHAUSTED: ADC peripheral in use.
*
* DEADLINE_EXCEEDED: Timed out waiting for a sample.
*
* Other statuses left up to the implementer.
*
*
◆ TryReadMicrovoltsUntil()
Result< int32_t > pw::analog::MicrovoltInput::TryReadMicrovoltsUntil |
( |
chrono::SystemClock::time_point |
deadline | ) |
|
|
inline |
Blocks until the deadline time has been reached or the voltage sample has been returned, whichever comes first.
This method is thread-safe.
- Returns
embed:rst:leading-asterisk
*
* .. pw-status-codes::
*
* OK: Returns a voltage sample in microvolts (uV) on success.
*
* RESOURCE_EXHAUSTED: ADC peripheral in use.
*
* DEADLINE_EXCEEDED: Timed out waiting for a sample.
*
* Other statuses left up to the implementer.
*
*
◆ TryReadUntil()
virtual Result< int32_t > pw::analog::AnalogInput::TryReadUntil |
( |
chrono::SystemClock::time_point |
deadline | ) |
|
|
pure virtual |
Blocks until the deadline time has been reached or the ADC sample has been returned, whichever comes first.
This method is thread safe.
- Returns
embed:rst:leading-asterisk
*
* .. pw-status-codes::
*
* OK: Returns a sample on success.
*
* RESOURCE_EXHAUSTED: ADC peripheral in use.
*
* DEADLINE_EXCEEDED: Timed out waiting for a sample.
*
* Other statuses left up to the implementer.
*
*