# LSAD

LSAD hardware abstraction layer.

## Summary

Typedefs

- lsad_io_t
- lsad_in_t
- lsad_channel_t
- lsad_prescale_t
- lsad_mode_t

Data Structures

- F_LSAD_TRIM : LSAD structure for offset/gain conversion function.

Enumerations

- lsad_io
- lsad_pol
- lsad_channel
- lsad_prescale
- lsad_mode

Macros

- LSAD_BIT_RES : Converts a raw ADC value to a voltage, calculated as follows voltage = adc_val * (2 V * 1000 [mV]/1 V / 2^14 steps.)
- RES_15BIT
- RES_16BIT
- V_REF_DIFF_MV
- RESOLUTION_DIV
- ADC_VAL_MV
- LSAD_OFFSET_ERROR_CONV_QUOTIENT
- LSAD_GAIN_ERROR_CONV_QUOTIENT
- ERROR_LSAD_INPUT_CFG
- PRE_SEL_SIZE
- LSAD_CFG_ARR_LENGTH
- LSAD_CFG_ARR_WIDTH
- GPIO_IDX
- IO_CFG_IDX
- MASK_IDX
- POS_SEL_IDX
- NEG_SEL_IDX
- NO_CFG
- LSAD_SPECIAL_CFG_ARR_LENGTH
- LSAD_SPECIAL_CFG_ARR_WIDTH
- LSAD_OCCUPIED_INPUT_ARR_WIDTH
- USER_CFG_IDX
- POS_SEL_SPEC_IDX
- NEG_SEL_SPEC_IDX
- SEL_IDX_SHIFT_DEF
- LSAD_CH_NUM
- LSAD_INPUTS_NUM
- OCCUPIED
- NOT_OCCUPIED
- EVEN_GPIO_NUM
- ODD_GPIO_NUM
- OCC_STATE_IDX
- EVENODD_IDX
- INPUT_MASK_IDX
- NEG_INPUTSEL_START
- POS_INPUTSEL_START

Functions

- Sys_LSAD_Gain_Offset : Convert a gain and offset value from NVR in integer format to float format.
- Sys_LSAD_TempSensor_Gain_Offset : Convert a gain and offset value from NVR in integer format to float format for the temperature sensor.
- Sys_LSAD_TrimsInit : Loads ATE trim values specific to the LSAD.
- Sys_LSAD_ModeConfig : Configure the LSAD to use either normal or continuous mode.
- Sys_LSAD_AlarmConfig : Configure the LSAD monitor alarm.
- Sys_LSAD_InterruptEnable : Sets LSAD interrupt to occur on conversion of the selected channel.
- Sys_LSAD_Start : Start LSAD measurements at the frequency determined by the specified prescale.
- Sys_LSAD_Stop : Stop LSAD measurements.
- Sys_LSAD_InputConfig : Configure LSAD channel inputs.
- Sys_LSAD_Special_InputConfig : Read special LSAD configuration from the LSAD_SpecialCfg array.
- Sys_LSAD_PreSelectWrite : Set LSAD->PRE_SEL_INPUT and return configuration which is written to LSAD->INPUT_SEL[channel].
- Sys_LSAD_GPIO_InputConfig : This function reads GPIO configuration from LSAD_GPIOCfg array.
- Sys_LSAD_GetRawData : Obtain the latest data from the DATA_TRIM_CH register.
- Sys_LSAD_ConvertToMVUntrimmed : Convert data from DATA_TRIM_CH to millivolts using calibrated trim data.
- Sys_LSAD_ConvertToMVTrimmed : Convert data from DATA_TRIM_CH to millivolts without using calibrated trim data.
- Sys_LSAD_NewSampleClear : Clears the ready bit from the MONITOR_STATUS register to acknowledge the most recent LSAD sample and indicate that the next sample will not cause an overrun.