touchpad3 2.0.0.0
Touchpad 3 Click Driver

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

Topics

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

Functions

void touchpad3_cfg_setup (touchpad3_cfg_t *cfg)
 Touchpad 3 configuration object setup function.
 
err_t touchpad3_init (touchpad3_t *ctx, touchpad3_cfg_t *cfg)
 Touchpad 3 initialization function.
 
err_t touchpad3_default_cfg (touchpad3_t *ctx)
 Touchpad 3 default configuration function.
 
uint8_t touchpad3_get_int (touchpad3_t *ctx)
 Touchpad 3 get interrupt function..
 
void touchpad3_hw_reset (touchpad3_t *ctx)
 Touchpad 3 hardware reset function.
 
void touchpad3_generic_write (touchpad3_t *ctx, uint8_t *tx_buf, uint8_t tx_len)
 Touchpad 3 I2C writing function.
 
err_t touchpad3_generic_read (touchpad3_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 Touchpad 3 I2C reading function.
 
void touchpad3_general_configuration (touchpad3_t *ctx)
 Touchpad 3 general configuration function.
 
void touchpad3_decoding_configuration (touchpad3_t *ctx)
 Touchpad 3 decoding configuration function.
 
void touchpad3_sensor_mapping_configuration (touchpad3_t *ctx)
 Touchpad 3 sensor mapping configuration function.
 
uint8_t touchpad3_get_touch (touchpad3_t *ctx, touch_data_t *tch_data, uint16_t *x_axis, uint16_t *y_axis)
 Touchpad 3 get touch data function.
 
uint8_t touchpad3_get_gesture (touchpad3_t *ctx, touch_data_t *gst_data, uint8_t *gesture)
 Touchpad 3 get gesture data function.
 
uint8_t touchpad3_cmd_protocol (touchpad3_t *ctx, cmd_protocol_t cmd_data, uint8_t *p_tx_data, uint8_t *p_rx_data)
 Touchpad 3 command protocol function.
 
uint8_t touchpad3_write_reg (touchpad3_t *ctx, uint8_t index_loc, uint8_t offset_loc, uint8_t tx_data, uint8_t *p_response)
 Touchpad 3 write register data function.
 
uint8_t touchpad3_read_reg (touchpad3_t *ctx, uint8_t index_loc, uint8_t offset_loc, uint8_t *read_data, uint8_t *p_response)
 Touchpad 3 read register data function.
 
uint8_t touchpad3_manufacturing_test (touchpad3_t *ctx)
 Touchpad 3 manufacturing test function.
 
uint32_t touchpad3_get_device_id (touchpad3_t *ctx)
 Touchpad 3 get device id function.
 
uint8_t touchpad3_config_touch (touchpad3_t *ctx, uint8_t en_touch)
 Touchpad 3 configure touch function.
 
uint8_t touchpad3_config_gesture (touchpad3_t *ctx, uint8_t en_gesture)
 Touchpad 3 configure gesture function.
 

Detailed Description

API for configuring and manipulating Touchpad 3 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

◆ touchpad3_cfg_setup()

void touchpad3_cfg_setup ( touchpad3_cfg_t * cfg)

Touchpad 3 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ touchpad3_cmd_protocol()

uint8_t touchpad3_cmd_protocol ( touchpad3_t * ctx,
cmd_protocol_t cmd_data,
uint8_t * p_tx_data,
uint8_t * p_rx_data )

Touchpad 3 command protocol function.

The function set the desired command to the MTCH6301 Projected Capacitive Touch Controller on the TouchPad 3 click board.

Parameters
[in]ctx: Click context object. See touchpad3_t object definition for detailed explanation.
[in]cmd_dataPointer to the memory location where data be stored.
[in]p_tx_dataPointer to the data to be written.
[in]p_rx_dataPointer to the memory location where respond data be stored.
Returns
  • 0x00 - Success,
  • 0x80 - Parameter out of range.
  • 0xFE - Timeout (not enough bytes received).
  • 0xFF - Unrecognized command.
  • 0xFD - Invalid parameter.
  • 0xFC - Missing or extra parameter.
See #err_t definition for detailed explanation.
Note
None.

◆ touchpad3_config_gesture()

uint8_t touchpad3_config_gesture ( touchpad3_t * ctx,
uint8_t en_gesture )

Touchpad 3 configure gesture function.

The function configures gesture of the MTCH6301 Projected Capacitive Touch Controller on the TouchPad 3 click board.

Parameters
[in]ctx: Click context object. See touchpad3_t object definition for detailed explanation.
[in]en_gesture: Gesture enable settings.
Returns
Status.
Note
None.

◆ touchpad3_config_touch()

uint8_t touchpad3_config_touch ( touchpad3_t * ctx,
uint8_t en_touch )

Touchpad 3 configure touch function.

The function configures touch of the MTCH6301 Projected Capacitive Touch Controller on the TouchPad 3 click board.

Parameters
[in]ctx: Click context object. See touchpad3_t object definition for detailed explanation.
[in]en_touch: Touch enable settings.
Returns
Status.
Note
None.

◆ touchpad3_decoding_configuration()

void touchpad3_decoding_configuration ( touchpad3_t * ctx)

Touchpad 3 decoding configuration function.

The function performs the decoding configuration of the MTCH6301 Projected Capacitive Touch Controller on the TouchPad 3 click board.

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

See #err_t definition for detailed explanation.

Note
None.

◆ touchpad3_default_cfg()

err_t touchpad3_default_cfg ( touchpad3_t * ctx)

Touchpad 3 default configuration function.

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

Parameters
[in]ctx: Click context object. See touchpad3_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.

◆ touchpad3_general_configuration()

void touchpad3_general_configuration ( touchpad3_t * ctx)

Touchpad 3 general configuration function.

The function performs the general configuration of the MTCH6301 Projected Capacitive Touch Controller on the TouchPad 3 click board.

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

See #err_t definition for detailed explanation.

Note
None.

◆ touchpad3_generic_read()

err_t touchpad3_generic_read ( touchpad3_t * ctx,
uint8_t reg,
uint8_t * rx_buf,
uint8_t rx_len )

Touchpad 3 I2C reading function.

This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See touchpad3_t object definition for detailed explanation.
[in]reg: Start register address.
[out]rx_buf: Output read data.
[in]rx_len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ touchpad3_generic_write()

void touchpad3_generic_write ( touchpad3_t * ctx,
uint8_t * tx_buf,
uint8_t tx_len )

Touchpad 3 I2C writing function.

This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See touchpad3_t object definition for detailed explanation.
[in]tx_buf: Data to be written.
[in]tx_len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ touchpad3_get_device_id()

uint32_t touchpad3_get_device_id ( touchpad3_t * ctx)

Touchpad 3 get device id function.

The function reads device id of the MTCH6301 Projected Capacitive Touch Controller on the TouchPad 3 click board.

Parameters
[in]ctx: Click context object. See touchpad3_t object definition for detailed explanation.
Returns
Device id.
Note
None.

◆ touchpad3_get_gesture()

uint8_t touchpad3_get_gesture ( touchpad3_t * ctx,
touch_data_t * gst_data,
uint8_t * gesture )

Touchpad 3 get gesture data function.

The function get gesture data of the MTCH6301 Projected Capacitive Touch Controller on the TouchPad 3 click board.

Parameters
[in]ctx: Click context object. See touchpad3_t object definition for detailed explanation.
[in]gst_dataStructure where gesture data be stored.
[out]gesturePointer to the memory location where data be stored.
Returns
  • 0x00 - Success,
  • 0x01 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ touchpad3_get_int()

uint8_t touchpad3_get_int ( touchpad3_t * ctx)

Touchpad 3 get interrupt function..

The function get INT pin state of the TouchPad 3 click board.

Parameters
[in]ctx: Click context object. See touchpad3_t object definition for detailed explanation.
Returns
State of the INT pin.

See #err_t definition for detailed explanation.

Note
None.

◆ touchpad3_get_touch()

uint8_t touchpad3_get_touch ( touchpad3_t * ctx,
touch_data_t * tch_data,
uint16_t * x_axis,
uint16_t * y_axis )

Touchpad 3 get touch data function.

The function get touch data of the MTCH6301 Projected Capacitive Touch Controller on the TouchPad 3 click board.

Parameters
[in]ctx: Click context object. See touchpad3_t object definition for detailed explanation.
[in]tch_datastructure where touch data be stored.
[out]x_axisPointer to the memory location where data be stored.
[out]y_axisPointer to the memory location where data be stored.
Returns
  • 0x00 - Success,
  • 0x01 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ touchpad3_hw_reset()

void touchpad3_hw_reset ( touchpad3_t * ctx)

Touchpad 3 hardware reset function.

The function hardware reset the MTCH6301 Projected Capacitive Touch Controller on the TouchPad 3 click board.

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

See #err_t definition for detailed explanation.

Note
None.

◆ touchpad3_init()

err_t touchpad3_init ( touchpad3_t * ctx,
touchpad3_cfg_t * cfg )

Touchpad 3 initialization function.

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

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

◆ touchpad3_manufacturing_test()

uint8_t touchpad3_manufacturing_test ( touchpad3_t * ctx)

Touchpad 3 manufacturing test function.

The function set manufacturing test of the MTCH6301 Projected Capacitive Touch Controller on the TouchPad 3 click board.

Parameters
[in]ctx: Click context object. See touchpad3_t object definition for detailed explanation.
Returns
  • 0x00 - Success,
  • 0x01 - I/O error.
See #err_t definition for detailed explanation.
Note
None.

◆ touchpad3_read_reg()

uint8_t touchpad3_read_reg ( touchpad3_t * ctx,
uint8_t index_loc,
uint8_t offset_loc,
uint8_t * read_data,
uint8_t * p_response )

Touchpad 3 read register data function.

The function read a the byte of data from the targeted index and offset location of the MTCH6301 Projected Capacitive Touch Controller on the TouchPad 3 click board.

Parameters
[in]ctx: Click context object. See touchpad3_t object definition for detailed explanation.
[in]index_loc: Index location.
[in]offset_loc: Offset location.
[in]tx_data: the data to be written.
[in]p_response: pointer to the memory location where respond data be stored.
Returns
  • 0x00 - Success,
  • 0x80 - Parameter out of range.
  • 0xFE - Timeout (not enough bytes received).
  • 0xFF - Unrecognized command.
  • 0xFD - Invalid parameter.
  • 0xFC - Missing or extra parameter.
See #err_t definition for detailed explanation.
Note
None.

◆ touchpad3_sensor_mapping_configuration()

void touchpad3_sensor_mapping_configuration ( touchpad3_t * ctx)

Touchpad 3 sensor mapping configuration function.

The function configures the sensor mapping of the MTCH6301 Projected Capacitive Touch Controller on the TouchPad 3 click board.

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

See #err_t definition for detailed explanation.

Note
None.

◆ touchpad3_write_reg()

uint8_t touchpad3_write_reg ( touchpad3_t * ctx,
uint8_t index_loc,
uint8_t offset_loc,
uint8_t tx_data,
uint8_t * p_response )

Touchpad 3 write register data function.

The function writes a the byte of data to the targeted index and offset locationof the MTCH6301 Projected Capacitive Touch Controller on the TouchPad 3 click board.

Parameters
[in]ctx: Click context object. See touchpad3_t object definition for detailed explanation.
[in]index_loc: Index location.
[in]offset_loc: Offset location.
[in]tx_data: the data to be written.
[in]p_response: pointer to the memory location where respond data be stored.
Returns
  • 0x00 - Success,
  • 0x80 - Parameter out of range.
  • 0xFE - Timeout (not enough bytes received).
  • 0xFF - Unrecognized command.
  • 0xFD - Invalid parameter.
  • 0xFC - Missing or extra parameter.
See #err_t definition for detailed explanation.
Note
None.