Driver for the Capacitive Touch Sensing Unit (CTSU).
More...
Driver for the Capacitive Touch Sensing Unit (CTSU).
◆ 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.
|
◆ R_CTSU_CallbackSet()
Updates the user callback and has option of providing memory for callback structure. Implements ctsu_api_t::callbackSet
- Return values
-
| SSP_SUCCESS | Callback updated successfully. |
| SSP_ERR_ASSERTION | A required pointer is NULL. |
| SSP_ERR_NOT_OPEN | The control block has not been opened. |
◆ R_CTSU_Close()
Disables specified CTSU control block. Implements ctsu_api_t::close.
- Return values
-
| SSP_SUCCESS | CTSU successfully configured. |
| SSP_ERR_ASSERTION | Null pointer passed as a parameter. |
| SSP_ERR_NOT_OPEN | Module is not open. |
Stops peripheral and clears any internal state to allow driver to be reconfigured.
◆ R_CTSU_DataGet()
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_SUCCESS | CTSU successfully configured. |
| SSP_ERR_ASSERTION | Null pointer passed as a parameter. |
| SSP_ERR_NOT_OPEN | Module is not open. |
| SSP_ERR_CTSU_SCANNING | Scanning this instance. |
| SSP_ERR_CTSU_INCOMPLETE_TUNING | Incomplete initial offset tuning. |
| SSP_ERR_CTSU_DIAG_NOT_YET | Diagnosis of data collected no yet. |
◆ R_CTSU_Diagnosis()
Diagnosis the CTSU peripheral. Implements ctsu_api_t::diagnosis.
- Return values
-
| SSP_SUCCESS | CTSU successfully configured. |
| SSP_ERR_ASSERTION | Null pointer passed as a parameter. |
| SSP_ERR_NOT_OPEN | Module is not open. |
| SSP_ERR_NOT_ENABLED | Diagnosis is not enabled in S7 Series |
| SSP_ERR_CTSU_NOT_GET_DATA | The previous data has not been retrieved by DataGet. |
| SSP_ERR_CTSU_DIAG_LDO_OVER_VOLTAGE | Diagnosis of LDO over voltage failed. |
| SSP_ERR_CTSU_DIAG_CCO_HIGH | Diagnosis of CCO into 19.2uA failed. |
| SSP_ERR_CTSU_DIAG_CCO_LOW | Diagnosis of CCO into 2.4uA failed. |
| SSP_ERR_CTSU_DIAG_SSCG | Diagnosis of SSCG frequency failed. |
| SSP_ERR_CTSU_DIAG_DAC | Diagnosis of non-touch count value failed. |
◆ R_CTSU_Open()
Opens and configures the CTSU driver module. Implements ctsu_api_t::open.
- Return values
-
| SSP_SUCCESS | CTSU successfully configured. |
| SSP_ERR_ASSERTION | Null pointer, or one or more configuration options is invalid. |
| SSP_ERR_ALREADY_OPEN | Module is already open. This module can only be opened once. |
| SSP_ERR_INVALID_ARGUMENT | Configuration parameter error. |
| SSP_ERR_IN_USE | Control block has already been opened or channel is being used by another instance. Call close() then open() to reconfigure. |
| SSP_ERR_IRQ_BSP_DISABLED | A 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()
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_SUCCESS | CTSU successfully configured. |
| SSP_ERR_ASSERTION | Null pointer passed as a parameter. |
| SSP_ERR_NOT_OPEN | Module is not open. |
| SSP_ERR_CTSU_SCANNING | Scanning this instance or other. |
| SSP_ERR_CTSU_NOT_GET_DATA | The previous data has not been retrieved by DataGet. |
< CTSU_STRT
◆ R_CTSU_VersionGet()
Return CTSU HAL driver version. Implements ctsu_api_t::versionGet.
- Return values
-
| SSP_SUCCESS | Version information successfully read. |
| SSP_ERR_ASSERTION | Null pointer passed as a parameter |