## LSAD Macro Definition Documentation

### LSAD_BIT_RES

#define LSAD_BIT_RES (14U)

Converts a raw ADC value to a voltage, calculated as follows voltage = adc_val * (2 V * 1000 [mV]/1 V / 2^14 steps.)

Location: lsad.h:54

Return

The voltage output in mV

Assumptions

Low frequency mode for the ADC is used, meaning that the resolution of the ADC is 14-bits. CONVERT provides voltage level as a milliVolt value based on the input ADC value.

### RES_15BIT

#define RES_15BIT (32768.0f)

Location: lsad.h:56

### RES_16BIT

#define RES_16BIT (65536.0f)

Location: lsad.h:58

### V_REF_DIFF_MV

#define V_REF_DIFF_MV (1000)

Location: lsad.h:60

### RESOLUTION_DIV

#define RESOLUTION_DIV ((x) >> (LSAD_BIT_RES - 1))

Location: lsad.h:64

### ADC_VAL_MV

#define ADC_VAL_MV ((int32_t)RESOLUTION_DIV((x) * V_REF_DIFF_MV))

Location: lsad.h:68

### LSAD_OFFSET_ERROR_CONV_QUOTIENT

#define LSAD_OFFSET_ERROR_CONV_QUOTIENT (RES_15BIT)

Location: lsad.h:72

### LSAD_GAIN_ERROR_CONV_QUOTIENT

#define LSAD_GAIN_ERROR_CONV_QUOTIENT (RES_16BIT)

Location: lsad.h:74

### ERROR_LSAD_INPUT_CFG

#define ERROR_LSAD_INPUT_CFG (0x80)

Location: lsad.h:77

### PRE_SEL_SIZE

#define PRE_SEL_SIZE (4)

Location: lsad.h:79

### LSAD_CFG_ARR_LENGTH

#define LSAD_CFG_ARR_LENGTH (32U)

Location: lsad.h:82

### LSAD_CFG_ARR_WIDTH

#define LSAD_CFG_ARR_WIDTH (5U)

Location: lsad.h:83

### GPIO_IDX

#define GPIO_IDX (0U)

Location: lsad.h:84

### IO_CFG_IDX

#define IO_CFG_IDX (1U)

Location: lsad.h:85

### MASK_IDX

#define MASK_IDX (2U)

Location: lsad.h:86

### POS_SEL_IDX

#define POS_SEL_IDX (3U)

Location: lsad.h:87

### NEG_SEL_IDX

#define NEG_SEL_IDX (4U)

Location: lsad.h:88

### NO_CFG

#define NO_CFG (0xFF)

Location: lsad.h:89

### LSAD_SPECIAL_CFG_ARR_LENGTH

#define LSAD_SPECIAL_CFG_ARR_LENGTH (4U)

Location: lsad.h:91

### LSAD_SPECIAL_CFG_ARR_WIDTH

#define LSAD_SPECIAL_CFG_ARR_WIDTH (3U)

Location: lsad.h:92

### LSAD_OCCUPIED_INPUT_ARR_WIDTH

#define LSAD_OCCUPIED_INPUT_ARR_WIDTH (3U)

Location: lsad.h:93

### USER_CFG_IDX

#define USER_CFG_IDX (0U)

Location: lsad.h:94

### POS_SEL_SPEC_IDX

#define POS_SEL_SPEC_IDX (1U)

Location: lsad.h:95

### NEG_SEL_SPEC_IDX

#define NEG_SEL_SPEC_IDX (2U)

Location: lsad.h:96

### SEL_IDX_SHIFT_DEF

#define SEL_IDX_SHIFT_DEF (15U)

Location: lsad.h:98

### LSAD_CH_NUM

#define LSAD_CH_NUM (8U)

Location: lsad.h:100

### LSAD_INPUTS_NUM

#define LSAD_INPUTS_NUM (4U)

Location: lsad.h:102

### OCCUPIED

#define OCCUPIED (1U)

Location: lsad.h:104

### NOT_OCCUPIED

#define NOT_OCCUPIED (0U)

Location: lsad.h:105

### EVEN_GPIO_NUM

#define EVEN_GPIO_NUM (0U)

Location: lsad.h:107

### ODD_GPIO_NUM

#define ODD_GPIO_NUM (1U)

Location: lsad.h:108

### OCC_STATE_IDX

#define OCC_STATE_IDX (2U)

Location: lsad.h:109

### EVENODD_IDX

#define EVENODD_IDX (1U)

Location: lsad.h:110

### INPUT_MASK_IDX

#define INPUT_MASK_IDX 0U

Location: lsad.h:111

### NEG_INPUTSEL_START

#define NEG_INPUTSEL_START (1U)

Location: lsad.h:113

### POS_INPUTSEL_START

#define POS_INPUTSEL_START (0U)

Location: lsad.h:114