The ADC hardware abstraction layer's control class.
More...
#include <adc.h>
|
| | Controller (const Controller &)=delete |
| Controller & | operator= (const Controller &)=delete |
| void | configure (const controller_config_t &config) |
| | Configures the ADC Controller.
|
| void | shutdown () |
| | Safely shuts down the controller and hardware.
|
| void | add (adc_channel_t adc_channel) |
| | Adds an ADC input to the controller.
|
| uint16_t | read_raw (adc_channel_t adc_channel, uint16_t samples=1) const |
| | Reads the current raw ADC reading.
|
| uint16_t | read_millivolts (adc_channel_t adc_channel, uint16_t samples=1) const |
| | Reads the current voltage in millivolts.
|
|
| static Controller & | get_instance () |
| | Returns a reference to the static controller instance.
|
The ADC hardware abstraction layer's control class.
◆ Controller()
| HAL::ADC::Controller::Controller |
( |
const Controller & | | ) |
|
|
delete |
◆ add()
| void HAL::ADC::Controller::add |
( |
adc_channel_t | adc_channel | ) |
|
Adds an ADC input to the controller.
- Parameters
-
| adc_channel | The ADC channel to add |
◆ configure()
Configures the ADC Controller.
- Parameters
-
| config | The config struct to use |
◆ get_instance()
| Controller & HAL::ADC::Controller::get_instance |
( |
| ) |
|
|
inlinestatic |
Returns a reference to the static controller instance.
- Note
- The instance will be created on the first call of this function
- Returns
- Reference to the controller object
◆ operator=()
| Controller & HAL::ADC::Controller::operator= |
( |
const Controller & | | ) |
|
|
delete |
◆ read_millivolts()
| uint16_t HAL::ADC::Controller::read_millivolts |
( |
adc_channel_t | adc_channel, |
|
|
uint16_t | samples = 1 ) const |
|
nodiscard |
Reads the current voltage in millivolts.
- Returns
- The voltage in millivolts
- Parameters
-
| adc_channel | The ADC channel to read from |
| samples | The amount of samples to take when reading (default: 1) |
◆ read_raw()
| uint16_t HAL::ADC::Controller::read_raw |
( |
adc_channel_t | adc_channel, |
|
|
uint16_t | samples = 1 ) const |
|
nodiscard |
Reads the current raw ADC reading.
- Returns
- The raw ADC reading
- Parameters
-
| adc_channel | The ADC channel to read from |
| samples | The amount of samples to take when reading (default: 1) |
◆ shutdown()
| void HAL::ADC::Controller::shutdown |
( |
| ) |
|
Safely shuts down the controller and hardware.
The documentation for this class was generated from the following files: