RA Flexible Software Package Documentation  Release v5.6.0

 
ADC (r_adc_b)

Functions

fsp_err_t R_ADC_B_Open (adc_ctrl_t *p_ctrl, adc_cfg_t const *const p_cfg)
 
fsp_err_t R_ADC_B_ScanCfg (adc_ctrl_t *p_ctrl, void const *const p_scan_cfg)
 
fsp_err_t R_ADC_B_CallbackSet (adc_ctrl_t *const p_api_ctrl, void(*p_callback)(adc_callback_args_t *), void const *const p_context, adc_callback_args_t *const p_callback_memory)
 
fsp_err_t R_ADC_B_ScanStart (adc_ctrl_t *p_ctrl)
 
fsp_err_t R_ADC_B_ScanGroupStart (adc_ctrl_t *p_ctrl, adc_group_mask_t group_mask)
 
fsp_err_t R_ADC_B_ScanStop (adc_ctrl_t *p_ctrl)
 
fsp_err_t R_ADC_B_StatusGet (adc_ctrl_t *p_ctrl, adc_status_t *p_status)
 
fsp_err_t R_ADC_B_Read (adc_ctrl_t *p_ctrl, adc_channel_t const channel_id, uint16_t *const p_data)
 
fsp_err_t R_ADC_B_Read32 (adc_ctrl_t *p_ctrl, adc_channel_t const channel_id, uint32_t *const p_data)
 
fsp_err_t R_ADC_B_FifoRead (adc_ctrl_t *p_ctrl, adc_group_mask_t const group_mask, adc_b_fifo_read_t *const p_data)
 
fsp_err_t R_ADC_B_InfoGet (adc_ctrl_t *p_ctrl, adc_info_t *p_adc_info)
 
fsp_err_t R_ADC_B_Close (adc_ctrl_t *p_ctrl)
 
fsp_err_t R_ADC_B_Calibrate (adc_ctrl_t *const p_ctrl, void const *p_extend)
 
fsp_err_t R_ADC_B_OffsetSet (adc_ctrl_t *const p_ctrl, adc_channel_t const reg_id, int32_t offset)
 

Detailed Description

Driver for the ADC_B peripheral on RA MCUs. This module implements the ADC Interface.

Overview

Features

The ADC_B module supports the following features:

Configuration

Virtual Channels and Scan Groups

A virtual channel is a group of registers that stores the A/D conversion configuration for a single analog pin. Each virtual channel has a number of options including the channel for conversion, settings for conversion, data processing method and so on.

To perform A/D conversion of an analog pin, the channel associated with the pin must first be assigned to a virtual channel. That virtual channel is then assigned to a scan group, which brings together one or more virtual channels to be converted in sequence with a specified conversion unit.

Note
Analog channels may be assigned to more than one virtual channel. However, a virtual channel can be assigned to only one scan group. When performing A/D conversion on one analog channel in different scan groups or when converting a channel several times within the same scan group, assign several virtual channels to one analog channel.
To avoid data being overwritten, when converting a channel multiple times within the same scan group use R_ADC_B_FifoRead() instead of R_ADC_B_Read().

Configuring a Scan

To perform A/D conversion of a scan group the following should be configured:

Note
Up to 8 virtual channels can be assigned to a scan group. If more than 8 channels are assigned to a group, only the lowest 8 will be targeted for A/D conversion.

Build Time Configurations for r_adc_b

The following build time configurations are defined in fsp_cfg/r_adc_b_cfg.h:

ConfigurationOptionsDefaultDescription
Parameter Checking
  • Default (BSP)
  • Enabled
  • Disabled
bsp If selected, code for parameter checking is included in the build.

Note
The instance configurations available in this driver are too numerous to list here. Please refer to the RA Configuration editor in e² studio for further details.

Clock Configuration

The ADC_B conversion clock source may be configured to use PCLKC, PCLKA, or GPT with a selectable division ratio. The ADC_B clock may operate between 25 MHz at a minimum and 60 MHz at a maximum.

Pin Configuration

The ANxxx pins are analog input channels that can be used with the ADC_B.

ADTRG0 and ADTRG1 can be used to start scans with an external trigger. When external triggers are used, ADC_B scans begin on the falling edge of the ADTRG pin.

Usage Notes

Limitations

Developers should be aware of the following limitations when using R_ADC_B:

Self-Calibration

Calibration is required to use this peripheral; call R_ADC_B_Calibrate() after R_ADC_B_ScanCfg() and prior to any other function. Self-Calibration should be performed any time ADC operating characteristics are modified, including after reset, releasing module-stop, when returning from software standby or deep software standby mode, each time the ADC ScanCfg function is called, and any time ADC related clocks are updated.

Note
Self-calibration is a non-blocking operation. The application should wait for an ADC_EVENT_CALIBRATION_COMPLETE callback before using other ADC_B functionality.
The self-calibration process will disable hardware triggers that were previously enabled.

ADC_B Operation Modes

The driver supports two primary operational modes, single-scan and continuous-scan. In single scan mode, one or more groups are scanned once per trigger. In continuous scan mode, one or more groups are started with a single trigger. Scans continue until R_ADC_B_ScanStop() is called. In each mode, analog groups and virtual channels are converted in ascending order.

Single Scan Mode

Continuous Scan Mode

Background Continuous Scan Mode

Note
Background Continuous Scan Mode is only available for Hybrid Mode

Synchronous-Scan Mode

When synchronous operation is enabled all A/D conversions are guaranteed to begin and end based on a user-configured period. When both conversion units are selected for synchronous scan they run from the same period, allowing for consistent timing of simultaneous conversions. Consult section 36.3.17 "Synchronous Operation" in the RA6T2 User's Manual (R01UH0951EJ0100) for details.

ADC_B Conversion Methods

Note
The ADC peripheral supports specific high-speed, high-precision, and normal-precision channels. See Table 46.34 "A/D conversion characteristics" in the RA6T2 User's Manual (R01UH0951EJ0100) for details about what conversion methods are supported by specific physical channels.

Successive Approximation Register (SAR) Mode

Oversampling Mode

Hybrid Mode

Digital Filter Selection

The following characteristics of the digital filter for the A/D converter unit may be selected:

Note
The digital filter must be disabled for ADC units configured to use Successive Approximation Register (SAR) Mode
The digital filter must be enabled for ADC units configured to use Oversampling Mode or Hybrid Mode

Sample-and-Hold

Enabling sample-and-hold on one or more channels instructs the ADC to perform sampling on all channels as soon as a group scan is started. Internal circuitry holds the sampled voltages until the conversion unit is ready.

Note
Each sample-and-hold unit is connected to two analog channels (0/1, 2/3 etc). When this function is enabled on both members of a pair only one of the two may be scanned at a time.
Enabling sample-and-hold functionality reduces maximum scan frequency because the sample hold time is added to each scan. Refer to the hardware manual for details on the sample-and-hold time. Consult section 46.4 "ADC Characteristics" in the RA6T2 User's Manual (R01UH0951EJ0100) for details.
If you use the channel-dedicated sample-and-hold circuits in Hybrid mode, the virtual channels and the scan groups are constrained. A dummy channel must be configured as last within the group. The A/D conversion data of the channel used as the dummy conversion channel is not guaranteed. See Operation in Hybrid Mode with Channel-dedicated Sample-and-hold Curcuit section in the User Manual for more information.

Self-Diagnosis

ADC_B has a built-in self-diagnosis function that can be used to confirm the unit is working correctly. One of three self-diagnosis voltages can be converted and compared to reference values. A self-diagnosis conversion produces a signed data value indicating the ideal A/D converter result. Reference values for 16-bit data format are shown below.

Self-diagnosis mode Expected reference data Accuracy Error
Self-diagnosis mode 1 0x0000 A/D conversion result becomes +1 or more when a positive accuracy error occurs and -1 or less when a negative accuracy error occurs.
Self-diagnosis mode 1 0x8000 A/D conversion result becomes greater than or equal to reference data when an accuracy error occurs.
Self-diagnosis mode 1 0x7FFF A/D conversion result becomes less than or equal to reference data when an accuracy error occurs.

Add/Average Funtion

The ADC can be configured to automatically add or average a number of conversions into a single result. When enabled only the result of the operation is returned.

Note
When the A/D-converted value addition/average function is used, overflow of conversion data may occur. However, in certain conditions overflow may not be detected. See the A/D Conversion Overflow section below for details.

Data Format

The A/D converter in this peripheral has a resolution of 16 bits. When 14-bit or 12-bit data format is selected, the lower 2 or 4 bits (respectively) of the A/D conversion result are extended for data processing, error calibration (Self-Calibration), gain/offset adjustment and the averaging function before rounding is applied.

Limiter Clip

The limit clipping function allows for setting upper and lower bounds on converted data. When the A/D conversion data exceeds the specified upper limit value, it is clipped to the upper limit value. If the A/D conversion data falls below the specified lower limit, it is clipped to the lower limit value.

The upper and lower limits are set in one of eight table entries. To perform limit clip functionality, each virtual channel may (optionally) have one of these entries assigned. Interrupts may be enabled for when limiter clip conditions are triggered.

Note
When 14-/12-/10-bit is selected as the data length of the A/D conversion data, the lower bits are cut based on the data-format selection. When 16-bit format is selected, the data length is not rounded.

Using the Temperature Sensor with the ADC_B

The ADC_B HAL module supports reading the data from the on-chip temperature sensor. The value returned from the sensor can be converted into degrees Celsius or Fahrenheit in the application program using the following formula:

T = (Vs - V1)/slope + T1

Note
The slope value can be obtained from the hardware manual for each device in the Electrical Characteristics Chapter - TSN Characteristics Table, Temperature slope entry.

User Offset and Gain

The user offset adjustment function adds or subtracts a constant value to or from the A/D conversion data. Virtual channels select an offset from a table of values specified by the user.

The user gain adjustment function multiplies the A/D conversion data by an arbitrary coefficient value. As with offset adjustment, virtual channels may select a gain value from a table specified by the user.

Note
When the offset or gain adjusting functions are used overflow of A/D conversion data may occur. See the A/D Conversion Overflow section below for details.
When 14-/12-/10-bit is selected as the data length of converted data the lower bits of offset values are cut based on the data-format selection.

FIFO

The FIFOs consist of 8 stages and can hold up to 8 A/D conversion data. One FIFO is implemented for each scan group. Each FIFO acts as a ring buffer and data will be lost if the FIFO is not read as needed. Interrupts may be enabled for a specific data storage threshold and on overrun.

Programmable Gain Amplifier

ADC has built-in Programmable Gain Amplifier (PGA). The PGA amplifies an external analog input signal and outputs it to A/D converter, Channel-dedicated sample-and-hold circuit, and High-Speed Analog Comparator (ACMPHS). PGA units are channel specific and utilize two analog input pins per unit. Please refer to the RA Configuration editor in e² studio or the hardware manual for further details.

Note
When PGA is used, the analog input pin assigned to PGAVSS pin cannot be input to A/D conversion or Channel-dedicated sample-and-hold circuit.

Single-ended input

In single-ended input mode, PGA amplifies the input from PGAIN pin with the specified gain, between ×2.000 to ×13.333. When operating the PGA in single-ended input mode, PGAIN should be connected to the signal source and PGAVSS should be connected to the analog ground (AVSS0). The input voltage to PGAIN must not exceed the range specified in the Electrical Characteristics.

Pseudo-differential input

In pseudo differential input mode, PGA amplifies the difference between PGAIN pin and PGAVSS pin with the specified gain and output the voltage obtained by adding the offset of 0.5 * AVcc. Settable gains are ×1.500, ×2.333, ×4.000, and ×5.667.

When operating the PGA in Pseudo Differential Input Mode, PGAIN should be connected to the signal source, and PGAVSS should be connected to the reference ground of the signal source. The inputs to PGAIN and PGAVSS pins must not exceed the range specified in the Electrical Characteristics.

When Interrupts Are Not Enabled

Interrupts are enabled by default. If scan-complete interrupts are disabled,@ ref R_ADC_B_StatusGet() can be used to poll the ADC_B driver to determine when the scan has completed. R_ADC_B_Read() is used to access the converted ADC_B result.

A/D Conversion Overflow

A/D conversion overflow is detected when converted data exceeds the range that can be handled in the specified data format. When overflow occurs, data is restricted to the upper or lower limit value of the specified data format. Overflow is detected in the following cases:

Examples

Basic Example

This is a basic example of minimal use of the ADC_B in an application.

/* A channel configuration is generated by the RA Configuration editor based on the options selected. If additional
* configurations are desired additional adc_channel_cfg_t elements can be defined and passed to R_ADC_B_ScanCfg. */
extern const adc_b_scan_cfg_t g_adc_b0_scan_cfg;
void adc_b_basic_example (void)
{
fsp_err_t err = FSP_SUCCESS;
/* Initializes the module. */
err = R_ADC_B_Open(&g_adc_b0_ctrl, &g_adc_b0_cfg);
assert(FSP_SUCCESS == err);
/* Enable channels. */
err = R_ADC_B_ScanCfg(&g_adc_b0_ctrl, &g_adc_b0_scan_cfg);
assert(FSP_SUCCESS == err);
err = R_ADC_B_Calibrate(&g_adc_b0_ctrl, NULL);
assert(FSP_SUCCESS == err);
/* Wait for calibration to complete */
while ((ADC_STATE_IDLE != status.state) &&
(FSP_SUCCESS == err))
{
err = R_ADC_B_StatusGet(&g_adc_b0_ctrl, &status);
}
assert(FSP_SUCCESS == err);
/* Start one or more scan groups by calling R_ADC_B_ScanGroupStart(). Alternatively, all scan groups may be started
* by calling R_ADC_B_ScanCfg(). */
(void) R_ADC_B_ScanGroupStart(&g_adc_b0_ctrl, ADC_GROUP_MASK_0);
/* Wait for conversion to complete. */
while (ADC_STATE_IDLE != status.state)
{
(void) R_ADC_B_StatusGet(&g_adc_b0_ctrl, &status);
}
/* Read converted data. */
uint16_t channel_0_conversion_result;
err = R_ADC_B_Read(&g_adc_b0_ctrl, ADC_CHANNEL_0, &channel_0_conversion_result);
assert(FSP_SUCCESS == err);
}

Data Structures

struct  adc_b_fifo_data_t
 
struct  adc_b_fifo_read_t
 
struct  adc_b_group_cfg_t
 
struct  adc_b_scan_cfg_t
 
struct  adc_b_isr_cfg_t
 
struct  adc_b_extended_cfg_t
 
struct  adc_b_instance_ctrl_t
 

Enumerations

enum  adc_b_clock_source_t
 
enum  adc_b_clock_divider_t
 
enum  adc_b_converter_mode_t
 
enum  adc_b_conversion_method_t
 
enum  adc_b_data_format_t
 
enum  adc_b_virtual_channel_t
 
enum  adc_b_channel_mask_t
 
enum  adc_b_limit_clip_table_id_t
 
enum  adc_b_unit_id_t
 
enum  adc_b_unit_mask_t
 
enum  adc_b_add_avg_mode_t
 
enum  adc_b_add_avg_count_t
 
enum  adc_b_gpt_trigger_t
 
enum  adc_b_external_trigger_t
 
enum  adc_b_self_diagnosis_mode_t
 
enum  adc_b_sample_and_hold_mask_t
 
enum  adc_b_pga_gain_t
 
enum  adc_b_digital_filter_selection_t
 
enum  adc_b_sampling_state_table_id_t
 
enum  adc_b_user_gain_table_id_t
 
enum  adc_b_user_offset_table_selection_id_t
 

Data Structure Documentation

◆ adc_b_fifo_data_t

struct adc_b_fifo_data_t

ADC FIFO data type

Data Fields
uint32_t data: 16 Conversion Data.
uint32_t __pad0__: 8
adc_channel_t physical_channel: 7 Channel number for data.
uint32_t err: 1 Error bit.

◆ adc_b_fifo_read_t

struct adc_b_fifo_read_t

ADC FIFO Read data structure

Data Fields
uint8_t count Number of valid FIFO data read.
adc_b_fifo_data_t fifo_data[8] FIFO data.

◆ adc_b_group_cfg_t

struct adc_b_group_cfg_t

ADC Group configuration data

Data Fields
adc_group_id_t scan_group_id Scan Group ID.
adc_b_unit_id_t converter_selection Converter selection.
bool scan_group_enable Scan Group enable state.
uint8_t virtual_channel_count Virtual Channel count.
bool scan_end_interrupt_enable Scan End Interrupt enable.
adc_b_external_trigger_t external_trigger_enable_mask External Trigger mask.
elc_peripheral_t elc_trigger_enable_mask ELC Trigger mask.
adc_b_gpt_trigger_t gpt_trigger_enable_mask GPT Trigger mask.
uint8_t conversion_start_delay Conversion start delay.
uint32_t self_diagnosis_mask Self-Diagnosis register data.
bool limit_clip_interrupt_enable Limiter Clip interrupt enable.
adc_b_virtual_channel_cfg_t ** p_virtual_channels Pointer to virtual channel configuration array of size virtual_channel_count.

◆ adc_b_scan_cfg_t

struct adc_b_scan_cfg_t

ADC Scan Group configuraiton

Data Fields
uint8_t group_count Group Count.
adc_b_group_cfg_t ** p_adc_groups Pointer to ADC group configuration data.

◆ adc_b_isr_cfg_t

struct adc_b_isr_cfg_t

ADC ISR configuration structure

Data Fields
uint8_t calibration_end_ipl_adc_0 Calibration end IPL for A/D converter unit 0.
uint8_t calibration_end_ipl_adc_1 Calibration end IPL for A/D converter unit 1.
uint8_t conversion_error_ipl_adc_0 Conversion error IPL for A/D converter unit 0.
uint8_t conversion_error_ipl_adc_1 Conversion error IPL for A/D converter unit 1.
uint8_t fifo_overflow_ipl FIFO Overflow IPL.
uint8_t fifo_read_ipl_group_0 FIFO Read threshold request IPL for Group 0.
uint8_t fifo_read_ipl_group_1 FIFO Read threshold request IPL for Group 1.
uint8_t fifo_read_ipl_group_2 FIFO Read threshold request IPL for Group 2.
uint8_t fifo_read_ipl_group_3 FIFO Read threshold request IPL for Group 3.
uint8_t fifo_read_ipl_group_4 FIFO Read threshold request IPL for Group 4.
uint8_t fifo_read_ipl_group_5678 FIFO Read threshold request IPL for Groups 5, 6, 7, and 8.
uint8_t limit_clip_ipl Limiter Clip IPL.
uint8_t overflow_error_ipl_adc_0 Overflow error IPL for A/D converter unit 0.
uint8_t overflow_error_ipl_adc_1 Overflow error IPL for A/D converter unit 1.
uint8_t scan_end_ipl_group_0 Scan End IPL for A/D Group 0.
uint8_t scan_end_ipl_group_1 Scan End IPL for A/D Group 1.
uint8_t scan_end_ipl_group_2 Scan End IPL for A/D Group 2.
uint8_t scan_end_ipl_group_3 Scan End IPL for A/D Group 3.
uint8_t scan_end_ipl_group_4 Scan End IPL for A/D Group 4.
uint8_t scan_end_ipl_group_5678 Scan End IRQ for A/D Groups 5, 6, 7, and 8.
IRQn_Type calibration_end_irq_adc_0 Calibration end IRQ for A/D converter unit 0.
IRQn_Type calibration_end_irq_adc_1 Calibration end IRQ for A/D converter unit 1.
IRQn_Type conversion_error_irq_adc_0 Conversion error IRQ for A/D converter unit 0.
IRQn_Type conversion_error_irq_adc_1 Conversion error IRQ for A/D converter unit 1.
IRQn_Type fifo_overflow_irq FIFO Overflow IRQ.
IRQn_Type fifo_read_irq_group_0 FIFO Read threshold request IRQ for Group 0.
IRQn_Type fifo_read_irq_group_1 FIFO Read threshold request IRQ for Group 1.
IRQn_Type fifo_read_irq_group_2 FIFO Read threshold request IRQ for Group 2.
IRQn_Type fifo_read_irq_group_3 FIFO Read threshold request IRQ for Group 3.
IRQn_Type fifo_read_irq_group_4 FIFO Read threshold request IRQ for Group 4.
IRQn_Type fifo_read_irq_group_5678 FIFO Read threshold request IRQ for Groups 5, 6, 7, and 8.
IRQn_Type limit_clip_irq Limiter Clip IRQ.
IRQn_Type overflow_error_irq_adc_0 Overflow error IRQ for A/D converter unit 0.
IRQn_Type overflow_error_irq_adc_1 Overflow error IRQ for A/D converter unit 1.
IRQn_Type scan_end_irq_group_0 Scan End IRQ for A/D Group 0.
IRQn_Type scan_end_irq_group_1 Scan End IRQ for A/D Group 1.
IRQn_Type scan_end_irq_group_2 Scan End IRQ for A/D Group 2.
IRQn_Type scan_end_irq_group_3 Scan End IRQ for A/D Group 3.
IRQn_Type scan_end_irq_group_4 Scan End IRQ for A/D Group 4.
IRQn_Type scan_end_irq_group_5678 Scan End IRQ for A/D Groups 5, 6, 7, and 8.

◆ adc_b_extended_cfg_t

struct adc_b_extended_cfg_t

ADC extended configuration data

Data Fields
adc_b_pga_gain_t pga_gain[4] PGA Gain selection.
union adc_b_extended_cfg_t __unnamed__
union adc_b_extended_cfg_t adc_filter_selection[2]
union adc_b_extended_cfg_t __unnamed__
union adc_b_extended_cfg_t __unnamed__
union adc_b_extended_cfg_t __unnamed__
uint32_t scan_group_enable Scan Group enable register data.
union adc_b_extended_cfg_t __unnamed__
union adc_b_extended_cfg_t __unnamed__
uint16_t fifo_interrupt_enable_mask FIFO interrupt enable register data.
union adc_b_extended_cfg_t __unnamed__
union adc_b_extended_cfg_t __unnamed__
uint32_t calibration_adc_state Calibration State register data.
uint32_t calibration_sample_and_hold Calibration Sample and Hold register data.
const adc_b_isr_cfg_t * p_isr_cfg Pointer to ISR configuration.
union adc_b_extended_cfg_t __unnamed__
uint8_t sample_and_hold_enable_mask Sample and Hold enable register data.
uint32_t sample_and_hold_config_012 Sample and Hold configuration register data.
uint32_t sample_and_hold_config_456 Sample and Hold configuration register data.
uint32_t conversion_state ADC 0/1 Successive Approximation Time Configuration.
int32_t user_offset_tables[8] User Offset Table register data.
uint32_t user_gain_tables[8] User Gain Table register data.
uint32_t limiter_clip_interrupt_enable_mask Limiter clip interrupt enable register data.
uint32_t limiter_clip_tables[8] Limiter clip Table register data.

◆ adc_b_instance_ctrl_t

struct adc_b_instance_ctrl_t

ADC instance control block. DO NOT INITIALIZE. Initialized in adc_api_t::open().

Data Fields

adc_b_converter_state_t adc_state
 ADC 0 converter State.
 
uint32_t cached_adtrgenr
 Cached conversion peripheral trigger bits, used when starting and stopping scans.
 
uint32_t cached_adsystr
 Cached conversion software start bits, used when starting and stopping scans.
 
uint32_t trigger_disable_wait_cycles
 ADC clock cycles required to wait after disabling trigger input.
 
adc_cfg_t const * p_cfg
 Boolean to verify that the Unit has been initialized.
 
void(* p_callback )(adc_callback_args_t *)
 Pointer to callback that is called when an adc_b_event_t occurs.
 
adc_callback_args_tp_callback_memory
 Pointer to non-secure memory that can be used to pass arguments to a callback in non-secure memory.
 
void const * p_context
 User defined context passed into callback function.
 
uint32_t initialized
 Initialized status of ADC_B.
 
uint32_t opened
 Open status of ADC_B.
 

Enumeration Type Documentation

◆ adc_b_clock_source_t

ADC Clock source selection

Enumerator
ADC_B_CLOCK_SOURCE_PCLKC 

ADC Clock Source PCLKC.

ADC_B_CLOCK_SOURCE_GPT 

ADC Clock Source GPT.

ADC_B_CLOCK_SOURCE_PCLKA 

ADC Clock Source PCLKA.

◆ adc_b_clock_divider_t

ADC clock divider selection

Enumerator
ADC_B_CLOCK_DIV_1 

ADC Clock Division 1/1.

ADC_B_CLOCK_DIV_2 

ADC Clock Division 1/2.

ADC_B_CLOCK_DIV_3 

ADC Clock Division 1/3.

ADC_B_CLOCK_DIV_4 

ADC Clock Division 1/4.

ADC_B_CLOCK_DIV_5 

ADC Clock Division 1/5.

ADC_B_CLOCK_DIV_6 

ADC Clock Division 1/6.

ADC_B_CLOCK_DIV_7 

ADC Clock Division 1/7.

ADC_B_CLOCK_DIV_8 

ADC Clock Division 1/8.

◆ adc_b_converter_mode_t

ADC_B Conversion Mode

Enumerator
ADC_B_CONVERTER_MODE_SINGLE_SCAN 

Single scan mode.

ADC_B_CONVERTER_MODE_CONTINUOUS_SCAN 

Continuous scan mode.

ADC_B_CONVERTER_MODE_BACKGROUND_SCAN 

Background continuous scan mode (Valid for Hybrid mode only)

◆ adc_b_conversion_method_t

ADC_B Conversion Method

Enumerator
ADC_B_CONVERSION_METHOD_SAR 

SAR conversion method.

ADC_B_CONVERSION_METHOD_OVERSAMPLE 

Oversampling conversion method.

ADC_B_CONVERSION_METHOD_HYBRID 

Hybrid conversion method.

◆ adc_b_data_format_t

ADC_B data data format definitions

Enumerator
ADC_B_DATA_FORMAT_16_BIT 

16 bit adc_b data format

ADC_B_DATA_FORMAT_14_BIT 

14 bit adc_b data format

ADC_B_DATA_FORMAT_12_BIT 

12 bit adc_b data format

ADC_B_DATA_FORMAT_10_BIT 

10 bit adc_b data format

◆ adc_b_virtual_channel_t

ADC channels

Enumerator
ADC_B_VIRTUAL_CHANNEL_0 

ADC B virtual channel 0.

ADC_B_VIRTUAL_CHANNEL_1 

ADC B virtual channel 1.

ADC_B_VIRTUAL_CHANNEL_2 

ADC B virtual channel 2.

ADC_B_VIRTUAL_CHANNEL_3 

ADC B virtual channel 3.

ADC_B_VIRTUAL_CHANNEL_4 

ADC B virtual channel 4.

ADC_B_VIRTUAL_CHANNEL_5 

ADC B virtual channel 5.

ADC_B_VIRTUAL_CHANNEL_6 

ADC B virtual channel 6.

ADC_B_VIRTUAL_CHANNEL_7 

ADC B virtual channel 7.

ADC_B_VIRTUAL_CHANNEL_8 

ADC B virtual channel 8.

ADC_B_VIRTUAL_CHANNEL_9 

ADC B virtual channel 9.

ADC_B_VIRTUAL_CHANNEL_10 

ADC B virtual channel 10.

ADC_B_VIRTUAL_CHANNEL_11 

ADC B virtual channel 11.

ADC_B_VIRTUAL_CHANNEL_12 

ADC B virtual channel 12.

ADC_B_VIRTUAL_CHANNEL_13 

ADC B virtual channel 13.

ADC_B_VIRTUAL_CHANNEL_14 

ADC B virtual channel 14.

ADC_B_VIRTUAL_CHANNEL_15 

ADC B virtual channel 15.

ADC_B_VIRTUAL_CHANNEL_16 

ADC B virtual channel 16.

ADC_B_VIRTUAL_CHANNEL_17 

ADC B virtual channel 17.

ADC_B_VIRTUAL_CHANNEL_18 

ADC B virtual channel 18.

ADC_B_VIRTUAL_CHANNEL_19 

ADC B virtual channel 19.

ADC_B_VIRTUAL_CHANNEL_20 

ADC B virtual channel 20.

ADC_B_VIRTUAL_CHANNEL_21 

ADC B virtual channel 21.

ADC_B_VIRTUAL_CHANNEL_22 

ADC B virtual channel 22.

ADC_B_VIRTUAL_CHANNEL_23 

ADC B virtual channel 23.

ADC_B_VIRTUAL_CHANNEL_24 

ADC B virtual channel 24.

ADC_B_VIRTUAL_CHANNEL_25 

ADC B virtual channel 25.

ADC_B_VIRTUAL_CHANNEL_26 

ADC B virtual channel 26.

ADC_B_VIRTUAL_CHANNEL_27 

ADC B virtual channel 27.

ADC_B_VIRTUAL_CHANNEL_28 

ADC B virtual channel 28.

ADC_B_VIRTUAL_CHANNEL_29 

ADC B virtual channel 29.

ADC_B_VIRTUAL_CHANNEL_30 

ADC B virtual channel 30.

ADC_B_VIRTUAL_CHANNEL_31 

ADC B virtual channel 31.

ADC_B_VIRTUAL_CHANNEL_32 

ADC B virtual channel 32.

ADC_B_VIRTUAL_CHANNEL_33 

ADC B virtual channel 33.

ADC_B_VIRTUAL_CHANNEL_34 

ADC B virtual channel 34.

ADC_B_VIRTUAL_CHANNEL_35 

ADC B virtual channel 35.

ADC_B_VIRTUAL_CHANNEL_36 

ADC B virtual channel 36.

◆ adc_b_channel_mask_t

ADC channel mask

Enumerator
ADC_B_CHANNEL_MASK_0 

Channel 0.

ADC_B_CHANNEL_MASK_1 

Channel 1.

ADC_B_CHANNEL_MASK_2 

Channel 2.

ADC_B_CHANNEL_MASK_3 

Channel 3.

ADC_B_CHANNEL_MASK_4 

Channel 4.

ADC_B_CHANNEL_MASK_5 

Channel 5.

ADC_B_CHANNEL_MASK_6 

Channel 6.

ADC_B_CHANNEL_MASK_7 

Channel 7.

ADC_B_CHANNEL_MASK_8 

Channel 8.

ADC_B_CHANNEL_MASK_9 

Channel 9.

ADC_B_CHANNEL_MASK_10 

Channel 10.

ADC_B_CHANNEL_MASK_11 

Channel 11.

ADC_B_CHANNEL_MASK_12 

Channel 12.

ADC_B_CHANNEL_MASK_13 

Channel 13.

ADC_B_CHANNEL_MASK_14 

Channel 14.

ADC_B_CHANNEL_MASK_15 

Channel 15.

ADC_B_CHANNEL_MASK_16 

Channel 16.

ADC_B_CHANNEL_MASK_17 

Channel 17.

ADC_B_CHANNEL_MASK_18 

Channel 18.

ADC_B_CHANNEL_MASK_19 

Channel 19.

ADC_B_CHANNEL_MASK_20 

Channel 20.

ADC_B_CHANNEL_MASK_21 

Channel 21.

ADC_B_CHANNEL_MASK_22 

Channel 22.

ADC_B_CHANNEL_MASK_23 

Channel 23.

ADC_B_CHANNEL_MASK_24 

Channel 24.

ADC_B_CHANNEL_MASK_25 

Channel 25.

ADC_B_CHANNEL_MASK_26 

Channel 26.

ADC_B_CHANNEL_MASK_27 

Channel 27.

ADC_B_CHANNEL_MASK_28 

Channel 28.

ADC_B_CHANNEL_MASK_DIAGNOSIS 

Self-Diagnosis Channel.

ADC_B_CHANNEL_MASK_TEMPERATURE 

Temperature sensor channel.

ADC_B_CHANNEL_MASK_VOLT 

Voltage Reference channel.

ADC_B_CHANNEL_MASK_DAC0 

DAC 0 Channel.

ADC_B_CHANNEL_MASK_DAC1 

DAC 1 Channel.

ADC_B_CHANNEL_MASK_DAC2 

DAC 2 Channel.

ADC_B_CHANNEL_MASK_DAC3 

DAC 3 Channel.

◆ adc_b_limit_clip_table_id_t

ADC limiter clipping table id selection options

Enumerator
ADC_B_LIMIT_CLIP_TABLE_SELECTION_NONE 

Limiter Clip Disabled.

ADC_B_LIMIT_CLIP_TABLE_SELECTION_0 

Limiter Clip Table 0.

ADC_B_LIMIT_CLIP_TABLE_SELECTION_1 

Limiter Clip Table 1.

ADC_B_LIMIT_CLIP_TABLE_SELECTION_2 

Limiter Clip Table 2.

ADC_B_LIMIT_CLIP_TABLE_SELECTION_3 

Limiter Clip Table 3.

ADC_B_LIMIT_CLIP_TABLE_SELECTION_4 

Limiter Clip Table 4.

ADC_B_LIMIT_CLIP_TABLE_SELECTION_5 

Limiter Clip Table 5.

ADC_B_LIMIT_CLIP_TABLE_SELECTION_6 

Limiter Clip Table 6.

ADC_B_LIMIT_CLIP_TABLE_SELECTION_7 

Limiter Clip Table 7.

◆ adc_b_unit_id_t

ADC unit selection options

Enumerator
ADC_B_UNIT_ID_0 

ADC Unit ID 0.

ADC_B_UNIT_ID_1 

ADC Unit ID 1.

◆ adc_b_unit_mask_t

ADC unit selection options

Enumerator
ADC_B_UNIT_MASK_0 

ADC Unit Mask 0.

ADC_B_UNIT_MASK_1 

ADC Unit Mask 1.

ADC_B_UNIT_MASK_UNDEFINED 

ADC Unit Mask Unknown.

◆ adc_b_add_avg_mode_t

ADC data sample addition and averaging options

Enumerator
ADC_B_ADD_AVERAGE_OFF 

Add/Average turned off for channels/sensors.

ADC_B_ADD_AVERAGE_ADDITION_ENABLE 

Addition Mode Enabled.

ADC_B_ADD_AVERAGE_AVERAGE_ENABLE 

Average Mode Enabled.

◆ adc_b_add_avg_count_t

ADC data sample addition and averaging options

Enumerator
ADC_B_ADD_AVERAGE_1 

Addition turned off for channels/sensors.

ADC_B_ADD_AVERAGE_2 

Add/Average 2 samples.

ADC_B_ADD_AVERAGE_4 

Add/Average 4 samples.

ADC_B_ADD_AVERAGE_8 

Add/Average 8 samples.

ADC_B_ADD_AVERAGE_16 

Add/Average 16 samples.

ADC_B_ADD_AVERAGE_32 

Add/Average 32 samples.

ADC_B_ADD_AVERAGE_64 

Add/Average 64 samples.

ADC_B_ADD_AVERAGE_128 

Add/Average 128 samples.

ADC_B_ADD_AVERAGE_256 

Add/Average 256 samples.

ADC_B_ADD_AVERAGE_512 

Add/Average 512 samples.

ADC_B_ADD_AVERAGE_1024 

Add/Average 1024 samples.

◆ adc_b_gpt_trigger_t

ADC GPT Trigger options

Enumerator
ADC_B_GPT_TRIGGER_NONE 

GPT Trigger Disabled.

ADC_B_GPT_TRIGGER_A0 

GPT Trigger A0.

ADC_B_GPT_TRIGGER_A1 

GPT Trigger A1.

ADC_B_GPT_TRIGGER_A2 

GPT Trigger A2.

ADC_B_GPT_TRIGGER_A3 

GPT Trigger A3.

ADC_B_GPT_TRIGGER_A4 

GPT Trigger A4.

ADC_B_GPT_TRIGGER_A5 

GPT Trigger A5.

ADC_B_GPT_TRIGGER_A6 

GPT Trigger A6.

ADC_B_GPT_TRIGGER_A7 

GPT Trigger A7.

ADC_B_GPT_TRIGGER_A8 

GPT Trigger A8.

ADC_B_GPT_TRIGGER_A9 

GPT Trigger A9.

ADC_B_GPT_TRIGGER_B0 

GPT Trigger B0.

ADC_B_GPT_TRIGGER_B1 

GPT Trigger B1.

ADC_B_GPT_TRIGGER_B2 

GPT Trigger B2.

ADC_B_GPT_TRIGGER_B3 

GPT Trigger B3.

ADC_B_GPT_TRIGGER_B4 

GPT Trigger B4.

ADC_B_GPT_TRIGGER_B5 

GPT Trigger B5.

ADC_B_GPT_TRIGGER_B6 

GPT Trigger B6.

ADC_B_GPT_TRIGGER_B7 

GPT Trigger B7.

ADC_B_GPT_TRIGGER_B8 

GPT Trigger B8.

ADC_B_GPT_TRIGGER_B9 

GPT Trigger B9.

◆ adc_b_external_trigger_t

ADC External Trigger options

Enumerator
ADC_B_EXTERNAL_TRIGGER_NONE 

External Trigger Disabled.

ADC_B_EXTERNAL_TRIGGER_ADTRG0 

External Trigger ADTRG0 Selection.

ADC_B_EXTERNAL_TRIGGER_ADTRG1 

External Trigger ADTRG1 Selection.

◆ adc_b_self_diagnosis_mode_t

ADC Self-Diagnosis mode options

Enumerator
ADC_B_SELF_DIAGNOSIS_DISABLED 

Self-Diagnosis Disabled.

ADC_B_SELF_DIAGNOSIS_MODE_1 

Self-Diagnosis Mode 1.

ADC_B_SELF_DIAGNOSIS_MODE_2 

Self-Diagnosis Mode 2.

ADC_B_SELF_DIAGNOSIS_MODE_3 

Self-Diagnosis Mode 3.

◆ adc_b_sample_and_hold_mask_t

ADC Sample-and-Hold unit enable mask

Enumerator
ADC_B_SAMPLE_AND_HOLD_MASK_NONE 

Sample-and-Hold Disabled.

ADC_B_SAMPLE_AND_HOLD_MASK_UNIT_0 

Sample-and-Hold Unit 0.

ADC_B_SAMPLE_AND_HOLD_MASK_UNIT_1 

Sample-and-Hold Unit 1.

ADC_B_SAMPLE_AND_HOLD_MASK_UNIT_2 

Sample-and-Hold Unit 2.

ADC_B_SAMPLE_AND_HOLD_MASK_UNIT_4 

Sample-and-Hold Unit 3.

ADC_B_SAMPLE_AND_HOLD_MASK_UNIT_5 

Sample-and-Hold Unit 4.

ADC_B_SAMPLE_AND_HOLD_MASK_UNIT_6 

Sample-and-Hold Unit 5.

◆ adc_b_pga_gain_t

ADC PGA Gain

Enumerator
ADC_B_PGA_GAIN_DISABLED 

PGA Gain Disabled.

ADC_B_PGA_GAIN_DIFFERENTIAL_1_500 

PGA Gain Setting 1.500.

ADC_B_PGA_GAIN_DIFFERENTIAL_2_333 

PGA Gain Setting 2.333.

ADC_B_PGA_GAIN_DIFFERENTIAL_4_000 

PGA Gain Setting 4.000.

ADC_B_PGA_GAIN_DIFFERENTIAL_5_667 

PGA Gain Setting 5.667.

ADC_B_PGA_GAIN_SINGLE_ENDED_2_500 

PGA Gain Setting 2.500.

ADC_B_PGA_GAIN_SINGLE_ENDED_2_667 

PGA Gain Setting 2.667.

ADC_B_PGA_GAIN_SINGLE_ENDED_2_857 

PGA Gain Setting 2.857.

ADC_B_PGA_GAIN_SINGLE_ENDED_3_077 

PGA Gain Setting 3.077.

ADC_B_PGA_GAIN_SINGLE_ENDED_3_333 

PGA Gain Setting 3.333.

ADC_B_PGA_GAIN_SINGLE_ENDED_3_636 

PGA Gain Setting 3.636.

ADC_B_PGA_GAIN_SINGLE_ENDED_4_000 

PGA Gain Setting 4.000.

ADC_B_PGA_GAIN_SINGLE_ENDED_4_444 

PGA Gain Setting 4.444.

ADC_B_PGA_GAIN_SINGLE_ENDED_5_000 

PGA Gain Setting 5.000.

ADC_B_PGA_GAIN_SINGLE_ENDED_5_714 

PGA Gain Setting 5.714.

ADC_B_PGA_GAIN_SINGLE_ENDED_6_667 

PGA Gain Setting 6.667.

ADC_B_PGA_GAIN_SINGLE_ENDED_8_000 

PGA Gain Setting 8.000.

ADC_B_PGA_GAIN_SINGLE_ENDED_10_000 

PGA Gain Setting 10.000.

ADC_B_PGA_GAIN_SINGLE_ENDED_13_333 

PGA Gain Setting 13.333.

◆ adc_b_digital_filter_selection_t

ADC Digital Filter Selection

Enumerator
ADC_B_DIGITAL_FILTER_MODE_SINC3 

Digital filter Sinc3 filter (Oversampling Rate = 8)

ADC_B_DIGITAL_FILTER_MODE_PHASE 

Digital filter Minimum phase filter (Group delay < 2)

◆ adc_b_sampling_state_table_id_t

ADC Sampling State table selection options

Enumerator
ADC_B_SAMPLING_STATE_TABLE_0 

Sampling State Table 0.

ADC_B_SAMPLING_STATE_TABLE_1 

Sampling State Table 1.

ADC_B_SAMPLING_STATE_TABLE_2 

Sampling State Table 2.

ADC_B_SAMPLING_STATE_TABLE_3 

Sampling State Table 3.

ADC_B_SAMPLING_STATE_TABLE_4 

Sampling State Table 4.

ADC_B_SAMPLING_STATE_TABLE_5 

Sampling State Table 5.

ADC_B_SAMPLING_STATE_TABLE_6 

Sampling State Table 6.

ADC_B_SAMPLING_STATE_TABLE_7 

Sampling State Table 7.

ADC_B_SAMPLING_STATE_TABLE_8 

Sampling State Table 8.

ADC_B_SAMPLING_STATE_TABLE_9 

Sampling State Table 9.

ADC_B_SAMPLING_STATE_TABLE_10 

Sampling State Table 10.

ADC_B_SAMPLING_STATE_TABLE_11 

Sampling State Table 12.

ADC_B_SAMPLING_STATE_TABLE_12 

Sampling State Table 13.

ADC_B_SAMPLING_STATE_TABLE_13 

Sampling State Table 14.

ADC_B_SAMPLING_STATE_TABLE_14 

Sampling State Table 15.

ADC_B_SAMPLING_STATE_TABLE_15 

Sampling State Table 16.

◆ adc_b_user_gain_table_id_t

ADC User Gain table options

Enumerator
ADC_B_USER_GAIN_TABLE_SELECTION_DISABLED 

User Gain disabled.

ADC_B_USER_GAIN_TABLE_SELECTION_0 

User Gain table 0.

ADC_B_USER_GAIN_TABLE_SELECTION_1 

User Gain table 1.

ADC_B_USER_GAIN_TABLE_SELECTION_2 

User Gain table 2.

ADC_B_USER_GAIN_TABLE_SELECTION_3 

User Gain table 3.

ADC_B_USER_GAIN_TABLE_SELECTION_4 

User Gain table 4.

ADC_B_USER_GAIN_TABLE_SELECTION_5 

User Gain table 5.

ADC_B_USER_GAIN_TABLE_SELECTION_6 

User Gain table 6.

ADC_B_USER_GAIN_TABLE_SELECTION_7 

User Gain table 7.

◆ adc_b_user_offset_table_selection_id_t

ADC User Offset table options

Enumerator
ADC_B_USER_OFFSET_TABLE_SELECTION_DISABLED 

User Offset disabled.

ADC_B_USER_OFFSET_TABLE_SELECTION_0 

User Offset table 0.

ADC_B_USER_OFFSET_TABLE_SELECTION_1 

User Offset table 1.

ADC_B_USER_OFFSET_TABLE_SELECTION_2 

User Offset table 2.

ADC_B_USER_OFFSET_TABLE_SELECTION_3 

User Offset table 3.

ADC_B_USER_OFFSET_TABLE_SELECTION_4 

User Offset table 4.

ADC_B_USER_OFFSET_TABLE_SELECTION_5 

User Offset table 5.

ADC_B_USER_OFFSET_TABLE_SELECTION_6 

User Offset table 6.

ADC_B_USER_OFFSET_TABLE_SELECTION_7 

User Offset table 7.

Function Documentation

◆ R_ADC_B_Open()

fsp_err_t R_ADC_B_Open ( adc_ctrl_t p_ctrl,
adc_cfg_t const *const  p_cfg 
)

Sets the operational mode, trigger sources, interrupt priority, and configurations for the peripheral as a whole. If provided, the function registers a callback function pointer for notifying the user whenever a scan has completed, error has occurred, FIFO read request is generated, or other ADC interrupt event occurrs. Implements adc_api_t::open.

Return values
FSP_SUCCESSModule is ready for use.
FSP_ERR_ASSERTIONAn input argument is invalid.
FSP_ERR_ALREADY_OPENThe instance control structure has already been opened.

◆ R_ADC_B_ScanCfg()

fsp_err_t R_ADC_B_ScanCfg ( adc_ctrl_t p_ctrl,
void const *const  p_scan_cfg 
)

Configures the ADC_B scan parameters. Channel specific settings are set in this function. Pass a pointer to adc_b_scan_cfg_t to p_channel_cfg. Implements adc_api_t::scanCfg.

Note
This starts group B scans if adc_b_scan_cfg_t::priority_group_a is set to ADC_B_GROUP_A_GROUP_B_CONTINUOUS_SCAN.
Return values
FSP_SUCCESSChannel specific settings applied.
FSP_ERR_ASSERTIONAn input argument is invalid.
FSP_ERR_NOT_OPENUnit is not open.
FSP_ERR_INVALID_STATEInvalid Scan Configuration.
FSP_ERR_INVALID_CHANNELInvalid configured channel for group converter id.

◆ R_ADC_B_CallbackSet()

fsp_err_t R_ADC_B_CallbackSet ( adc_ctrl_t *const  p_api_ctrl,
void(*)(adc_callback_args_t *)  p_callback,
void const *const  p_context,
adc_callback_args_t *const  p_callback_memory 
)

Updates the user callback and has option of providing memory for callback structure. Implements adc_api_t::callbackSet

Return values
FSP_SUCCESSCallback updated successfully.
FSP_ERR_ASSERTIONA required pointer is NULL.
FSP_ERR_NOT_OPENThe control block has not been opened.
FSP_ERR_NO_CALLBACK_MEMORYp_callback is non-secure and p_callback_memory is either secure or NULL.

◆ R_ADC_B_ScanStart()

fsp_err_t R_ADC_B_ScanStart ( adc_ctrl_t p_ctrl)

Enables the hardware trigger for a scan depending on how the triggers were configured in the R_ADC_B_ScanCfg call. If the unit was configured for ELC, GPT, or external hardware triggering, then this function allows the trigger signal to get to the ADC unit. The function is not able to control the generation of the trigger itself. If the unit was configured for software triggering, This function was added to this ADC version for compatability with r_adc driver. For additional flexibility, it is recommended to use R_ADC_B_ScanGroupStart.

Precondition
Call R_ADC_B_ScanCfg after R_ADC_B_Open before starting a scan.
Call R_ADC_B_Calibrate and wait for calibration to complete before starting a scan.
Return values
FSP_SUCCESSScan started (software trigger) or hardware triggers enabled.
FSP_ERR_ASSERTIONAn input argument is invalid.
FSP_ERR_INVALID_ARGUMENTNo hardware triggers configured for groups.
FSP_ERR_NOT_OPENUnit is not open.
FSP_ERR_NOT_INITIALIZEDUnit not initialized.
FSP_ERR_INVALID_STATECalibration required.

◆ R_ADC_B_ScanGroupStart()

fsp_err_t R_ADC_B_ScanGroupStart ( adc_ctrl_t p_ctrl,
adc_group_mask_t  group_mask 
)

Starts a software scan or enables the hardware trigger for a scan depending on how triggers were configured. If the group was configured for ELC, GPT, or external hardware triggering then this function allows the trigger signal to get to the ADC unit. The function itself is not able to control the generation of peripheral triggers. If the unit was configured for software triggering, then this function starts the software triggered scan.

Note
Except for Group Priority Operation, if ADC0 or ADC1 are currently performing an A/D conversion operation, attempting to start another scan group that uses the same A/D converter will be ignored. This also applies to starting multiple groups at one time. When Group Priority Operation is not enabled, only the lowest numbered group will be started (for each ADC converter), other groups will be ignored.
Precondition
Call R_ADC_B_ScanCfg after R_ADC_B_Open before starting a scan.
Call R_ADC_B_Calibrate and wait for calibration to complete before starting a scan.
Return values
FSP_SUCCESSScan started (software trigger) or hardware triggers enabled.
FSP_ERR_ASSERTIONAn input argument is invalid.
FSP_ERR_INVALID_ARGUMENTAn invalid group has been provided.
FSP_ERR_NOT_OPENUnit is not open.
FSP_ERR_NOT_INITIALIZEDUnit not initialized.
FSP_ERR_INVALID_STATECalibration required.

◆ R_ADC_B_ScanStop()

fsp_err_t R_ADC_B_ScanStop ( adc_ctrl_t p_ctrl)

Disables the hardware trigger for a scan and immediately stops all active converters. This function will abortall active conversions.

Return values
FSP_SUCCESSAll scans stopped.
FSP_ERR_ASSERTIONAn input argument is invalid.
FSP_ERR_INVALID_ARGUMENTNo hardware triggers configured for groups.
FSP_ERR_NOT_OPENUnit is not open.
FSP_ERR_NOT_INITIALIZEDUnit not initialized.

◆ R_ADC_B_StatusGet()

fsp_err_t R_ADC_B_StatusGet ( adc_ctrl_t p_ctrl,
adc_status_t p_status 
)

Provides the status of any scan process that was started, including scans started by ELC or external triggers and calibration scans on MCUs that support calibration.

Return values
FSP_SUCCESSModule status stored in the provided pointer p_status
FSP_ERR_ASSERTIONAn input argument is invalid.
FSP_ERR_NOT_OPENUnit is not open.

◆ R_ADC_B_Read()

fsp_err_t R_ADC_B_Read ( adc_ctrl_t p_ctrl,
adc_channel_t const  channel_id,
uint16_t *const  p_data 
)

Reads conversion results from a single channel or sensor.

Return values
FSP_SUCCESSData read into provided p_data.
FSP_ERR_INVALID_DATAAccuracy of data cannot be guaranteed. ADC requires calibration or SAR timing settings are irregular.
FSP_ERR_ASSERTIONAn input argument is invalid.
FSP_ERR_NOT_OPENUnit is not open.
FSP_ERR_NOT_INITIALIZEDUnit not initialized.
FSP_ERR_INVALID_CHANNELInvalid channel provided.

◆ R_ADC_B_Read32()

fsp_err_t R_ADC_B_Read32 ( adc_ctrl_t p_ctrl,
adc_channel_t const  channel_id,
uint32_t *const  p_data 
)

Reads conversion results from a single channel or sensor register into a 32-bit result.

Return values
FSP_SUCCESSData read into provided p_data.
FSP_ERR_INVALID_DATAAccuracy of data cannot be guaranteed. ADC requires calibration or SAR timing settings are irregular.
FSP_ERR_ASSERTIONAn input argument is invalid.
FSP_ERR_NOT_OPENUnit is not open.
FSP_ERR_NOT_INITIALIZEDUnit not initialized.
FSP_ERR_INVALID_CHANNELInvalid channel provided.
Returns
See Common Error Codes or functions called by this function for other possible return codes. This function calls:

◆ R_ADC_B_FifoRead()

fsp_err_t R_ADC_B_FifoRead ( adc_ctrl_t p_ctrl,
adc_group_mask_t const  group_mask,
adc_b_fifo_read_t *const  p_data 
)

Reads conversion results from FIFO for the given group mask.

Return values
FSP_SUCCESSData read into provided p_data.
FSP_ERR_ASSERTIONAn input argument is invalid.
FSP_ERR_NOT_OPENUnit is not open.
FSP_ERR_NOT_INITIALIZEDUnit not initialized.
FSP_ERR_INVALID_ARGUMENTInvalid group provided.
FSP_ERR_UNDERFLOWFIFO empty.

◆ R_ADC_B_InfoGet()

fsp_err_t R_ADC_B_InfoGet ( adc_ctrl_t p_ctrl,
adc_info_t p_adc_info 
)

Provides the temperature sensor slope and the calibration data for the sensor if available on this MCU. Otherwise, invalid calibration data of 0xFFFFFFFF will be returned.

Return values
FSP_SUCCESSInfo is read into p_adc_info.
FSP_ERR_ASSERTIONAn input argument is invalid.
FSP_ERR_NOT_OPENUnit is not open.
FSP_ERR_NOT_INITIALIZEDUnit not initialized.

◆ R_ADC_B_Close()

fsp_err_t R_ADC_B_Close ( adc_ctrl_t p_ctrl)

This function ends any scan in progress, disables interrupts, and removes power to the A/D peripheral.

Return values
FSP_SUCCESSModule closed.
FSP_ERR_ASSERTIONAn input argument is invalid.
FSP_ERR_NOT_OPENUnit is not open.

◆ R_ADC_B_Calibrate()

fsp_err_t R_ADC_B_Calibrate ( adc_ctrl_t *const  p_ctrl,
void const *  p_extend 
)

Initiates calibration of the ADC_B. This function must be called before starting a scan and again whenever ADC_B configuration or state is changed.

Note
Self-calibration is a non-blocking operation. The application should wait for an ADC_EVENT_CALIBRATION_COMPLETE callback before using other ADC_B functionality.
The self-calibration process will disable hardware triggers that were previously enabled.
Parameters
[in]p_ctrlPointer to the instance control structure
[in]p_extendUnused argument.
Return values
FSP_SUCCESSCalibration successfully initiated.
FSP_ERR_ASSERTIONAn input argument is invalid.
FSP_ERR_NOT_OPENUnit is not open.

◆ R_ADC_B_OffsetSet()

fsp_err_t R_ADC_B_OffsetSet ( adc_ctrl_t *const  p_ctrl,
adc_channel_t const  reg_id,
int32_t  offset 
)

adc_api_t::offsetSet is not supported on the ADC_B.

Return values
FSP_ERR_UNSUPPORTEDFunction not supported in this implementation.