ldc1101 2.0.0.0
ldc1101.h File Reference

This file contains API for LDC 1101 Click driver. More...

#include "drv_digital_in.h"
#include "drv_spi_master.h"

Go to the source code of this file.

Data Structures

struct  ldc1101_t
 Click ctx object definition. More...
 
struct  ldc1101_cfg_t
 Click configuration structure definition. More...
 

Macros

#define LDC1101_MAP_MIKROBUS(cfg, mikrobus)
 
#define LDC1101_RETVAL   uint8_t
 
#define LDC1101_OK   0x00
 
#define LDC1101_INIT_ERROR   0xFF
 
#define LDC1101_REG_CFG_RP_MEASUREMENT_DYNAMIC_RANGE   0x01
 
#define LDC1101_REG_CFG_INTERNAL_TIME_CONSTANT_1   0x02
 
#define LDC1101_REG_CFG_INTERNAL_TIME_CONSTANT_2   0x03
 
#define LDC1101_REG_CFG_RP_L_CONVERSION_INTERVAL   0x04
 
#define LDC1101_REG_CFG_ADDITIONAL_DEVICE   0x05
 
#define LDC1101_REG_RP_THRESH_H_LSB   0x06
 
#define LDC1101_REG_RP_THRESH_H_MSB   0x07
 
#define LDC1101_REG_RP_THRESH_L_LSB   0x08
 
#define LDC1101_REG_RP_THRESH_L_MSB   0x09
 
#define LDC1101_REG_CFG_INTB_MODE   0x0A
 
#define LDC1101_REG_CFG_POWER_STATE   0x0B
 
#define LDC1101_REG_AMPLITUDE_CONTROL_REQUIREMENT   0x0C
 
#define LDC1101_REG_L_THRESH_HI_LSB   0x16
 
#define LDC1101_REG_L_THRESH_HI_MSB   0x17
 
#define LDC1101_REG_L_THRESH_LO_LSB   0x18
 
#define LDC1101_REG_L_THRESH_LO_MSB   0x19
 
#define LDC1101_REG_RP_L_MEASUREMENT_STATUS   0x20
 
#define LDC1101_REG_RP_DATA_LSB   0x21
 
#define LDC1101_REG_RP_DATA_MSB   0x22
 
#define LDC1101_REG_L_DATA_LSB   0x23
 
#define LDC1101_REG_L_DATA_MSB   0x24
 
#define LDC1101_REG_LHR_RCOUNT_LSB   0x30
 
#define LDC1101_REG_LHR_RCOUNT_MSB   0x31
 
#define LDC1101_REG_LHR_OFFSET_LSB   0x32
 
#define LDC1101_REG_LHR_OFFSET_MSB   0x33
 
#define LDC1101_REG_CFG_LHR   0x34
 
#define LDC1101_REG_LHR_DATA_LSB   0x38
 
#define LDC1101_REG_LHR_DATA_MID   0x39
 
#define LDC1101_REG_LHR_DATA_MSB   0x3A
 
#define LDC1101_REG_LHR_STATUS   0x3B
 
#define LDC1101_REG_DEVICE_RID_VALUE   0x3E
 
#define LDC1101_REG_CHIP_ID   0x3F
 
#define LDC1101_CHIP_ID_VAL   0xD4
 
#define LDC1101_RP_SET_RP_MAX_IS_DRIVEN   0x00
 
#define LDC1101_RP_SET_RP_MAX_CURRENT_IS_IGNORED   0x80
 
#define LDC1101_RP_SET_RP_MAX_96KOhm   0x00
 
#define LDC1101_RP_SET_RP_MAX_48KOhm   0x10
 
#define LDC1101_RP_SET_RP_MAX_24KOhm   0x20
 
#define LDC1101_RP_SET_RP_MAX_12KOhm   0x30
 
#define LDC1101_RP_SET_RP_MAX_6KOhm   0x40
 
#define LDC1101_RP_SET_RP_MAX_3KOhm   0x50
 
#define LDC1101_RP_SET_RP_MAX_1_5KOhm   0x60
 
#define LDC1101_RP_SET_RP_MAX_0_75KOh   0x70
 
#define LDC1101_RP_SET_RP_MIN_96KOhm   0x00
 
#define LDC1101_RP_SET_RP_MIN_48KOhm   0x01
 
#define LDC1101_RP_SET_RP_MIN_24KOhm   0x02
 
#define LDC1101_RP_SET_RP_MIN_12KOhm   0x03
 
#define LDC1101_RP_SET_RP_MIN_6KOhm   0x04
 
#define LDC1101_RP_SET_RP_MIN_3KOhm   0x05
 
#define LDC1101_RP_SET_RP_MIN_1_5KOhm   0x06
 
#define LDC1101_RP_SET_RP_MIN_0_75KOh   0x07
 
#define LDC1101_TC1_C1_0_75pF   0x00
 
#define LDC1101_TC1_C1_1_5pF   0x40
 
#define LDC1101_TC1_C1_3pF   0x80
 
#define LDC1101_TC1_C1_6pF   0xC0
 
#define LDC1101_TC1_R1_417kOhm   0x00
 
#define LDC1101_TC1_R1_212_7kOhm   0x10
 
#define LDC1101_TC1_R1_21_1kOhm   0x1F
 
#define LDC1101_TC2_C2_3pF   0x00
 
#define LDC1101_TC2_C2_6pF   0x40
 
#define LDC1101_TC2_C2_12pF   0x80
 
#define LDC1101_TC2_C2_24pF   0xC0
 
#define LDC1101_TC2_R2_835kOhm   0x00
 
#define LDC1101_TC2_R2_426_4kOhm   0x20
 
#define LDC1101_TC2_R2_30_5kOhm   0x3F
 
#define LDC1101_DIG_CFG_MIN_FREQ_500kHz   0x00
 
#define LDC1101_DIG_CFG_MIN_FREQ_118kHz   0xD0
 
#define LDC1101_DIG_CFG_MIN_FREQ_8MHz   0xF0
 
#define LDC1101_DIG_CFG_RESP_TIME_192s   0x02
 
#define LDC1101_DIG_CFG_RESP_TIME_384s   0x03
 
#define LDC1101_DIG_CFG_RESP_TIME_768s   0x04
 
#define LDC1101_DIG_CFG_RESP_TIME_1536s   0x05
 
#define LDC1101_DIG_CFG_RESP_TIME_3072s   0x06
 
#define LDC1101_DIG_CFG_RESP_TIME_6144s   0x07
 
#define LDC1101_ALT_CFG_SHUTDOWN_ENABLE   0x02
 
#define LDC1101_ALT_CFG_SHUTDOWN_DISABLE   0x00
 
#define LDC1101_ALT_CFG_L_OPTIMAL_DISABLED   0x00
 
#define LDC1101_ALT_CFG_L_OPTIMAL_ENABLE   0x01
 
#define LDC1101_ALT_CFG_R_OPTIMAL_ENABLE   0x02
 
#define LDC1101_REQ_AMPLINTUDE_REGUL_CONVERT   0x00
 
#define LDC1101_CONTINUES_CONVERT   0x01
 
#define LDC1101_INTB_MODE_DONT_REPORT_INTB_ON_SDO_PIN   0x00
 
#define LDC1101_INTB_MODE_REPORT_INTB_ON_SDO_PIN   0x80
 
#define LDC1101_INTB_MODE_REPORT_LHR_DATA_READY   0x20
 
#define LDC1101_INTB_MODE_L_CONVERSION_TO_L_THRESHOLDS   0x10
 
#define LDC1101_INTB_MODE_L_CONVERSION_TO_L_HIGH_THRESHOLDS   0x08
 
#define LDC1101_INTB_MODE_REPORT_RP_L_DATA_READY   0x04
 
#define LDC1101_INTB_MODE_RP_CONVERSION_TO_L_THRESHOLDS   0x02
 
#define LDC1101_INTB_MODE_RP_CONVERSION_TO_L_HIGH_THRESHOLDS   0x01
 
#define LDC1101_INTB_MODE_NO_OUTPUT   0x00
 
#define LDC1101_FUNC_MODE_ACTIVE_MODE_DEF_CFG   0x00
 
#define LDC1101_RES_L_MEAS_REF_CNT_DEF_CFG   0x00
 
#define LDC1101_RES_OFF_L_MEAS_REF_CNT_DEF_CFG   0x00
 
#define LDC1101_FUNC_MODE_ACTIVE_CONVERSION_MODE   0x00
 
#define LDC1101_FUNC_MODE_SLEEP_MODE   0x01
 
#define LDC1101_FUNC_MODE_SHUTDOWN_MODE   0x02
 
#define LDC1101_SENSOR_FREQ_DIV_NO   0x00
 
#define LDC1101_SENSOR_FREQ_DIV_BY_2   0x01
 
#define LDC1101_SENSOR_FREQ_DIV_BY_4   0x02
 
#define LDC1101_SENSOR_FREQ_DIV_BY_8   0x04
 
#define LDC1101_LHR_CFG_FREQUENCY_NOT_DIVIDED   0x00
 
#define LDC1101_LHR_CFG_FREQUENCY_DIVIDED_BY_2   0x01
 
#define LDC1101_LHR_CFG_FREQUENCY_DIVIDED_BY_4   0x02
 
#define LDC1101_LHR_CFG_FREQUENCY_DIVIDED_BY_8   0x03
 

Functions

void ldc1101_cfg_setup (ldc1101_cfg_t *cfg)
 Config Object Initialization function.
 
LDC1101_RETVAL ldc1101_init (ldc1101_t *ctx, ldc1101_cfg_t *cfg)
 Initialization function.
 
void ldc1101_default_cfg (ldc1101_t *ctx)
 Click Default Configuration function.
 
void ldc1101_generic_transfer (ldc1101_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
 Generic transfer function.
 
void ldc1101_generic_write (ldc1101_t *ctx, uint8_t reg_addr, uint8_t tx_data)
 Functions for write one byte on address.
 
uint8_t ldc1101_generic_read (ldc1101_t *ctx, uint8_t reg_addr)
 Functions for read byte from address.
 
void ldc1101_set_power_mode (ldc1101_t *ctx, uint8_t pwr_mode)
 Set power mode function.
 
void ldc1101_go_to_l_mode (ldc1101_t *ctx)
 Functions for go to L mode.
 
void ldc1101_go_to_r_mode (ldc1101_t *ctx)
 Functions for go to RP mode.
 
uint8_t ldc1101_get_status (ldc1101_t *ctx)
 Functions for reads status.
 
uint16_t ldc1101_get_rp_data (ldc1101_t *ctx)
 Functions for reads RP data.
 
uint16_t ldc1101_get_l_data (ldc1101_t *ctx)
 Functions for reads L data.
 
uint8_t ldc1101_get_interrupt (ldc1101_t *ctx)
 Functions for get interrupt pin status.
 

Detailed Description

This file contains API for LDC 1101 Click driver.