ldc1101 2.0.0.0
Public function

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

Function Documentation

◆ ldc1101_cfg_setup()

void ldc1101_cfg_setup ( ldc1101_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ ldc1101_default_cfg()

void ldc1101_default_cfg ( ldc1101_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Ldc1101 click.

Note

Click default configuration:

   LDC1101_REG_CFG_RP_MEASUREMENT_DYNAMIC_RANGE
-------------------------------------------------
   LDC1101_RP_SET_RP_MIN_0_75KOh

LDC1101_REG_CFG_INTERNAL_TIME_CONSTANT_1

   LDC1101_TC1_C1_3pF
   LDC1101_TC1_R1_212_7kOhm
   LDC1101_REG_CFG_INTERNAL_TIME_CONSTANT_2
-------------------------------------------------
   LDC1101_TC2_C2_12pF
   LDC1101_TC2_R2_426_4kOhm
   LDC1101_REG_CFG_RP_L_CONVERSION_INTERVAL
-------------------------------------------------
   LDC1101_DIG_CFG_RESP_TIME_384s
   LDC1101_REG_CFG_ADDITIONAL_DEVICE
-------------------------------------------------
   LDC1101_ALT_CFG_SHUTDOWN_DISABLE
   LDC1101_ALT_CFG_L_OPTIMAL_DISABLED
   LDC1101_REG_RP_THRESH_H_MSB
-------------------------------------------------
   LDC1101_FUNC_MODE_ACTIVE_MODE_DEF_CFG
   LDC1101_REG_RP_THRESH_L_LSB
-------------------------------------------------
   LDC1101_FUNC_MODE_ACTIVE_MODE_DEF_CFG
   LDC1101_REG_RP_THRESH_L_MSB
-------------------------------------------------
   LDC1101_FUNC_MODE_ACTIVE_MODE_DEF_CFG
   LDC1101_REG_CFG_INTB_MODE
-------------------------------------------------
   LDC1101_FUNC_MODE_ACTIVE_CONVERSION_MODE
   LDC1101_REG_CFG_POWER_STATE
-------------------------------------------------
   LDC1101_FUNC_MODE_SLEEP_MODE
   LDC1101_REG_AMPLITUDE_CONTROL_REQUIREMENT
-------------------------------------------------
   LDC1101_FUNC_MODE_ACTIVE_CONVERSION_MODE
   LDC1101_REG_L_THRESH_HI_LSB
-------------------------------------------------
   LDC1101_FUNC_MODE_ACTIVE_MODE_DEF_CFG
   LDC1101_REG_L_THRESH_HI_MSB
-------------------------------------------------
   LDC1101_FUNC_MODE_ACTIVE_MODE_DEF_CFG
   LDC1101_REG_L_THRESH_LO_LSB
-------------------------------------------------
   LDC1101_FUNC_MODE_ACTIVE_MODE_DEF_CFG
   LDC1101_REG_L_THRESH_LO_MSB
-------------------------------------------------
   LDC1101_FUNC_MODE_ACTIVE_MODE_DEF_CFG
   LDC1101_REG_LHR_RCOUNT_LSB
-------------------------------------------------
   LDC1101_RES_L_MEAS_REF_CNT_DEF_CFG
   LDC1101_REG_LHR_RCOUNT_MSB
-------------------------------------------------
   LDC1101_RES_L_MEAS_REF_CNT_DEF_CFG
   LDC1101_REG_LHR_OFFSET_LSB
-------------------------------------------------
   LDC1101_RES_OFF_L_MEAS_REF_CNT_DEF_CFG
   LDC1101_REG_LHR_OFFSET_MSB
-------------------------------------------------
   LDC1101_RES_OFF_L_MEAS_REF_CNT_DEF_CFG
   LDC1101_REG_CFG_LHR
-------------------------------------------------
   LDC1101_SENSOR_FREQ_DIV_NO

Work configuration:

   LDC1101_REG_CFG_RP_MEASUREMENT_DYNAMIC_RANGE
-------------------------------------------------
   LDC1101_RP_SET_RP_MAX_24KOhm
   LDC1101_RP_SET_RP_MIN_1_5KOhm

LDC1101_REG_CFG_INTERNAL_TIME_CONSTANT_1

   LDC1101_TC1_C1_0_75pF
   LDC1101_TC1_R1_21_1kOhm
   LDC1101_REG_CFG_INTERNAL_TIME_CONSTANT_2
-------------------------------------------------
   LDC1101_TC2_C2_3pF
   LDC1101_TC2_R2_30_5kOhm

LDC1101_REG_CFG_RP_L_CONVERSION_INTERVAL

   LDC1101_DIG_CFG_MIN_FREQ_118kHz
   LDC1101_DIG_CFG_RESP_TIME_768s

Set power mode:

   LDC1101_REG_CFG_POWER_STATE
-------------------------------------------------
   LDC1101_FUNC_MODE_ACTIVE_CONVERSION_MODE

◆ ldc1101_generic_read()

uint8_t ldc1101_generic_read ( ldc1101_t * ctx,
uint8_t reg_addr )

Functions for read byte from address.

Parameters
ctxClick object.
reg_addrAddress in which the data will be written.
Returns
byte uint8_t data which is read from the address.

@description Generic SPI transfer, for sending packages.

◆ ldc1101_generic_transfer()

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.

Parameters
ctxClick object.
wr_bufWrite data buffer
wr_lenNumber of byte in write data buffer
rd_bufRead data buffer
rd_lenNumber of byte in read data buffer

@description Generic SPI transfer, for sending and receiving packages

◆ ldc1101_generic_write()

void ldc1101_generic_write ( ldc1101_t * ctx,
uint8_t reg_addr,
uint8_t tx_data )

Functions for write one byte on address.

Parameters
ctxClick object.
reg_addrAddress in which the data will be written.
tx_dataData which be written on the address.

@description Generic SPI read, for receiving packages.

◆ ldc1101_get_interrupt()

uint8_t ldc1101_get_interrupt ( ldc1101_t * ctx)

Functions for get interrupt pin status.

Parameters
ctxClick object.
Returns
INT pin status

◆ ldc1101_get_l_data()

uint16_t ldc1101_get_l_data ( ldc1101_t * ctx)

Functions for reads L data.

Parameters
ctxClick object.
Returns
uint16_t L data

◆ ldc1101_get_rp_data()

uint16_t ldc1101_get_rp_data ( ldc1101_t * ctx)

Functions for reads RP data.

Parameters
ctxClick object.
Returns
uint16_t RT data

◆ ldc1101_get_status()

uint8_t ldc1101_get_status ( ldc1101_t * ctx)

Functions for reads status.

Parameters
ctxClick object.

◆ ldc1101_go_to_l_mode()

void ldc1101_go_to_l_mode ( ldc1101_t * ctx)

Functions for go to L mode.

Parameters
ctxClick object.

◆ ldc1101_go_to_r_mode()

void ldc1101_go_to_r_mode ( ldc1101_t * ctx)

Functions for go to RP mode.

Parameters
ctxClick object.

◆ ldc1101_init()

LDC1101_RETVAL ldc1101_init ( ldc1101_t * ctx,
ldc1101_cfg_t * cfg )

Initialization function.

Parameters
ldc1101Click object.
cfgClick configuration structure.

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

◆ ldc1101_set_power_mode()

void ldc1101_set_power_mode ( ldc1101_t * ctx,
uint8_t pwr_mode )

Set power mode function.

Parameters
ctxClick object.
pwr_modeMode to be set.
  - 0 : LDC1101_FUNC_MODE_ACTIVE_CONVERSION_MODE;
  - 1 : LDC1101_FUNC_MODE_SLEEP_MODE;
  - 2 : LDC1101_FUNC_MODE_SHUTDOWN_MODE;
*
@description Function set power mode.