Functions
Basic Configuration
Peripheral Driver » LL Driver » ADC » Functions
Collaboration diagram for Basic Configuration:

## 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_enable_clock (void)
| Enable ADC clock. 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.

\rst +-------------------—+--------------------------—+ | Register | BitsName | +======================+=============================+ | SNSADC_CFG | REG4 | +-------------------—+--------------------------—+ \endrst

Return values

  None |

Definition at line 277 of file gr55xx_ll_adc.h.

## ◆ ll_adc_disable_clock()

__STATIC_INLINE void ll_adc_disable_clock | ( | void |  | ) |

Disable ADC clock.

\rst +-------------------—+--------------------------—+ | Register | BitsName | +======================+=============================+ | MSIO_PAD_CFG_1 | ADC_CLK_EN | +-------------------—+--------------------------—+ \endrst

Return values

  None |

Definition at line 333 of file gr55xx_ll_adc.h.

## ◆ ll_adc_disable_mas_rst()

__STATIC_INLINE void ll_adc_disable_mas_rst | ( | void |  | ) |

Disable ADC MAS_RST.

\rst +-------------------—+--------------------------—+ | Register | BitsName | +======================+=============================+ | SNSADC_CFG | REG4 | +-------------------—+--------------------------—+ \endrst

Return values

  None |

Definition at line 828 of file gr55xx_ll_adc.h.

## ◆ ll_adc_disable_ofs_cal()

__STATIC_INLINE void ll_adc_disable_ofs_cal | ( | void |  | ) |

Disable offset calibration.

\rst +-------------------—+--------------------------—+ | Register | BitsName | +======================+=============================+ | SNSADC_CFG | REG2 | +-------------------—+--------------------------—+ \endrst

Return values

  None |

Definition at line 634 of file gr55xx_ll_adc.h.

## ◆ ll_adc_disable_temp()

__STATIC_INLINE void ll_adc_disable_temp | ( | void |  | ) |

Disable temperature sensor.

\rst +-------------------—+--------------------------—+ | Register | BitsName | +======================+=============================+ | SNSADC_CFG | REG2 | +-------------------—+--------------------------—+ \endrst

Return values

  None |

Definition at line 483 of file gr55xx_ll_adc.h.

## ◆ ll_adc_disable_vbat()

__STATIC_INLINE void ll_adc_disable_vbat | ( | void |  | ) |

Disable Vbattery sensor.

\rst +-------------------—+--------------------------—+ | Register | BitsName | +======================+=============================+ | SNSADC_CFG | REG2 | +-------------------—+--------------------------—+ \endrst

Return values

  None |

Definition at line 537 of file gr55xx_ll_adc.h.

## ◆ ll_adc_enable()

__STATIC_INLINE void ll_adc_enable | ( | void |  | ) |

Enable ADC module.

\rst +-------------------—+--------------------------—+ | Register | BitsName | +======================+=============================+ | SNSADC_CFG | REG4 | +-------------------—+--------------------------—+ \endrst

Return values

  None |

Definition at line 259 of file gr55xx_ll_adc.h.

## ◆ ll_adc_enable_clock()

__STATIC_INLINE void ll_adc_enable_clock | ( | void |  | ) |

Enable ADC clock.

\rst +-------------------—+--------------------------—+ | Register | BitsName | +======================+=============================+ | MSIO_PAD_CFG_1 | ADC_CLK_EN | +-------------------—+--------------------------—+ \endrst

Return values

  None |

Definition at line 313 of file gr55xx_ll_adc.h.

## ◆ ll_adc_enable_mas_rst()

__STATIC_INLINE void ll_adc_enable_mas_rst | ( | void |  | ) |

Enable ADC MAS_RST.

\rst +-------------------—+--------------------------—+ | Register | BitsName | +======================+=============================+ | SNSADC_CFG | REG4 | +-------------------—+--------------------------—+ \endrst

Return values

  None |

Definition at line 810 of file gr55xx_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.

\rst +-------------------—+--------------------------—+ | Register | BitsName | +======================+=============================+ | SNSADC_CFG | REG2 | +-------------------—+--------------------------—+ \endrst

Return values

  None |

Definition at line 616 of file gr55xx_ll_adc.h.

## ◆ ll_adc_enable_temp()

__STATIC_INLINE void ll_adc_enable_temp | ( | void |  | ) |

Enable temperature sensor.

\rst +-------------------—+--------------------------—+ | Register | BitsName | +======================+=============================+ | SNSADC_CFG | REG2 | +-------------------—+--------------------------—+ \endrst

Return values

  None |

Definition at line 465 of file gr55xx_ll_adc.h.

## ◆ ll_adc_enable_vbat()

__STATIC_INLINE void ll_adc_enable_vbat | ( | void |  | ) |

Enable Vbattery sensor.

\rst +-------------------—+--------------------------—+ | Register | BitsName | +======================+=============================+ | SNSADC_CFG | REG2 | +-------------------—+--------------------------—+ \endrst

Return values

  None |

Definition at line 519 of file gr55xx_ll_adc.h.

## ◆ ll_adc_get_channeln()

__STATIC_INLINE uint32_t ll_adc_get_channeln | ( | void |  | ) |

Return source of ADC input channelN.

\rst +-------------------—+--------------------------—+ | Register | BitsName | +======================+=============================+ | SNSADC_CFG | REG3 | +-------------------—+--------------------------—+ \endrst

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 792 of file gr55xx_ll_adc.h.

## ◆ ll_adc_get_channelp()

__STATIC_INLINE uint32_t ll_adc_get_channelp | ( | void |  | ) |

Return source of ADC input channelP.

\rst +-------------------—+--------------------------—+ | Register | BitsName | +======================+=============================+ | SNSADC_CFG | REG3 | +-------------------—+--------------------------—+ \endrst

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 741 of file gr55xx_ll_adc.h.

## ◆ ll_adc_get_clock()

__STATIC_INLINE uint32_t ll_adc_get_clock | ( | void |  | ) |

Return source for ADC clock.

\rst +-------------------—+--------------------------—+ | Register | BitsName | +======================+=============================+ | MSIO_PAD_CFG_1 | ADC_CLK_SEL | +-------------------—+--------------------------—+ \endrst

Return values

  Returned | value can be one of the following values: LL_ADC_CLK_16 LL_ADC_CLK_8 LL_ADC_CLK_4 LL_ADC_CLK_2 LL_ADC_CLK_1P6 LL_ADC_CLK_1

Definition at line 404 of file gr55xx_ll_adc.h.

## ◆ ll_adc_get_dynamic_rang()

__STATIC_INLINE uint32_t ll_adc_get_dynamic_rang | ( | void |  | ) |

Return ADC dynamic rang.

\rst +-------------------—+--------------------------—+ | Register | BitsName | +======================+=============================+ | SNSADC_CFG | REG2 | +-------------------—+--------------------------—+ \endrst

Return values

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

Definition at line 690 of file gr55xx_ll_adc.h.

## ◆ ll_adc_get_input_mode()

__STATIC_INLINE uint32_t ll_adc_get_input_mode | ( | void |  | ) |

Return ADC input mode.

\rst +-------------------—+--------------------------—+ | Register | BitsName | +======================+=============================+ | SNSADC_CFG | REG2 | +-------------------—+--------------------------—+ \endrst

Return values

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

Definition at line 596 of file gr55xx_ll_adc.h.

## ◆ ll_adc_get_ref()

__STATIC_INLINE uint32_t ll_adc_get_ref | ( | void |  | ) |

Return source of ADC reference.

\rst +-------------------—+--------------------------—+ | Register | BitsName | +======================+=============================+ | SNSADC_CFG | REG4 | +-------------------—+--------------------------—+ \endrst

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 893 of file gr55xx_ll_adc.h.

## ◆ ll_adc_get_ref_current()

__STATIC_INLINE uint32_t ll_adc_get_ref_current | ( | void |  | ) |

Return current of ADC reference circuit.

\rst +-------------------—+--------------------------—+ | Register | BitsName | +======================+=============================+ | SNSADC_CFG | REG4 | +-------------------—+--------------------------—+ \endrst

Return values

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

Definition at line 932 of file gr55xx_ll_adc.h.

## ◆ ll_adc_get_ref_value()

__STATIC_INLINE uint32_t ll_adc_get_ref_value | ( | void |  | ) |

Return ADC bias reference.

\rst +-------------------—+--------------------------—+ | Register | BitsName | +======================+=============================+ | SNSADC_CFG | REG1 | +-------------------—+--------------------------—+ \endrst

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

Definition at line 447 of file gr55xx_ll_adc.h.

## ◆ ll_adc_is_enabled()

__STATIC_INLINE uint32_t ll_adc_is_enabled | ( | void |  | ) |

Check if ADC module is enabled.

\rst +-------------------—+--------------------------—+ | Register | BitsName | +======================+=============================+ | SNSADC_CFG | REG4 | +-------------------—+--------------------------—+ \endrst

Return values

  State | of bit (1 or 0).

Definition at line 295 of file gr55xx_ll_adc.h.

## ◆ ll_adc_is_enabled_clock()

__STATIC_INLINE uint32_t ll_adc_is_enabled_clock | ( | void |  | ) |

Check if ADC clock is enabled.

\rst +-------------------—+--------------------------—+ | Register | BitsName | +======================+=============================+ | MSIO_PAD_CFG_1 | ADC_CLK_EN | +-------------------—+--------------------------—+ \endrst

Return values

  State | of bit (1 or 0).

Definition at line 353 of file gr55xx_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.

\rst +-------------------—+--------------------------—+ | Register | BitsName | +======================+=============================+ | SNSADC_CFG | REG4 | +-------------------—+--------------------------—+ \endrst

Return values

  State | of bit (1 or 0).

Definition at line 846 of file gr55xx_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.

\rst +-------------------—+--------------------------—+ | Register | BitsName | +======================+=============================+ | SNSADC_CFG | REG2 | +-------------------—+--------------------------—+ \endrst

Return values

  State | of bit (1 or 0).

Definition at line 652 of file gr55xx_ll_adc.h.

## ◆ ll_adc_is_enabled_temp()

__STATIC_INLINE uint32_t ll_adc_is_enabled_temp | ( | void |  | ) |

Check if temperature sensor is enabled.

\rst +-------------------—+--------------------------—+ | Register | BitsName | +======================+=============================+ | SNSADC_CFG | REG2 | +-------------------—+--------------------------—+ \endrst

Return values

  State | of bit (1 or 0).

Definition at line 501 of file gr55xx_ll_adc.h.

## ◆ ll_adc_is_enabled_vbat()

__STATIC_INLINE uint32_t ll_adc_is_enabled_vbat | ( | void |  | ) |

Check if Vbattery sensor is enabled.

\rst +-------------------—+--------------------------—+ | Register | BitsName | +======================+=============================+ | SNSADC_CFG | REG2 | +-------------------—+--------------------------—+ \endrst

Return values

  State | of bit (1 or 0).

Definition at line 555 of file gr55xx_ll_adc.h.

## ◆ ll_adc_set_channeln()

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

Set source of ADC input channelN.

\rst +-------------------—+--------------------------—+ | Register | BitsName | +======================+=============================+ | SNSADC_CFG | REG3 | +-------------------—+--------------------------—+ \endrst

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 767 of file gr55xx_ll_adc.h.

## ◆ ll_adc_set_channelp()

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

Set source of ADC input channelP.

\rst +-------------------—+--------------------------—+ | Register | BitsName | +======================+=============================+ | SNSADC_CFG | REG3 | +-------------------—+--------------------------—+ \endrst

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 716 of file gr55xx_ll_adc.h.

## ◆ ll_adc_set_clock()

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

Set ADC clock source.

\rst +-------------------—+--------------------------—+ | Register | BitsName | +======================+=============================+ | MSIO_PAD_CFG_1 | ADC_CLK_SEL | +-------------------—+--------------------------—+ \endrst

Parameters

  clk | This parameter can be one of the following values: LL_ADC_CLK_16 LL_ADC_CLK_8 LL_ADC_CLK_4 LL_ADC_CLK_2 LL_ADC_CLK_1P6 LL_ADC_CLK_1

Return values

  None |

Definition at line 378 of file gr55xx_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.

\rst +-------------------—+--------------------------—+ | Register | BitsName | +======================+=============================+ | SNSADC_CFG | REG2 | +-------------------—+--------------------------—+ \endrst

Parameters

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

Return values

  None |

Definition at line 672 of file gr55xx_ll_adc.h.

## ◆ ll_adc_set_input_mode()

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

Set ADC input mode.

\rst +-------------------—+--------------------------—+ | Register | BitsName | +======================+=============================+ | SNSADC_CFG | REG2 | +-------------------—+--------------------------—+ \endrst

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 576 of file gr55xx_ll_adc.h.

## ◆ ll_adc_set_ref()

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

Set source of ADC reference.

\rst +-------------------—+--------------------------—+ | Register | BitsName | +======================+=============================+ | SNSADC_CFG | REG4 | +-------------------—+--------------------------—+ \endrst

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 870 of file gr55xx_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.

\rst +-------------------—+--------------------------—+ | Register | BitsName | +======================+=============================+ | SNSADC_CFG | REG4 | +-------------------—+--------------------------—+ \endrst

Parameters

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

Return values

  None |

Definition at line 914 of file gr55xx_ll_adc.h.

## ◆ ll_adc_set_ref_value()

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

Set ADC bias reference.

\rst +-------------------—+--------------------------—+ | Register | BitsName | +======================+=============================+ | SNSADC_CFG | REG1 | +-------------------—+--------------------------—+ \endrst

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

Return values

  None |

Definition at line 426 of file gr55xx_ll_adc.h.