Analog-To-Digital Converter driver.
More...
Analog-To-Digital Converter driver.
Enable an ADC pin to be sampled in burst mode.
- Parameters
-
pin | The desired pin to sample. |
Initializes the Analog/Digital converter for Burst Mode.
- Parameters
-
clock_divider | The divider applied to APB peripheral clock. |
handler | Interruption handler |
- Note
- This function DOES NOT actually starts the driver (see rflpc_adc_burst_start()).
void rflpc_adc_burst_start |
( |
| ) |
|
Start ADC burst mode.
- Note
- This function actually starts the driver with burst mode enabled. Please check you have previously enabled all the adc pins you want to be sampled.
Initializes the Analog/Digital Converter on given pin.
- Parameters
-
pin | The desired pin to sample. |
clock_divider | The divider applied to APB peripheral clock. |
- Note
- This function actually starts the driver.
-
APB peripheral clock is set by default at 13MHz, because the maximum sample clock is 13Mhz anyway.
Read the last converted value of specified pin using dedicated data register.
- Parameters
-
- Returns
- The value corresponding to specified pin's last conversion.
- Note
- Returned value is stored on 12 bits. Bit 15 stores the OVERRUN flag.
-
This function waits for a conversion to be done.
-
You should use ONLY ONE method to read converted values on ADC pins, as OVERRUN flag may be out of synchronization between registers.
uint16_t rflpc_adc_read_global |
( |
| ) |
|
Read the last converted value of any ADC pin, using global data register.
- Returns
- The last converted value by any pin.
- Note
- Returned value is stored on 12 bits. Bits 12 to 14 store the pin from which the value has been converted. Bit 15 stores the OVERRUN flag.
-
This function waits for a conversion to be done.
-
You should use ONLY ONE method to read converted values on ADC pins, as OVERRUN flag may be out of synchronization between registers.
Start an ADC conversion on specified pin.
- Parameters
-
pin | the pin to be sampled. |
- Note
- This only starts sampling, it does not wait until conversion is done.
Definition at line 85 of file adc.h.
References RFLPC_SET_BITS_VAL.