RA Flexible Software Package Documentation  Release v5.2.0

 
CTSU (r_ctsu)

Functions

fsp_err_t R_CTSU_Open (ctsu_ctrl_t *const p_ctrl, ctsu_cfg_t const *const p_cfg)
 Opens and configures the CTSU driver module. Implements ctsu_api_t::open. More...
 
fsp_err_t R_CTSU_ScanStart (ctsu_ctrl_t *const p_ctrl)
 This function should be called each time a periodic timer expires. If initial offset tuning is enabled, The first several calls are used to tuning for the sensors. Before starting the next scan, first get the data with R_CTSU_DataGet(). If a different control block scan should be run, check the scan is complete before executing. Implements ctsu_api_t::scanStart. More...
 
fsp_err_t R_CTSU_DataGet (ctsu_ctrl_t *const p_ctrl, uint16_t *p_data)
 This function gets the sensor values as scanned by the CTSU. If initial offset tuning is enabled, The first several calls are used to tuning for the sensors. Implements ctsu_api_t::dataGet. More...
 
fsp_err_t R_CTSU_OffsetTuning (ctsu_ctrl_t *const p_ctrl)
 This function tunes the offset register(SO). Call after the measurement is completed. If the return value is FSP_ERR_CTSU_INCOMPLETE_TUNING, tuning is not complete. Execute the measurement and this function call routine until the return value becomes FSP_SUCCESS. It is recommended to run this routine after R_CTSU_Open(). It can be recalled and tuned again. When the automatic judgement is enabled, after the offset tuning is completed,the baseline initialization bit flag is set. Implements ctsu_api_t::offsetTuning. More...
 
fsp_err_t R_CTSU_ScanStop (ctsu_ctrl_t *const p_ctrl)
 This function scan stops the sensor as scanning by the CTSU. Implements ctsu_api_t::scanStop. More...
 
fsp_err_t R_CTSU_CallbackSet (ctsu_ctrl_t *const p_api_ctrl, void(*p_callback)(ctsu_callback_args_t *), void const *const p_context, ctsu_callback_args_t *const p_callback_memory)
 
fsp_err_t R_CTSU_Close (ctsu_ctrl_t *const p_ctrl)
 Disables specified CTSU control block. Implements ctsu_api_t::close. More...
 
fsp_err_t R_CTSU_SpecificDataGet (ctsu_ctrl_t *const p_ctrl, uint16_t *p_specific_data, ctsu_specific_data_type_t specific_data_type)
 This function gets the sensor specific data values as scanned by the CTSU. Call this function after calling the R_CTSU_DataGet() function. More...
 
fsp_err_t R_CTSU_DataInsert (ctsu_ctrl_t *const p_ctrl, uint16_t *p_insert_data)
 This function inserts the value of the second argument as the measurement result value. Call this function after calling the R_CTSU_DataInsert() function. Implements ctsu_api_t::dataInsert. More...
 
fsp_err_t R_CTSU_Diagnosis (ctsu_ctrl_t *const p_ctrl)
 Diagnosis the CTSU peripheral. Implements ctsu_api_t::diagnosis. More...
 

Detailed Description

This HAL driver supports the Capacitive Touch Sensing Unit (CTSU). It implements the CTSU Interface.

Overview

The capacitive touch sensing unit HAL driver (r_ctsu) provides an API to control the CTSU peripheral. This module performs capacitance measurement based on various settings defined by the configuration. This module is configured via the QE for Capacitive Touch.

Features

Configuration

Note
This module is configured via the QE for Capacitive Touch. For information on how to use the QE tool, once the tool is installed click Help -> Help Contents in e² studio and search for "QE".

Build Time Configurations for r_ctsu

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

ConfigurationOptionsDefaultDescription
Parameter Checking
  • Default (BSP)
  • Enabled
  • Disabled
Default (BSP) If selected code for parameter checking is included in the build.
Support for using DTC
  • Enabled
  • Disabled
Disabled Enable DTC support for the CTSU module.
Interrupt priority levelMCU Specific OptionsPriority level of all CTSU interrupt (CSTU_WR,CTSU_RD,CTSU_FN)

Configurations for CapTouch > CTSU (r_ctsu)

This module can be added to the Stacks tab via New Stack > CapTouch > CTSU (r_ctsu). Non-secure callable guard functions can be generated for this module by right clicking the module in the RA Configuration tool and checking the "Non-secure Callable" box.

ConfigurationOptionsDefaultDescription
Scan Start TriggerMCU Specific OptionsCTSU Scan Start Trigger Select

Interrupt Configuration

The first R_CTSU_Open function call sets CTSU peripheral interrupts. The user should provide a callback function to be invoked at the end of the CTSU scan sequence. The callback argument will contain information about the scan status.

Clock Configuration

The CTSU peripheral module uses PCLKB as its clock source. You can set the PCLKB frequency using the Clocks tab of the RA Configuration editor or by using the CGC Interface at run-time.

Note
The CTSU Drive pulse will be calculated and set by the tooling depending on the selected transfer rate.

Pin Configuration

The TSn pins are sensor pins for the CTSU.

The TSCAP pin is used for an internal low-pass filter and must be connected to an external decoupling capacitor.

Usage Notes

The CTSU module is a CTSU driver for the Touch module. The CTSU module assumes the access from the Touch middleware layer, and it is also accessible from an user application.
CTSU and CTSU2 are functionally different, so CTSU and CTSU2 are described in this application note as below.
Common description for CTSU and CTSU2 -> CTSU
Description only for CTSU -> CTSU1
Description only for CTSU2 -> CTSU2
Without mention, it means the common description for CTSU and CTSU2.

Functions

The CTSU module supports the following functions.

Touch Judgment Mode

CTSU2 has two modes, which differ in processing and output data.
It is common to get three raw value for each element and calculate CCO correction, and then performs different processing.

  1. Value Majority Mode(VMM)
    Calculate three frequency correction value from three CCO correction values. Calculate the sum of the two closest values of the three frequency correction value. Outputs the moving average of this added value.
    r_ctsu_Majority_Value_Mode.png
    Value Majority Mode (VMM)
  2. Judgement Majority Mode (JMM)
    This mode is supported from FSP V5.1.0 or later.
    Outputs the moving average of three CCO correction values.
    r_ctsu_Majority_Judgement_Mode.png
    Judgement Majority Mode (JMM)

Measurements and Obtaining Data

Measurements can be started by a software trigger or by an external event triggered by the Event Link Controller (ELC).
As the measurement process is carried out by the CTSU2 peripheral, it does not use up main processor processing time.
The CTSU module processes INTCTSUWR and INTCTSURD if generated during a measurement. The data transfer controller (DTC) can also be used for these processes.
When the measurement complete interrupt (INTCTSUFN) process is complete, the application is notified in a callback function. Make sure you obtain the measurement results before the next measurement is started as internal processes are also executed when a measurement is completed.
Start the measurement with API function R_CTSU_ScanStart().
Obtain the measurement results with API function R_CTSU_DataGet().
The number of arrays in the second argument of R_CTSU_DataGet() is different between VMM and JMM.
VMM returns one measurement result for each element.
JMM returns three measurement results for each element.

Sensor CCO Correction function

The CTSU2 peripheral has a built-in correction circuit to handle the potential microvariations related to the manufacturing process of the sensor CCO MCU.
The module temporarily transitions to the correction process during initialization after power is turned on. In the correction process, the correction circuit is used to generate a correction coefficient (factor) to ensure accurate sensor measurement values.
When temperature correction is enabled, an external resistor connected to a TS terminal is used to periodically update the correction coefficient. By using an external resistor that is not dependent on temperature, you can even correct the temperature drift of the sensor CCO.
In CTSU2's Majority Value Mode, there is only one type of CCO correction, but in Majority Judgment Mode, three types of CCO correction are performed for each three frequencies.

Initial Offset Adjustment

The CTSU2 peripheral was designed with a built-in offset current circuit in consideration of the amount of change in current due to touch. The offset current circuit cancels enough of the parasitic capacitance for it to fit within the sensor CCO dynamic range.
This module automatically adjusts the offset current setting. As the adjustment uses the normal measurement process, the combination of R_CTSU_ScanStart() and R_CTSU_DataGet() or the combination of R_CTSU_ScanStart() and R_CTSU_OffsetTuning() must be repeated several times after startup. Because the ctsu_element_cfg_t member “so” is the starting point for adjustments, you can set the appropriate value for “so” in order to reduce the number of times the two functions must be run to complete the adjustment. Normally, the value used for “so” is a value adjusted by QE for Capacitive Touch.
R_CTSU_OffsetTuning() was added in FSP 3.8.0. This API can also be used for initial offset adjustment, and offset adjustment can be performed again at any time. See example code of R_CTSU_OffsetTuning() for details.

ModeCTSU1 target valueCTSU2 target value
Self-capacitance15360 (37.5%)15360 (50%)
Self-capacitance using active shield-6144 (20%)
Mutual-capacitance10240 (20%)10240 (33.3%)

The percentage is for the CCO's input limit. In CTSU1, 100% is the measured value 40960. In CTSU2, 100% is the measured value 30720.
The target value is based on 526us(CTSU1) or 256us(CTSU2).
When the measurement time is changed, the target value is adjusted by the ratio with the base time.

Example of target value in combination of CTSUSNUM and CTSUSDPA.
CTSU1 (CTSU clock = 32MHz, Self-capacitance mode)

Target valueCTSUSNUMCTSUSDPAMeasurement time
153600x30x7526usec
307200x70x71052usec
307200x30xF1052usec
76800x10x7263usec
76800x30x3263usec

The measurement time changes depending on the combination of CTSUSNUM and CTSUSDPA.
In the above table, CTSUPRRTIO is the recommended value of 3, and CSTUPRMODE is the recommended value of 2.
When changing CTSUPRRATIO and CTSUPRMODE from the recommended values, follow the Hardware Manual for the measurement time.

CTSU2 (Self-capacitance mode)

Target valueTarget value (multi frequency)CTSUSNUMMeasurement time
768015360 (128us + 128us)0x7128usec
1536030720 (256us + 256us) 0xF256usec
38407680 (64us + 64us)0x364usec

The measurement time changes depending on CTSUSNUM.
If STCLK cannot be set to 0.5MHz, it will not support the table above.
When setting STCLK to other than 0.5MHz because the CTSU clock is not an integer, follow the hardware manual for the measurement time.

Random Pulse Frequency Measurement (CTSU1)

The CTSU1 peripheral measures at one drive frequency.
The drive frequency determines the amperage to the electrode and generally uses the value tuned with QE for Capacitive Touch.
The drive frequency is calculated as below.
It is determined by PCLK frequency input to CTSU, CTSU Count Source Select bit(CTSUCLK), and CTSU Sensor Drive pulse Division Control bit(CTSUSDPA). For example, If it is set PCLK =32MHz, CTSUCLK = PLCK/2, and CTSUSDPA = 1/16, then drive frequency is 0.5MHz. CTSUSDPA can change for each TS port.

r_ctsu_Drive_Frequency_Settings.png
Drive Frequency Settings

The actual drive pulse is phase-shifted and frequency-spread with respect to the clock based on the drive frequency as a measure against external environmental noise. This module is fixed at initialization and sets the following.
CTSUSOFF = 0,CTSUSSMOD = 0,CTSUSSCNT = 3

Multi-frequency Measurements (CTSU2)

The CTSU2 peripheral can measure in one of four drive frequencies to avoid synchronous noise.
With the default settings, the module takes measurements at three different frequencies. This data are called raw data. And calculate CCO correction. This data are called CCO correction data.
In VMM, After standardizing the results obtained at the three frequencies in accordance with the first frequency reference value, the measured value is determined based on majority in a process referred to as “normalization.”
The three values standardized to the first frequency reference value are called frequency correction data.
You can get the three correction data with R_CTSU_SpecificDataGet().
In VMM, three raw data, CCO correction data, and frequency correction data can be obtained with R_CTSU_SpecificDataGet().
In JMM, three raw data and three CCO correction data can be obtained with R_CTSU_SpecificDataGet().

r_ctsu_Multi-Frequency_Mesurements.png
Multi-frequency Measurements

Drive frequency is determined based on the config settings. The module sets registers according to the config settings, and sets the three drive frequencies.
Drive frequency is calculated in the following equation:
(PCLKB frequency / CLK / STCLK) x SUMULTIn / 2 / SDPA : n = 0, 1, 2
The figure below shows the settings for generating a 2MHz drive frequency when the PCLKB frequency is 32 MHz. SDPA can be set for each touch interface configuration.

r_ctsu_Drive_Frequency_Settings_ctsu2.png
Drive Frequency Settings

Shield Function(CTSU2)

The CTSU2 peripheral has a built-in function that outputs a shield signal in phase with the drive pulse from the shield terminal and the non-measurement terminal in order to shield against external influences while suppressing any increase in parasitic capacitance. This function can only be used during self-capacitance measurements.
This module allows the user to set a shield for each touch interface configuration.
For example, for the electrode configuration shown in , the members of ctsu_cfg_t should be set as follows. Other members have been omitted for the example.
.txvsel = CTSU_TXVSEL_INTERNAL_POWER,
.txvsel2 = CTSU_TXVSEL_MODE,
.md = CTSU_MODE_SELF_MULTI_SCAN,
.posel = CTSU_POSEL_SAME_PULSE,
.ctsuchac0 = 0x0F,
.ctsuchtrc0 = 0x08,

r_ctsu_Shield_Electrode_Structure.png
Example of Shield Electrode Structure

Measurement Error Message

When the CTSU2 peripheral detects an abnormal measurement, it sets the status register bit to 1.
In the measurement complete interrupt process, the module reads ICOMP1, ICOMP0, and SENSOVF of the status register and notifies the results in the callback function. The status register is reset after the contents are read. For more details on abnormal measurements, refer to “member event” in the ctsu_callback_args_t callback function argument.

Moving Average

This function calculates the moving average of the measured results.
Set the number of times the moving average should be calculated in the config settings.

Diagnosis Function

The CTSU peripheral has a built-in function that diagnoses its own inner circuit. This diagnosis function provides the API for diagnosing the inner circuit.
The diagnostic requirements are different for CTSU1 and CTSU2 providing 5 types of diagnosis for CTSU1 and 9 types for CTSU2.
The diagnosis function is executed by calling the API function. This is executed independently from the other measurements and does not affect them.
To enable the diagnosis function, set CTSU_CFG_DIAG_SUPPORT_ENABLE to 1.
For CTSU1, a 27pF condenser should be connected externally.
For CTSU2, Diagnosis function uses the ADC module.
If an error occurs in the ADC module used for Diagnosis mode, return FSP_ERR_ABORTED as the return value of R_CTSU_DataGet().
If an ADC error is returned, exit the function so as not to measure or close the ADC.
See ADC (r_adc) for ADC module errors.
Please pay particular attention to the following three points.

  1. Be sure to measure the ADC module when using the Diagnosis mode function of the CTSU module. Therefore, in order for the user to use it with Dignosis, please close the user's ADC. After closing, please use the Diagnosis mode function of the CTSU module.
  2. When creating an application with RTOS, please be careful about the scheduling of the CTSU module's Diagnosis mode function task and the user's ADC task.
  3. If FSP_ERR_ABORTED occurs, please call the user's ADC again when using the user's ADC.

Measurement Mode

This module supports all three modes offered by the CTSU2 peripheral: self-capacitance, mutual-capacitance, and current measurement modes. The temperature correction mode is also offered as a mode for updating the correction coefficient.

Self-capacitance Mode

The self-capacitance mode is used to measure the capacitance of each terminal (TS).
The CTSU2 peripheral measures the terminals in ascending order according to the TS numbers, then stores the data. For example, even if you want to use TS5, TS8, TS2, TS3 and TS6 in your application in that order, they will still be measured and stored in the order of TS2, TS3, TS5, TS6, and TS8. Therefore, you will need to reference buffer indexes [2], [4], [0], [1], and [3].
VMM returns one measurement result for each element.
JMM returns three measurement results for each element.

[CTSU1]
In default settings, the measurement period for each TS is wait-time plus approximately 526us.

r_ctsu_Self_capacitance_Measurement_Period.png
Self-capacitance Measurement Period (CTSU1)

[CTSU2]
In default settings, the measurement period for each TS is approximately 576us.

r_ctsu_Self_capacitance_Measurement_Period_ctsu2.png
Self-capacitance Measurement Period (CTSU2)

Mutual-Capacitance Mode

The mutual-capacitance mode is used to measure the capacitance generated between the receive TS (Rx) and transmit TS (Tx), and therefore requires at least two terminals.
The CTSU2 peripheral measures all specified combinations of Rx and Tx. For example, when Rx is TS1 and TS3, and Tx is TS2, TS7 and TS4, the combinations are measured in the following order and the data is stored.
TS3-TS2, TS3-TS4, TS3-TS7, TS10-TS2, TS10-TS4, TS10-TS7
To measure the mutual-capacitance generated between electrodes, the CTSU2 peripheral performs the measurement process on the same electrode twice.
The mutual-capacitance is obtained by inverting the phase relationship of the pulse output and switched capacitor in the primary and secondary measurements, and calculating the difference between the two measurements. This module does not calculate the difference, but outputs the secondary measured result.
VMM returns two measurement results for each element.
JMM returns six measurement results for each element.

[CTSU1]
In default settings, the measurement period for each TS is twice of wait-time plus approximately 526us.
[CTSU2]
In default settings, the measurement period for each TS is approximately 1152us.

r_ctsu_Mutual_capacitance_Measurement_Period.png
Mutual-capacitance Measurement Period

Mutual-capacitance parallel scan mode(CTSU2)

This mode provides fast measurement time by parallel scanning the RX lines with a CFC circuit. Operation is otherwise identical to normal CTSU mutual scanning.

Current Measurement Mode(CTSU2)

The current measurement mode is used to measure the minute current input to the TS terminal. The order of measurement and data storage is the same as that of the self-capacitance mode. As this does not involve the switched capacitor operation, the measurement is only performed once. The measurement period for one TS under default settings is approximately 256us. The current measurement mode requires a longer stable wait time than the other modes, so the SST is set to 63.

r_ctsu_Current_Measurement_Period.png
Current Measurement Period

Temperature Correction Mode(CTSU2)

The temperature correction mode is used to periodically update the correction coefficient using an external resistor connected to a TS terminal. This involves three processes as described below. Also refer to the timing chart in Figure of Temperature Correction Measurement Timing Chart.

  1. Measure the correction circuit. One set comprises twelve measurements.
  2. Measure the current when TSCAP voltage is applied to the external resistor to create a correction coefficient based on an external resistor that does not depend on temperature. Execute the next measurement after the previous measurement set is completed (as described in step 1).
  3. Flow offset current to the external resistor and measure the voltage with the ADC. This will adjust the RTRIM register and handle the temperature drift of the internal reference resistor. In the config settings, set the number of times step 2 should be executed before carrying out this measurement.
r_ctsu_Temperature_Correction_Measurement_Period.png
Temperature Correction Measurement Timing Chart

Temperature correction uses the ADC module.
If an error occurs in the ADC module used for temperature correction, return FSP_ERR_ABORTED as the return value of R_CTSU_DataGet().
If an ADC error is returned, exit the function so as not to measure or close the ADC.
See ADC (r_adc) for ADC module errors.
Please pay articular attention to the following three points.

  1. When using the temperature correction of the CTSU module, be sure to measure the ADC module. Therefore, please close the user's ADC for use in temperature correction. After closing, please use temperature correction of CTSU module.
  2. When creating an RTOS, please be careful about the scheduling of the CTSU module's temperature correction task and the user's ADC task when creating an application.
  3. If FSP_ERR_ABORTED occurs, please call the user's ADC again when using the user's ADC.

Diagnosis Mode

The diagnosis mode is a mode in which various internal measurement values are scanned by using this diagnosis function R_CTSU_Diagnosis().

Measurement Timing

Measurements are initiated by a software trigger or an external event which is triggered by the Event Link Controller (ELC).
The most common method is using a timer to carry out periodic measurements. Make sure to set the timer interval to allow the measurement and internal value update processes to complete before the next measurement period. The measurement period differs according to touch interface configuration and measurement mode.
The execution timing of software triggers and external triggers differ slightly.
Since a software trigger sets the start flag after setting the touch interface configuration with R_CTSU_ScanStart(), there is a slight delay after the timer event occurrence. However, as the delay is much smaller than the measurement period, a software trigger is recommended for most instances as it is easy to set.
An external trigger is recommended for applications in which this slight delay is not acceptable or that require low-power consumption operations. When using an external trigger with multiple touch interface configurations, use R_CTSU_ScanStart() to set another touch interface configuration after one measurement is completed.

TrustZone Support

In r_ctsu and rm_touch module, Non-Secure Callable Guard Functions are only generated from QE for Capacitive Touch. QE can be used for tuning in secure or flat project, but not in non-secure project. If you want to use in non-secure project, copy the output file from secure or flat project. Refer to QE Help for more information.

Data flow

The flow of storing data in RAM is as follows.

(CTSU1)

  1. Read registers and stored in RAM as raw data.
  2. ICO correction calculation of raw data and stored in RAM as correction data.
  3. The correction data is calculated by moving average and stored in RAM as measurement results.

(CTSU2 VMM)

  1. Reads a register and stores raw data measured at three different frequencies in RAM.
  2. Calculate CCO correction from three raw data and stored three CCO correction values in RAM.
  3. Calculate three frequency correction values from three CCO correction values.
  4. Three frequency correction data are calculated by majority decision and moving average, and stored in RAM as measurement results.

(CTSU2 JMM)

  1. Reads a register and stores raw data measured at three different frequencies in RAM.
  2. Calculate CCO correction from three raw data and stored three CCO correction values in RAM.
  3. three CCO correction data is calculated by moving average and stored three measurement results in RAM.

Add user's filter

There are two ways to add the user's filter.

  1. Instead of filter calculation of R_CTSU_DataGet(), perform user filter calculation and use R_CTSU_DataInsert() to input user filter calculation result.
    R_CTSU_DataInsert()
    In VMM, the second argument p_insert_data stores one data for each element.
    In JMM, the second argument p_insert_data stores three data for each element.
  2. Using the correction data obtained by R_CTSU_SpecificDataGet(), instead of majority decision calculation and filter calculation of R_CTSU_DataGet(), perform user majority decision calculation & filter calculation and use R_CTSU_DataInsert() to input user majority decision calculation & filter calculation result.

Please check example.
User's filter additional Example

Examples

Basic Example

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

volatile bool g_scan_flag = false;
void ctsu_callback (ctsu_callback_args_t * p_args)
{
{
g_scan_flag = true;
}
}
void ctsu_basic_example (void)
{
fsp_err_t err = FSP_SUCCESS;
uint16_t data[CTSU_CFG_NUM_SELF_ELEMENTS];
err = R_CTSU_Open(&g_ctsu_ctrl, &g_ctsu_cfg);
/* Handle any errors. This function should be defined by the user. */
assert(FSP_SUCCESS == err);
while (true)
{
err = R_CTSU_ScanStart(&g_ctsu_ctrl);
assert(FSP_SUCCESS == err);
while (!g_scan_flag)
{
/* Wait for scan end callback */
}
g_scan_flag = false;
err = R_CTSU_DataGet(&g_ctsu_ctrl, data);
if (FSP_SUCCESS == err)
{
/* Application specific data processing. */
}
}
}

Multi-configuration Example

This is a optional example of using both Self-capacitance and Mutual-capacitance configurations in the same project.

void ctsu_optional_example (void)
{
fsp_err_t err = FSP_SUCCESS;
uint16_t data[CTSU_CFG_NUM_SELF_ELEMENTS + (CTSU_CFG_NUM_MUTUAL_ELEMENTS * 2)];
err = R_CTSU_Open(&g_ctsu_ctrl, &g_ctsu_cfg);
assert(FSP_SUCCESS == err);
err = R_CTSU_Open(&g_ctsu_ctrl_mutual, &g_ctsu_cfg_mutual);
assert(FSP_SUCCESS == err);
while (true)
{
R_CTSU_ScanStart(&g_ctsu_ctrl);
while (!g_scan_flag)
{
/* Wait for scan end callback */
}
g_scan_flag = false;
R_CTSU_ScanStart(&g_ctsu_ctrl_mutual);
while (!g_scan_flag)
{
/* Wait for scan end callback */
}
g_scan_flag = false;
err = R_CTSU_DataGet(&g_ctsu_ctrl, data);
assert(FSP_SUCCESS == err);
if (FSP_SUCCESS == err)
{
/* Application specific data processing. */
}
err = R_CTSU_DataGet(&g_ctsu_ctrl_mutual, data);
assert(FSP_SUCCESS == err);
if (FSP_SUCCESS == err)
{
/* Application specific data processing. */
}
}
}

Offset Adjustment Example

This is an example of offset adjustment using R_CTSU_OffsetTuning().
After completing R_CTSU_Open (), perform initial offset adjustment.
Offset adjustment is performed again when the parasitic capacitance changes significantly due to changes in the surrounding environment and the count value becomes an abnormal value.

void ctsu_offsettuning_example (void)
{
fsp_err_t err = FSP_SUCCESS;
uint16_t data[CTSU_CFG_NUM_SELF_ELEMENTS];
err = R_CTSU_Open(&g_ctsu_ctrl, &g_ctsu_cfg);
assert(FSP_SUCCESS == err);
/* Initial offset tuning */
do
{
R_CTSU_ScanStart(&g_ctsu_ctrl);
while (!g_scan_flag)
{
/* Wait for scan end callback */
}
g_scan_flag = false;
err = R_CTSU_OffsetTuning(&g_ctsu_ctrl);
} while (FSP_SUCCESS != err);
while (true)
{
R_CTSU_ScanStart(&g_ctsu_ctrl);
while (!g_scan_flag)
{
/* Wait for scan end callback */
}
g_scan_flag = false;
err = R_CTSU_DataGet(&g_ctsu_ctrl, data);
assert(FSP_SUCCESS == err);
if (FSP_SUCCESS == err)
{
/* Re-offset tuning is performed when the parasitic capacitance changes significantly due */
/* to changes in the surrounding environment and the count value becomes an abnormal value. */
/* */
/* if (abnormal value detection conditions) */
/* { */
/* Re-offset tuning */
do
{
R_CTSU_ScanStart(&g_ctsu_ctrl);
while (!g_scan_flag)
{
/* Wait for scan end callback */
}
g_scan_flag = false;
err = R_CTSU_OffsetTuning(&g_ctsu_ctrl);
} while (FSP_SUCCESS != err);
/* } */
}
}
}

Diagnosis function Example

This is a Diagnosis function example of using the configuration in the basic example.

void ctsu_diag_example (void)
{
fsp_err_t err = FSP_SUCCESS;
uint16_t data[CTSU_CFG_NUM_SELF_ELEMENTS];
uint16_t dummy;
R_CTSU_Open(&g_ctsu_ctrl, &g_ctsu_cfg);
assert(FSP_SUCCESS == err);
R_CTSU_Open(&g_ctsu_ctrl_diagnosis, &g_ctsu_cfg_diagnosis);
assert(FSP_SUCCESS == err);
while (true)
{
R_CTSU_ScanStart(&g_ctsu_ctrl);
while (!g_scan_flag)
{
/* Wait for scan end callback */
}
g_scan_flag = false;
err = R_CTSU_DataGet(&g_ctsu_ctrl, data);
assert(FSP_SUCCESS == err);
R_CTSU_ScanStart(&g_ctsu_ctrl_diagnosis);
while (!g_scan_flag)
{
/* Wait for scan end callback */
}
g_scan_flag = false;
err = R_CTSU_DataGet(&g_ctsu_ctrl_diagnosis, &dummy);
assert(FSP_SUCCESS == err);
if (FSP_SUCCESS == err)
{
err = R_CTSU_Diagnosis(&g_ctsu_ctrl_diagnosis);
assert(FSP_SUCCESS == err);
if (FSP_SUCCESS == err)
{
break;
}
}
}
}

User's filter additional Example

This is a user's filter additiional example of using the configuration in the basic example.
To perform user's filter calculation, change the num_moving_average of the element in the target ctsu_cfg_t to 1.

Perform user filter calculation and use R_CTSU_DataInsert() to input user filter calculation result.

void ctsu_user_filter_example (void)
{
fsp_err_t err = FSP_SUCCESS;
uint16_t data[CTSU_CFG_NUM_SELF_ELEMENTS];
uint16_t filter_data[CTSU_CFG_NUM_SELF_ELEMENTS];
/* If you want to make a touch judgment, call RM_TOUCH_Open()instead of the following. */
err = R_CTSU_Open(&g_ctsu_ctrl, &g_ctsu_cfg);
/* Handle any errors. This function should be defined by the user. */
assert(FSP_SUCCESS == err);
while (true)
{
/* If you want to make a touch judgment, call RM_TOUCH_ScanStart()instead of the following. */
err = R_CTSU_ScanStart(&g_ctsu_ctrl);
assert(FSP_SUCCESS == err);
while (!g_scan_flag)
{
/* Wait for scan end callback */
}
g_scan_flag = false;
err = R_CTSU_DataGet(&g_ctsu_ctrl, data);
if (FSP_SUCCESS == err)
{
/* User original function. */
ctsu_user_filter(data, filter_data);
err = R_CTSU_DataInsert(&g_ctsu_ctrl, filter_data);
assert(FSP_SUCCESS == err);
/* Call RM_TOUCH_DataGet() to make a touch decision. */
}
}
}

Using the correction data obtained by R_CTSU_SpecificDataGet(). Perform user majority decision calculation & filter calculation and use R_CTSU_DataInsert() to input user majority decision calculation & filter calculation result.

void ctsu_user_majority_decition_example (void)
{
fsp_err_t err = FSP_SUCCESS;
uint16_t data[CTSU_CFG_NUM_SELF_ELEMENTS];
uint16_t corr_data[CTSU_CFG_NUM_SELF_ELEMENTS * CTSU_CFG_NUM_SUMULTI];
uint16_t filter_data[CTSU_CFG_NUM_SELF_ELEMENTS];
/* If you want to make a touch judgment, call RM_TOUCH_Open()instead of the following. */
err = R_CTSU_Open(&g_ctsu_ctrl, &g_ctsu_cfg);
/* Handle any errors. This function should be defined by the user. */
assert(FSP_SUCCESS == err);
while (true)
{
/* If you want to make a touch judgment, call RM_TOUCH_ScanStart()instead of the following. */
err = R_CTSU_ScanStart(&g_ctsu_ctrl);
assert(FSP_SUCCESS == err);
while (!g_scan_flag)
{
/* Wait for scan end callback */
}
g_scan_flag = false;
err = R_CTSU_DataGet(&g_ctsu_ctrl, data);
if (FSP_SUCCESS == err)
{
err = R_CTSU_SpecificDataGet(&g_ctsu_ctrl, corr_data, CTSU_SPECIFIC_CCO_CORRECTION_DATA);
assert(FSP_SUCCESS == err);
/* User original function */
ctsu_user_filter(corr_data, filter_data);
err = R_CTSU_DataInsert(&g_ctsu_ctrl, filter_data);
assert(FSP_SUCCESS == err);
/* Call RM_TOUCH_DataGet() to make a touch decision. */
}
}
}

Data Structures

struct  ctsu_ctsuwr_t
 
struct  ctsu_self_buf_t
 
struct  ctsu_mutual_buf_t
 
struct  ctsu_correction_info_t
 
struct  ctsu_instance_ctrl_t
 

Enumerations

enum  ctsu_state_t
 
enum  ctsu_tuning_t
 
enum  ctsu_correction_status_t
 
enum  ctsu_range_t
 

Data Structure Documentation

◆ ctsu_ctsuwr_t

struct ctsu_ctsuwr_t

CTSUWR write register value

Data Fields
uint16_t ctsussc Copy from (ssdiv << 8) by Open API.
uint16_t ctsuso0 Copy from ((snum << 10) | so) by Open API.
uint16_t ctsuso1 Copy from (sdpa << 8) by Open API. ICOG and RICOA is set recommend value.

◆ ctsu_self_buf_t

struct ctsu_self_buf_t

Scan buffer data formats (Self)

Data Fields
uint16_t sen Sensor counter data.
uint16_t ref Reference counter data (Not used)

◆ ctsu_mutual_buf_t

struct ctsu_mutual_buf_t

Scan buffer data formats (Mutual)

Data Fields
uint16_t pri_sen Primary sensor data.
uint16_t pri_ref Primary reference data (Not used)
uint16_t snd_sen Secondary sensor data.
uint16_t snd_ref Secondary reference data (Not used)

◆ ctsu_correction_info_t

struct ctsu_correction_info_t

Correction information

Data Fields
ctsu_correction_status_t status Correction status.
ctsu_ctsuwr_t ctsuwr Correction scan parameter.
volatile ctsu_self_buf_t scanbuf Correction scan buffer.
uint16_t first_val 1st correction value
uint16_t second_val 2nd correction value
uint32_t first_coefficient 1st correction coefficient
uint32_t second_coefficient 2nd correction coefficient
uint32_t ctsu_clock CTSU clock [MHz].

◆ ctsu_instance_ctrl_t

struct ctsu_instance_ctrl_t

CTSU private control block. DO NOT MODIFY. Initialization occurs when R_CTSU_Open() is called.

Data Fields

uint32_t open
 Whether or not driver is open.
 
volatile ctsu_state_t state
 CTSU run state.
 
ctsu_cap_t cap
 CTSU Scan Start Trigger Select.
 
ctsu_md_t md
 CTSU Measurement Mode Select(copy to cfg)
 
ctsu_tuning_t tuning
 CTSU Initial offset tuning status.
 
uint16_t num_elements
 Number of elements to scan.
 
uint16_t wr_index
 Word index into ctsuwr register array.
 
uint16_t rd_index
 Word index into scan data buffer.
 
uint8_t * p_element_complete_flag
 Pointer to complete flag of each element. g_ctsu_element_complete_flag[] is set by Open API.
 
int32_t * p_tuning_diff
 Pointer to difference from base value of each element. g_ctsu_tuning_diff[] is set by Open API.
 
uint16_t average
 CTSU Moving average counter.
 
uint16_t num_moving_average
 Copy from config by Open API.
 
uint8_t ctsucr1
 Copy from (atune1 << 3, md << 6) by Open API. CLK, ATUNE0, CSW, and PON is set by HAL driver.
 
ctsu_ctsuwr_tp_ctsuwr
 CTSUWR write register value. g_ctsu_ctsuwr[] is set by Open API.
 
ctsu_self_buf_tp_self_raw
 Pointer to Self raw data. g_ctsu_self_raw[] is set by Open API.
 
uint16_t * p_self_corr
 Pointer to Self correction data. g_ctsu_self_corr[] is set by Open API.
 
ctsu_data_t * p_self_data
 Pointer to Self moving average data. g_ctsu_self_data[] is set by Open API.
 
ctsu_mutual_buf_tp_mutual_raw
 Pointer to Mutual raw data. g_ctsu_mutual_raw[] is set by Open API.
 
uint16_t * p_mutual_pri_corr
 Pointer to Mutual primary correction data. g_ctsu_self_corr[] is set by Open API.
 
uint16_t * p_mutual_snd_corr
 Pointer to Mutual secondary correction data. g_ctsu_self_corr[] is set by Open API.
 
ctsu_data_t * p_mutual_pri_data
 Pointer to Mutual primary moving average data. g_ctsu_mutual_pri_data[] is set by Open API.
 
ctsu_data_t * p_mutual_snd_data
 Pointer to Mutual secondary moving average data. g_ctsu_mutual_snd_data[] is set by Open API.
 
ctsu_correction_info_tp_correction_info
 Pointer to correction info.
 
ctsu_txvsel_t txvsel
 CTSU Transmission Power Supply Select.
 
ctsu_txvsel2_t txvsel2
 CTSU Transmission Power Supply Select 2 (CTSU2 Only)
 
uint8_t ctsuchac0
 TS00-TS07 enable mask.
 
uint8_t ctsuchac1
 TS08-TS15 enable mask.
 
uint8_t ctsuchac2
 TS16-TS23 enable mask.
 
uint8_t ctsuchac3
 TS24-TS31 enable mask.
 
uint8_t ctsuchac4
 TS32-TS39 enable mask.
 
uint8_t ctsuchtrc0
 TS00-TS07 mutual-tx mask.
 
uint8_t ctsuchtrc1
 TS08-TS15 mutual-tx mask.
 
uint8_t ctsuchtrc2
 TS16-TS23 mutual-tx mask.
 
uint8_t ctsuchtrc3
 TS24-TS31 mutual-tx mask.
 
uint8_t ctsuchtrc4
 TS32-TS39 mutual-tx mask.
 
uint16_t self_elem_index
 self element index number for Current instance.
 
uint16_t mutual_elem_index
 mutual element index number for Current instance.
 
uint16_t ctsu_elem_index
 CTSU element index number for Current instance.
 
ctsu_cfg_t const * p_ctsu_cfg
 Pointer to initial configurations.
 
IRQn_Type write_irq
 Copy from config by Open API. CTSU_CTSUWR interrupt vector.
 
IRQn_Type read_irq
 Copy from config by Open API. CTSU_CTSURD interrupt vector.
 
IRQn_Type end_irq
 Copy from config by Open API. CTSU_CTSUFN interrupt vector.
 
void(* p_callback )(ctsu_callback_args_t *)
 Callback provided when a CTSUFN occurs.
 
uint8_t interrupt_reverse_flag
 Flag in which read interrupt and end interrupt are reversed.
 
ctsu_event_t error_status
 error status variable to send to QE for serial tuning.
 
ctsu_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
 Placeholder for user data.
 
bool serial_tuning_enable
 Flag of serial tuning status.
 
uint16_t serial_tuning_mutual_cnt
 Word index into ctsuwr register array.
 
uint16_t tuning_self_target_value
 Target self value for initial offset tuning.
 
uint16_t tuning_mutual_target_value
 Target mutual value for initial offset tuning.
 

Enumeration Type Documentation

◆ ctsu_state_t

CTSU run state

Enumerator
CTSU_STATE_INIT 

Not open.

CTSU_STATE_IDLE 

Opened.

CTSU_STATE_SCANNING 

Scanning now.

CTSU_STATE_SCANNED 

Scan end.

◆ ctsu_tuning_t

CTSU Initial offset tuning status

Enumerator
CTSU_TUNING_INCOMPLETE 

Initial offset tuning incomplete.

CTSU_TUNING_COMPLETE 

Initial offset tuning complete.

◆ ctsu_correction_status_t

CTSU Correction status

Enumerator
CTSU_CORRECTION_INIT 

Correction initial status.

CTSU_CORRECTION_RUN 

Correction scan running.

CTSU_CORRECTION_COMPLETE 

Correction complete.

CTSU_CORRECTION_ERROR 

Correction error.

◆ ctsu_range_t

CTSU range definition

Enumerator
CTSU_RANGE_20UA 

20uA mode

CTSU_RANGE_40UA 

40uA mode

CTSU_RANGE_80UA 

80uA mode

CTSU_RANGE_160UA 

160uA mode

CTSU_RANGE_NUM 

number of range

Function Documentation

◆ R_CTSU_Open()

fsp_err_t R_CTSU_Open ( ctsu_ctrl_t *const  p_ctrl,
ctsu_cfg_t const *const  p_cfg 
)

Opens and configures the CTSU driver module. Implements ctsu_api_t::open.

Example:

err = R_CTSU_Open(&g_ctsu_ctrl, &g_ctsu_cfg);
Return values
FSP_SUCCESSCTSU successfully configured.
FSP_ERR_ASSERTIONNull pointer, or one or more configuration options is invalid.
FSP_ERR_ALREADY_OPENModule is already open. This module can only be opened once.
FSP_ERR_INVALID_ARGUMENTConfiguration parameter error.
Note
In the first Open, measurement for correction works, and it takes several tens of milliseconds.

◆ R_CTSU_ScanStart()

fsp_err_t R_CTSU_ScanStart ( ctsu_ctrl_t *const  p_ctrl)

This function should be called each time a periodic timer expires. If initial offset tuning is enabled, The first several calls are used to tuning for the sensors. Before starting the next scan, first get the data with R_CTSU_DataGet(). If a different control block scan should be run, check the scan is complete before executing. Implements ctsu_api_t::scanStart.

Example:

while (true)
{
err = R_CTSU_ScanStart(&g_ctsu_ctrl);
assert(FSP_SUCCESS == err);
while (!g_scan_flag)
{
/* Wait for scan end callback */
}
g_scan_flag = false;
err = R_CTSU_DataGet(&g_ctsu_ctrl, data);
if (FSP_SUCCESS == err)
{
/* Application specific data processing. */
}
}
Return values
FSP_SUCCESSCTSU successfully configured.
FSP_ERR_ASSERTIONNull pointer passed as a parameter.
FSP_ERR_NOT_OPENModule is not open.
FSP_ERR_CTSU_SCANNINGScanning this instance or other.
FSP_ERR_CTSU_NOT_GET_DATAThe previous data has not been retrieved by DataGet.

◆ R_CTSU_DataGet()

fsp_err_t R_CTSU_DataGet ( ctsu_ctrl_t *const  p_ctrl,
uint16_t *  p_data 
)

This function gets the sensor values as scanned by the CTSU. If initial offset tuning is enabled, The first several calls are used to tuning for the sensors. Implements ctsu_api_t::dataGet.

Example:

while (true)
{
err = R_CTSU_ScanStart(&g_ctsu_ctrl);
assert(FSP_SUCCESS == err);
while (!g_scan_flag)
{
/* Wait for scan end callback */
}
g_scan_flag = false;
err = R_CTSU_DataGet(&g_ctsu_ctrl, data);
if (FSP_SUCCESS == err)
{
/* Application specific data processing. */
}
}
Return values
FSP_SUCCESSCTSU successfully configured.
FSP_ERR_ASSERTIONNull pointer passed as a parameter.
FSP_ERR_NOT_OPENModule is not open.
FSP_ERR_CTSU_SCANNINGScanning this instance.
FSP_ERR_CTSU_INCOMPLETE_TUNINGIncomplete initial offset tuning.
FSP_ERR_CTSU_DIAG_NOT_YETDiagnosis of data collected no yet.
FSP_ERR_ABORTEDOperate error of Diagnosis ADC data collection ,since ADC use other

◆ R_CTSU_OffsetTuning()

fsp_err_t R_CTSU_OffsetTuning ( ctsu_ctrl_t *const  p_ctrl)

This function tunes the offset register(SO). Call after the measurement is completed. If the return value is FSP_ERR_CTSU_INCOMPLETE_TUNING, tuning is not complete. Execute the measurement and this function call routine until the return value becomes FSP_SUCCESS. It is recommended to run this routine after R_CTSU_Open(). It can be recalled and tuned again. When the automatic judgement is enabled, after the offset tuning is completed,the baseline initialization bit flag is set. Implements ctsu_api_t::offsetTuning.

Example:

/* Initial offset tuning */
do
{
R_CTSU_ScanStart(&g_ctsu_ctrl);
while (!g_scan_flag)
{
/* Wait for scan end callback */
}
g_scan_flag = false;
err = R_CTSU_OffsetTuning(&g_ctsu_ctrl);
} while (FSP_SUCCESS != err);
while (true)
{
R_CTSU_ScanStart(&g_ctsu_ctrl);
while (!g_scan_flag)
{
/* Wait for scan end callback */
}
g_scan_flag = false;
err = R_CTSU_DataGet(&g_ctsu_ctrl, data);
assert(FSP_SUCCESS == err);
if (FSP_SUCCESS == err)
{
/* Re-offset tuning is performed when the parasitic capacitance changes significantly due */
/* to changes in the surrounding environment and the count value becomes an abnormal value. */
/* */
/* if (abnormal value detection conditions) */
/* { */
/* Re-offset tuning */
do
{
R_CTSU_ScanStart(&g_ctsu_ctrl);
while (!g_scan_flag)
{
/* Wait for scan end callback */
}
g_scan_flag = false;
err = R_CTSU_OffsetTuning(&g_ctsu_ctrl);
} while (FSP_SUCCESS != err);
/* } */
}
}
Return values
FSP_SUCCESSCTSU successfully configured.
FSP_ERR_ASSERTIONNull pointer passed as a parameter.
FSP_ERR_NOT_OPENModule is not open.
FSP_ERR_CTSU_SCANNINGScanning this instance.
FSP_ERR_CTSU_INCOMPLETE_TUNINGIncomplete initial offset tuning.

◆ R_CTSU_ScanStop()

fsp_err_t R_CTSU_ScanStop ( ctsu_ctrl_t *const  p_ctrl)

This function scan stops the sensor as scanning by the CTSU. Implements ctsu_api_t::scanStop.

Return values
FSP_SUCCESSCTSU successfully scan stop.
FSP_ERR_ASSERTIONNull pointer passed as a parameter.
FSP_ERR_NOT_OPENModule is not open.

◆ R_CTSU_CallbackSet()

fsp_err_t R_CTSU_CallbackSet ( ctsu_ctrl_t *const  p_api_ctrl,
void(*)(ctsu_callback_args_t *)  p_callback,
void const *const  p_context,
ctsu_callback_args_t *const  p_callback_memory 
)

Updates the user callback and has option of providing memory for callback structure. Implements ctsu_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_CTSU_Close()

fsp_err_t R_CTSU_Close ( ctsu_ctrl_t *const  p_ctrl)

Disables specified CTSU control block. Implements ctsu_api_t::close.

Return values
FSP_SUCCESSCTSU successfully configured.
FSP_ERR_ASSERTIONNull pointer passed as a parameter.
FSP_ERR_NOT_OPENModule is not open.

◆ R_CTSU_SpecificDataGet()

fsp_err_t R_CTSU_SpecificDataGet ( ctsu_ctrl_t *const  p_ctrl,
uint16_t *  p_specific_data,
ctsu_specific_data_type_t  specific_data_type 
)

This function gets the sensor specific data values as scanned by the CTSU. Call this function after calling the R_CTSU_DataGet() function.

By setting the third argument to CTSU_SPECIFIC_RAW_DATA, RAW data can be output from the second argument.

By setting the third argument to CTSU_SPECIFIC_CCO_CORRECTION_DATA, the cco corrected data can be output from the second argument.

By setting the third argument to CTSU_SPECIFIC_CORRECTION_DATA, the frequency corrected data can be output from the second argument.

By setting the third argument to CTSU_SPECIFIC_SELECTED_FREQ, Get bitmap of the frequency values used in majority decision from the second argument.(CTSU2 Only) The bitmap is shown as follows. ||2bit | 1bit | 0bit || ||3rd frequency value | 2nd frequency value | 1st frequency value ||

Implements ctsu_api_t::specificDataGet.

Example:

err = R_CTSU_SpecificDataGet(&g_ctsu_ctrl, corr_data, CTSU_SPECIFIC_CCO_CORRECTION_DATA);
Return values
FSP_SUCCESSCTSU successfully configured.
FSP_ERR_ASSERTIONNull pointer passed as a parameter.
FSP_ERR_NOT_OPENModule is not open.
FSP_ERR_CTSU_SCANNINGScanning this instance.
FSP_ERR_CTSU_INCOMPLETE_TUNINGIncomplete initial offset tuning.
FSP_ERR_NOT_ENABLEDCTSU_SPECIFIC_SELECTED_FREQ is not enabled in CTSU1.(CTSU2 Only)

◆ R_CTSU_DataInsert()

fsp_err_t R_CTSU_DataInsert ( ctsu_ctrl_t *const  p_ctrl,
uint16_t *  p_insert_data 
)

This function inserts the value of the second argument as the measurement result value. Call this function after calling the R_CTSU_DataInsert() function. Implements ctsu_api_t::dataInsert.

Example:

err = R_CTSU_DataInsert(&g_ctsu_ctrl, filter_data);
Return values
FSP_SUCCESSCTSU successfully configured.
FSP_ERR_ASSERTIONNull pointer passed as a parameter.
FSP_ERR_NOT_OPENModule is not open.
FSP_ERR_CTSU_SCANNINGScanning this instance.
FSP_ERR_CTSU_INCOMPLETE_TUNINGIncomplete initial offset tuning.

◆ R_CTSU_Diagnosis()

fsp_err_t R_CTSU_Diagnosis ( ctsu_ctrl_t *const  p_ctrl)

Diagnosis the CTSU peripheral. Implements ctsu_api_t::diagnosis.

Example:

err = R_CTSU_Diagnosis(&g_ctsu_ctrl_diagnosis);
assert(FSP_SUCCESS == err);
Return values
FSP_SUCCESSCTSU successfully configured.
FSP_ERR_ASSERTIONNull pointer passed as a parameter.
FSP_ERR_NOT_OPENModule is not open.
FSP_ERR_CTSU_NOT_GET_DATAThe previous data has not been retrieved by DataGet.
FSP_ERR_CTSU_DIAG_LDO_OVER_VOLTAGEDiagnosis of LDO over voltage failed.
FSP_ERR_CTSU_DIAG_CCO_HIGHDiagnosis of CCO into 19.2uA failed.
FSP_ERR_CTSU_DIAG_CCO_LOWDiagnosis of CCO into 2.4uA failed.
FSP_ERR_CTSU_DIAG_SSCGDiagnosis of SSCG frequency failed.
FSP_ERR_CTSU_DIAG_DACDiagnosis of non-touch count value failed.
FSP_ERR_CTSU_DIAG_OUTPUT_VOLTAGEDiagnosis of LDO output voltage failed.
FSP_ERR_CTSU_DIAG_OVER_VOLTAGEDiagnosis of over voltage detection circuit failed.
FSP_ERR_CTSU_DIAG_OVER_CURRENTDiagnosis of over current detection circuit failed.
FSP_ERR_CTSU_DIAG_LOAD_RESISTANCEDiagnosis of LDO internal resistance value failed.
FSP_ERR_CTSU_DIAG_CURRENT_SOURCEDiagnosis of LDO internal resistance value failed.
FSP_ERR_CTSU_DIAG_SENSCLK_GAINDiagnosis of SENSCLK frequency gain failed.
FSP_ERR_CTSU_DIAG_SUCLK_GAINDiagnosis of SUCLK frequency gain failed.
FSP_ERR_CTSU_DIAG_CLOCK_RECOVERYDiagnosis of SUCLK clock recovery function failed.
FSP_ERR_CTSU_DIAG_CFC_GAINDiagnosis of CFC oscillator gain failed.