Functions
Basic Configuration
Peripheral Driver » LL Driver » ADC » Functions

## Functions
__STATIC_INLINE void | ll_adc_enable (void)
| Enable ADC module. More...
__STATIC_INLINE void | ll_adc_disable (void)
| Disable ADC module. More...
__STATIC_INLINE uint32_t | ll_adc_is_enabled (void)
| Check if ADC module is enabled. More...
__STATIC_INLINE void | ll_adc_disable_clock (void)
| Disable ADC clock. More...
__STATIC_INLINE uint32_t | ll_adc_is_enabled_clock (void)
| Check if ADC clock is enabled. More...
__STATIC_INLINE void | ll_adc_set_clock (uint32_t clk)
| Set ADC clock source. More...
__STATIC_INLINE uint32_t | ll_adc_get_clock (void)
| Return source for ADC clock. More...
__STATIC_INLINE void | ll_adc_set_ref_value (uint32_t value)
| Set ADC bias reference. More...
__STATIC_INLINE uint32_t | ll_adc_get_ref_value (void)
| Return ADC bias reference. More...
__STATIC_INLINE void | ll_adc_enable_temp (void)
| Enable temperature sensor. More...
__STATIC_INLINE void | ll_adc_disable_temp (void)
| Disable temperature sensor. More...
__STATIC_INLINE uint32_t | ll_adc_is_enabled_temp (void)
| Check if temperature sensor is enabled. More...
__STATIC_INLINE void | ll_adc_enable_vbat (void)
| Enable Vbattery sensor. More...
__STATIC_INLINE void | ll_adc_disable_vbat (void)
| Disable Vbattery sensor. More...
__STATIC_INLINE uint32_t | ll_adc_is_enabled_vbat (void)
| Check if Vbattery sensor is enabled. More...
__STATIC_INLINE void | ll_adc_set_input_mode (uint32_t mode)
| Set ADC input mode. More...
__STATIC_INLINE uint32_t | ll_adc_get_input_mode (void)
| Return ADC input mode. More...
__STATIC_INLINE void | ll_adc_enable_ofs_cal (void)
| Enable offset calibration. More...
__STATIC_INLINE void | ll_adc_disable_ofs_cal (void)
| Disable offset calibration. More...
__STATIC_INLINE uint32_t | ll_adc_is_enabled_ofs_cal (void)
| Check if offset calibration is enabled. More...
__STATIC_INLINE void | ll_adc_set_dynamic_rang (uint32_t rang)
| Set dynamic rang of ADC. More...
__STATIC_INLINE uint32_t | ll_adc_get_dynamic_rang (void)
| Return ADC dynamic rang. More...
__STATIC_INLINE void | ll_adc_set_channelp (uint32_t source)
| Set source of ADC input channelP. More...
__STATIC_INLINE uint32_t | ll_adc_get_channelp (void)
| Return source of ADC input channelP. More...
__STATIC_INLINE void | ll_adc_set_channeln (uint32_t source)
| Set source of ADC input channelN. More...
__STATIC_INLINE uint32_t | ll_adc_get_channeln (void)
| Return source of ADC input channelN. More...
__STATIC_INLINE void | ll_adc_enable_mas_rst (void)
| Enable ADC MAS_RST. More...
__STATIC_INLINE void | ll_adc_disable_mas_rst (void)
| Disable ADC MAS_RST. More...
__STATIC_INLINE uint32_t | ll_adc_is_enabled_mas_rst (void)
| Check if ADC MAS_RST is enabled. More...
__STATIC_INLINE void | ll_adc_set_ref (uint32_t source)
| Set source of ADC reference. More...
__STATIC_INLINE uint32_t | ll_adc_get_ref (void)
| Return source of ADC reference. More...
__STATIC_INLINE void | ll_adc_set_ref_current (uint32_t source)
| Set current of ADC reference circuit. More...
__STATIC_INLINE uint32_t | ll_adc_get_ref_current (void)
| Return current of ADC reference circuit. More...

## Detailed Description

## Function Documentation

## ◆ ll_adc_disable()

__STATIC_INLINE void ll_adc_disable | ( | void |  | ) |

Disable ADC module.

Register|BitsName --------|-------- SNSADC_CFG | REG4

Return values

  None |

Definition at line 278 of file ll_adc.h.

## ◆ ll_adc_disable_clock()

__STATIC_INLINE void ll_adc_disable_clock | ( | void |  | ) |

Disable ADC clock.

Register|BitsName --------|-------- MSIO_PAD_CFG_1 | ADC_CLK_EN

Return values

  None |

Definition at line 306 of file ll_adc.h.

## ◆ ll_adc_disable_mas_rst()

__STATIC_INLINE void ll_adc_disable_mas_rst | ( | void |  | ) |

Disable ADC MAS_RST.

Register|BitsName --------|-------- SNSADC_CFG | REG4

Return values

  None |

Definition at line 707 of file ll_adc.h.

## ◆ ll_adc_disable_ofs_cal()

__STATIC_INLINE void ll_adc_disable_ofs_cal | ( | void |  | ) |

Disable offset calibration.

Register|BitsName --------|-------- SNSADC_CFG | REG2

Return values

  None |

Definition at line 549 of file ll_adc.h.

## ◆ ll_adc_disable_temp()

__STATIC_INLINE void ll_adc_disable_temp | ( | void |  | ) |

Disable temperature sensor.

Register|BitsName --------|-------- SNSADC_CFG | REG2

Return values

  None |

Definition at line 430 of file ll_adc.h.

## ◆ ll_adc_disable_vbat()

__STATIC_INLINE void ll_adc_disable_vbat | ( | void |  | ) |

Disable Vbattery sensor.

Register|BitsName --------|-------- SNSADC_CFG | REG2

Return values

  None |

Definition at line 472 of file ll_adc.h.

## ◆ ll_adc_enable()

__STATIC_INLINE void ll_adc_enable | ( | void |  | ) |

Enable ADC module.

Register|BitsName --------|-------- SNSADC_CFG | REG4

Return values

  None |

Definition at line 264 of file ll_adc.h.

## ◆ ll_adc_enable_mas_rst()

__STATIC_INLINE void ll_adc_enable_mas_rst | ( | void |  | ) |

Enable ADC MAS_RST.

Register|BitsName --------|-------- SNSADC_CFG | REG4

Return values

  None |

Definition at line 693 of file ll_adc.h.

## ◆ ll_adc_enable_ofs_cal()

__STATIC_INLINE void ll_adc_enable_ofs_cal | ( | void |  | ) |

Enable offset calibration.

Note
  Enable offset calibration, used to swap inputs of comparator for offset calibration.

Register|BitsName --------|-------- SNSADC_CFG | REG2

Return values

  None |

Definition at line 535 of file ll_adc.h.

## ◆ ll_adc_enable_temp()

__STATIC_INLINE void ll_adc_enable_temp | ( | void |  | ) |

Enable temperature sensor.

Register|BitsName --------|-------- SNSADC_CFG | REG2

Return values

  None |

Definition at line 416 of file ll_adc.h.

## ◆ ll_adc_enable_vbat()

__STATIC_INLINE void ll_adc_enable_vbat | ( | void |  | ) |

Enable Vbattery sensor.

Register|BitsName --------|-------- SNSADC_CFG | REG2

Return values

  None |

Definition at line 458 of file ll_adc.h.

## ◆ ll_adc_get_channeln()

__STATIC_INLINE uint32_t ll_adc_get_channeln | ( | void |  | ) |

Return source of ADC input channelN.

Register|BitsName --------|-------- SNSADC_CFG | REG3

Return values

  Returned | value can be one of the following values: LL_ADC_INPUT_SRC_IO0 LL_ADC_INPUT_SRC_IO1 LL_ADC_INPUT_SRC_IO2 LL_ADC_INPUT_SRC_IO3 LL_ADC_INPUT_SRC_IO4 LL_ADC_INPUT_SRC_TMP LL_ADC_INPUT_SRC_BAT

Definition at line 679 of file ll_adc.h.

## ◆ ll_adc_get_channelp()

__STATIC_INLINE uint32_t ll_adc_get_channelp | ( | void |  | ) |

Return source of ADC input channelP.

Register|BitsName --------|-------- SNSADC_CFG | REG3

Return values

  Returned | value can be one of the following values: LL_ADC_INPUT_SRC_IO0 LL_ADC_INPUT_SRC_IO1 LL_ADC_INPUT_SRC_IO2 LL_ADC_INPUT_SRC_IO3 LL_ADC_INPUT_SRC_IO4 LL_ADC_INPUT_SRC_TMP LL_ADC_INPUT_SRC_BAT

Definition at line 636 of file ll_adc.h.

## ◆ ll_adc_get_clock()

__STATIC_INLINE uint32_t ll_adc_get_clock | ( | void |  | ) |

Return source for ADC clock.

Register|BitsName --------|-------- MSIO_PAD_CFG_1 | ADC_CLK_SEL

Return values

  Returned | value can be one of the following values: LL_ADC_CLK_16M LL_ADC_CLK_8M LL_ADC_CLK_4M LL_ADC_CLK_1M LL_ADC_CLK_16K LL_ADC_CLK_8K LL_ADC_CLK_4K LL_ADC_CLK_NONE

Definition at line 365 of file ll_adc.h.

## ◆ ll_adc_get_dynamic_rang()

__STATIC_INLINE uint32_t ll_adc_get_dynamic_rang | ( | void |  | ) |

Return ADC dynamic rang.

Register|BitsName --------|-------- SNSADC_CFG | REG2

Return values

  Returned | value can be a value between: 1 ~ 7

Definition at line 593 of file ll_adc.h.

## ◆ ll_adc_get_input_mode()

__STATIC_INLINE uint32_t ll_adc_get_input_mode | ( | void |  | ) |

Return ADC input mode.

Register|BitsName --------|-------- SNSADC_CFG | REG2

Return values

  Returned | value can be one of the following values: LL_ADC_INPUT_SINGLE LL_ADC_INPUT_DIFFERENTIAL

Definition at line 519 of file ll_adc.h.

## ◆ ll_adc_get_ref()

__STATIC_INLINE uint32_t ll_adc_get_ref | ( | void |  | ) |

Return source of ADC reference.

Register|BitsName --------|-------- SNSADC_CFG | REG4

Return values

  Returned | value can be one of the following values: LL_ADC_REF_SRC_BUF_INT LL_ADC_REF_SRC_IO0 LL_ADC_REF_SRC_IO1 LL_ADC_REF_SRC_IO2 LL_ADC_REF_SRC_IO3

Definition at line 760 of file ll_adc.h.

## ◆ ll_adc_get_ref_current()

__STATIC_INLINE uint32_t ll_adc_get_ref_current | ( | void |  | ) |

Return current of ADC reference circuit.

Register|BitsName --------|-------- SNSADC_CFG | REG4

Return values

  Returned | value can be a value between: 0 ~ 7

Definition at line 791 of file ll_adc.h.

## ◆ ll_adc_get_ref_value()

__STATIC_INLINE uint32_t ll_adc_get_ref_value | ( | void |  | ) |

Return ADC bias reference.

Register|BitsName --------|-------- SNSADC_CFG | REG1

Return values

  Returned | value can be one of the following values: LL_ADC_REF_VALUE_0P8 LL_ADC_REF_VALUE_1P2 LL_ADC_REF_VALUE_1P6 LL_ADC_REF_VALUE_2P0

Definition at line 402 of file ll_adc.h.

## ◆ ll_adc_is_enabled()

__STATIC_INLINE uint32_t ll_adc_is_enabled | ( | void |  | ) |

Check if ADC module is enabled.

Register|BitsName --------|-------- SNSADC_CFG | REG4

Return values

  State | of bit (1 or 0).

Definition at line 292 of file ll_adc.h.

## ◆ ll_adc_is_enabled_clock()

__STATIC_INLINE uint32_t ll_adc_is_enabled_clock | ( | void |  | ) |

Check if ADC clock is enabled.

Register|BitsName --------|-------- MSIO_PAD_CFG_1 | ADC_CLK_EN

Return values

  State | of bit (1 or 0).

Definition at line 320 of file ll_adc.h.

## ◆ ll_adc_is_enabled_mas_rst()

__STATIC_INLINE uint32_t ll_adc_is_enabled_mas_rst | ( | void |  | ) |

Check if ADC MAS_RST is enabled.

Register|BitsName --------|-------- SNSADC_CFG | REG4

Return values

  State | of bit (1 or 0).

Definition at line 721 of file ll_adc.h.

## ◆ ll_adc_is_enabled_ofs_cal()

__STATIC_INLINE uint32_t ll_adc_is_enabled_ofs_cal | ( | void |  | ) |

Check if offset calibration is enabled.

Register|BitsName --------|-------- SNSADC_CFG | REG2

Return values

  State | of bit (1 or 0).

Definition at line 563 of file ll_adc.h.

## ◆ ll_adc_is_enabled_temp()

__STATIC_INLINE uint32_t ll_adc_is_enabled_temp | ( | void |  | ) |

Check if temperature sensor is enabled.

Register|BitsName --------|-------- SNSADC_CFG | REG2

Return values

  State | of bit (1 or 0).

Definition at line 444 of file ll_adc.h.

## ◆ ll_adc_is_enabled_vbat()

__STATIC_INLINE uint32_t ll_adc_is_enabled_vbat | ( | void |  | ) |

Check if Vbattery sensor is enabled.

Register|BitsName --------|-------- SNSADC_CFG | REG2

Return values

  State | of bit (1 or 0).

Definition at line 486 of file ll_adc.h.

## ◆ ll_adc_set_channeln()

__STATIC_INLINE void ll_adc_set_channeln | ( | uint32_t | source | ) |

Set source of ADC input channelN.

Register|BitsName --------|-------- SNSADC_CFG | REG3

Parameters

  source | This parameter can be one of the following values: LL_ADC_INPUT_SRC_IO0 LL_ADC_INPUT_SRC_IO1 LL_ADC_INPUT_SRC_IO2 LL_ADC_INPUT_SRC_IO3 LL_ADC_INPUT_SRC_IO4 LL_ADC_INPUT_SRC_TMP LL_ADC_INPUT_SRC_BAT

Return values

  None |

Definition at line 658 of file ll_adc.h.

## ◆ ll_adc_set_channelp()

__STATIC_INLINE void ll_adc_set_channelp | ( | uint32_t | source | ) |

Set source of ADC input channelP.

Register|BitsName --------|-------- SNSADC_CFG | REG3

Parameters

  source | This parameter can be one of the following values: LL_ADC_INPUT_SRC_IO0 LL_ADC_INPUT_SRC_IO1 LL_ADC_INPUT_SRC_IO2 LL_ADC_INPUT_SRC_IO3 LL_ADC_INPUT_SRC_IO4 LL_ADC_INPUT_SRC_TMP LL_ADC_INPUT_SRC_BAT

Return values

  None |

Definition at line 615 of file ll_adc.h.

## ◆ ll_adc_set_clock()

__STATIC_INLINE void ll_adc_set_clock | ( | uint32_t | clk | ) |

Set ADC clock source.

Register|BitsName --------|-------- MSIO_PAD_CFG_1 | ADC_CLK_SEL

Parameters

  clk | This parameter can be one of the following values: LL_ADC_CLK_16M LL_ADC_CLK_8M LL_ADC_CLK_4M LL_ADC_CLK_1M LL_ADC_CLK_16K LL_ADC_CLK_8K LL_ADC_CLK_4K LL_ADC_CLK_NONE

Return values

  None |

Definition at line 343 of file ll_adc.h.

## ◆ ll_adc_set_dynamic_rang()

__STATIC_INLINE void ll_adc_set_dynamic_rang | ( | uint32_t | rang | ) |

Set dynamic rang of ADC.

Note
  When higher input signal frequencies close to Nyquist rate, you should set 1.

Register|BitsName --------|-------- SNSADC_CFG | REG2

Parameters

  rang | This parameter can be a value between: 1 ~ 7

Return values

  None |

Definition at line 579 of file ll_adc.h.

## ◆ ll_adc_set_input_mode()

__STATIC_INLINE void ll_adc_set_input_mode | ( | uint32_t | mode | ) |

Set ADC input mode.

Register|BitsName --------|-------- SNSADC_CFG | REG2

Parameters

  mode | This parameter can be one of the following values: LL_ADC_INPUT_SINGLE LL_ADC_INPUT_DIFFERENTIAL

Return values

  None |

Definition at line 503 of file ll_adc.h.

## ◆ ll_adc_set_ref()

__STATIC_INLINE void ll_adc_set_ref | ( | uint32_t | source | ) |

Set source of ADC reference.

Register|BitsName --------|-------- SNSADC_CFG | REG4

Parameters

  source | This parameter can be one of the following values: LL_ADC_REF_SRC_BUF_INT LL_ADC_REF_SRC_IO0 LL_ADC_REF_SRC_IO1 LL_ADC_REF_SRC_IO2 LL_ADC_REF_SRC_IO3

Return values

  None |

Definition at line 741 of file ll_adc.h.

## ◆ ll_adc_set_ref_current()

__STATIC_INLINE void ll_adc_set_ref_current | ( | uint32_t | source | ) |

Set current of ADC reference circuit.

Note
  When samples at 100kbps, you should set 0. When samples at 1mbps, you should set 7.

Register|BitsName --------|-------- SNSADC_CFG | REG4

Parameters

  source | This parameter can be a value between: 0 ~ 7

Return values

  None |

Definition at line 777 of file ll_adc.h.

## ◆ ll_adc_set_ref_value()

__STATIC_INLINE void ll_adc_set_ref_value | ( | uint32_t | value | ) |

Set ADC bias reference.

Register|BitsName --------|-------- SNSADC_CFG | REG1

Parameters

  value | This parameter can be one of the following values: LL_ADC_REF_VALUE_0P8 LL_ADC_REF_VALUE_1P2 LL_ADC_REF_VALUE_1P6 LL_ADC_REF_VALUE_2P0

Return values

  None |

Definition at line 384 of file ll_adc.h.