Functions
Basic Configuration
Peripheral Driver » LL Driver » COMP » Functions

## Functions
__STATIC_INLINE void | ll_comp_enable (void)
| Enable COMP module. More...
__STATIC_INLINE void | ll_comp_disable (void)
| Disable COMP module. More...
__STATIC_INLINE void | ll_comp_set_input_src (uint32_t source)
| Set channel of COMP input source. More...
__STATIC_INLINE void | ll_comp_set_ref_src (uint32_t source)
| Set channel of COMP reference source. More...
__STATIC_INLINE void | ll_comp_set_vbatt_lvl (uint32_t level)
| Set VBATT control level. More...
__STATIC_INLINE void | ll_comp_set_vref_lvl (uint32_t level)
| Set VREF control level. More...
__STATIC_INLINE void | ll_comp_set_current (uint32_t level)
| set current of comparator. More...
__STATIC_INLINE void | ll_comp_cascres_half_high (uint32_t level)
| set power of comparator. More...
__STATIC_INLINE void | ll_comp_positive_hysteresis (uint32_t hyst)
| Set positive hysteresis comparator. More...
__STATIC_INLINE void | ll_comp_negative_hysteresis (uint32_t hyst)
| Set negative hysteresis comparator. More...
__STATIC_INLINE void | ll_comp_positive_degeneration (uint32_t res_deg)
| Set calibration of comparator. More...
__STATIC_INLINE void | ll_comp_negative_degeneration (uint32_t res_deg)
| Set calibration of comparator. More...
__STATIC_INLINE void | ll_comp_enable_rising_wakeup (void)
| Enable Wakeup Interrupt for COMP Rising. More...
__STATIC_INLINE void | ll_comp_disable_rising_wakeup (void)
| Disable Wakeup Interrupt for COMP Rising. More...
__STATIC_INLINE uint32_t | ll_comp_is_enable_rising_wakeup (void)
| Get Wakeup Interrupt for COMP Rising. More...
__STATIC_INLINE void | ll_comp_enable_falling_wakeup (void)
| Enable Wakeup Interrupt for COMP Falling. More...
__STATIC_INLINE void | ll_comp_disable_falling_wakeup (void)
| Disable Wakeup Interrupt for COMP Falling. More...
__STATIC_INLINE uint32_t | ll_comp_is_enable_falling_wakeup (void)
| Get Wakeup Interrupt for COMP Falling. More...
__STATIC_FORCEINLINE uint32_t | ll_comp_is_rising_triger_flag_it (void)
| Indicate if the COMP rising_triger Flag is set or not. More...
__STATIC_FORCEINLINE void | ll_comp_clear_rising_triger_flag_it (void)
| Clear rising_triger flag for COMP. More...
__STATIC_FORCEINLINE uint32_t | ll_comp_is_falling_triger_flag_it (void)
| Indicate if the COMP falling_triger Flag is set or not. More...
__STATIC_FORCEINLINE void | ll_comp_clear_falling_triger_flag_it (void)
| Clear falling_triger flag for COMP. More...
__STATIC_INLINE void | ll_comp_set_remove_cycle (uint32_t cycle)
| Set compator glitch remove cycles. More...
__STATIC_INLINE uint32_t | ll_comp_get_remove_cycle (void)
| Set compator glitch remove cycles. More...

## Detailed Description

## Function Documentation

## ◆ ll_comp_cascres_half_high()

__STATIC_INLINE void ll_comp_cascres_half_high | ( | uint32_t | level | ) |

set power of comparator.

Register|BitsName --------|-------- COMP_REG_0 | cascres_half

Parameters

  level | The power of comparator

Return values

  None |

Definition at line 370 of file ll_comp.h.

## ◆ ll_comp_clear_falling_triger_flag_it()

__STATIC_FORCEINLINE void ll_comp_clear_falling_triger_flag_it | ( | void |  | ) |

Clear falling_triger flag for COMP.

Register|BitsName --------|-------- AON_SLEEP_EVENT | MSIO_COMP

Return values

  None. |

Definition at line 578 of file ll_comp.h.

References AON_CTL.

## ◆ ll_comp_clear_rising_triger_flag_it()

__STATIC_FORCEINLINE void ll_comp_clear_rising_triger_flag_it | ( | void |  | ) |

Clear rising_triger flag for COMP.

Register|BitsName --------|-------- AON_SLEEP_EVENT | MSIO_COMP

Return values

  None. |

Definition at line 550 of file ll_comp.h.

References AON_CTL.

## ◆ ll_comp_disable()

__STATIC_INLINE void ll_comp_disable | ( | void |  | ) |

Disable COMP module.

Register|BitsName --------|-------- COMP_REG_0 | COMP_EN

Return values

  None |

Definition at line 259 of file ll_comp.h.

## ◆ ll_comp_disable_falling_wakeup()

__STATIC_INLINE void ll_comp_disable_falling_wakeup | ( | void |  | ) |

Disable Wakeup Interrupt for COMP Falling.

Register|BitsName --------|-------- MCU_WAKEUP_CTRL | MSIO_COMP

Return values

  None. |

Definition at line 508 of file ll_comp.h.

References AON_CTL.

## ◆ ll_comp_disable_rising_wakeup()

__STATIC_INLINE void ll_comp_disable_rising_wakeup | ( | void |  | ) |

Disable Wakeup Interrupt for COMP Rising.

Register|BitsName --------|-------- MCU_WAKEUP_CTRL | MSIO_COMP

Return values

  None. |

Definition at line 466 of file ll_comp.h.

References AON_CTL.

## ◆ ll_comp_enable()

__STATIC_INLINE void ll_comp_enable | ( | void |  | ) |

Enable COMP module.

Register|BitsName --------|-------- COMP_REG_0 | COMP_EN

Return values

  None |

Definition at line 245 of file ll_comp.h.

## ◆ ll_comp_enable_falling_wakeup()

__STATIC_INLINE void ll_comp_enable_falling_wakeup | ( | void |  | ) |

Enable Wakeup Interrupt for COMP Falling.

Register|BitsName --------|-------- MCU_WAKEUP_CTRL | MSIO_COMP

Return values

  None. |

Definition at line 494 of file ll_comp.h.

References AON_CTL.

## ◆ ll_comp_enable_rising_wakeup()

__STATIC_INLINE void ll_comp_enable_rising_wakeup | ( | void |  | ) |

Enable Wakeup Interrupt for COMP Rising.

Register|BitsName --------|-------- MCU_WAKEUP_CTRL | MSIO_COMP

Return values

  None. |

Definition at line 452 of file ll_comp.h.

References AON_CTL.

## ◆ ll_comp_get_remove_cycle()

__STATIC_INLINE uint32_t ll_comp_get_remove_cycle | ( | void |  | ) |

Set compator glitch remove cycles.

Register|BitsName --------|-------- AON_CTL_PMU_COMP_GLITCH_REMOVE | AON_CTL_PMU_COMP_GLITCH_REMOVE_CYCLE

Return values

  None. |

Definition at line 606 of file ll_comp.h.

References AON_CTL.

## ◆ ll_comp_is_enable_falling_wakeup()

__STATIC_INLINE uint32_t ll_comp_is_enable_falling_wakeup | ( | void |  | ) |

Get Wakeup Interrupt for COMP Falling.

Register|BitsName --------|-------- MCU_WAKEUP_CTRL | MSIO_COMP

Return values

  State | of bit (1 or o).

Definition at line 522 of file ll_comp.h.

References AON_CTL.

## ◆ ll_comp_is_enable_rising_wakeup()

__STATIC_INLINE uint32_t ll_comp_is_enable_rising_wakeup | ( | void |  | ) |

Get Wakeup Interrupt for COMP Rising.

Register|BitsName --------|-------- MCU_WAKEUP_CTRL | MSIO_COMP

Return values

  State | of bit (1 or o).

Definition at line 480 of file ll_comp.h.

References AON_CTL.

## ◆ ll_comp_is_falling_triger_flag_it()

__STATIC_FORCEINLINE uint32_t ll_comp_is_falling_triger_flag_it | ( | void |  | ) |

Indicate if the COMP falling_triger Flag is set or not.

Register|BitsName --------|-------- AON_SLEEP_EVENT | MSIO_COMP

Return values

  State | of bit (1 or o).

Definition at line 564 of file ll_comp.h.

References AON_CTL.

## ◆ ll_comp_is_rising_triger_flag_it()

__STATIC_FORCEINLINE uint32_t ll_comp_is_rising_triger_flag_it | ( | void |  | ) |

Indicate if the COMP rising_triger Flag is set or not.

Register|BitsName --------|-------- AON_SLEEP_EVENT | MSIO_COMP

Return values

  State | of bit (1 or o).

Definition at line 536 of file ll_comp.h.

References AON_CTL.

## ◆ ll_comp_negative_degeneration()

__STATIC_INLINE void ll_comp_negative_degeneration | ( | uint32_t | res_deg | ) |

Set calibration of comparator.

Register|BitsName --------|-------- COMP_REG_1 | RDEG_N

Parameters

  res_deg | This parameter can be the following value: LL_COMP_RES_DEGENERATION_NEGATIVE

Return values

  None |

Definition at line 438 of file ll_comp.h.

## ◆ ll_comp_negative_hysteresis()

__STATIC_INLINE void ll_comp_negative_hysteresis | ( | uint32_t | hyst | ) |

Set negative hysteresis comparator.

Register|BitsName --------|-------- COMP_REG_0 | N_HYS_EN

Parameters

  hyst | This parameter can be the following value: LL_COMP_HYST_NEGATIVE

Return values

  None |

Definition at line 404 of file ll_comp.h.

## ◆ ll_comp_positive_degeneration()

__STATIC_INLINE void ll_comp_positive_degeneration | ( | uint32_t | res_deg | ) |

Set calibration of comparator.

Register|BitsName --------|-------- COMP_REG_1 | RDEG_P

Parameters

  res_deg | This parameter can be the following value: LL_COMP_RES_DEGENERATION_POSITIVE

Return values

  None |

Definition at line 421 of file ll_comp.h.

## ◆ ll_comp_positive_hysteresis()

__STATIC_INLINE void ll_comp_positive_hysteresis | ( | uint32_t | hyst | ) |

Set positive hysteresis comparator.

Register|BitsName --------|-------- COMP_REG_0 | P_HYS_EN

Parameters

  hyst | This parameter can be the following value: LL_COMP_HYST_POSITIVE

Return values

  None |

Definition at line 387 of file ll_comp.h.

## ◆ ll_comp_set_current()

__STATIC_INLINE void ll_comp_set_current | ( | uint32_t | level | ) |

set current of comparator.

Register|BitsName --------|-------- COMP_REG_0 | icomp_ctrl

Parameters

  level | The current of comparator

Return values

  None |

Definition at line 355 of file ll_comp.h.

## ◆ ll_comp_set_input_src()

__STATIC_INLINE void ll_comp_set_input_src | ( | uint32_t | source | ) |

Set channel of COMP input source.

Register|BitsName --------|-------- COMP_REG_0 | AON_COMP_REG_0_CHANNEL_SEL_P

Parameters

  source | This parameter can be one of the following values: LL_COMP_INPUT_SRC_IO0 LL_COMP_INPUT_SRC_IO1 LL_COMP_INPUT_SRC_IO2 LL_COMP_INPUT_SRC_IO3 LL_COMP_INPUT_SRC_IO4 LL_COMP_INPUT_SRC_IO5 LL_COMP_INPUT_SRC_IO6 LL_COMP_INPUT_SRC_IO7 LL_COMP_INPUT_SRC_VBAT LL_COMP_INPUT_SRC_VREF

Return values

  None |

Definition at line 284 of file ll_comp.h.

## ◆ ll_comp_set_ref_src()

__STATIC_INLINE void ll_comp_set_ref_src | ( | uint32_t | source | ) |

Set channel of COMP reference source.

Register|BitsName --------|-------- COMP_REG_0 | AON_COMP_REG_0_CHANNEL_SEL_N

Parameters

  source | This parameter can be one of the following values: LL_COMP_REF_SRC_IO0 LL_COMP_REF_SRC_IO1 LL_COMP_REF_SRC_IO2 LL_COMP_REF_SRC_IO3 LL_COMP_REF_SRC_IO4 LL_COMP_REF_SRC_IO5 LL_COMP_REF_SRC_IO6 LL_COMP_REF_SRC_IO7 LL_COMP_REF_SRC_VBAT LL_COMP_REF_SRC_VREF

Return values

  None |

Definition at line 309 of file ll_comp.h.

## ◆ ll_comp_set_remove_cycle()

__STATIC_INLINE void ll_comp_set_remove_cycle | ( | uint32_t | cycle | ) |

Set compator glitch remove cycles.

Register|BitsName --------|-------- AON_CTL_PMU_COMP_GLITCH_REMOVE | AON_CTL_PMU_COMP_GLITCH_REMOVE_CYCLE

Return values

  None. |

Definition at line 592 of file ll_comp.h.

References AON_CTL.

## ◆ ll_comp_set_vbatt_lvl()

__STATIC_INLINE void ll_comp_set_vbatt_lvl | ( | uint32_t | level | ) |

Set VBATT control level.

Register|BitsName --------|-------- COMP_REG_0 | BATT_LVL_CTRL_LV

Parameters

  level | This parameter can be a value between: 0 ~ 7 Vbatt_ref = ((level+1)/10) * VBATT

Return values

  None |

Definition at line 325 of file ll_comp.h.

## ◆ ll_comp_set_vref_lvl()

__STATIC_INLINE void ll_comp_set_vref_lvl | ( | uint32_t | level | ) |

Set VREF control level.

Register|BitsName --------|-------- COMP_REG_1 | COMP_REF_CTRL

Parameters

  level | This parameter can be a value between: 0 ~ 255 Vref = 50.82nA * [166.5k * level] + 30mv

Return values

  None |

Definition at line 341 of file ll_comp.h.