CAPSENSE™ Touchpad I2C Host 1.0.0.44
 
Loading...
Searching...
No Matches
CAPSENSE™ Touchpad I2C Host functions

General Description

Function prototypes for the CAPSENSE™ Touchpad I2C Host middleware.

Functions

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_init (mtb_touchpad_write_handle_t bus_write, mtb_touchpad_read_handle_t bus_read, void *intf_ptr, mtb_touchpad_intf_context_t *context)
 Initializes the touchpad interface.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_fw_ver (mtb_touchpad_fw_ver_t *ver, mtb_touchpad_intf_context_t *context)
 Retrieves the firmware version of the touchpad device.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_reset_cause (uint8_t *rst_cause, mtb_touchpad_intf_context_t *context)
 Retrieves the reset cause of the touchpad device.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_set_cmd (uint16_t cmd, mtb_touchpad_intf_context_t *context)
 Sends a command to the touchpad device.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_sw_reset (mtb_touchpad_intf_context_t *context)
 Performs a software reset of the touchpad device.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_save_nvm (mtb_touchpad_intf_context_t *context)
 Saves current configuration to non-volatile memory (NVM).
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_load_nvm (mtb_touchpad_intf_context_t *context)
 Loads configuration from non-volatile memory (NVM).
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_run_cap_test (mtb_touchpad_intf_context_t *context)
 Executes capacitive self-test on the touchpad device.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_run_short_test (mtb_touchpad_intf_context_t *context)
 Executes short-circuit self-test on the touchpad device.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_bootloader_jump (mtb_touchpad_intf_context_t *context)
 Switches the touchpad device to bootloader mode.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_test_status (MTB_TOUCHPAD_TEST_STATUS_t *test_status, mtb_touchpad_intf_context_t *context)
 Retrieves the test status from the touchpad controller.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_short_pin_ids (uint32_t *pin_ids, mtb_touchpad_intf_context_t *context)
 Retrieves the shorted sensor pin IDs from the touchpad controller.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_set_int_src_en (uint8_t src_en, mtb_touchpad_intf_context_t *context)
 Sets the interrupt source enable mask for the touchpad controller.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_int_src_en (uint8_t *src_en, mtb_touchpad_intf_context_t *context)
 Retrieves the interrupt source enable register from the touchpad controller.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_set_int_status (uint8_t int_status, mtb_touchpad_intf_context_t *context)
 Sets the interrupt status register of the touchpad controller.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_int_status (uint8_t *int_status, mtb_touchpad_intf_context_t *context)
 Retrieves the interrupt status from the touchpad controller.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_clear_all_int_status (mtb_touchpad_intf_context_t *context)
 Clears all interrupt status flag on the touchpad controller.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_error_status (uint8_t *error_status, mtb_touchpad_intf_context_t *context)
 Retrieves the error status from the touchpad controller.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_set_scan_mode (MTB_TOUCHPAD_SCAN_MODE_t scan_mode, mtb_touchpad_intf_context_t *context)
 Sets the current scan mode of the touchpad controller.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_scan_mode (MTB_TOUCHPAD_SCAN_MODE_t *scan_mode, mtb_touchpad_intf_context_t *context)
 Retrieves the current scan mode from the touchpad controller.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_set_mode_timeout_en (uint8_t mode_timeout_en, mtb_touchpad_intf_context_t *context)
 Sets the mode timeout enable flag for the touchpad controller.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_mode_timeout_en (uint8_t *mode_timeout_en, mtb_touchpad_intf_context_t *context)
 Retrieves the current mode timeout enable flag from the touchpad controller.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_set_shield_en (MTB_TOUCHPAD_SHIELD_EN_t shield_en, mtb_touchpad_intf_context_t *context)
 Sets the shield enable configuration of the touchpad controller.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_shield_en (MTB_TOUCHPAD_SHIELD_EN_t *shield_en, mtb_touchpad_intf_context_t *context)
 Retrieves the shield enable status from the touchpad controller.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_set_sns_filt_cfg (uint16_t sns_filt_cfg, mtb_touchpad_intf_context_t *context)
 Sets the sensor filter configuration of the touchpad controller.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_sns_filt_cfg (uint16_t *sns_filt_cfg, mtb_touchpad_intf_context_t *context)
 Retrieves the sensor filter configuration from the touchpad controller.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_set_active_refresh_rate (uint8_t refresh_rate, mtb_touchpad_intf_context_t *context)
 Sets the active mode refresh rate of the touchpad controller.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_active_refresh_rate (uint8_t *refresh_rate, mtb_touchpad_intf_context_t *context)
 Retrieves the active mode refresh rate from the touchpad controller.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_set_mode_timeout_act (uint32_t timeout, mtb_touchpad_intf_context_t *context)
 Sets the Active mode timeout of the touchpad controller.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_mode_timeout_act (uint32_t *timeout, mtb_touchpad_intf_context_t *context)
 Retrieves the Active mode timeout from the touchpad controller.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_set_alr_refresh_rate (uint8_t refresh_rate, mtb_touchpad_intf_context_t *context)
 Sets the active low refresh rate (ALR) mode refresh rate of the touchpad controller.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_alr_refresh_rate (uint8_t *refresh_rate, mtb_touchpad_intf_context_t *context)
 Retrieves the active low refresh rate (ALR) mode refresh rate from the touchpad controller.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_set_mode_timeout_alr (uint32_t timeout, mtb_touchpad_intf_context_t *context)
 Sets the Active Low Refresh (ALR) mode timeout of the touchpad controller.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_mode_timeout_alr (uint32_t *timeout, mtb_touchpad_intf_context_t *context)
 Retrieves the Active Low Refresh (ALR) mode timeout from the touchpad controller.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_pos (mtb_touchpad_pos_t *positions, mtb_touchpad_intf_context_t *context)
 Retrieves the touch position data from the touchpad controller.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_gestures (uint32_t *gestures, mtb_touchpad_intf_context_t *context)
 Retrieves the gesture detection value from the touchpad controller.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_gestures_dir (uint32_t *gestures, mtb_touchpad_intf_context_t *context)
 Retrieves the gesture direction value from the touchpad controller.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_set_liquid_detect_en (uint8_t liquid_detect_en, mtb_touchpad_intf_context_t *context)
 Enables or disables liquid detection functionality.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_liquid_detect_en (uint8_t *liquid_detect_en, mtb_touchpad_intf_context_t *context)
 Retrieves the liquid detection enable configuration.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_liquid_detected (uint8_t *liquid_detected, mtb_touchpad_intf_context_t *context)
 Retrieves the liquid detected status from the touchpad controller.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_set_liquid_duty_cycle (uint8_t liquid_duty_cycle, mtb_touchpad_intf_context_t *context)
 Configures the liquid detection duty cycle value.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_liquid_duty_cycle (uint8_t *liquid_duty_cycle, mtb_touchpad_intf_context_t *context)
 Retrieves the liquid detection duty cycle value.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_set_donn_en (uint8_t donn_en, mtb_touchpad_intf_context_t *context)
 Enables or disables DONN functionality.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_donn_en (uint8_t *donn_en, mtb_touchpad_intf_context_t *context)
 Retrieves the DONN enable configuration.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_donn_detect (uint8_t *donn_detected, mtb_touchpad_intf_context_t *context)
 Retrieves the DONN detection status from the touchpad controller.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_nvm_flag (MTB_TOUCHPAD_CONFIG_STORED_t *stored_flag, mtb_touchpad_intf_context_t *context)
 Retrieves the NVM (Non-Volatile Memory) flag status from the touchpad controller.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_num_sns (uint8_t *num_sns, mtb_touchpad_intf_context_t *context)
 Retrieves the number of sensors from touchpad controller.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_sns_raw_count (uint8_t sns_idx, uint16_t *raw_count, mtb_touchpad_intf_context_t *context)
 Retrieves the raw count value for a specific touchpad sensor.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_all_sns_raw_count (uint16_t *buff, mtb_touchpad_intf_context_t *context)
 Retrieves raw count values for all sensors from the touchpad controller.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_sns_baseline (uint8_t sns_idx, uint16_t *baseline, mtb_touchpad_intf_context_t *context)
 Retrieves the baseline value for a specific touchpad sensor.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_all_sns_baseline (uint16_t *buff, mtb_touchpad_intf_context_t *context)
 Retrieves baseline values for all touchpad sensors.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_sns_capacitance (uint8_t sns_idx, uint32_t *capacitance, mtb_touchpad_intf_context_t *context)
 Retrieves the capacitance value for a specific touchpad sensor.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_all_sns_capacitance (uint32_t *capacitances, mtb_touchpad_intf_context_t *context)
 Retrieves capacitance values for all touchpad sensors.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_user_data_size (uint16_t *size, mtb_touchpad_intf_context_t *context)
 Retrieves the size of the user data area of the touchpad controller.
 
MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_user_data (uint8_t *buf, uint16_t len, mtb_touchpad_intf_context_t *context)
 Retrieves the user data from the touchpad controller.
 

Function Documentation

◆ mtb_touchpad_init()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_init ( mtb_touchpad_write_handle_t bus_write,
mtb_touchpad_read_handle_t bus_read,
void * intf_ptr,
mtb_touchpad_intf_context_t * context )

Initializes the touchpad interface.

This function initializes CAPSENSE™ Touchpad I2C Host with platform-specific read and write handlers along with the interface context. It sets up the communication layer (e.g., I2C) required for interacting with the touchpad device and stores the configuration in the provided context structure.

Parameters
[in]bus_write: Function pointer to platform-specific write operation.
[in]bus_read: Function pointer to platform-specific read operation.
[in]intf_ptr: Pointer to interface-specific context (e.g., I2C address, bus handle).
[out]context: Pointer to touchpad interface context structure to be initialized.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Initialization successful MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The function pointers (bus_read and bus_write) must be valid and implemented before calling this function.
The context structure must be allocated by the caller.
This function must be called before performing any touchpad read/write operations.

◆ mtb_touchpad_get_fw_ver()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_fw_ver ( mtb_touchpad_fw_ver_t * ver,
mtb_touchpad_intf_context_t * context )

Retrieves the firmware version of the touchpad device.

This function reads the firmware version information from the touchpad device and populates the provided version structure. The communication with the device is performed using the interface defined in the context.

Parameters
[out]ver: Pointer to structure where firmware version will be stored.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Firmware version retrieved successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'ver' pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_get_reset_cause()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_reset_cause ( uint8_t * rst_cause,
mtb_touchpad_intf_context_t * context )

Retrieves the reset cause of the touchpad device.

This function reads the reset cause register from the touchpad device and provides information about the reason for the last reset event (e.g., watchdog reset, software reset, protection fault, voltage reset).

Parameters
[out]rst_cause: Pointer to variable where reset cause will be stored.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Reset cause retrieved successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The rst_cause pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_set_cmd()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_set_cmd ( uint16_t cmd,
mtb_touchpad_intf_context_t * context )

Sends a command to the touchpad device.

This function writes the specified command to the touchpad device using the interface defined in the context. It is typically used to trigger specific operations such as reset, configuration updates, load configuration, short test, and bootloader jump.

Parameters
[in]cmd: Command value to be sent to the touchpad device.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Command sent successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The command value must be valid as per device specification.

◆ mtb_touchpad_sw_reset()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_sw_reset ( mtb_touchpad_intf_context_t * context)

Performs a software reset of the touchpad device.

This function issues a software reset command to the touchpad device.

Parameters
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Reset command executed successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
A delay may be required after reset before issuing further commands.

◆ mtb_touchpad_save_nvm()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_save_nvm ( mtb_touchpad_intf_context_t * context)

Saves current configuration to non-volatile memory (NVM).

This function stores the current touchpad configuration into the device's non-volatile memory so that the settings are retained across resets or power cycles.

Parameters
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Configuration saved successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
Ensure that no other operations are in progress during NVM write.
Writing to NVM may take additional time; avoid issuing commands immediately after.

◆ mtb_touchpad_load_nvm()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_load_nvm ( mtb_touchpad_intf_context_t * context)

Loads configuration from non-volatile memory (NVM).

This function reads the stored configuration from the touchpad device's non-volatile memory and applies it to the active configuration. It is typically used after reset or power-up to restore previously saved settings.

Parameters
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Configuration loaded successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
Ensure the device is ready before invoking this function after reset.

◆ mtb_touchpad_run_cap_test()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_run_cap_test ( mtb_touchpad_intf_context_t * context)

Executes capacitive self-test on the touchpad device.

This function triggers a capacitive test routine on the touchpad device to evaluate the health and functionality of the sensor elements. The results of the test may be used for diagnostics or calibration purposes.

Parameters
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Test executed successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
Ensure no touch activity or other operations are in progress during the test.
Additional APIs may be required to retrieve detailed test results.

◆ mtb_touchpad_run_short_test()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_run_short_test ( mtb_touchpad_intf_context_t * context)

Executes short-circuit self-test on the touchpad device.

This function triggers a short test routine on the touchpad device to detect potential short circuits between sensor electrodes or lines. The test helps ensure the integrity of the touch sensing hardware.

Parameters
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Test executed successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
Ensure no touch activity or other operations are in progress during the test.
Additional APIs may be required to retrieve detailed test results.

◆ mtb_touchpad_bootloader_jump()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_bootloader_jump ( mtb_touchpad_intf_context_t * context)

Switches the touchpad device to bootloader mode.

This function issues a command to the touchpad device to jump from application firmware to bootloader mode. This is typically used for firmware update operations.

Parameters
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Bootloader jump command sent successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
After this call, the device will no longer respond to normal application commands.
A firmware update procedure should be initiated after entering bootloader mode.

◆ mtb_touchpad_get_test_status()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_test_status ( MTB_TOUCHPAD_TEST_STATUS_t * test_status,
mtb_touchpad_intf_context_t * context )

Retrieves the test status from the touchpad controller.

This function reads the TEST_STATUS register from the touchpad controller and stores the result in the provided pointer. The communication with the device is performed using the interface defined in the context.

Parameters
[out]test_status: Pointer to store the retrieved test status value.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Test status retrieved successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'test_status' pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_get_short_pin_ids()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_short_pin_ids ( uint32_t * pin_ids,
mtb_touchpad_intf_context_t * context )

Retrieves the shorted sensor pin IDs from the touchpad controller.

This function reads the SHORTED_SNS_ID register from the touchpad controller and stores the pin ID in the provided pointer. This is typically used after running a short test to identify which sensor pins are shorted.

Parameters
[out]pin_ids: Pointer to store the 32-bit shorted pin ID.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Short pin IDs retrieved successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'pin_ids' pointer must be a valid, non-NULL pointer.
Run mtb_touchpad_run_short_test() before calling this function for valid results.

◆ mtb_touchpad_set_int_src_en()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_set_int_src_en ( uint8_t src_en,
mtb_touchpad_intf_context_t * context )

Sets the interrupt source enable mask for the touchpad controller.

This function writes the interrupt source enable configuration to the touchpad controller, allowing the caller to enable or disable specific interrupt sources as defined by the src_en parameter. This controls which events will trigger an interrupt from the touchpad hardware.

Parameters
[in]src_en: Interrupt sources to enable.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Interrupt source enable mask set successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'context' pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_get_int_src_en()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_int_src_en ( uint8_t * src_en,
mtb_touchpad_intf_context_t * context )

Retrieves the interrupt source enable register from the touchpad controller.

This function reads the INT_SRC_EN register from the touchpad controller and stores the enabled interrupt source flag in the provided pointer. The communication with the device is performed using the interface defined in the context.

Parameters
[out]src_en: Pointer to store the interrupt source enable flag.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Interrupt source enable flag retrieved successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'src_en' pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_set_int_status()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_set_int_status ( uint8_t int_status,
mtb_touchpad_intf_context_t * context )

Sets the interrupt status register of the touchpad controller.

This function writes the interrupt status value to the touchpad controller's interrupt status register. This is typically used to clear or acknowledge specific interrupt status flag after they have been serviced by the host.

Parameters
[in]int_status: Interrupt status flag to write.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Interrupt status set successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'context' pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_get_int_status()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_int_status ( uint8_t * int_status,
mtb_touchpad_intf_context_t * context )

Retrieves the interrupt status from the touchpad controller.

This function reads the INT_STATUS register from the touchpad controller and stores the interrupt status flag in the provided pointer. The communication with the device is performed using the interface defined in the context.

Parameters
[out]int_status: Pointer to store the interrupt status flag.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Interrupt status retrieved successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'int_status' pointer must be a valid, non-NULL pointer.
Use mtb_touchpad_clear_all_int_status() to clear flag after processing.

◆ mtb_touchpad_clear_all_int_status()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_clear_all_int_status ( mtb_touchpad_intf_context_t * context)

Clears all interrupt status flag on the touchpad controller.

This function writes to the INT_STATUS register of the touchpad controller to clear all pending interrupt status flag. The communication with the device is performed using the interface defined in the context.

Parameters
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Interrupt status cleared successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'context' pointer must be a valid, non-NULL pointer.
Call this function after processing interrupts to re-arm the interrupt line.

◆ mtb_touchpad_get_error_status()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_error_status ( uint8_t * error_status,
mtb_touchpad_intf_context_t * context )

Retrieves the error status from the touchpad controller.

This function reads the ERROR_STATUS register from the touchpad controller and stores the error flag in the provided pointer. The communication with the device is performed using the interface defined in the context.

Parameters
[out]error_status: Pointer to store the error status flag.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Error status retrieved successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'error_status' pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_set_scan_mode()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_set_scan_mode ( MTB_TOUCHPAD_SCAN_MODE_t scan_mode,
mtb_touchpad_intf_context_t * context )

Sets the current scan mode of the touchpad controller.

This function updates the base scan mode bits (IDLE, ACTIVE, or IDLE | ACTIVE) of the SCAN_MODE register of the touchpad controller. It first reads back the current register value so that the timeout-enable bit is preserved, then writes only the requested base scan mode combined with that preserved bit. Use mtb_touchpad_set_mode_timeout_en() to change the timeout-enable bit. The communication with the device is performed using the interface defined in the context.

Parameters
[in]scan_mode: The scan mode value to set. Only MTB_TOUCHPAD_SCAN_MODE_IDLE and/or MTB_TOUCHPAD_SCAN_MODE_ACTIVE bits may be set (i.e. 'scan_mode' must be in the range 0x01 - 0x03).
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Scan mode set successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read/write failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'context' pointer must be a valid, non-NULL pointer.
Any bit outside MTB_TOUCHPAD_SCAN_MODE_IDLE | MTB_TOUCHPAD_SCAN_MODE_ACTIVE (0x03), including MTB_TOUCHPAD_SCAN_MODE_TIMEOUT_ENABLE, makes 'scan_mode' invalid.

◆ mtb_touchpad_get_scan_mode()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_scan_mode ( MTB_TOUCHPAD_SCAN_MODE_t * scan_mode,
mtb_touchpad_intf_context_t * context )

Retrieves the current scan mode from the touchpad controller.

This function reads the SCAN_MODE register from the touchpad controller and stores the active scan mode in the provided pointer. The communication with the device is performed using the interface defined in the context.

Parameters
[out]scan_mode: Pointer to store the current scan mode value.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Scan mode retrieved successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'scan_mode' pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_set_mode_timeout_en()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_set_mode_timeout_en ( uint8_t mode_timeout_en,
mtb_touchpad_intf_context_t * context )

Sets the mode timeout enable flag for the touchpad controller.

This function writes the mode timeout enable flag to the SCAN_MODE register of the touchpad controller. The communication with the device is performed using the interface defined in the context.

Parameters
[in]mode_timeout_en: The mode timeout enable flag value to set.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Mode timeout enable flag set successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or write failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'context' pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_get_mode_timeout_en()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_mode_timeout_en ( uint8_t * mode_timeout_en,
mtb_touchpad_intf_context_t * context )

Retrieves the current mode timeout enable flag from the touchpad controller.

This function reads the mode timeout enable flag from the SCAN_MODE register of the touchpad controller. The communication with the device is performed using the interface defined in the context.

Parameters
[out]mode_timeout_en: Pointer to store the current mode timeout enable flag value.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Mode timeout enable flag retrieved successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'mode_timeout_en' pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_set_shield_en()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_set_shield_en ( MTB_TOUCHPAD_SHIELD_EN_t shield_en,
mtb_touchpad_intf_context_t * context )

Sets the shield enable configuration of the touchpad controller.

This function writes the shield enable configuration to the touchpad controller, allowing the caller to enable or disable the shield electrode functionality. The shield electrode is used to reduce the effect of environmental noise and improve touch sensing accuracy.

Parameters
[in]shield_en: Enumeration value specifying the shield enable state. Refer to MTB_TOUCHPAD_SHIELD_EN_t for valid values.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Shield enable configuration set successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'context' pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_get_shield_en()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_shield_en ( MTB_TOUCHPAD_SHIELD_EN_t * shield_en,
mtb_touchpad_intf_context_t * context )

Retrieves the shield enable status from the touchpad controller.

This function reads the SHIELD_EN register from the touchpad controller and stores the enable/disable status in the provided pointer. The communication with the device is performed using the interface defined in the context.

Parameters
[out]shield_en: Pointer to store the shield enable status value.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Shield enable status retrieved successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'shield_en' pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_set_sns_filt_cfg()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_set_sns_filt_cfg ( uint16_t sns_filt_cfg,
mtb_touchpad_intf_context_t * context )

Sets the sensor filter configuration of the touchpad controller.

This function writes the sensor filter configuration value to the touchpad controller, allowing the caller to configure the filtering parameters applied to raw sensor data. The filter configuration controls noise reduction and signal smoothing behavior, directly affecting touch detection accuracy and response time.

Parameters
[in]sns_filt_cfg: 16-bit value specifying the sensor filter configuration. Refer to the touchpad controller datasheet for valid filter configurations.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Sensor filter configuration set successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'context' pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_get_sns_filt_cfg()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_sns_filt_cfg ( uint16_t * sns_filt_cfg,
mtb_touchpad_intf_context_t * context )

Retrieves the sensor filter configuration from the touchpad controller.

This function reads the SNS_FILT_CFG register from the touchpad controller and stores the 16-bit configuration value in the provided pointer. The communication with the device is performed using the interface defined in the context.

Parameters
[out]sns_filt_cfg: Pointer to store the sensor filter configuration value.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Sensor filter configuration retrieved successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'sns_filt_cfg' pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_set_active_refresh_rate()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_set_active_refresh_rate ( uint8_t refresh_rate,
mtb_touchpad_intf_context_t * context )

Sets the active mode refresh rate of the touchpad controller.

This function writes the refresh rate configuration to the touchpad controller for active operating mode, defining how frequently the touchpad scans and updates sensor data. A higher refresh rate provides faster touch response but increases power consumption, while a lower refresh rate conserves power at the expense of touch responsiveness.

Parameters
[in]refresh_rate: 8-bit value specifying the active mode refresh rate. Refer to the touchpad controller datasheet for valid refresh rate values and their corresponding scan intervals.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Active refresh rate set successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'context' pointer must be a valid, non-NULL pointer.
This function configures the refresh rate only for active mode.

◆ mtb_touchpad_get_active_refresh_rate()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_active_refresh_rate ( uint8_t * refresh_rate,
mtb_touchpad_intf_context_t * context )

Retrieves the active mode refresh rate from the touchpad controller.

This function reads the active mode refresh rate register from the touchpad controller and stores the rate value in the provided pointer. The communication with the device is performed using the interface defined in the context.

Parameters
[out]refresh_rate: Pointer to store the active mode refresh rate value.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Active refresh rate retrieved successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'refresh_rate' pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_set_mode_timeout_act()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_set_mode_timeout_act ( uint32_t timeout,
mtb_touchpad_intf_context_t * context )

Sets the Active mode timeout of the touchpad controller.

This function configures the timeout, in milliseconds, before the touchpad controller transitions from Active mode to Active Low Refresh (ALR) mode when timeout-based power management is enabled.

Writing a value of 0 disables Active mode.

Parameters
[in]timeout: 32-bit timeout value in milliseconds. Refer to the touchpad controller datasheet for the supported range of timeout values.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Active mode timeout set successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or write failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'context' pointer must be a valid, non-NULL pointer.
A timeout value of 0 disables Active mode.

◆ mtb_touchpad_get_mode_timeout_act()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_mode_timeout_act ( uint32_t * timeout,
mtb_touchpad_intf_context_t * context )

Retrieves the Active mode timeout from the touchpad controller.

This function reads the timeout value, in milliseconds, that controls the transition from Active mode to Active Low Refresh (ALR) mode when timeout-based power management is enabled, and stores the value in the provided pointer.

A returned value of 0 indicates that Active mode is disabled.

Parameters
[out]timeout: Pointer to store the 32-bit Active mode timeout value in milliseconds.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Active mode timeout retrieved successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'timeout' pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_set_alr_refresh_rate()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_set_alr_refresh_rate ( uint8_t refresh_rate,
mtb_touchpad_intf_context_t * context )

Sets the active low refresh rate (ALR) mode refresh rate of the touchpad controller.

This function writes the refresh rate configuration to the touchpad controller for active low refresh rate (ALR) operating mode, defining how frequently the touchpad scans and updates sensor data when the system is in a reduced activity state. The ALR mode provides a balance between touch responsiveness and power consumption during periods of low user interaction.

Parameters
[in]refresh_rate: 8-bit value specifying the ALR mode refresh rate. Refer to the touchpad controller datasheet for valid refresh rate values and their corresponding scan intervals.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - ALR mode refresh rate set successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'context' pointer must be a valid, non-NULL pointer.
This function configures the refresh rate only for ALR mode.

◆ mtb_touchpad_get_alr_refresh_rate()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_alr_refresh_rate ( uint8_t * refresh_rate,
mtb_touchpad_intf_context_t * context )

Retrieves the active low refresh rate (ALR) mode refresh rate from the touchpad controller.

This function reads the ALR mode refresh rate register from the touchpad controller and stores the rate value in the provided pointer. The communication with the device is performed using the interface defined in the context.

Parameters
[out]refresh_rate: Pointer to store the ALR mode refresh rate value.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - ALR refresh rate retrieved successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'refresh_rate' pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_set_mode_timeout_alr()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_set_mode_timeout_alr ( uint32_t timeout,
mtb_touchpad_intf_context_t * context )

Sets the Active Low Refresh (ALR) mode timeout of the touchpad controller.

This function configures the timeout, in milliseconds, before the touchpad controller transitions from Active Low Refresh (ALR) mode to Wake-on-Touch (WoT) mode when timeout-based power management is enabled.

Writing a value of 0 disables ALR mode.

Parameters
[in]timeout: 32-bit timeout value in milliseconds. Refer to the touchpad controller datasheet for the supported range of timeout values.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - ALR mode timeout set successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or write failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'context' pointer must be a valid, non-NULL pointer.
A timeout value of 0 disables ALR mode.

◆ mtb_touchpad_get_mode_timeout_alr()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_mode_timeout_alr ( uint32_t * timeout,
mtb_touchpad_intf_context_t * context )

Retrieves the Active Low Refresh (ALR) mode timeout from the touchpad controller.

This function reads the timeout value, in milliseconds, that controls the transition from Active Low Refresh (ALR) mode to Wake-on-Touch (WoT) mode when timeout-based power management is enabled, and stores the value in the provided pointer.

A returned value of 0 indicates that ALR mode is disabled.

Parameters
[out]timeout: Pointer to store the 32-bit ALR mode timeout value in milliseconds.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - ALR mode timeout retrieved successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'timeout' pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_get_pos()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_pos ( mtb_touchpad_pos_t * positions,
mtb_touchpad_intf_context_t * context )

Retrieves the touch position data from the touchpad controller.

This function reads the X, Y, and Z coordinates for the first and second touch points, as well as the total number of active touches, from the touchpad controller. The communication with the device is performed using the interface defined in the context.

Parameters
[out]positions: Pointer to a mtb_touchpad_pos_t structure where touch coordinates and touch count will be stored.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Touch position data retrieved successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'positions' pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_get_gestures()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_gestures ( uint32_t * gestures,
mtb_touchpad_intf_context_t * context )

Retrieves the gesture detection value from the touchpad controller.

This function reads the GESTURE_DET register from the touchpad controller and stores the detected gesture in the provided pointer. The communication with the device is performed using the interface defined in the context.

Parameters
[out]gestures: Pointer to store the 32-bit gesture detection value.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Gesture data retrieved successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'gestures' pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_get_gestures_dir()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_gestures_dir ( uint32_t * gestures,
mtb_touchpad_intf_context_t * context )

Retrieves the gesture direction value from the touchpad controller.

This function reads the GESTURE_DIR register from the touchpad controller and stores the detected gesture in the provided pointer. The communication with the device is performed using the interface defined in the context.

Parameters
[out]gestures: Pointer to store the 32-bit gesture direction value.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Gesture data retrieved successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'gestures' pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_set_liquid_detect_en()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_set_liquid_detect_en ( uint8_t liquid_detect_en,
mtb_touchpad_intf_context_t * context )

Enables or disables liquid detection functionality.

This function writes the liquid detection enable configuration to the touchpad controller. The communication with the device is performed using the interface defined in the context.

Parameters
[in]liquid_detect_en: Liquid detection enable value.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Liquid detection configuration updated successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or write failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.

◆ mtb_touchpad_get_liquid_detect_en()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_liquid_detect_en ( uint8_t * liquid_detect_en,
mtb_touchpad_intf_context_t * context )

Retrieves the liquid detection enable configuration.

This function reads the liquid detection enable register from the touchpad controller and stores the value in the provided pointer. The communication with the device is performed using the interface defined in the context.

Parameters
[out]liquid_detect_en: Pointer to store the liquid detection enable value.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Liquid detection configuration retrieved successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'liquid_detect_en' pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_get_liquid_detected()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_liquid_detected ( uint8_t * liquid_detected,
mtb_touchpad_intf_context_t * context )

Retrieves the liquid detected status from the touchpad controller.

This function reads the liquid detected status register from the touchpad controller and stores the detection status in the provided pointer. The communication with the device is performed using the interface defined in the context.

Parameters
[out]liquid_detected: Pointer to store the liquid detected status.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Liquid detection status retrieved successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'liquid_detected' pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_set_liquid_duty_cycle()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_set_liquid_duty_cycle ( uint8_t liquid_duty_cycle,
mtb_touchpad_intf_context_t * context )

Configures the liquid detection duty cycle value.

This function writes the liquid detection duty cycle configuration to the touchpad controller. The communication with the device is performed using the interface defined in the context.

Parameters
[in]liquid_duty_cycle: Liquid detection duty cycle value.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Duty cycle configured successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or write failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.

◆ mtb_touchpad_get_liquid_duty_cycle()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_liquid_duty_cycle ( uint8_t * liquid_duty_cycle,
mtb_touchpad_intf_context_t * context )

Retrieves the liquid detection duty cycle value.

This function reads the liquid detection duty cycle register from the touchpad controller and stores the value in the provided pointer. The communication with the device is performed using the interface defined in the context.

Parameters
[out]liquid_duty_cycle: Pointer to store the liquid detection duty cycle value.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Duty cycle retrieved successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'liquid_duty_cycle' pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_set_donn_en()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_set_donn_en ( uint8_t donn_en,
mtb_touchpad_intf_context_t * context )

Enables or disables DONN functionality.

This function writes the DONN enable configuration to the touchpad controller. The communication with the device is performed using the interface defined in the context.

Parameters
[in]donn_en: DONN enable value.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - DONN configuration updated successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or write failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.

◆ mtb_touchpad_get_donn_en()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_donn_en ( uint8_t * donn_en,
mtb_touchpad_intf_context_t * context )

Retrieves the DONN enable configuration.

This function reads the DONN enable register from the touchpad controller and stores the value in the provided pointer. The communication with the device is performed using the interface defined in the context.

Parameters
[out]donn_en: Pointer to store the DONN enable value.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - DONN configuration retrieved successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'donn_en' pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_get_donn_detect()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_donn_detect ( uint8_t * donn_detected,
mtb_touchpad_intf_context_t * context )

Retrieves the DONN detection status from the touchpad controller.

This function reads the DONN detection status register from the touchpad controller and stores the detection status in the provided pointer. The communication with the device is performed using the interface defined in the context.

Parameters
[out]donn_detected: Pointer to store the DONN detection status.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - DONN detection status retrieved successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'donn_detected' pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_get_nvm_flag()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_nvm_flag ( MTB_TOUCHPAD_CONFIG_STORED_t * stored_flag,
mtb_touchpad_intf_context_t * context )

Retrieves the NVM (Non-Volatile Memory) flag status from the touchpad controller.

This function reads the NVM flag from the touchpad controller, indicating whether configuration data is stored in non-volatile memory. The result is stored in the provided pointer. Communication with the device uses the interface defined in the context.

Parameters
[out]stored_flag: Pointer to store the NVM flag status value.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - NVM flag retrieved successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'stored_flag' pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_get_num_sns()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_num_sns ( uint8_t * num_sns,
mtb_touchpad_intf_context_t * context )

Retrieves the number of sensors from touchpad controller.

This function reads the sensor count configuration from the touchpad controller and stores the number of sensors in the provided pointer. The communication with the device is performed using the interface defined in the context.

Parameters
[out]num_sns: Pointer to store the number of sensors value.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Number of sensors retrieved successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'num_sns' pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_get_sns_raw_count()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_sns_raw_count ( uint8_t sns_idx,
uint16_t * raw_count,
mtb_touchpad_intf_context_t * context )

Retrieves the raw count value for a specific touchpad sensor.

This function reads the raw count value of the specified sensor from the touchpad device. The raw count represents the unprocessed sensor measurement prior to baseline subtraction and filtering.

Parameters
[in]sns_idx: Index of the sensor for which raw count is requested.
[out]raw_count: Pointer to variable where the raw count value will be stored.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Raw count retrieved successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'sns_idx' value must be within the valid range based on the number of sensors.
The 'raw_count' pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_get_all_sns_raw_count()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_all_sns_raw_count ( uint16_t * buff,
mtb_touchpad_intf_context_t * context )

Retrieves raw count values for all sensors from the touchpad controller.

This function reads the raw count data for all sensors from the touchpad controller and stores the values sequentially in the provided buffer. The buffer must be large enough to hold data for all sensors. The communication with the device is performed using the interface defined in the context.

Parameters
[out]buff: Pointer to buffer to store the raw count values for all sensors.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Raw count data retrieved successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'buff' pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_get_sns_baseline()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_sns_baseline ( uint8_t sns_idx,
uint16_t * baseline,
mtb_touchpad_intf_context_t * context )

Retrieves the baseline value for a specific touchpad sensor.

This function reads the baseline value of the specified sensor from the touchpad device. The baseline represents the reference capacitance level used for touch detection for that sensor.

Parameters
[in]sns_idx: Index of the sensor for which baseline is requested.
[out]baseline: Pointer to variable where the baseline value will be stored.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Baseline retrieved successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'sns_idx' value must be within the valid range based on the number of sensors.
The 'baseline' pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_get_all_sns_baseline()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_all_sns_baseline ( uint16_t * buff,
mtb_touchpad_intf_context_t * context )

Retrieves baseline values for all touchpad sensors.

This function reads the baseline data for all configured sensors from the touchpad device and stores the values in the provided buffer. Baseline values represent the reference capacitance levels used for touch detection.

Parameters
[out]buff: Pointer to buffer where baseline values will be stored.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Baseline data retrieved successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'buff' pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_get_sns_capacitance()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_sns_capacitance ( uint8_t sns_idx,
uint32_t * capacitance,
mtb_touchpad_intf_context_t * context )

Retrieves the capacitance value for a specific touchpad sensor.

This function reads the capacitance value of the specified sensor from the touchpad device. The capacitance value represents the measured sensor signal used for touch detection and processing.

Parameters
[in]sns_idx: Index of the sensor for which capacitance is requested.
[out]capacitance: Pointer to variable where the capacitance value will be stored.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Capacitance retrieved successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'sns_idx' value must be within the valid range based on the number of sensors.
The 'capacitance' pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_get_all_sns_capacitance()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_all_sns_capacitance ( uint32_t * capacitances,
mtb_touchpad_intf_context_t * context )

Retrieves capacitance values for all touchpad sensors.

This function reads the capacitance data for all configured sensors from the touchpad device and stores the values in the provided buffer.

Parameters
[out]capacitances: Pointer to buffer where sensor capacitance values will be stored.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - Capacitance data retrieved successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'capacitances' pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_get_user_data_size()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_user_data_size ( uint16_t * size,
mtb_touchpad_intf_context_t * context )

Retrieves the size of the user data area of the touchpad controller.

This function reads the USER_DATA_LEN register, which reports the number of bytes available in the user data area located after the per-sensor raw/baseline/capacitance data.

Parameters
[out]size: Pointer to store the user data area size, in bytes.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - User data size retrieved successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'size' pointer must be a valid, non-NULL pointer.

◆ mtb_touchpad_get_user_data()

MTB_TOUCHPAD_RET_TYPE mtb_touchpad_get_user_data ( uint8_t * buf,
uint16_t len,
mtb_touchpad_intf_context_t * context )

Retrieves the user data from the touchpad controller.

This function reads up to 'len' bytes from the user data area of the touchpad device into the provided buffer. The location of the user data area is derived from the configured number of sensors. The requested length is validated against the USER_DATA_LEN register before the read is performed.

Parameters
[out]buf: Pointer to buffer where the user data will be stored.
[in]len: Number of bytes to read from the user data area.
[in]context: Pointer to initialized touchpad interface context.
Returns
MTB_TOUCHPAD_RET_SUCCESS - User data retrieved successfully MTB_TOUCHPAD_RET_INVALID_PARAM - Invalid input parameters, or 'len' exceeds the user data area size MTB_TOUCHPAD_RET_ERROR - Communication or read failure
Note
The context must be initialized using mtb_touchpad_init() before calling this function.
The 'buf' pointer must be a valid, non-NULL pointer, and must be at least 'len' bytes.