Synergy Software Package User's Manual

Driver for the Capacitive Touch Sensing Unit (CTSU). More...

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 { CTSU_STATE_INIT, CTSU_STATE_IDLE, CTSU_STATE_SCANNING, CTSU_STATE_SCANNED }
 
enum  ctsu_tuning_t { CTSU_TUNING_INCOMPLETE, CTSU_TUNING_COMPLETE }
 
enum  ctsu_correction_status_t { CTSU_CORRECTION_INIT, CTSU_CORRECTION_RUN, CTSU_CORRECTION_COMPLETE, CTSU_CORRECTION_ERROR }
 

Functions

ssp_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...
 
ssp_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...
 
ssp_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...
 
ssp_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)
 
ssp_err_t R_CTSU_Close (ctsu_ctrl_t *const p_ctrl)
 Disables specified CTSU control block. Implements ctsu_api_t::close. More...
 
ssp_err_t R_CTSU_VersionGet (ssp_version_t *const p_version)
 Return CTSU HAL driver version. Implements ctsu_api_t::versionGet. More...
 
ssp_err_t R_CTSU_Diagnosis (ctsu_ctrl_t *const p_ctrl)
 Diagnosis the CTSU peripheral. Implements ctsu_api_t::diagnosis. More...
 

Detailed Description

Driver for the Capacitive Touch Sensing Unit (CTSU).

Enumeration Type Documentation

◆ 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_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.

Function Documentation

◆ R_CTSU_CallbackSet()

ssp_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
SSP_SUCCESSCallback updated successfully.
SSP_ERR_ASSERTIONA required pointer is NULL.
SSP_ERR_NOT_OPENThe control block has not been opened.

◆ R_CTSU_Close()

ssp_err_t R_CTSU_Close ( ctsu_ctrl_t *const  p_ctrl)

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

Return values
SSP_SUCCESSCTSU successfully configured.
SSP_ERR_ASSERTIONNull pointer passed as a parameter.
SSP_ERR_NOT_OPENModule is not open.

Stops peripheral and clears any internal state to allow driver to be reconfigured.

◆ R_CTSU_DataGet()

ssp_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.

Return values
SSP_SUCCESSCTSU successfully configured.
SSP_ERR_ASSERTIONNull pointer passed as a parameter.
SSP_ERR_NOT_OPENModule is not open.
SSP_ERR_CTSU_SCANNINGScanning this instance.
SSP_ERR_CTSU_INCOMPLETE_TUNINGIncomplete initial offset tuning.
SSP_ERR_CTSU_DIAG_NOT_YETDiagnosis of data collected no yet.

◆ R_CTSU_Diagnosis()

ssp_err_t R_CTSU_Diagnosis ( ctsu_ctrl_t *const  p_ctrl)

Diagnosis the CTSU peripheral. Implements ctsu_api_t::diagnosis.

Return values
SSP_SUCCESSCTSU successfully configured.
SSP_ERR_ASSERTIONNull pointer passed as a parameter.
SSP_ERR_NOT_OPENModule is not open.
SSP_ERR_NOT_ENABLEDDiagnosis is not enabled in S7 Series
SSP_ERR_CTSU_NOT_GET_DATAThe previous data has not been retrieved by DataGet.
SSP_ERR_CTSU_DIAG_LDO_OVER_VOLTAGEDiagnosis of LDO over voltage failed.
SSP_ERR_CTSU_DIAG_CCO_HIGHDiagnosis of CCO into 19.2uA failed.
SSP_ERR_CTSU_DIAG_CCO_LOWDiagnosis of CCO into 2.4uA failed.
SSP_ERR_CTSU_DIAG_SSCGDiagnosis of SSCG frequency failed.
SSP_ERR_CTSU_DIAG_DACDiagnosis of non-touch count value failed.

◆ R_CTSU_Open()

ssp_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.

Return values
SSP_SUCCESSCTSU successfully configured.
SSP_ERR_ASSERTIONNull pointer, or one or more configuration options is invalid.
SSP_ERR_ALREADY_OPENModule is already open. This module can only be opened once.
SSP_ERR_INVALID_ARGUMENTConfiguration parameter error.
SSP_ERR_IN_USEControl block has already been opened or channel is being used by another instance. Call close() then open() to reconfigure.
SSP_ERR_IRQ_BSP_DISABLEDA required interrupt does not exist in the vector table
Returns
See Common Error Codes or functions called by this function for other possible return codes. This function calls:
Note
In the first Open, measurement for correction works, and it takes several tens of milliseconds.

◆ R_CTSU_ScanStart()

ssp_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.

Return values
SSP_SUCCESSCTSU successfully configured.
SSP_ERR_ASSERTIONNull pointer passed as a parameter.
SSP_ERR_NOT_OPENModule is not open.
SSP_ERR_CTSU_SCANNINGScanning this instance or other.
SSP_ERR_CTSU_NOT_GET_DATAThe previous data has not been retrieved by DataGet.

< CTSU_STRT

◆ R_CTSU_VersionGet()

ssp_err_t R_CTSU_VersionGet ( ssp_version_t *const  p_version)

Return CTSU HAL driver version. Implements ctsu_api_t::versionGet.

Return values
SSP_SUCCESSVersion information successfully read.
SSP_ERR_ASSERTIONNull pointer passed as a parameter