4 #include <twr_common.h>
5 #include <stm32l083xx.h>
void twr_adc_resolution_set(twr_adc_channel_t channel, twr_adc_resolution_t resolution)
Set ADC resolution for specific channel.
bool twr_adc_async_measure(twr_adc_channel_t channel)
Begins reading the ADC channel voltage in asynchronous mode.
void twr_adc_oversampling_set(twr_adc_channel_t channel, twr_adc_oversampling_t oversampling)
Set ADC oversampling for specific channel.
bool twr_adc_set_event_handler(twr_adc_channel_t channel, void(*event_handler)(twr_adc_channel_t, twr_adc_event_t, void *), void *event_param)
Set callback function.
twr_adc_oversampling_t
ADC oversampling.
bool twr_adc_calibration(void)
Calibration.
bool twr_adc_async_get_voltage(twr_adc_channel_t channel, float *result)
Get asynchronous measurement result in volts.
twr_adc_event_t
ADC event.
bool twr_adc_get_vdda_voltage(float *vdda_voltage)
Get voltage on VDDA pin.
twr_adc_channel_t
ADC channel.
twr_adc_resolution_t
ADC resolution.
bool twr_adc_is_ready()
Check if ADC is ready for reading.
bool twr_adc_async_get_value(twr_adc_channel_t channel, uint16_t *result)
Get asynchronous measurement result.
bool twr_adc_get_value(twr_adc_channel_t channel, uint16_t *result)
Reads the ADC channel value.
void twr_adc_init()
Initialize ADC converter.
@ TWR_ADC_OVERSAMPLING_128
ADC 128x oversampling.
@ TWR_ADC_OVERSAMPLING_4
ADC 4x oversampling.
@ TWR_ADC_OVERSAMPLING_2
ADC 2x oversampling.
@ TWR_ADC_OVERSAMPLING_64
ADC 64x oversampling.
@ TWR_ADC_OVERSAMPLING_256
ADC 256x oversampling.
@ TWR_ADC_OVERSAMPLING_8
ADC 8x oversampling.
@ TWR_ADC_OVERSAMPLING_NONE
ADC no oversampling.
@ TWR_ADC_OVERSAMPLING_32
ADC 32x oversampling.
@ TWR_ADC_OVERSAMPLING_16
ADC 16x oversampling.
@ TWR_ADC_EVENT_DONE
ADC event.
@ TWR_ADC_CHANNEL_A2
ADC channel A2.
@ TWR_ADC_CHANNEL_A5
ADC channel A5.
@ TWR_ADC_CHANNEL_A0
ADC channel A0.
@ TWR_ADC_CHANNEL_A4
ADC channel A4.
@ TWR_ADC_CHANNEL_A6
ADC channel A6.
@ TWR_ADC_CHANNEL_A3
ADC channel A3.
@ TWR_ADC_CHANNEL_A1
ADC channel A1.
@ TWR_ADC_RESOLUTION_6_BIT
ADC 6 bit resolution.
@ TWR_ADC_RESOLUTION_10_BIT
ADC 10 bit resolution.
@ TWR_ADC_RESOLUTION_12_BIT
ADC 12 bit resolution.
@ TWR_ADC_RESOLUTION_8_BIT
ADC 8 bit resolution.