RA Flexible Software Package Documentation  Release v5.6.0

 
Touch (rm_touch)

Functions

fsp_err_t RM_TOUCH_Open (touch_ctrl_t *const p_ctrl, touch_cfg_t const *const p_cfg)
 Opens and configures the TOUCH Middle module. Implements touch_api_t::open. More...
 
fsp_err_t RM_TOUCH_ScanStart (touch_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 RM_TOUCH_DataGet(). If a different control block scan should be run, check the scan is complete before executing. Implements touch_api_t::scanStart. More...
 
fsp_err_t RM_TOUCH_DataGet (touch_ctrl_t *const p_ctrl, uint64_t *p_button_status, uint16_t *p_slider_position, uint16_t *p_wheel_position)
 Gets the 64-bit mask indicating which buttons are pressed. Also, this function gets the current position of where slider or wheel is being pressed. If initial offset tuning is enabled, The first several calls are used to tuning for the sensors. Implements touch_api_t::dataGet. More...
 
fsp_err_t RM_TOUCH_PadDataGet (touch_ctrl_t *const p_ctrl, uint16_t *p_pad_rx_coordinate, uint16_t *p_pad_tx_coordinate, uint8_t *p_pad_num_touch)
 This function gets the current position of pad is being pressed. Implements touch_api_t::padDataGet , g_touch_on_ctsu. More...
 
fsp_err_t RM_TOUCH_ScanStop (touch_ctrl_t *const p_ctrl)
 Scan stop specified TOUCH control block. Implements touch_api_t::scanStop. More...
 
fsp_err_t RM_TOUCH_CallbackSet (touch_ctrl_t *const p_api_ctrl, void(*p_callback)(touch_callback_args_t *), void const *const p_context, touch_callback_args_t *const p_callback_memory)
 
fsp_err_t RM_TOUCH_Close (touch_ctrl_t *const p_ctrl)
 Disables specified TOUCH control block. Implements touch_api_t::close. More...
 
fsp_err_t RM_TOUCH_SensitivityRatioGet (touch_ctrl_t *const p_ctrl, touch_sensitivity_info_t *p_touch_sensitivity_info)
 Get the touch sensitivity ratio. Implements touch_api_t::sensitivityRatioGet. More...
 
fsp_err_t RM_TOUCH_ThresholdAdjust (touch_ctrl_t *const p_ctrl, touch_sensitivity_info_t *p_touch_sensitivity_info)
 Adjust the touch judgment threshold. Implements touch_api_t::thresholdAdjust. More...
 
fsp_err_t RM_TOUCH_DriftControl (touch_ctrl_t *const p_ctrl, uint16_t input_drift_freq)
 Control drift correction. Implements touch_api_t::driftControl. More...
 

Detailed Description

This module supports the Capacitive Touch Sensing Unit (CTSU). It implements the Touch Middleware Interface.

Overview

The Touch Middleware uses the CTSU (r_ctsu) API and provides application-level APIs for scanning touch buttons, sliders, and wheels. 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".

This module supports the QE monitor function. The monitor determines whether to use debugger or serial communications, determines the type of the information from QE and sends only the necessary information. This module supports the serial tuning function with the standalone version of QE. Generates a configuration configuration file by UART communication with QE.

Note
Multiple configurations can be defined within a single project allowing for different scan procedures or button layouts.

Build Time Configurations for rm_touch

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

ConfigurationOptionsDefaultDescription
Parameter Checking
  • Default (BSP)
  • Enabled
  • Disabled
Default (BSP) If selected code for parameter checking is included in the build.
Support for QE monitoring using UART
  • Enabled
  • Disabled
Disabled Enable SCI_UART support for QE monitoring.
Support for QE Tuning using UART
  • Enabled
  • Disabled
Disabled Enable SCI_UART support for QE Tuning.
Type of chattering suppression
  • TypeA : Counter of exceed threshold is hold within hysteresis range
  • TypeB : Counter of exceed threshold is reset within hysteresis range.
TypeA : Counter of exceed threshold is hold within hysteresis range TypeA of chattering suppression : Counter of exceed threshold is hold within hysteresis range. / TypeB of chattering suppression : Counter of exceed threshold is reset within hysteresis range.

Configurations for CapTouch > Touch (rm_touch)

This module can be added to the Stacks tab via New Stack > CapTouch > Touch (rm_touch). 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

Interrupt Configuration

Refer to the CTSU (r_ctsu) section for details.

Clock Configuration

Refer to the CTSU (r_ctsu) section for details.

Pin Configuration

Refer to the CTSU (r_ctsu) section for details.

Usage Notes

Measurements and Data Processing

The module determines whether the button has been touched based on the change in capacitance and detects the position of the slider or wheel. This requires continued periodic measurements of capacitance. When developing your application, make sure to periodically call RM_TOUCH_ScanStart() and RM_TOUCH_DataGet(). For more details, refer to the sample application.

Button Touch Determination

Touch judgment type

Touch detection has three modes in CTSU2.

  1. Value Majority Mode (VMM)
    Touch module obtains one measurement result by combining the two measured value which have less noise out of three measured value for each button from CTSU module and outputs the touch judgment result.
    As a result, the measurement results has been noise-reduced in CTSU (r_ctsu) module.
  2. Judgment Majority Mode (JMM)
    This mode supported from FSP V5.6.0 or later.
    Touch module obtains three measurement results for each button from CTSU module, judges each touch, and outputs the final touch judgment result by majority vote. This mode can be only applied to button.
  3. Mixture Vmm and Jmm Mode (VMM & JMM)
    This mode is a mixture of VMM and JMM. Judgment type can be selected by each touch interface configuration.
rm_touch_JMM_vs_VMM.png
Data flow comparison of VMM and JMM


Creating reference value and threshold

A touch button is not a mechanical button in which the ON/OF state is switched by hardware. The ON/OFF state is determined via software.
First, a reference value is created based on measurement results in the non-touch state. The initial reference value is the first measured value. The threshold is then determined with an arbitrary offset. If a measured value exceeds the threshold, the button is determined to be in the ON state, if it does not exceed the threshold, it is in the OFF state.
Processing for self-capacitance and mutual capacitance are basically the same. However, because the amount of capacitance decreases when a mutual capacitance button is touched, the user needs to set the threshold based on decreasing measured values to determine the ON/OFF state.
You can set the threshold for each button separately in the configuration settings (threshold in touch_button_cfg_t). The following functions are also included to deal with issues such as chattering suppression and changes in the external environment which affect actual touch recognition.
VMM : Creates one reference value and one threshold value for each button.
JMM : Creates three reference values and three threshold values for each button.

Positive Noise Filter/Negative Noise Filter

As a chattering countermeasure, you can confirm the ON/OFF state after a set number of consecutive ON or OFF determinations.
In the configuration settings (on_freq and off_freq in touch_cfg_t) set the number of consecutive ON or OFF states. You can do this for all buttons in the touch interface configuration. Be aware that, although this is an effective solution to improving chattering, the greater the number of consecutive states, the slower the response to actual touch.

Hysteresis

This is another chattering countermeasure. Offset the constant to the threshold after the state goes to ON, and prevent chattering by using hysteresis as the OFF-to-ON and ON-to-OFF threshold.
You can set the hysteresis value for each button in the configuration settings (hysteresis in touch_button_cfg_t). The larger the hysteresis, the more effective the countermeasure is in suppressing chattering. However, keep in mind that this will make it more difficult to return the state from ON-to-OFF of OFF-to-ON.
VMM : One hysteresis for each button.
JMM : Three hysteresis for each button.

Drift Correction Process

As a countermeasure for changes in the external environment, the drift correction process refreshes the reference value.
After averaging the measured value in the OFF state over a set period, if the button is in the touch OFF state after a set period, the reference value is refreshed. The drift correction is only executed in the OFF state and is cleared when touch ON is determined.
Set the period in the configuration settings (drift_freq in touch_cfg_t). You can do this for all buttons in the touch interface configuration. This allows you to adjust the ability to determine the touch state despite changes in the external environment.
VMM : Drift corrects one baseline value per button.
JMM : Drift corrects three baseline value per button.

rm_touch_Button_Touch_Determination.png
Button Touch Determination

Press and hold cancel

Strong noise or other sudden environment changes can disable the drift correction process, preventing return from the ON state. The press and hold cancel function implements the drift correction process and returns the button from the ON state by forcibly turning the state to OFF after a certain number of consecutive ON state periods.
Set the number of consecutive ON periods required for the press and hold cancel function to return the button to the OFF state in the configuration settings (cancel_freq in touch_cfg_t). You can do this for all buttons in the touch interface configuration.

Chattering suppression type (Build option)

This build option is a function to supplement the above functions (Positive Noise Filter/Negative Noise Filter and Hysteresis) for performing touch judgment.
This build option changes the processing method for Counter of exceed threshold to TypeA or TypeB.
TypeA of chattering suppression : Counter of exceed threshold is hold within hysteresis range.
TypeB of chattering suppression : Counter of exceed threshold is reset within hysteresis range.

rm_touch_Chattering_Suppression_Type.png
Chattering suppression type

Touch Position Detection of Slider/Wheel

Configure a slider with multiple terminals to be measured (TS) physically arranged in a straight line. Configure a wheel with multiple terminals physically arranged in a circle.
The touch position is calculated from the measured values of the TS in the configuration. The calculation method for sliders and wheels is fundamentally the same.

  1. Detect the maximum value (TS_MAX) among the terminals in the configuration.
  2. Calculate the difference (d1, d2) between TS_MAX and the terminals on either side. (If the TS_MAX terminal is at one end of the slider, use the values of the two terminals to the right or left, accordingly.)
  3. If the total of d1 and d2 exceeds the threshold, position calculation is initiated. If the total amount does not exceed the threshold, the position calculation process is ended.
  4. With TS_MAX as the middle position, the ratio of d1 to d2 is used to calculate the position. The slider has a range of 1 to 100, and the while has a range of 1 to 360.
Slider Wheel
Electrode type Self capacitance only Self capacitance only
Number of electrodes 3-10 4+
Touch position output range 1-100 1-360
Default value (no touch) 0xFFFF 0xFFFF

Tuning the Touch Determination Adjustment

When QE tuning, a measurement is performed with a finger touching the button and the tuned parameters are output in the configuration file. The setting value of the threshold is 60% of the touch sensitivity between touch and non-touch state, and the setting value of the hysteresis coefficient is 5% of the threshold.
This module provides the functions for dynamic adjusting of these threshold and hysteresis coefficient.
They are two functions as below.

Adjusting the threshold and hysteresis coefficient to an arbitrary ratio.
Use RM_TOUCH_ThresholdAdjust().

When changing the touch determination threshold ratio from 60% QE set to 70% user specified, the touch determination thresholds are as below.
If you want to make this setting, set the member of the second argument as follows. It is also necessary to set the ratio of the amount of touch change and the hysteresis value.

*p_touch_sensitivity_ratio = 100,
old_threshold_ratio = 60,
new_threshold_ratio = 70,
new_hysteresis_ratio = 5

rm_touch_change_threshold_ratio.png
Example of changing the threshold ratio

Adjusting the threshold and hysteresis coefficient according to the current touch sensitivity.
Use RM_TOUCH_SensitivityRatioGet(), RM_TOUCH_ThresholdAdjust(), and RM_TOUCH_DriftControl().

When changing the kind of the overlay panel, the touch sensitivity differs from the one QE tuned. Wanting to use the software as it is without re-tuning. If you use a thicker overlay than that at QE tuning, the touch sensitivity decreases, and a touch may not be determined because of the same touch determination threshold. This function adjusts the touch determination threshold based on the ratio of the touch sensitivity after changing the overlay to the touch sensitivity at the QE tuning.

RM_TOUCH_SensitivityRatioGet() outputs the ratio of the current touch sensitivity assuming that the touch sensitivity at the QE setting is 100%.
The following figure shows the case where an overlay panel is thinner and the touch sensitivity increases.

rm_touch_change_sensitivity_high.png
Example of increase touch sensitivity for thin overlay panels

Following figure shows the case where an overlay panel is thicker and the touch sensitivity decreases.

rm_touch_change_sensitivity_low.png
Example of decrease touch sensitivity for thicker overlay panels

RM_TOUCH_ThresholdAdjust() sets the new touch determination threshold and the hysteresis value by using the touch sensitivity ratio obtained with RM_TOUCH_SensitivityRatioGet() as arguments.

Example of calculation 1:
The touch sensitivity ratio is 140%, and the threshold set by QE is 1500.
Threshold = 140 * 1500 / 100 = 2100

*p_touch_sensitivity_ratio = 140,
old_threshold_ratio = 60,
new_threshold_ratio = 60,
new_hysteresis_ratio = 5

rm_touch_change_threshold_ratio_high_sensitivity.png
Example of calculation 1

Example of calculation 2:
The touch sensitivity ratio is 60%, and the threshold set by QE is 1500.
Threshold = 60 * 1500 / 100 = 900

*p_touch_sensitivity_ratio = 60,
old_threshold_ratio = 60,
new_threshold_ratio = 60,
new_hysteresis_ratio = 5

rm_touch_change_threshold_ratio_low_sensitivity.png
Example of calculation 2

RM_TOUCH_DriftContorol() set the second argument to 0 to stop the drift correction function.
When calculating the ratio of the touch change amount using RM_TOUCH_SensitivityRatioGet(), the touch change amount decreases due to the thick overlay, and the threshold value is not exceeded even if touched. Prevents the reference value from drifting.

Example of the application for adjustment using data flash without re-tuning or software rewriting

Enable UART communication to PC and ‘tuning mode’. In tuning mode, the MCU transmits the ratio of the touch sensitivity in the touch state to the PC in real time. A user sends a command to decide the ratio while monitoring on the PC. The MCU stores the received ratio in the data flash. Make sure that the ratio stored in the data flash is read at the software activation, and the touch determination threshold is adjusted based on this stored value.

Pad

Configure a pad with multiple terminals physically arranged in cross.
The current position is Calculated from the measured values of the CTSU mutual scanning in the configuration.
Use RM_TOUCH_PadDataGet().
Pad is subject so some limitations:

Pad
Electrode type CFC mutual capacitance only
Number of electrodes RX(TS-CFC)3+, TX(Any TS)3+
Touch position output range rx_coodinate:(0 ~ rx_pixel), tx_coodinate:(0 ~ tx_pixsel)
Default value (no touch) rx_coodinate:0xFFFF, tx_coodinate:0xFFFF
Pixel range rx_pixel:(1 ~ 65535), tx_pixsel:(1 ~ 65535)

Pitch for each terminal can be set with QE. Pitch's default value is 64.
The relationship between pixel and pitch : Pixel = Pitch × number of TS - 1

rm_touch_pad_example.png
Example of Pad

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.

Examples

Basic Example

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

void touch_basic_example (void)
{
fsp_err_t err = FSP_SUCCESS;
err = RM_TOUCH_Open(&g_touch_ctrl, &g_touch_cfg);
/* Handle any errors. This function should be defined by the user. */
assert(FSP_SUCCESS == err);
while (true)
{
RM_TOUCH_ScanStart(&g_touch_ctrl);
while (0 == g_flag)
{
/* Wait scan end callback */
}
g_flag = 0;
err = RM_TOUCH_DataGet(&g_touch_ctrl, &button, slider, wheel);
if (FSP_SUCCESS == err)
{
/* Application specific data processing. */
}
}
}

Multi Mode Example

This is a optional example of using both Self-capacitance and Mutual-capacitance. Refer to the Multi Mode Example in CTSU usage notes.

void touch_optional_example (void)
{
fsp_err_t err = FSP_SUCCESS;
err = RM_TOUCH_Open(&g_touch_ctrl, &g_touch_cfg);
assert(FSP_SUCCESS == err);
err = RM_TOUCH_Open(&g_touch_ctrl_mutual, &g_touch_cfg_mutual);
assert(FSP_SUCCESS == err);
while (true)
{
RM_TOUCH_ScanStart(&g_touch_ctrl);
while (0 == g_flag)
{
/* Wait scan end callback */
}
g_flag = 0;
RM_TOUCH_ScanStart(&g_touch_ctrl_mutual);
while (0 == g_flag)
{
/* Wait scan end callback */
}
g_flag = 0;
err = RM_TOUCH_DataGet(&g_touch_ctrl, &button, slider, wheel);
if (FSP_SUCCESS == err)
{
/* Application specific data processing. */
}
err = RM_TOUCH_DataGet(&g_touch_ctrl_mutual, &button, slider, wheel);
if (FSP_SUCCESS == err)
{
/* Application specific data processing. */
}
}
}

Data Structures

struct  touch_button_info_t
 
struct  touch_slider_info_t
 
struct  touch_wheel_info_t
 
struct  touch_pad_info_t
 
struct  touch_mm_info_t
 
struct  touch_instance_ctrl_t
 

Data Structure Documentation

◆ touch_button_info_t

struct touch_button_info_t

Information of button

Data Fields
uint64_t status Touch result bitmap.
uint16_t * p_threshold Pointer to Threshold value array. g_touch_button_threshold[] is set by Open API.
uint16_t * p_hysteresis Pointer to Hysteresis value array. g_touch_button_hysteresis[] is set by Open API.
uint16_t * p_reference Pointer to Reference value array. g_touch_button_reference[] is set by Open API.
uint16_t * p_on_count Continuous touch counter. g_touch_button_on_count[] is set by Open API.
uint16_t * p_off_count Continuous non-touch counter. g_touch_button_off_count[] is set by Open API.
uint32_t * p_drift_buf Drift reference value. g_touch_button_drift_buf[] is set by Open API.
uint16_t * p_drift_count Drift counter. g_touch_button_drift_count[] is set by Open API.
uint8_t on_freq Copy from config by Open API.
uint8_t off_freq Copy from config by Open API.
uint16_t drift_freq Copy from config by Open API.
uint16_t cancel_freq Copy from config by Open API.

◆ touch_slider_info_t

struct touch_slider_info_t

Information of slider

Data Fields
uint16_t * p_position Calculated Position data. g_touch_slider_position[] is set by Open API.
uint16_t * p_threshold Copy from config by Open API. g_touch_slider_threshold[] is set by Open API.

◆ touch_wheel_info_t

struct touch_wheel_info_t

Information of wheel

Data Fields
uint16_t * p_position Calculated Position data. g_touch_wheel_position[] is set by Open API.
uint16_t * p_threshold Copy from config by Open API. g_touch_wheel_threshold[] is set by Open API.

◆ touch_pad_info_t

struct touch_pad_info_t

Information of pad

Data Fields
uint16_t * p_rx_coordinate RX coordinate.
uint16_t * p_tx_coordinate TX coordinate.
uint16_t * p_num_touch number of touch
uint16_t * p_threshold Coordinate calculation threshold value.
uint16_t * p_base_buf ScanData Base Value Buffer.
uint16_t * p_rx_pixel X coordinate resolution.
uint16_t * p_tx_pixel Y coordinate resolution.
uint8_t * p_max_touch Maximum number of touch judgments used by the pad.
int32_t * p_drift_buf Drift reference value. g_touch_button_drift_buf[] is set by Open API.
uint16_t * p_drift_count Drift counter. g_touch_button_drift_count[] is set by Open API.
uint8_t num_drift Copy from config by Open API.

◆ touch_mm_info_t

struct touch_mm_info_t

Information of touch button judge(CTSU2)

◆ touch_instance_ctrl_t

struct touch_instance_ctrl_t

TOUCH private control block. DO NOT MODIFY. Initialization occurs when RM_TOUCH_Open() is called.

Data Fields
uint32_t open Whether or not driver is open.
touch_button_info_t binfo Information of button.
touch_slider_info_t sinfo Information of slider.
touch_wheel_info_t winfo Information of wheel.
bool serial_tuning_enable Flag of serial tuning status.
touch_pad_info_t pinfo Information of pad.
touch_cfg_t const * p_touch_cfg Pointer to initial configurations.
ctsu_instance_t const * p_ctsu_instance Pointer to CTSU instance.
touch_mm_info_t * p_touch_mm_info Pointer to information of touch button judge.

Function Documentation

◆ RM_TOUCH_Open()

fsp_err_t RM_TOUCH_Open ( touch_ctrl_t *const  p_ctrl,
touch_cfg_t const *const  p_cfg 
)

Opens and configures the TOUCH Middle module. Implements touch_api_t::open.

Example:

err = RM_TOUCH_Open(&g_touch_ctrl, &g_touch_cfg);
Return values
FSP_SUCCESSTOUCH 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.

◆ RM_TOUCH_ScanStart()

fsp_err_t RM_TOUCH_ScanStart ( touch_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 RM_TOUCH_DataGet(). If a different control block scan should be run, check the scan is complete before executing. Implements touch_api_t::scanStart.

Return values
FSP_SUCCESSSuccessfully started.
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.

◆ RM_TOUCH_DataGet()

fsp_err_t RM_TOUCH_DataGet ( touch_ctrl_t *const  p_ctrl,
uint64_t *  p_button_status,
uint16_t *  p_slider_position,
uint16_t *  p_wheel_position 
)

Gets the 64-bit mask indicating which buttons are pressed. Also, this function gets the current position of where slider or wheel is being pressed. If initial offset tuning is enabled, The first several calls are used to tuning for the sensors. Implements touch_api_t::dataGet.

Note
FSP v4.0.0 or later,
  • The value of 'Secondary - Primary' is modified from uint16_t to int16_t. When the value of 'Secondary - Primary' is larger than 32767 and less than -32767, this API return FSP_ERR_INVALID_DATA.
  • An upper limit is set for the value of Secondary. When the value of Secondary is larger than 45000, this API return FSP_ERR_INVALID_DATA.
Return values
FSP_SUCCESSSuccessfully data decoded.
FSP_ERR_ASSERTIONNull pointer passed as a parameter.
FSP_ERR_NOT_OPENModule is not open.
FSP_ERR_INVALID_DATAAccuracy of data is not guaranteed.
FSP_ERR_CTSU_SCANNINGScanning this instance.
FSP_ERR_CTSU_INCOMPLETE_TUNINGIncomplete initial offset tuning.

◆ RM_TOUCH_PadDataGet()

fsp_err_t RM_TOUCH_PadDataGet ( touch_ctrl_t *const  p_ctrl,
uint16_t *  p_pad_rx_coordinate,
uint16_t *  p_pad_tx_coordinate,
uint8_t *  p_pad_num_touch 
)

This function gets the current position of pad is being pressed. Implements touch_api_t::padDataGet , g_touch_on_ctsu.

Note
FSP v4.0.0 or later,
  • The value of 'Secondary - Primary' is modified from uint16_t to int16_t. When the value of 'Secondary - Primary' is larger than 32767 and less than -32767, this API return FSP_ERR_INVALID_DATA.
  • An upper limit is set for the value of Secondary. When the value of Secondary is larger than 45000, this API return FSP_ERR_INVALID_DATA.
Return values
FSP_SUCCESSSuccessfully data decoded.
FSP_ERR_ASSERTIONNull pointer.
FSP_ERR_NOT_OPENModule is not open.
FSP_ERR_INVALID_DATAAccuracy of data is not guaranteed.
FSP_ERR_CTSU_SCANNINGScanning this instance.

◆ RM_TOUCH_ScanStop()

fsp_err_t RM_TOUCH_ScanStop ( touch_ctrl_t *const  p_ctrl)

Scan stop specified TOUCH control block. Implements touch_api_t::scanStop.

Return values
FSP_SUCCESSSuccessfully closed.
FSP_ERR_ASSERTIONNull pointer passed as a parameter.
FSP_ERR_NOT_OPENModule is not open.

◆ RM_TOUCH_CallbackSet()

fsp_err_t RM_TOUCH_CallbackSet ( touch_ctrl_t *const  p_api_ctrl,
void(*)(touch_callback_args_t *)  p_callback,
void const *const  p_context,
touch_callback_args_t *const  p_callback_memory 
)

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

◆ RM_TOUCH_Close()

fsp_err_t RM_TOUCH_Close ( touch_ctrl_t *const  p_ctrl)

Disables specified TOUCH control block. Implements touch_api_t::close.

Return values
FSP_SUCCESSSuccessfully closed.
FSP_ERR_ASSERTIONNull pointer passed as a parameter.
FSP_ERR_NOT_OPENModule is not open.

◆ RM_TOUCH_SensitivityRatioGet()

fsp_err_t RM_TOUCH_SensitivityRatioGet ( touch_ctrl_t *const  p_ctrl,
touch_sensitivity_info_t p_touch_sensitivity_info 
)

Get the touch sensitivity ratio. Implements touch_api_t::sensitivityRatioGet.

Return values
FSP_SUCCESSSuccessfully touch sensitivity ratio got.
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.

◆ RM_TOUCH_ThresholdAdjust()

fsp_err_t RM_TOUCH_ThresholdAdjust ( touch_ctrl_t *const  p_ctrl,
touch_sensitivity_info_t p_touch_sensitivity_info 
)

Adjust the touch judgment threshold. Implements touch_api_t::thresholdAdjust.

Return values
FSP_SUCCESSSuccessfully touch judgment threshold was adjusted.
FSP_ERR_ASSERTIONNull pointer passed as a parameter.
FSP_ERR_NOT_OPENModule is not open.

◆ RM_TOUCH_DriftControl()

fsp_err_t RM_TOUCH_DriftControl ( touch_ctrl_t *const  p_ctrl,
uint16_t  input_drift_freq 
)

Control drift correction. Implements touch_api_t::driftControl.

Return values
FSP_SUCCESSSuccessfully drift correction was controlled.
FSP_ERR_ASSERTIONNull pointer passed as a parameter.
FSP_ERR_NOT_OPENModule is not open.