RAFW Flexible Software Package Documentation  Release v2.0.1

 
ADC (r_adc_w)

Functions

fsp_err_t R_ADC_W_Open (adc_ctrl_t *p_ctrl, adc_cfg_t const *const p_cfg)
 
fsp_err_t R_ADC_W_ScanCfg (adc_ctrl_t *p_ctrl, void const *const p_scan_cfg)
 
fsp_err_t R_ADC_W_CallbackSet (adc_ctrl_t *const p_api_ctrl, void(*p_callback)(adc_callback_args_t *), void *const p_context, adc_callback_args_t *const p_callback_memory)
 
fsp_err_t R_ADC_W_ScanStart (adc_ctrl_t *p_ctrl)
 
fsp_err_t R_ADC_W_ScanGroupStart (adc_ctrl_t *p_ctrl, adc_group_mask_t group_id)
 
fsp_err_t R_ADC_W_ScanStop (adc_ctrl_t *p_ctrl)
 
fsp_err_t R_ADC_W_StatusGet (adc_ctrl_t *p_ctrl, adc_status_t *p_status)
 
fsp_err_t R_ADC_W_Read (adc_ctrl_t *p_ctrl, adc_channel_t const reg_id, uint16_t *const p_data)
 
fsp_err_t R_ADC_W_Read32 (adc_ctrl_t *p_ctrl, adc_channel_t const reg_id, uint32_t *const p_data)
 
fsp_err_t R_ADC_W_InfoGet (adc_ctrl_t *p_ctrl, adc_info_t *p_adc_info)
 
fsp_err_t R_ADC_W_Close (adc_ctrl_t *p_ctrl)
 
fsp_err_t R_ADC_W_Calibrate (adc_ctrl_t *const p_ctrl, void const *p_extend)
 
fsp_err_t R_ADC_W_OffsetSet (adc_ctrl_t *const p_ctrl, adc_channel_t const reg_id, int32_t offset)
 
fsp_err_t R_ADC_W_SensorWakeupcfg (adc_ctrl_t *const p_ctrl)
 
fsp_err_t R_ADC_W_FifoRead (adc_ctrl_t *p_ctrl, adc_channel_t const reg_id, uint16_t *const p_data)
 

Detailed Description

Driver for ADC_W version of the ADC peripheral on RAFW MCUs. This module implements the ADC Interface.

Overview

Features

The ADC module supports the following features:

Configuration

Build Time Configurations for r_adc_w

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

ConfigurationOptionsDefaultDescription
Parameter Checking
  • Default (BSP)
  • Enabled
  • Disabled
Default (BSP) If selected code for parameter checking is included in the build.
Interrupt Support
  • Enabled
  • Disabled
Enabled Enable Scan End Interrupt support for the ADC module.

Configurations for Analog > ADC (r_adc_w)

This module can be added to the Stacks tab via New Stack > Analog > ADC (r_adc_w).

ConfigurationOptionsDefaultDescription
General
Resolution
  • 12-Bit
  • 10-Bit
  • 7-Bit
  • 4-Bit
12-Bit Specifies the conversion resolution for this unit.
ADC Input Clock DividerMust be a valid integer3 Specifies divider for ADC input clock.
Interrupts
Upper threshold of conversion resultMust be a valid integer65535 Specify the threshold of the conversion value that corresponds to the condition to generate an interrupt request.
Lower threshold of conversion resultMust be a valid integer0 Specify the threshold of the conversion value that corresponds to the condition to generate an interrupt request.
CallbackName must be a valid C symbolNULL A user callback function. If this callback function is provided, it is called from the interrupt service routine (ISR) whenever the AD conversion result meets the interrupt generation condition.
Scan End Interrupt PriorityMCU Specific OptionsSelect scan end interrupt priority.
Sensor Wakeup
Timer count clock source
  • 7.81 msec
  • 31.25 msec
  • 62.5 msec
  • 250 msec
  • 1000 msec
  • 4000 msec
  • 16000 msec
  • 64000 msec
7.81 msec Timer count clock source used for the sensor wakeup function. (base = 32.768KHz).
Timer valueMust be a valid integer1 The AD conversion period is 'Timer count clock source' multiplied by (Timer value + 1). The range of Timer value is from 1 to 0xF. ex. when 'Timer count clock source' 7.81 msec period, the cycle is 15.62 to 124.8 msec. when 'Timer count clock source' 64,000 msec period, the cycle is 128,000 ~ 1,024,000 msec (max. 17.1 min).
Sample number for average
  • 4
  • 8
  • 16
  • 32
  • 64
  • 128
  • 256
  • 512
4 This is the number of ADC sample data to be averaged.The average value is obtained and compared with the value set in Wake-up-threshold to check whether the condition is satisfied.
NameName must be a valid C symbolg_adc0 Module name.

Configurations for Analog > ADC_W Channel Configuration (r_adc_w)

ConfigurationOptionsDefaultDescription
DMA support
DMA support
  • Disabled
  • Enabled
Disabled Enable DMA support for this channel.
Interrupts
Interrupt Mode of FIFO
  • Disabled
  • HALF
Disabled Specify the interrupt mode of FIFO. If HALF is selected, an interrupt occurs when the analog to digital conversion is completed and the FIFO is filled with 4 data.
Interrupt Mode of Threshold
  • Disabled
  • Over
  • Under
Disabled If Over is selected, an interrupt occurs when the conversion result exceeds the specified threshold. If Under is selected, an interrupt occurs when the conversion result falls below the specified threshold.
Sensor Wake-up
Sensor wakeup support
  • Disabled
  • Enabled
Disabled Enable Sensor Wake-up support for this channel.
Wake-up thresholdMust be a valid integer0 The threshold used to wake up from Sleep mode. From 0 to 0xFFF.
Threshold mode selection
  • Over
  • Under
Over If Over threshold is selected, sleep mode ends when the input value exceeds the threshold.(If Under threshold is selected, sleep mode ends when it falls below the threshold.)

Clock Configuration

The ADC input clock source is configured to use AUX_CLK with a selectable division ratio.

Pin Configuration

The ADCx pins are analog input channels that can be used with the ADC_W.

Conversion frequency

Conversion frequency depends on input clock, resolution(clock cycle per sample), and number of channels used.

For example, when the input clock is 15 MHz, the resolution is 10 bits, and two channels are used, the conversion frequency is as follows.

Usage Notes

ADC_W Operational Conversion

The driver supports an operation conversion mode: Continuous scan mode. For each time conversion, ADC peripheral only converts for each a pin.

Continuous scan mode

In Continuous scan mode, the specified channels are scanned continuously. This scan continues until R_ADC_W_ScanStop() is called.

When Interrupt Is Not Enabled

If interrupts are not enabled, R_ADC_W_StatusGet() can be used to check if AD conversion has started. The read API function is used to access the converted ADC result.

When Interrupt Is Enabled

An interrupt is generated depend on setting condition of converted ADC result is over or under the threshold value, or number of ADC results in FIFO exceed the threshold.

Note
If interrupts occur frequently, the interrupt handler may be called more frequently, causing the application to stop processing

Selecting ADC Input Clock Divider

The ADC input clock is configured to use the AUX_CLK with the specified division ratio.

FIFO

The FIFOs consist of 4 stages and can hold up to 4 A/D conversion data. One FIFO is implemented for each channel.

Data in the FIFO can be read by R_ADC_W_FifoRead().

Sensor Wake-up

Even in Sleep mode, when a change of an external analog signal is detected, a wakeup event occurs and normal operation is resumed.

This function can be used in up to four channels. Also, when multiple external sensors are used, analog signals are detected while the channel are automatically changed. For example, if all four channels are set as input sources which have their threshold register respectively, the channels are measured sequentially from 0 to 3.

If one of the four ADC channels exceed the allowed range of values set by the threshold register, the device awakes from the Sleep mode.

Examples

Basic Example

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

void adc_w_basic_example (void)
{
fsp_err_t err = FSP_SUCCESS;
/* Initializes the module. */
err = R_ADC_W_Open(&g_adc0_ctrl, &g_adc0_cfg);
/* Handle any errors. This function should be defined by the user. */
assert(FSP_SUCCESS == err);
/* Enable channels. */
err = R_ADC_W_ScanCfg(&g_adc0_ctrl, &g_adc0_scan_cfg);
assert(FSP_SUCCESS == err);
/* In software trigger mode, start a scan by calling R_ADC_W_ScanStart(). In other modes, enable hardware
* triggers by calling R_ADC_W_ScanStart(). */
(void) R_ADC_W_ScanStart(&g_adc0_ctrl);
/* Wait for conversion to complete. */
adc_status_t status;
(void) R_ADC_W_StatusGet(&g_adc0_ctrl, &status);
/* Read converted data. */
uint16_t channel0_conversion_result;
err = R_ADC_W_Read(&g_adc0_ctrl, ADC_CHANNEL_0, &channel0_conversion_result);
assert(FSP_SUCCESS == err);
/* Stop scan */
err = R_ADC_W_ScanStop(&g_adc0_ctrl);
assert(FSP_SUCCESS == err);
}

ADC-DMAC Transfer Example

This example demonstrates reading multiple data from an ADC channel and storing the data in memory through DMAC.

#define TEST_DMAC_TRANS_LEN (32)
#define BSP_VECTOR_DMA_IRQN ((IRQn_Type) 0)
void DMAC_Callback(dmac_callback_args_t * const cb_data);
static uint8_t dma_done_1 = 0;
static uint16_t adc_dmac_dst[TEST_DMAC_TRANS_LEN];
dmac_instance_ctrl_t g_transfer0_ctrl;
transfer_info_t g_transfer0_info =
{
.transfer_settings_word_b.dest_addr_mode = TRANSFER_ADDR_MODE_INCREMENTED,
.transfer_settings_word_b.src_addr_mode = TRANSFER_ADDR_MODE_FIXED,
.transfer_settings_word_b.size = TRANSFER_SIZE_2_BYTE,
.transfer_settings_word_b.mode = TRANSFER_MODE_NORMAL,
.p_dest = &adc_dmac_dst,
.p_src = (uint16_t const *) (ADC_CH0_DMAC_SRC_ADDR + ADC_CHANNEL_0),
.length = TEST_DMAC_TRANS_LEN,
};
dmac_extended_cfg_t g_transfer0_extend =
{
.channel = 0x00,
.irq = BSP_VECTOR_DMA_IRQN,
.ipl = (15),
.init_mode = DMAC_INIT_AX_BX_AY_BY,
.burst_mode = DMAC_BURST_MODE_4x,
.channel_prio = (7),
.periph_trigger = BSP_DMAC_TRIG_AUXADC0,
.irq_num_of_trans = TEST_DMAC_TRANS_LEN,
.p_callback = DMAC_Callback,
.p_context = NULL,
};
const transfer_cfg_t g_transfer0_cfg =
{
.p_info = &g_transfer0_info,
.p_extend = (void *) &g_transfer0_extend,
};
const transfer_instance_t g_transfer0 =
{
.p_ctrl = &g_transfer0_ctrl,
.p_cfg = &g_transfer0_cfg,
.p_api = &g_transfer_on_dmac_w
};
void DMAC_Callback (dmac_callback_args_t * const cb_data)
{
dma_done_1 = 1;
}
void adc_w_dmac_example (void)
{
fsp_err_t err = FSP_SUCCESS;
/* Initializes the module. */
err = R_ADC_W_Open(&g_adc0_ctrl, &g_adc0_cfg);
/* Handle any errors. This function should be defined by the user. */
assert(FSP_SUCCESS == err);
/* Enable channels. */
err = R_ADC_W_ScanCfg(&g_adc0_ctrl, &g_adc0_scan_cfg);
assert(FSP_SUCCESS == err);
/* Enable DMAC */
err = R_DMAC_W_Open(&g_transfer0_ctrl, &g_transfer0_cfg);
assert(FSP_SUCCESS == err);
err = R_DMAC_W_Reconfigure(&g_transfer0_ctrl, &g_transfer0_info);
assert(FSP_SUCCESS == err);
err = R_DMAC_W_Enable(&g_transfer0_ctrl);
assert(FSP_SUCCESS == err);
(void) R_ADC_W_ScanStart(&g_adc0_ctrl);
uint32_t timeout = UINT16_MAX;
while ((!dma_done_1) && (timeout > 0U))
{
timeout--;
}
/* Stop scan */
err = R_ADC_W_ScanStop(&g_adc0_ctrl);
assert(FSP_SUCCESS == err);
/* Close DMAC */
err = R_DMAC_W_Disable(&g_transfer0_ctrl);
err = R_DMAC_W_Close(&g_transfer0_ctrl);
}

ADC-Sensor Wake-up Example

This is an example of using the ADC sensor wake-up function.

void adc_w_sensor_wakeup_example (void)
{
fsp_err_t err;
/* Initializes the module. */
err = R_ADC_W_Open(&g_adc0_ctrl, &g_adc0_cfg);
/* Handle any errors. This function should be defined by the user. */
assert(FSP_SUCCESS == err);
/* Enable the channel. */
err = R_ADC_W_SensorWakeupcfg(&g_adc0_ctrl);
assert(FSP_SUCCESS == err);
#if 0 // TIN-TODO
R_PM_LowPowerModeEnter(PMGR_LLD_POWER_MODE_SLEEP3, 0xFFFFFFFF);
#endif
}

Data Structures

struct  adc_w_scan_cfg_t
 
struct  adc_w_channel_cfg_t
 
struct  adc_w_extended_cfg_t
 
struct  adc_w_instance_ctrl_t
 

Enumerations

enum  adc_w_dma_enable_t
 
enum  adc_w_thd_interrupt_mode_t
 
enum  adc_w_fifo_interrupt_mode_t
 
enum  adc_w_sensorwakeup_enable_t
 
enum  adc_w_sensorwakeup_thd_mode_t
 
enum  adc_w_timer_count_clock_source_t
 
enum  adc_w_sample_average_t
 

Data Structure Documentation

◆ adc_w_scan_cfg_t

struct adc_w_scan_cfg_t

ADC_W active channel configuration

Data Fields
uint32_t scan_mask Channels/bits: bit 0 is ch0; bit 3 is ch3.

◆ adc_w_channel_cfg_t

struct adc_w_channel_cfg_t

ADC chennel config structure

Data Fields
adc_w_fifo_interrupt_mode_t interrupt_mode_fifo FIFO interrupt settings(four data/none)
adc_w_thd_interrupt_mode_t interrupt_mode_thd Threshold interrupt setting(none/over/under)
adc_w_dma_enable_t dma_en Enable/disable DMA support.
adc_w_sensorwakeup_enable_t sensorwakeup_en Enable/disable sensor wakeup mode.
uint16_t thd_value Threshold Level for the channel.
adc_w_sensorwakeup_thd_mode_t threshold_mode Use threshold as upper or lower limit.

◆ adc_w_extended_cfg_t

struct adc_w_extended_cfg_t

ADC extended configuration data

Data Fields
uint16_t conversion_clockdiv Divider for conversion clock (fAD) setting.
uint16_t upper_bound_limit Setting upper limit conversion value.
uint16_t lower_bound_limit Setting lower limit conversion value.
adc_w_channel_cfg_t const * p_channel_cfgs[BSP_FEATURE_ADC_W_MAX_NUM_CHANNELS] Configuration for each channel, set to NULL if unused.
adc_w_timer_count_clock_source_t timer_count_clock_source Setting lower limit conversion value.
uint16_t timer_value Timer count clock source for sensor wakeup mode (base = 32.768KHz)
adc_w_sample_average_t sample_average Sample number for average in sensor wakeup mode.

◆ adc_w_instance_ctrl_t

struct adc_w_instance_ctrl_t

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

Data Fields

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_w_event_t occurs.
 
void * p_context
 User defined context passed into callback function.
 
uint32_t initialized
 Initialized status of ADC_W.
 
uint32_t opened
 Open status of ADC_W.
 
uint32_t scan_mask
 Scan mask of enabled channels.
 
uint32_t scan_cfg_mask
 Scan mask of configured channels.
 

Enumeration Type Documentation

◆ adc_w_dma_enable_t

DMA enable

Enumerator
ADC_W_DMA_DISABLED 

DMA disabled

ADC_W_DMA_ENABLED 

DMA enabled

◆ adc_w_thd_interrupt_mode_t

ADC Interrupt Mode Threshold

Enumerator
ADC_W_INTERRUPT_THD_NONE 

Threshold interrupt is disabled

ADC_W_INTERRUPT_THD_OVER 

An interrupt occurs when the conversion result exceeds the threshold.

ADC_W_INTERRUPT_THD_UNDER 

An interrupt occurs when the conversion result is below the threshold.

◆ adc_w_fifo_interrupt_mode_t

ADC Interrupt Mode FIFO

Enumerator
ADC_W_INTERRUPT_FIFO_NONE 

FIFO interrupt is disabled

ADC_W_INTERRUPT_FIFO_HALF 

An interrupt occurs when the FIFO is filled with four data.

◆ adc_w_sensorwakeup_enable_t

ADC Sensor Wakeup Mode enable

Enumerator
ADC_W_SENSOR_WAKEUP_DISABLED 

sensor wakeup disabled

ADC_W_SENSOR_WAKEUP_ENABLED 

sensor wakeup enabled

◆ adc_w_sensorwakeup_thd_mode_t

Threshold mode selection for sensor wakeup mode

Enumerator
ADC_W_SENSOR_WAKEUP_THD_OVER 

Over threshold

ADC_W_SENSOR_WAKEUP_THD_UNDER 

Under threshold

◆ adc_w_timer_count_clock_source_t

Timer count clock source for sensor wakeup mode (base = 32.768KHz)

Enumerator
ADC_W_TIMER_COUNT_SOURCE_8 

7.81-msec period

ADC_W_TIMER_COUNT_SOURCE_31 

31.25-msec period

ADC_W_TIMER_COUNT_SOURCE_62 

62.5-msec period

ADC_W_TIMER_COUNT_SOURCE_250 

250-msec period

ADC_W_TIMER_COUNT_SOURCE_1000 

1000-msec period

ADC_W_TIMER_COUNT_SOURCE_4000 

4000-msec period

ADC_W_TIMER_COUNT_SOURCE_16000 

16000-msec period

ADC_W_TIMER_COUNT_SOURCE_64000 

64,000-msec period

◆ adc_w_sample_average_t

Sample number for average in sensor wakeup mode

Enumerator
ADC_W_SAMPLE_AVERAGE_4 

4-sample processing

ADC_W_SAMPLE_AVERAGE_8 

8-sample processing

ADC_W_SAMPLE_AVERAGE_16 

16-sample processing

ADC_W_SAMPLE_AVERAGE_32 

32-sample processing

ADC_W_SAMPLE_AVERAGE_64 

64-sample processing

ADC_W_SAMPLE_AVERAGE_128 

128-sample processing

ADC_W_SAMPLE_AVERAGE_256 

256-sample processing

ADC_W_SAMPLE_AVERAGE_512 

512-sample processing

Function Documentation

◆ R_ADC_W_Open()

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

Initialize the ADC_W peripheral. If interrupt is enabled, the function registers a callback function for notifying the user when 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.
FSP_ERR_IRQ_BSP_DISABLEDA callback is provided, but the interrupt is not enabled.

◆ R_ADC_W_ScanCfg()

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

Configures the enabled channels of the ADC. Channel specific settings are set in this function. Pass a pointer to adc_w_scan_cfg_t to p_extend. Implements adc_api_t::scanCfg.

Return values
FSP_SUCCESSChannel specific settings applied.
FSP_ERR_ASSERTIONAn input argument is invalid.
FSP_ERR_NOT_OPENUnit is not open.

◆ R_ADC_W_CallbackSet()

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

Updates the user callback. Implements adc_api_t::callbackSet

Return values
FSP_SUCCESSCallback updated successfully.
FSP_ERR_NOT_OPENUnit is not open.
FSP_ERR_ASSERTIONA required pointer is NULL.

◆ R_ADC_W_ScanStart()

fsp_err_t R_ADC_W_ScanStart ( adc_ctrl_t p_ctrl)

This function starts the software triggered scan.

Precondition
Call R_ADC_W_ScanCfg after R_ADC_W_Open before starting a scan.
Return values
FSP_SUCCESSScan started.
FSP_ERR_ASSERTIONAn input argument is invalid.
FSP_ERR_NOT_OPENADC_W is not open.
FSP_ERR_NOT_INITIALIZEDADC_W is not initialized.

◆ R_ADC_W_ScanGroupStart()

fsp_err_t R_ADC_W_ScanGroupStart ( adc_ctrl_t p_ctrl,
adc_group_mask_t  group_id 
)

adc_api_t::scanGroupStart is not supported on the ADC_W. Use scanStart instead.

Return values
FSP_ERR_UNSUPPORTEDFunction not supported in this implementation.

◆ R_ADC_W_ScanStop()

fsp_err_t R_ADC_W_ScanStop ( adc_ctrl_t p_ctrl)

Immediately stops converters. This function will abort conversions.

Return values
FSP_SUCCESSScan stopped.
FSP_ERR_ASSERTIONAn input argument is invalid.
FSP_ERR_NOT_OPENUnit is not open.
FSP_ERR_NOT_INITIALIZEDUnit is not initialized.

◆ R_ADC_W_StatusGet()

fsp_err_t R_ADC_W_StatusGet ( adc_ctrl_t p_ctrl,
adc_status_t p_status 
)

Provides the status of any scan process that was started.

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

◆ R_ADC_W_Read()

fsp_err_t R_ADC_W_Read ( adc_ctrl_t p_ctrl,
adc_channel_t const  reg_id,
uint16_t *const  p_data 
)

Reads conversion results from a channel register.

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 is not initialized.

◆ R_ADC_W_Read32()

fsp_err_t R_ADC_W_Read32 ( adc_ctrl_t p_ctrl,
adc_channel_t const  reg_id,
uint32_t *const  p_data 
)

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

Return values
FSP_SUCCESSData read into provided p_data.
FSP_ERR_ASSERTIONAn input argument is invalid.
FSP_ERR_NOT_OPENADC_W is not open.
FSP_ERR_NOT_INITIALIZEDADC_W is not initialized.

◆ R_ADC_W_InfoGet()

fsp_err_t R_ADC_W_InfoGet ( adc_ctrl_t p_ctrl,
adc_info_t p_adc_info 
)

Returns the address of the lowest number configured channel, determine the size of data that must be read.

Return values
FSP_SUCCESSInformation stored in p_adc_info.
FSP_ERR_ASSERTIONAn input argument is invalid.
FSP_ERR_NOT_OPENADC_W is not open.
FSP_ERR_NOT_INITIALIZEDADC_W is not initialized.

◆ R_ADC_W_Close()

fsp_err_t R_ADC_W_Close ( adc_ctrl_t p_ctrl)

This function ends any scan or select mode 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_OPENADC_W is not open.

◆ R_ADC_W_Calibrate()

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

adc_api_t::calibrate is not supported on the ADC_W.

Return values
FSP_ERR_UNSUPPORTEDFunction not supported in this implementation.

◆ R_ADC_W_OffsetSet()

fsp_err_t R_ADC_W_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_W.

Return values
FSP_ERR_UNSUPPORTEDFunction not supported in this implementation.

◆ R_ADC_W_SensorWakeupcfg()

fsp_err_t R_ADC_W_SensorWakeupcfg ( adc_ctrl_t *const  p_ctrl)

Prepare ADC_W to enter sensor wakeup mode. This function must be called before entering sleep mode.

Parameters
[in]p_ctrlPointer to the ADC control block
Return values
FSP_SUCCESSADC is configured to request sensor wakeup mode.
FSP_ERR_ASSERTIONAn input argument is invalid.
FSP_ERR_NOT_OPENADC_W is not open.

◆ R_ADC_W_FifoRead()

fsp_err_t R_ADC_W_FifoRead ( adc_ctrl_t p_ctrl,
adc_channel_t const  reg_id,
uint16_t *const  p_data 
)

Reads conversion results from FIFO for the given channel. When reading multiple data from the FIFO, call this function repeatedly.

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.