LSAD Function Documentation
Sys_LSAD_Gain_Offset
void Sys_LSAD_Gain_Offset(const volatile struct LSAD_TRIM * i_gain_offset, struct F_LSAD_TRIM * f_gain_offset)
Location: lsad.h:79
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
i_gain_offset |
Gain and offset error from NVR, raw integer form |
|
out |
f_gain_offset |
Gain and offset error converted to floating point. |
Sys_LSAD_TempSensor_Gain_Offset
void Sys_LSAD_TempSensor_Gain_Offset(const volatile struct TEMP_SENSOR_TRIM * i_gain_offset, struct F_LSAD_TRIM * f_gain_offset)
Location: lsad.h:100
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
i_gain_offset |
Gain and offset error from NVR, raw integer form |
|
out |
f_gain_offset |
Gain and offset error converted to floating point. |
Sys_LSAD_InputConfig
uint32_t Sys_LSAD_InputConfig(uint32_t num, uint32_t source, uint32_t pos_gpio, uint32_t neg_gpio)
Location: lsad.h:124
Returns:
| Example Code for Sys_LSAD_InputConfig |
// Use LSAD channel 0 // Set LSAD positive source to gpio selection source 1 and negative source to // ground // Connect GPIO 7 to the LSAD // No GPIO used for negative input (-1) Sys_LSAD_InputConfig(0, LSAD_POS_INPUT_SEL1 | LSAD_NEG_INPUT_GND, GPIO7, -1); |
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
num |
Channel number; use an integer |
|
in |
source |
Select ADC channel input source use LSAD_[POS | NEG]_INPUT_[SEL* | AOUT | VBAT | TEMP | GND]. |
|
in |
pos_gpio |
Select GPIO to use for positive input(if applicable); use an integer. If no GPIO used, use a negative integer. |
|
in |
neg_gpio |
Select GPIO to use for negative input(if applicable); use an integer. If no GPIO used, use a negative integer. |