Analog-to-digital converter libraries and utilities.
Main docs: Home
|
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
- A Result containing a sample on success or one of the following error codes on failure:
◆ 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
- A Result containing a voltage sample in microvolts (uV) on success or one of the following error codes on failure:
◆ 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
- A Result containing a voltage sample in microvolts (uV) on success or one of the following error codes on failure:
- 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
- A Result containing a sample on success or one of the following error codes on failure: