nRF51 SDK - S130 SoftDevice
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Synaptics Touchpad driver.

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.
 

Enumerations

enum  TouchpadSleepMode_t {
  SleepmodeNormal = 0x00,
  SleepmodeSensorSleep = 0x01
}
 

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_addressTWI address of the device in bits [6:0]
Return values
trueTouchpad was successfully identified and initialized
falseUnexpected 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_statusAddress to store interrupt status to.
Return values
trueRegister contents read successfully to interrupt_status
falseReading 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_idPointer to a address to store product ID. Memory must be allocated for product_id_bytes number of bytes.
[in]product_id_bytesNumber of bytes to read
Return values
trueProduct ID read succeeded
falseProduct ID read failed
bool touchpad_product_id_verify ( void  )

Function for reading and verifying touchpad's product ID.

Return values
trueProduct ID is what was expected
falseProduct 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_addressRegister address
[out]valuePointer to a data buffer where read data will be stored
Return values
trueRegister read succeeded
falseRegister read failed
bool touchpad_reset ( void  )

Function for attempting to soft-reset the device.

Return values
trueReset succeeded
falseReset 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]modeOperational mode
Return values
trueSleep mode set successfully
falseSleep 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_addressRegister address
[in]valueValue to write to register
Return values
trueRegister write succeeded
falseRegister write failed