CAPSENSE™ Touchpad I2C Host 1.0.0.44
 
Loading...
Searching...
No Matches
PSOC Edge I2C Port Functions

General Description

Reference I2C port functions for PSOC Edge E84.

Functions

uint32_t touchpad_i2c_init (void)
 Initializes the I2C interface for the touchpad.
 
uint32_t touchpad_i2c_read (uint16_t subaddress, uint8_t *data, uint16_t length, void *intf_ptr)
 Reads data from the touchpad device over I2C.
 
uint32_t touchpad_i2c_write (uint16_t subaddress, uint8_t *data, uint16_t length, void *intf_ptr)
 Writes data to the touchpad device over I2C.
 

Function Documentation

◆ touchpad_i2c_init()

uint32_t touchpad_i2c_init ( void )

Initializes the I2C interface for the touchpad.

This function initializes the I2C peripheral and configures it for communication with the touchpad device. It must be called before any read or write operations are performed.

Returns
: 0 - Initialization successful Non-zero - Initialization failed
Note
Ensure that the I2C hardware and pins are properly configured.

◆ touchpad_i2c_read()

uint32_t touchpad_i2c_read ( uint16_t subaddress,
uint8_t * data,
uint16_t length,
void * intf_ptr )

Reads data from the touchpad device over I2C.

This function reads a specified number of bytes from the given subaddress (register) of the touchpad device and stores the data in the provided buffer.

Parameters
[in]subaddress: Register address to read from.
[out]data: Pointer to buffer where read data will be stored.
[in]length: Number of bytes to read.
[in]intf_ptr: Pointer to interface-specific context (e.g., I2C handle or slave address).
Returns
: 0 - Read successful Non-zero - Read failed
Note
The 'data' pointer must be valid and have sufficient space.

◆ touchpad_i2c_write()

uint32_t touchpad_i2c_write ( uint16_t subaddress,
uint8_t * data,
uint16_t length,
void * intf_ptr )

Writes data to the touchpad device over I2C.

This function writes a specified number of bytes to the given subaddress (register) of the touchpad device using the provided data buffer.

Parameters
[in]subaddress: Register address to write to.
[in]data: Pointer to buffer containing data to be written.
[in]length: Number of bytes to write.
[in]intf_ptr: Pointer to interface-specific context (e.g., I2C handle or slave address).
Returns
: 0 - Write successful Non-zero - Write failed
Note
The 'data' pointer must be valid and contain at least 'length' bytes.