RX Family ADC Module Using Firmware Integration Technology
R01AN1666EJ0220 Rev. 2.20 Page 68 of 74
Dec 01, 2016
3.5 R_ADC_ReadAll()
This function reads conversion results from all potential sources, enabled or not.
Format
adc_err_t R_ADC_ReadAll(adc_data_t * const p_data);
Parameters
p_data
Pointer to structure to load register values into.
See type adc_data_t in section 2.10 for the MCU being used
An example structure for the register values is as follows:
typedef struct st_adc_data
{
uint16_t chan[ADC_REG_ARRAY_MAX]; // chans/indexes used depends upon MCU
uint16_t temp;
uint16_t volt;
uint16_t dbltrig;
uint16_t self_diag;
} adc_data_t;
Return Values
ADC_SUCCESS: Success
ADC_ERR_MISSING_PTR: p_data is FIT_NO_PTR/NULL
Properties
Prototyped in file “r_s12ad_rx_if.h”
Description
Reads conversion results from all potential sources, enabled or not. This function is convenient for getting a
snapshot of all values at any point in time.
Reentrant
Yes.
Example
adc_data_t data;
:
/* Read all channel registers available on hardware */
R_ADC_ReadAll(&data); // “data” loaded with all conversion reg values
Special Notes:
None.