touchpad4 2.0.0.0
Touchpad 4 Click Driver

API for configuring and manipulating Touchpad 4 Click driver. More...

Topics

 Touchpad 4 Registers List
 List of registers of Touchpad 4 Click driver.
 
 Touchpad 4 Registers Settings
 Settings for registers of Touchpad 4 Click driver.
 
 Touchpad 4 MikroBUS Map
 MikroBUS pin mapping of Touchpad 4 Click driver.
 

Functions

void touchpad4_cfg_setup (touchpad4_cfg_t *cfg)
 Touchpad 4 configuration object setup function.
 
err_t touchpad4_init (touchpad4_t *ctx, touchpad4_cfg_t *cfg)
 Touchpad 4 initialization function.
 
err_t touchpad4_default_cfg (touchpad4_t *ctx)
 Touchpad 4 default configuration function.
 
err_t touchpad4_generic_write (touchpad4_t *ctx, uint8_t reg, uint16_t tx_data)
 Touchpad 4 I2C writing function.
 
err_t touchpad4_generic_read (touchpad4_t *ctx, uint8_t reg, uint16_t *rx_data)
 Touchpad 4 I2C reading function.
 
uint8_t touchpad4_get_ready (touchpad4_t *ctx)
 Get ready pin state.
 
void touchpad4_set_rst (touchpad4_t *ctx, uint8_t state)
 Set reset pin state.
 
void touchpad4_reset (touchpad4_t *ctx)
 Reset function.
 
err_t touchpad4_get_touch (touchpad4_t *ctx, touchpad4_info_t *touch_info)
 Read touch informations.
 
err_t touchpad_get_channels (touchpad4_t *ctx, uint32_t *channels)
 Read channel information.
 

Detailed Description

API for configuring and manipulating Touchpad 4 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ touchpad4_cfg_setup()

void touchpad4_cfg_setup ( touchpad4_cfg_t * cfg)

Touchpad 4 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See touchpad4_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ touchpad4_default_cfg()

err_t touchpad4_default_cfg ( touchpad4_t * ctx)

Touchpad 4 default configuration function.

This function executes a default configuration of Touchpad 4 click board.

Parameters
[in]ctx: Click context object. See touchpad4_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ touchpad4_generic_read()

err_t touchpad4_generic_read ( touchpad4_t * ctx,
uint8_t reg,
uint16_t * rx_data )

Touchpad 4 I2C reading function.

This function reads a data from the selected register.

Parameters
[in]ctx: Click context object. See touchpad4_t object definition for detailed explanation.
[in]reg: Start register address.
[out]rx_data: Output read data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ touchpad4_generic_write()

err_t touchpad4_generic_write ( touchpad4_t * ctx,
uint8_t reg,
uint16_t tx_data )

Touchpad 4 I2C writing function.

This function writes a data to the selected register.

Parameters
[in]ctx: Click context object. See touchpad4_t object definition for detailed explanation.
[in]reg: Start register address.
[in]tx_data: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ touchpad4_get_ready()

uint8_t touchpad4_get_ready ( touchpad4_t * ctx)

Get ready pin state.

This function reads logic state of the rdy pin.

Parameters
[in]ctx: Click context object. See touchpad4_t object definition for detailed explanation.
Returns
Logic state of the pin.

◆ touchpad4_get_touch()

err_t touchpad4_get_touch ( touchpad4_t * ctx,
touchpad4_info_t * touch_info )

Read touch informations.

This function reads number of touches, touch informations and gesture.

Parameters
[in]ctx: Click context object. See touchpad4_t object definition for detailed explanation.
[out]touch_info: Touch information object. See touchpad4_info_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ touchpad4_init()

err_t touchpad4_init ( touchpad4_t * ctx,
touchpad4_cfg_t * cfg )

Touchpad 4 initialization function.

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

Parameters
[out]ctx: Click context object. See touchpad4_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See touchpad4_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ touchpad4_reset()

void touchpad4_reset ( touchpad4_t * ctx)

Reset function.

This function resets device.

Parameters
[in]ctx: Click context object. See touchpad4_t object definition for detailed explanation.
Returns
Nothing.

◆ touchpad4_set_rst()

void touchpad4_set_rst ( touchpad4_t * ctx,
uint8_t state )

Set reset pin state.

This function sets mclr/rst pin state.

Parameters
[in]ctx: Click context object. See touchpad4_t object definition for detailed explanation.
[in]state: Logic state.
Returns
Nothing.

◆ touchpad_get_channels()

err_t touchpad_get_channels ( touchpad4_t * ctx,
uint32_t * channels )

Read channel information.

This function reads state of the channels.

Parameters
[in]ctx: Click context object. See touchpad4_t object definition for detailed explanation.
[out]channels: Channel data.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.