touchpad 2.0.0.0
Public function

Functions

void touchpad_cfg_setup (touchpad_cfg_t *cfg)
 Config Object Initialization function.
 
TOUCHPAD_RETVAL touchpad_init (touchpad_t *ctx, touchpad_cfg_t *cfg)
 Initialization function.
 
void touchpad_default_cfg (touchpad_t *ctx)
 Click Default Configuration function.
 
void touchpad_generic_write (touchpad_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void touchpad_generic_read (touchpad_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void touchpad_get_touch_coordinate (touchpad_t *ctx, touchpad_cord_t *cord)
 Get touch coordinate.
 
uint8_t touchpad_get_interrupt_state (touchpad_t *ctx)
 Get interrupt state.
 
void touchpad_reset (touchpad_t *ctx)
 Hardware Reset.
 
uint8_t touchpad_get_event_state (touchpad_t *ctx)
 Get event state.
 
uint8_t touchpad_get_gesture_type (touchpad_t *ctx)
 Gesture type.
 

Detailed Description

Function Documentation

◆ touchpad_cfg_setup()

void touchpad_cfg_setup ( touchpad_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ touchpad_default_cfg()

void touchpad_default_cfg ( touchpad_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Touchpad click.

Note
waking up the cip and setting the RST to VDD state enter the default configuration

◆ touchpad_generic_read()

void touchpad_generic_read ( touchpad_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic read function.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf
lenNumber of the bytes to be read

@description This function reads data from the desired register.

◆ touchpad_generic_write()

void touchpad_generic_write ( touchpad_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic write function.

Parameters
ctxClick object.
regRegister address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

@description This function writes data to the desired register.

◆ touchpad_get_event_state()

uint8_t touchpad_get_event_state ( touchpad_t * ctx)

Get event state.

Parameters
ctxClick object.
Returns
an event that occurred (touch or gesture)

◆ touchpad_get_gesture_type()

uint8_t touchpad_get_gesture_type ( touchpad_t * ctx)

Gesture type.

Parameters
ctxClick object.
Returns
Gesture type
Note
Gesture type options:
     - NO_GESTURE_PRESENT
     - SINGLE_CLICK
     - CLICK_AND_HOLD
     - DOUBLE_CLICK
     - DOWN_SWIPE
     - DOWN_SWIPE_AND_HOLD
     - RIGHT_SWIPE
     - RIGHT_SWIPE_AND_HOLD
     - UP_SWIPE
     - UP_SWIPE_AND_HOLD
     - LEFT_SWIPE
     - LEFT_SWIPE_AND_HOLD

◆ touchpad_get_interrupt_state()

uint8_t touchpad_get_interrupt_state ( touchpad_t * ctx)

Get interrupt state.

Parameters
ctxClick object.
Returns
Interrupt (INT) pin state

◆ touchpad_get_touch_coordinate()

void touchpad_get_touch_coordinate ( touchpad_t * ctx,
touchpad_cord_t * cord )

Get touch coordinate.

Parameters
ctxClick object.
cordA structure that contains information about touch coordinates

@description This function reads X and Y coordinate

◆ touchpad_init()

TOUCHPAD_RETVAL touchpad_init ( touchpad_t * ctx,
touchpad_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ touchpad_reset()

void touchpad_reset ( touchpad_t * ctx)

Hardware Reset.

Parameters
ctxClick object.