![]() |
RUI3 (RAK Unified Interface 3) - RAK4631
|
Provide a hardware independent ADC driver layer for API layer to use. More...
Go to the source code of this file.
Macros | |
#define | UDRV_ADC_SAMPLE_CNT 16 |
Enumerations | |
enum | UDRV_ADC_RESOLUTION { UDRV_ADC_RESOLUTION_6BIT = (0UL), UDRV_ADC_RESOLUTION_8BIT = (1UL), UDRV_ADC_RESOLUTION_10BIT = (2UL), UDRV_ADC_RESOLUTION_12BIT = (3UL), UDRV_ADC_RESOLUTION_14BIT = (4UL) } |
enum | UDRV_ADC_MODE { UDRV_ADC_MODE_DEFAULT = (0UL), UDRV_ADC_MODE_3_3 = (1UL), UDRV_ADC_MODE_3_0 = (2UL), UDRV_ADC_MODE_2_4 = (3UL), UDRV_ADC_MODE_1_8 = (4UL), UDRV_ADC_MODE_1_2 = (5UL) } |
enum | UDRV_ADC_CHANNEL { UDRV_ADC_CHANNEL_TEMPSENSOR = 253, UDRV_ADC_CHANNEL_VREFINT = 254, UDRV_ADC_CHANNEL_VBAT = 255 } |
Functions | |
void | udrv_adc_set_resolution (UDRV_ADC_RESOLUTION resolution) |
UDRV_ADC_RESOLUTION | udrv_adc_get_resolution (void) |
void | udrv_adc_set_mode (UDRV_ADC_MODE mode) |
UDRV_ADC_MODE | udrv_adc_get_mode (void) |
void | udrv_adc_oversampling (uint32_t uloversampling) |
int32_t | udrv_adc_read (uint32_t pin, int16_t *value) |
void | udrv_adc_suspend (void) |
void | udrv_adc_resume (void) |
Provide a hardware independent ADC driver layer for API layer to use.
#define UDRV_ADC_SAMPLE_CNT 16 |
enum UDRV_ADC_RESOLUTION |
enum UDRV_ADC_MODE |
enum UDRV_ADC_CHANNEL |
void udrv_adc_set_resolution | ( | UDRV_ADC_RESOLUTION | resolution | ) |
Set ADC resolutions.
resolution | The resolution to be set UDRV_ADC_RESOLUTION_8BIT - 8 bit resolution. UDRV_ADC_RESOLUTION_10BIT - 10 bit resolution. UDRV_ADC_RESOLUTION_12BIT - 12 bit resolution. UDRV_ADC_RESOLUTION_14BIT - 14 bit resolution. |
UDRV_ADC_RESOLUTION udrv_adc_get_resolution | ( | void | ) |
Get ADC resolutions.
void udrv_adc_set_mode | ( | UDRV_ADC_MODE | mode | ) |
Set ADC mode.
mode | The ADC mode to be set UDRV_ADC_MODE_DEFAULT : default range For RAK11720 (Apollo3), UDRV_ADC_MODE_1_5 : 0 - 1.5 V For other RAK boards, UDRV_ADC_MODE_3_0 : 0 - 3.0 V UDRV_ADC_MODE_2_4 : 0 - 2.4 V UDRV_ADC_MODE_1_8 : 0 - 1.8 V UDRV_ADC_MODE_1_2 : 0 - 1.2 V |
UDRV_ADC_MODE udrv_adc_get_mode | ( | void | ) |
Get ADC mode.
void udrv_adc_oversampling | ( | uint32_t | uloversampling | ) |
int32_t udrv_adc_read | ( | uint32_t | pin, |
int16_t * | value | ||
) |
Read out the ADC value.
pin | The analog input pin |
value | The read out value |
void udrv_adc_suspend | ( | void | ) |
Disable and save all the active ADC channel for power saving
void udrv_adc_resume | ( | void | ) |
Restore all the active ADC channel after power saving