R_Adc_Read() - Renesas RX110 Application Note

12-bit a/d converter support
Table of Contents

Advertisement

RX Family
3.4

R_ADC_Read()

This function reads conversion results from a single channel, sensor, double trigger, or self-diagnosis register.
Format
adc_err_t R_ADC_Read(uint8_t
Parameters
unit
0 or 1. For MCUs with only one unit 0 should be passed (only the RX64M/RX71M/RX65x have 2 units).
reg_id
Id for the register to read. See type adc_reg_t in section 2.10 for the MCU being used.
p_data
Pointer to variable to load value into.
Return Values
ADC_SUCCESS:
ADC_ERR_INVALID_ARG:
ADC_ERR_MISSING _PTR:
Properties
Prototyped in file "r_s12ad_rx_if.h"
Description
Reads conversion results from a single channel, sensor, double trigger, or self-diagnosis register.
Reentrant
Yes.
Example
uint16_t data;
:
/* Read channel 0 on unit 0 */
R_ADC_Read(0, ADC_CH0_REG, &data);
Special Notes (RX110/RX111/RX113):
For temperature sensor output and internal reference voltage, discard the first A/D conversion result after the open, and
use the second and the subsequent A/D conversion results.
R01AN1666EJ0220 Rev. 2.20
Dec 01, 2016
ADC Module Using Firmware Integration Technology
unit,
adc_reg_t const
reg_id,
uint16_t * const
p_data);
Success
unit or reg_id contains an invalid value.
p_data is FIT_NO_PTR/NULL
// conversion value placed in "data"
Page 67 of 74

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents