Synaptics Touchpad driver

nRF5 SDK v15.2.0

Synaptics Touchpad driver. More...

Macros

#define TOUCHPAD_INT_STATUS 0x14
Interrupt status register. More...
#define TOUCHPAD_BUTTON_STATUS 0x41
Button status register.
#define TOUCHPAD_FINGER0_REL 0x30
First register in finger delta block.
#define TOUCHPAD_GESTURE_FLAGS 0x3A
Gesture flags 0.
#define TOUCHPAD_SCROLL 0x3F
Scroll zone X / horizontal multifinger scroll.
#define TOUCHPAD_CONTROL 0x42
Device control register.
#define TOUCHPAD_COMMAND 0x8F
Device command register.
#define TOUCHPAD_RESET 0x54
Address of reset.
#define TOUCHPAD_PAGESELECT 0xFF
Address of page select (can be found in every page at the same address)
#define TOUCHPAD_PRODUCT_ID 0xA2
Address of product ID string.

Functions

bool touchpad_init (uint8_t device_address)
Function for Touchpad initialization. More...
bool touchpad_reset (void)
Function for attempting to soft-reset the device. More...
bool touchpad_interrupt_status_read (uint8_t *interrupt_status)
Function for reading the interrupt status register of the device. This clears all interrupts. More...
bool touchpad_set_sleep_mode ( TouchpadSleepMode_t mode)
Function for sleep mode configuration. More...
bool touchpad_read_register (uint8_t register_address, uint8_t *value)
Function for reading a touchpad register contents over TWI. More...
bool touchpad_write_register (uint8_t register_address, uint8_t value)
Function for writing a touchpad register contents over TWI. More...
bool touchpad_product_id_read (uint8_t *product_id, uint8_t product_id_bytes)
Function for writing touchpad register contents over TWI. Writes one or more consecutive registers. More...
bool touchpad_product_id_verify (void)
Function for reading and verifying touchpad's product ID. More...

Detailed Description

Synaptics Touchpad driver.

Macro Definition Documentation

#define TOUCHPAD_INT_STATUS   0x14

Interrupt status register.

Touchpad register addresses.

Enumeration Type Documentation

Operational states

Enumerator
SleepmodeNormal

Normal operation.

SleepmodeSensorSleep

Low power operation.

Function Documentation

bool touchpad_init ( uint8_t device_address )

Function for Touchpad initialization.

Parameters
device_address TWI address of the device in bits [6:0]
Return values
true Touchpad was successfully identified and initialized
false Unexpected product ID or communication failure
bool touchpad_interrupt_status_read ( uint8_t * interrupt_status )

Function for reading the interrupt status register of the device. This clears all interrupts.

Parameters
interrupt_status Address to store interrupt status to.
Return values
true Register contents read successfully to interrupt_status
false Reading failed
bool touchpad_product_id_read ( uint8_t * product_id ,
uint8_t product_id_bytes
)

Function for writing touchpad register contents over TWI. Writes one or more consecutive registers.

Parameters
[out] product_id Pointer to a address to store product ID. Memory must be allocated for product_id_bytes number of bytes.
[in] product_id_bytes Number of bytes to read
Return values
true Product ID read succeeded
false Product ID read failed
bool touchpad_product_id_verify ( void )

Function for reading and verifying touchpad's product ID.

Return values
true Product ID is what was expected
false Product ID was not what was expected
bool touchpad_read_register ( uint8_t register_address ,
uint8_t * value
)

Function for reading a touchpad register contents over TWI.

Parameters
[in] register_address Register address
[out] value Pointer to a data buffer where read data will be stored
Return values
true Register read succeeded
false Register read failed
bool touchpad_reset ( void )

Function for attempting to soft-reset the device.

Return values
true Reset succeeded
false Reset failed
bool touchpad_set_sleep_mode ( TouchpadSleepMode_t mode )

Function for sleep mode configuration.

Note
In low power mode the touchpad do not generate interrupts from touch sensing.
Parameters
[in] mode Operational mode
Return values
true Sleep mode set successfully
false Sleep mode setting failed
bool touchpad_write_register ( uint8_t register_address ,
uint8_t value
)

Function for writing a touchpad register contents over TWI.

Parameters
[in] register_address Register address
[in] value Value to write to register
Return values
true Register write succeeded
false Register write failed