#include <microvolt_input.h>
Classes | |
struct | References |
Public Member Functions | |
Result< int32_t > | TryReadMicrovoltsFor (chrono::SystemClock::duration timeout) |
Result< int32_t > | TryReadMicrovoltsUntil (chrono::SystemClock::time_point deadline) |
![]() | |
Result< int32_t > | TryReadFor (chrono::SystemClock::duration timeout) |
virtual Result< int32_t > | TryReadUntil (chrono::SystemClock::time_point deadline)=0 |
virtual Limits | GetLimits () const =0 |
The common interface for obtaining voltage samples in microvolts. This interface represents a single voltage input or channel. Users will need to supply their own ADC driver implementation in order to provide the reference voltages and to configure and enable the ADC peripheral where needed. Users are responsible for managing multi-threaded access to the ADC driver if the ADC services multiple channels.
|
inline |
Blocks until the specified timeout duration has elapsed or the voltage sample has been returned, whichever comes first.
This method is thread-safe.
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. * *
|
inline |
Blocks until the deadline time has been reached or the voltage sample has been returned, whichever comes first.
This method is thread-safe.
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. * *