SmartSnippets DA1459x SDK
Functions

Gain and offset calibration. More...

Functions

__STATIC_INLINE void hw_gpadc_set_offset_positive (uint16_t offset)
 Set offset adjustment for positive ADC array. This register offers a coarse offset calibration, whereas a finer calibration occurs in the hw_gpadc_apply_correction, using the device trim values (positive/negative offsets, gain correction) stored in the Configuration Script. More...
 
__STATIC_INLINE uint16_t hw_gpadc_get_offset_positive (void)
 Get the current offset adjustment for positive ADC array. More...
 
__STATIC_INLINE void hw_gpadc_set_offset_negative (uint16_t offset)
 Set offset adjustment for negative ADC array. This register offers a coarse offset calibration, whereas a finer calibration occurs in the hw_gpadc_apply_correction, using the device trim values (positive/negative offsets, gain correction) stored in the Configuration Script. More...
 
__STATIC_INLINE uint16_t hw_gpadc_get_offset_negative (void)
 Get the current offset adjustment for negative ADC array. More...
 
void hw_gpadc_store_se_gain_error (int16_t single)
 Store Single Ended ADC Gain Error. More...
 
void hw_gpadc_store_diff_gain_error (int16_t diff)
 Store Differential ADC Gain Error. More...
 
void hw_gpadc_store_se_offset_error (int16_t single)
 Store Single Ended ADC Offset Error. More...
 
void hw_gpadc_store_diff_offset_error (int16_t diff)
 Store Differential ADC Offset Error. More...
 
__STATIC_INLINE int16_t hw_gpadc_calculate_single_ended_gain_error (int16_t low, int16_t high)
 Calculate Single Ended ADC Gain Error from two points. More...
 
__STATIC_INLINE int16_t hw_gpadc_calculate_single_ended_offset_error (int16_t low, int16_t high)
 Calculate Single Ended ADC Offset Error from two points. More...
 
__STATIC_INLINE int16_t hw_gpadc_calculate_differential_gain_error (int16_t low, int16_t high)
 Calculate Differential ADC Gain Error from two points. More...
 
__STATIC_INLINE int16_t hw_gpadc_calculate_differential_offset_error (int16_t low, int16_t high)
 Calculate Differential ADC Offset Error from two points. More...
 
bool hw_gpadc_pre_check_for_gain_error (void)
 Check the availability of ADC Gain Error. More...
 
int16_t hw_gpadc_get_single_ended_gain_error (void)
 Get single ended ADC Gain Error. More...
 
void hw_gpadc_offset_calibrate (void)
 Perform coarse ADC offset calibration. More...
 

Detailed Description

Gain and offset calibration.

Function Documentation

◆ hw_gpadc_calculate_differential_gain_error()

__STATIC_INLINE int16_t hw_gpadc_calculate_differential_gain_error ( int16_t  low,
int16_t  high 
)

Calculate Differential ADC Gain Error from two points.

Parameters
[in]lowmeasurement at the low end of the full scale
[in]highmeasurement at the high end of the full scale
Returns
Differential ADC Gain Error
Note
Valid return range (-2048, 2048)

◆ hw_gpadc_calculate_differential_offset_error()

__STATIC_INLINE int16_t hw_gpadc_calculate_differential_offset_error ( int16_t  low,
int16_t  high 
)

Calculate Differential ADC Offset Error from two points.

Parameters
[in]lowmeasurement at the low end of the full scale
[in]highmeasurement at the high end of the full scale
Returns
Differential ADC Offset Error
Note
Valid return range (-512, 512)

◆ hw_gpadc_calculate_single_ended_gain_error()

__STATIC_INLINE int16_t hw_gpadc_calculate_single_ended_gain_error ( int16_t  low,
int16_t  high 
)

Calculate Single Ended ADC Gain Error from two points.

Parameters
[in]lowmeasurement at the low end of the full scale
[in]highmeasurement at the high end of the full scale
Returns
Single Ended ADC Gain Error
Note
Valid return range (-2048, 2048)

◆ hw_gpadc_calculate_single_ended_offset_error()

__STATIC_INLINE int16_t hw_gpadc_calculate_single_ended_offset_error ( int16_t  low,
int16_t  high 
)

Calculate Single Ended ADC Offset Error from two points.

Parameters
[in]lowmeasurement at the low end of the full scale
[in]highmeasurement at the high end of the full scale
Returns
Single Ended ADC Offset Error
Note
Valid return range (-512, 512)

◆ hw_gpadc_get_offset_negative()

__STATIC_INLINE uint16_t hw_gpadc_get_offset_negative ( void  )

Get the current offset adjustment for negative ADC array.

Returns
offset value
See also
hw_gpadc_set_offset_negative

◆ hw_gpadc_get_offset_positive()

__STATIC_INLINE uint16_t hw_gpadc_get_offset_positive ( void  )

Get the current offset adjustment for positive ADC array.

Returns
offset value
See also
hw_gpadc_set_offset_positive

◆ hw_gpadc_get_single_ended_gain_error()

int16_t hw_gpadc_get_single_ended_gain_error ( void  )

Get single ended ADC Gain Error.

Returns
ADC Gain Error

◆ hw_gpadc_offset_calibrate()

void hw_gpadc_offset_calibrate ( void  )

Perform coarse ADC offset calibration.

A coarse offset calibration is performed at runtime. Dependent on the current

See also
HW_GPADC_INPUT_MODE. The calibration must be done with specific configuration settings of the ADC. The driver configuration is saved and re-applied after calibration. The outcome is saved in the OFFP and OFFN registers. Re-calibrate if the input mode is changed OR these OFFP/OFFN registers are reset to their defaults.

◆ hw_gpadc_pre_check_for_gain_error()

bool hw_gpadc_pre_check_for_gain_error ( void  )

Check the availability of ADC Gain Error.

Returns
ADC Gain Error availability

◆ hw_gpadc_set_offset_negative()

__STATIC_INLINE void hw_gpadc_set_offset_negative ( uint16_t  offset)

Set offset adjustment for negative ADC array. This register offers a coarse offset calibration, whereas a finer calibration occurs in the hw_gpadc_apply_correction, using the device trim values (positive/negative offsets, gain correction) stored in the Configuration Script.

Parameters
[in]offsetoffset value
See also
hw_gpadc_offset_calibrate
hw_gpadc_apply_correction
hw_gpadc_set_positive_offset

◆ hw_gpadc_set_offset_positive()

__STATIC_INLINE void hw_gpadc_set_offset_positive ( uint16_t  offset)

Set offset adjustment for positive ADC array. This register offers a coarse offset calibration, whereas a finer calibration occurs in the hw_gpadc_apply_correction, using the device trim values (positive/negative offsets, gain correction) stored in the Configuration Script.

Parameters
[in]offsetoffset value
See also
hw_gpadc_offset_calibrate
hw_gpadc_apply_correction
hw_gpadc_set_negative_offset

◆ hw_gpadc_store_diff_gain_error()

void hw_gpadc_store_diff_gain_error ( int16_t  diff)

Store Differential ADC Gain Error.

Parameters
[in]diffADC Differential Gain Error

◆ hw_gpadc_store_diff_offset_error()

void hw_gpadc_store_diff_offset_error ( int16_t  diff)

Store Differential ADC Offset Error.

Parameters
[in]diffADC Differential Offset Error

◆ hw_gpadc_store_se_gain_error()

void hw_gpadc_store_se_gain_error ( int16_t  single)

Store Single Ended ADC Gain Error.

Parameters
[in]singleADC Single Ended Gain Error

◆ hw_gpadc_store_se_offset_error()

void hw_gpadc_store_se_offset_error ( int16_t  single)

Store Single Ended ADC Offset Error.

Parameters
[in]singleADC Single Ended Offset Error