ldctouch 2.0.0.0
ldctouch.h File Reference

This file contains API for LDC Touch Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  ldctouch_t
 LDC Touch Click context object. More...
 
struct  ldctouch_cfg_t
 LDC Touch Click configuration object. More...
 
struct  ldctouch_data_t
 LDC Touch Click data object. More...
 

Macros

#define LDCTOUCH_REG_STATUS   0x00
 LDC Touch register map.
 
#define LDCTOUCH_REG_OUT   0x01
 
#define LDCTOUCH_REG_DATA0_LSB   0x02
 
#define LDCTOUCH_REG_DATA0_MSB   0x03
 
#define LDCTOUCH_REG_DATA1_LSB   0x04
 
#define LDCTOUCH_REG_DATA1_MSB   0x05
 
#define LDCTOUCH_REG_DATA2_LSB   0x06
 
#define LDCTOUCH_REG_DATA2_MSB   0x07
 
#define LDCTOUCH_REG_DATA3_LSB   0x08
 
#define LDCTOUCH_REG_DATA3_MSB   0x09
 
#define LDCTOUCH_REG_RESET   0x0A
 
#define LDCTOUCH_REG_EN   0x0C
 
#define LDCTOUCH_REG_NP_SCAN_RATE   0x0D
 
#define LDCTOUCH_REG_GAIN0   0x0E
 
#define LDCTOUCH_REG_LP_SCAN_RATE   0x0F
 
#define LDCTOUCH_REG_GAIN1   0x10
 
#define LDCTOUCH_REG_INTPOL   0x11
 
#define LDCTOUCH_REG_GAIN2   0x12
 
#define LDCTOUCH_REG_LP_BASE_INC   0x13
 
#define LDCTOUCH_REG_GAIN3   0x14
 
#define LDCTOUCH_REG_NP_BASE_INC   0x15
 
#define LDCTOUCH_REG_BTPAUSE_MAXWIN   0x16
 
#define LDCTOUCH_REG_LC_DIVIDER   0x17
 
#define LDCTOUCH_REG_HYST   0x18
 
#define LDCTOUCH_REG_TWIST   0x19
 
#define LDCTOUCH_REG_COMMON_DEFORM   0x1A
 
#define LDCTOUCH_REG_OPOL_DPOL   0x1C
 
#define LDCTOUCH_REG_CNTSC   0x1E
 
#define LDCTOUCH_REG_SENSOR0_CONFIG   0x20
 
#define LDCTOUCH_REG_SENSOR1_CONFIG   0x22
 
#define LDCTOUCH_REG_SENSOR2_CONFIG   0x24
 
#define LDCTOUCH_REG_FTF0   0x25
 
#define LDCTOUCH_REG_SENSOR3_CONFIG   0x26
 
#define LDCTOUCH_REG_FTF1_2   0x28
 
#define LDCTOUCH_REG_FTF3   0x2B
 
#define LDCTOUCH_REG_RAW_DATA0_3   0x59
 
#define LDCTOUCH_REG_RAW_DATA0_2   0x5A
 
#define LDCTOUCH_REG_RAW_DATA0_1   0x5B
 
#define LDCTOUCH_REG_RAW_DATA1_3   0x5C
 
#define LDCTOUCH_REG_RAW_DATA1_2   0x5D
 
#define LDCTOUCH_REG_RAW_DATA1_1   0x5E
 
#define LDCTOUCH_REG_RAW_DATA2_3   0x5F
 
#define LDCTOUCH_REG_RAW_DATA2_2   0x60
 
#define LDCTOUCH_REG_RAW_DATA2_1   0x61
 
#define LDCTOUCH_REG_RAW_DATA3_3   0x62
 
#define LDCTOUCH_REG_RAW_DATA3_2   0x63
 
#define LDCTOUCH_REG_RAW_DATA3_1   0x64
 
#define LDCTOUCH_REG_MANUFACTURER_ID_LSB   0xFC
 
#define LDCTOUCH_REG_MANUFACTURER_ID_MSB   0xFD
 
#define LDCTOUCH_REG_DEVICE_ID_LSB   0xFE
 
#define LDCTOUCH_REG_DEVICE_ID_MSB   0xFF
 
#define LDCTOUCH_STATUS_OUT   0x80
 LDC Touch status settings.
 
#define LDCTOUCH_STATUS_CHIP_READY   0x40
 
#define LDCTOUCH_STATUS_READY_TO_WRITE   0x20
 
#define LDCTOUCH_STATUS_MAXOUT   0x10
 
#define LDCTOUCH_STATUS_FSM_WD   0x08
 
#define LDCTOUCH_STATUS_LC_WD   0x04
 
#define LDCTOUCH_STATUS_TIMEOUT   0x02
 
#define LDCTOUCH_STATUS_REGISTER_FLAG   0x01
 
#define LDCTOUCH_MODE_NORMAL   0x00
 LDC Touch operating mode settings.
 
#define LDCTOUCH_MODE_CONFIG   0x01
 
#define LDCTOUCH_MODE_FULL_RESET   0x10
 
#define LDCTOUCH_EN_CH3_LP   0x80
 LDC Touch enable register settings.
 
#define LDCTOUCH_EN_CH2_LP   0x40
 
#define LDCTOUCH_EN_CH1_LP   0x20
 
#define LDCTOUCH_EN_CH0_LP   0x10
 
#define LDCTOUCH_EN_CH3_NP   0x08
 
#define LDCTOUCH_EN_CH2_NP   0x04
 
#define LDCTOUCH_EN_CH1_NP   0x02
 
#define LDCTOUCH_EN_CH0_NP   0x01
 
#define LDCTOUCH_OPOL3_ACTIVE_HIGH   0x80
 LDC Touch output polarity settings.
 
#define LDCTOUCH_OPOL3_ACTIVE_LOW   0x00
 
#define LDCTOUCH_OPOL2_ACTIVE_HIGH   0x40
 
#define LDCTOUCH_OPOL2_ACTIVE_LOW   0x00
 
#define LDCTOUCH_OPOL1_ACTIVE_HIGH   0x20
 
#define LDCTOUCH_OPOL1_ACTIVE_LOW   0x00
 
#define LDCTOUCH_OPOL0_ACTIVE_HIGH   0x10
 
#define LDCTOUCH_OPOL0_ACTIVE_LOW   0x00
 
#define LDCTOUCH_DPOL3_DATA_INCREASES   0x08
 
#define LDCTOUCH_DPOL3_DATA_DECREASES   0x00
 
#define LDCTOUCH_DPOL2_DATA_INCREASES   0x04
 
#define LDCTOUCH_DPOL2_DATA_DECREASES   0x00
 
#define LDCTOUCH_DPOL1_DATA_INCREASES   0x02
 
#define LDCTOUCH_DPOL1_DATA_DECREASES   0x00
 
#define LDCTOUCH_DPOL0_DATA_INCREASES   0x01
 
#define LDCTOUCH_DPOL0_DATA_DECREASES   0x00
 
#define LDCTOUCH_BUTTON_MODE_FINGER   0x00
 LDC Touch button mode settings.
 
#define LDCTOUCH_BUTTON_MODE_METAL   0x01
 
#define LDCTOUCH_BUTTON_MODE   LDCTOUCH_BUTTON_MODE_FINGER
 
#define LDCTOUCH_MANUFACTURER_ID_LSB   0x49
 LDC Touch device ID values.
 
#define LDCTOUCH_MANUFACTURER_ID_MSB   0x54
 
#define LDCTOUCH_DEVICE_ID_LSB   0x00
 
#define LDCTOUCH_DEVICE_ID_MSB   0x40
 
#define LDCTOUCH_DEVICE_ADDRESS   0x2A
 LDC Touch device address setting.
 
#define LDCTOUCH_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  ldctouch_return_value_t { LDCTOUCH_OK = 0 , LDCTOUCH_ERROR = -1 }
 LDC Touch Click return value data. More...
 

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

This file contains API for LDC Touch Click Driver.

Enumeration Type Documentation

◆ ldctouch_return_value_t

LDC Touch Click return value data.

Predefined enum values for driver return values.

Enumerator
LDCTOUCH_OK 
LDCTOUCH_ERROR