ldctouch 2.0.0.0
LDC Touch Click Driver

API for configuring and manipulating LDC Touch Click driver. More...

Topics

 LDC Touch Registers List
 List of registers of LDC Touch Click driver.
 
 LDC Touch Registers Settings
 Settings for registers of LDC Touch Click driver.
 
 LDC Touch MikroBUS Map
 MikroBUS pin mapping of LDC Touch Click driver.
 

Functions

void ldctouch_cfg_setup (ldctouch_cfg_t *cfg)
 LDC Touch configuration object setup function.
 
err_t ldctouch_init (ldctouch_t *ctx, ldctouch_cfg_t *cfg)
 LDC Touch initialization function.
 
err_t ldctouch_default_cfg (ldctouch_t *ctx)
 LDC Touch default configuration function.
 
err_t ldctouch_generic_write (ldctouch_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 LDC Touch I2C writing function.
 
err_t ldctouch_generic_read (ldctouch_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 LDC Touch I2C reading function.
 
err_t ldctouch_write_register (ldctouch_t *ctx, uint8_t reg, uint8_t data_in)
 LDC Touch write register function.
 
err_t ldctouch_read_register (ldctouch_t *ctx, uint8_t reg, uint8_t *data_out)
 LDC Touch read register function.
 
uint8_t ldctouch_get_s0_pin (ldctouch_t *ctx)
 LDC Touch get s0 pin function.
 
uint8_t ldctouch_get_s1_pin (ldctouch_t *ctx)
 LDC Touch get s1 pin function.
 
uint8_t ldctouch_get_s2_pin (ldctouch_t *ctx)
 LDC Touch get s2 pin function.
 
uint8_t ldctouch_get_s3_pin (ldctouch_t *ctx)
 LDC Touch get s3 pin function.
 
uint8_t ldctouch_get_int_pin (ldctouch_t *ctx)
 LDC Touch get int pin function.
 
err_t ldctouch_check_communication (ldctouch_t *ctx)
 LDC Touch check communication function.
 
err_t ldctouch_set_operation_mode (ldctouch_t *ctx, uint8_t mode)
 LDC Touch set operation mode function.
 
err_t ldctouch_get_data (ldctouch_t *ctx, ldctouch_data_t *button_data)
 LDC Touch get data function.
 

Detailed Description

API for configuring and manipulating LDC Touch 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

◆ ldctouch_cfg_setup()

void ldctouch_cfg_setup ( ldctouch_cfg_t * cfg)

LDC Touch configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ ldctouch_check_communication()

err_t ldctouch_check_communication ( ldctouch_t * ctx)

LDC Touch check communication function.

This function checks the communication by reading and verifying the defice and manufacturer IDs.

Parameters
[in]ctx: Click context object. See ldctouch_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ldctouch_default_cfg()

err_t ldctouch_default_cfg ( ldctouch_t * ctx)

LDC Touch default configuration function.

This function executes a default configuration of LDC Touch click board.

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

◆ ldctouch_generic_read()

err_t ldctouch_generic_read ( ldctouch_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

LDC Touch 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 ldctouch_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ldctouch_generic_write()

err_t ldctouch_generic_write ( ldctouch_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

LDC Touch 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 ldctouch_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ldctouch_get_data()

err_t ldctouch_get_data ( ldctouch_t * ctx,
ldctouch_data_t * button_data )

LDC Touch get data function.

This function reads status, out_state, and all buttons raw data.

Parameters
[in]ctx: Click context object. See ldctouch_t object definition for detailed explanation.
[out]button_data: Button data object. See ldctouch_data_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ldctouch_get_int_pin()

uint8_t ldctouch_get_int_pin ( ldctouch_t * ctx)

LDC Touch get int pin function.

This function returns the INT pin logic state.

Parameters
[in]ctx: Click context object. See ldctouch_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ ldctouch_get_s0_pin()

uint8_t ldctouch_get_s0_pin ( ldctouch_t * ctx)

LDC Touch get s0 pin function.

This function returns the S0 pin logic state.

Parameters
[in]ctx: Click context object. See ldctouch_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ ldctouch_get_s1_pin()

uint8_t ldctouch_get_s1_pin ( ldctouch_t * ctx)

LDC Touch get s1 pin function.

This function returns the S1 pin logic state.

Parameters
[in]ctx: Click context object. See ldctouch_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ ldctouch_get_s2_pin()

uint8_t ldctouch_get_s2_pin ( ldctouch_t * ctx)

LDC Touch get s2 pin function.

This function returns the S2 pin logic state.

Parameters
[in]ctx: Click context object. See ldctouch_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ ldctouch_get_s3_pin()

uint8_t ldctouch_get_s3_pin ( ldctouch_t * ctx)

LDC Touch get s3 pin function.

This function returns the S3 pin logic state.

Parameters
[in]ctx: Click context object. See ldctouch_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ ldctouch_init()

err_t ldctouch_init ( ldctouch_t * ctx,
ldctouch_cfg_t * cfg )

LDC Touch initialization function.

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

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

◆ ldctouch_read_register()

err_t ldctouch_read_register ( ldctouch_t * ctx,
uint8_t reg,
uint8_t * data_out )

LDC Touch read register function.

This function reads data from the selected register.

Parameters
[in]ctx: Click context object. See ldctouch_t object definition for detailed explanation.
[in]reg: Register address.
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ldctouch_set_operation_mode()

err_t ldctouch_set_operation_mode ( ldctouch_t * ctx,
uint8_t mode )

LDC Touch set operation mode function.

This function sets the operation mode.

Parameters
[in]ctx: Click context object. See ldctouch_t object definition for detailed explanation.
[in]mode:
  • 0x00 - Normal,
  • 0x01 - Config,
  • 0x10 - Full Reset.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ldctouch_write_register()

err_t ldctouch_write_register ( ldctouch_t * ctx,
uint8_t reg,
uint8_t data_in )

LDC Touch write register function.

This function writes a desired data to the selected register.

Parameters
[in]ctx: Click context object. See ldctouch_t object definition for detailed explanation.
[in]reg: Register address.
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.