|
SmartSnippets DA1459x SDK
|
Access to specific hw_gpadc_config_t structure members and other essential configuration tweaks. More...
Functions | |
| __STATIC_INLINE void | hw_gpadc_set_continuous (bool enabled) |
| Set continuous mode. More... | |
| __STATIC_INLINE bool | hw_gpadc_get_continuous (void) |
| Get continuous mode state. More... | |
| __STATIC_INLINE void | hw_gpadc_set_input_mode (HW_GPADC_INPUT_MODE mode) |
| Set input mode. More... | |
| __STATIC_INLINE HW_GPADC_INPUT_MODE | hw_gpadc_get_input_mode (void) |
| Get the current input mode. More... | |
| __STATIC_INLINE void | hw_gpadc_set_oversampling (HW_GPADC_OVERSAMPLING n_samples) |
| Set oversampling. More... | |
| __STATIC_INLINE HW_GPADC_OVERSAMPLING | hw_gpadc_get_oversampling (void) |
| Get the current oversampling. More... | |
| __STATIC_INLINE void | hw_gpadc_set_mute (bool enabled) |
| Set input mute state. More... | |
| __STATIC_INLINE bool | hw_gpadc_get_mute (void) |
| Get the current input mute state. More... | |
| __STATIC_INLINE void | hw_gpadc_set_sign_change (bool enabled) |
| Set input and output sign change. More... | |
| __STATIC_INLINE bool | hw_gpadc_get_sign_change (void) |
| Get the current input and output sign change. More... | |
| __STATIC_INLINE void | hw_gpadc_set_chopping (bool enabled) |
| Set chopping state. More... | |
| __STATIC_INLINE bool | hw_gpadc_get_chopping (void) |
| Get the current chopping state. More... | |
| __STATIC_INLINE void | hw_gpadc_set_mint (bool enabled) |
| Set masked interrupt. More... | |
| __STATIC_INLINE bool | hw_gpadc_get_mint (void) |
| Get masked interrupt state. More... | |
| __STATIC_INLINE void | hw_gpadc_set_ldo_constant_current (bool enabled) |
| Set state of constant 20uA load current on ADC LDO output. More... | |
| __STATIC_INLINE bool | hw_gpadc_get_ldo_constant_current (void) |
| Get the current state of constant 20uA load current on ADC LDO output. More... | |
| __STATIC_INLINE void | hw_gpadc_set_interval (uint8_t mult) |
| Set interval between conversions in continuous mode. More... | |
| __STATIC_INLINE uint8_t | hw_gpadc_get_interval (void) |
| Get the current interval between conversions in continuous mode. More... | |
| __STATIC_INLINE void | hw_gpadc_set_dma_functionality (bool enabled) |
| Set DMA functionality. More... | |
| __STATIC_INLINE bool | hw_gpadc_get_dma_functionality (void) |
| Get current state of DMA functionality. More... | |
| __STATIC_INLINE void | hw_gpadc_set_ldo_delay (uint32_t delay) |
| Set the delay required to enable the ADC_LDO. 0: Not allowed 1: 4x ADC_CLK period. n: n*4x ADC_CLK period. More... | |
| __STATIC_INLINE void | hw_gpadc_set_store_delay (HW_GPADC_STORE_DELAY delay) |
| Set STORE_DEL field. More... | |
| __STATIC_INLINE void | hw_gpadc_set_positive (HW_GPADC_INPUT_POSITIVE channel) |
| Set positive input channel. More... | |
| __STATIC_INLINE HW_GPADC_INPUT_POSITIVE | hw_gpadc_get_positive (void) |
| Get the current positive input channel. More... | |
| __STATIC_INLINE void | hw_gpadc_set_negative (HW_GPADC_INPUT_NEGATIVE channel) |
| Set negative input channel. More... | |
| __STATIC_INLINE HW_GPADC_INPUT_NEGATIVE | hw_gpadc_get_negative (void) |
| Get the current negative input channel. More... | |
| __STATIC_INLINE void | hw_gpadc_set_input_attenuator_state (HW_GPADC_MAX_INPUT_VOLTAGE vmax) |
| Set state of input attenuator. More... | |
| __STATIC_INLINE HW_GPADC_MAX_INPUT_VOLTAGE | hw_gpadc_get_input_attenuator_state (void) |
| Get the current state of input attenuator. More... | |
| __STATIC_INLINE void | hw_gpadc_set_sample_time (uint8_t mult) |
| Set sample time. More... | |
| __STATIC_INLINE uint8_t | hw_gpadc_get_sample_time (void) |
| Get the current sample time. The sample time is calculated, based on this register field value. More... | |
| __STATIC_INLINE void | hw_gpadc_set_die_temp (bool enabled) |
| Set DIE_TEMP_EN field. More... | |
| __STATIC_INLINE bool | hw_gpadc_get_die_temp (void) |
| Get the current status of the die-temperature sensor. Output can be measured on GPADC input 4. More... | |
| __STATIC_INLINE void | hw_gpadc_set_ldo_hold (bool enabled) |
| Set the mode of bandgap reference. More... | |
| __STATIC_INLINE bool | hw_gpadc_get_ldo_hold (void) |
| Get the current mode of bandgap reference. More... | |
Access to specific hw_gpadc_config_t structure members and other essential configuration tweaks.
| __STATIC_INLINE bool hw_gpadc_get_chopping | ( | void | ) |
Get the current chopping state.
| __STATIC_INLINE bool hw_gpadc_get_continuous | ( | void | ) |
Get continuous mode state.
| __STATIC_INLINE bool hw_gpadc_get_die_temp | ( | void | ) |
Get the current status of the die-temperature sensor. Output can be measured on GPADC input 4.
| __STATIC_INLINE bool hw_gpadc_get_dma_functionality | ( | void | ) |
Get current state of DMA functionality.
| __STATIC_INLINE HW_GPADC_MAX_INPUT_VOLTAGE hw_gpadc_get_input_attenuator_state | ( | void | ) |
Get the current state of input attenuator.
| __STATIC_INLINE HW_GPADC_INPUT_MODE hw_gpadc_get_input_mode | ( | void | ) |
Get the current input mode.
return input mode
| __STATIC_INLINE uint8_t hw_gpadc_get_interval | ( | void | ) |
Get the current interval between conversions in continuous mode.
| __STATIC_INLINE bool hw_gpadc_get_ldo_constant_current | ( | void | ) |
Get the current state of constant 20uA load current on ADC LDO output.
| __STATIC_INLINE bool hw_gpadc_get_ldo_hold | ( | void | ) |
Get the current mode of bandgap reference.
| __STATIC_INLINE bool hw_gpadc_get_mint | ( | void | ) |
Get masked interrupt state.
| __STATIC_INLINE bool hw_gpadc_get_mute | ( | void | ) |
| __STATIC_INLINE HW_GPADC_INPUT_NEGATIVE hw_gpadc_get_negative | ( | void | ) |
Get the current negative input channel.
| __STATIC_INLINE HW_GPADC_OVERSAMPLING hw_gpadc_get_oversampling | ( | void | ) |
Get the current oversampling.
| __STATIC_INLINE HW_GPADC_INPUT_POSITIVE hw_gpadc_get_positive | ( | void | ) |
Get the current positive input channel.
| __STATIC_INLINE uint8_t hw_gpadc_get_sample_time | ( | void | ) |
Get the current sample time. The sample time is calculated, based on this register field value.
| __STATIC_INLINE bool hw_gpadc_get_sign_change | ( | void | ) |
Get the current input and output sign change.
| __STATIC_INLINE void hw_gpadc_set_chopping | ( | bool | enabled | ) |
Set chopping state.
Once enabled, two samples with opposite polarity are taken to cancel offset.
| [in] | enabled | chopping state |
| __STATIC_INLINE void hw_gpadc_set_continuous | ( | bool | enabled | ) |
Set continuous mode.
With continuous mode enabled ADC will automatically restart conversion once completed. It's still required to start 1st conversion using hw_gpadc_start(). Interval between subsequent conversions can be adjusted using hw_gpadc_set_interval().
| [in] | enabled | continuous mode state |
| __STATIC_INLINE void hw_gpadc_set_die_temp | ( | bool | enabled | ) |
Set DIE_TEMP_EN field.
Enables the die-temperature sensor. Output can be measured on GPADC input 4.
| [in] | enabled | enable/disable the die-temperature sensor |
| __STATIC_INLINE void hw_gpadc_set_dma_functionality | ( | bool | enabled | ) |
Set DMA functionality.
| [in] | enabled | True to enable DMA functionality, false to disable it |
| __STATIC_INLINE void hw_gpadc_set_input_attenuator_state | ( | HW_GPADC_MAX_INPUT_VOLTAGE | vmax | ) |
Set state of input attenuator.
Enabling the internal attenuator scales input voltage, increasing the effective input scale from 0-1.2V to 0-3.6V in single ended mode or from -1.2-1.2V to -3.6-3.6V in differential mode.
| [in] | vmax | attenuator state |
| __STATIC_INLINE void hw_gpadc_set_input_mode | ( | HW_GPADC_INPUT_MODE | mode | ) |
Set input mode.
| [in] | mode | input mode |
| __STATIC_INLINE void hw_gpadc_set_interval | ( | uint8_t | mult | ) |
Set interval between conversions in continuous mode.
Interval time is mult x 1.024ms. Valid values are 0-255.
| [in] | mult | multiplier |
| __STATIC_INLINE void hw_gpadc_set_ldo_constant_current | ( | bool | enabled | ) |
Set state of constant 20uA load current on ADC LDO output.
Constant 20uA load current on LDO output can be enabled so that the current will not drop to 0.
| [in] | enabled | load current state |
| __STATIC_INLINE void hw_gpadc_set_ldo_delay | ( | uint32_t | delay | ) |
Set the delay required to enable the ADC_LDO. 0: Not allowed 1: 4x ADC_CLK period. n: n*4x ADC_CLK period.
param [in] LDO enable delay
| __STATIC_INLINE void hw_gpadc_set_ldo_hold | ( | bool | enabled | ) |
Set the mode of bandgap reference.
0: GPADC LDO tracking bandgap reference (default) 1: GPADC LDO hold sampled bandgap reference
| [in] | enabled | ldo bandgap reference mode |
| __STATIC_INLINE void hw_gpadc_set_mint | ( | bool | enabled | ) |
Set masked interrupt.
| [in] | enabled | masked interrupt |
| __STATIC_INLINE void hw_gpadc_set_mute | ( | bool | enabled | ) |
Set input mute state.
Once enabled, samples are taken at mid-scale to determine internal offset and/or notice of the ADC with regards to VDD_REF.
| [in] | enabled | mute state |
| __STATIC_INLINE void hw_gpadc_set_negative | ( | HW_GPADC_INPUT_NEGATIVE | channel | ) |
Set negative input channel.
| [in] | channel | negative input channel |
| __STATIC_INLINE void hw_gpadc_set_oversampling | ( | HW_GPADC_OVERSAMPLING | n_samples | ) |
Set oversampling.
With oversampling enabled multiple successive conversions will be executed and results are added together to increase effective number of bits in result.
Number of samples taken is 2n_samples. Valid values for n_samples are 0-7 thus at most 128 samples can be taken. In this case, 17bits of result are generated with the least significant bit being discarded.
| [in] | n_samples | number of samples to be taken |
| __STATIC_INLINE void hw_gpadc_set_positive | ( | HW_GPADC_INPUT_POSITIVE | channel | ) |
Set positive input channel.
| [in] | channel | positive input channel |
| __STATIC_INLINE void hw_gpadc_set_sample_time | ( | uint8_t | mult | ) |
Set sample time.
Sample time is mult x 8 clock cycles or 1 clock cycle when mult is 0. Valid values are 0-15.
| [in] | mult | multiplier |
| __STATIC_INLINE void hw_gpadc_set_sign_change | ( | bool | enabled | ) |
Set input and output sign change.
Once enabled, sign of ADC input and output is changed.
| [in] | enabled | sign change state |
| __STATIC_INLINE void hw_gpadc_set_store_delay | ( | HW_GPADC_STORE_DELAY | delay | ) |
Set STORE_DEL field.
0: Data is stored after handshake synchronization 1-3: Reserved 4: Data is stored 5 ADC_CLK cycles after internal start trigger 7: Data is stored 8 ADC_CLK cycles after internal start trigger
| [in] | delay | store delay setting |
1.8.16