Functions
Configuration functions
Peripheral Driver » LL Driver » RTC » Functions

## Functions
__STATIC_INLINE void | ll_rtc_timer_set_clk (rtc_regs_t *RTCx, uint32_t value)
| Set the RTC Timer clock. More...
__STATIC_INLINE uint32_t | ll_rtc1_timer_get_clk (rtc_regs_t *RTCx)
| Get the RTC Timer clock. More...
__STATIC_INLINE void | ll_rtc_enable (rtc_regs_t *RTCx)
| Enable RTC counter. More...
__STATIC_INLINE void | ll_rtc_disable (rtc_regs_t *RTCx)
| Disable RTC counter. More...
__STATIC_INLINE uint32_t | ll_rtc_is_enabled (rtc_regs_t *RTCx)
| Check if the RTC peripheral is enabled or disabled. More...
__STATIC_INLINE void | ll_rtc_reload_counter (rtc_regs_t *RTCx, uint32_t counter)
| Reloads RTC counter. More...
__STATIC_INLINE void | ll_rtc_start_value_set_and_request (rtc_regs_t *RTCx, uint32_t start_value)
| Reloads RTC counter and request. More...
__STATIC_INLINE void | ll_rtc_clear_counter_set (rtc_regs_t *RTCx)
| Clear RTC counter. More...
__STATIC_INLINE void | ll_rtc_alarm_value_set_and_request (rtc_regs_t *RTCx, uint32_t alarm_value)
| Reloads RTC alarm and request. More...
__STATIC_INLINE void | ll_rtc_reload_tick (rtc_regs_t *RTCx, uint32_t tick)
| Reloads RTC perd_alarm. More...
__STATIC_INLINE uint32_t | ll_rtc_get_write_counter (rtc_regs_t *RTCx)
| Read the RTC counter config value. More...
__STATIC_INLINE uint32_t | ll_rtc_get_read_counter (rtc_regs_t *RTCx)
| Read the RTC counter current value. More...
__STATIC_INLINE uint32_t | ll_rtc_get_write_alarm (rtc_regs_t *RTCx)
| Read the RTC counter config alarm value. More...
__STATIC_INLINE uint32_t | ll_rtc_get_read_alarm (rtc_regs_t *RTCx)
| Read the RTC counter current alarm value. More...
__STATIC_INLINE uint32_t | ll_rtc_get_write_tick (rtc_regs_t *RTCx)
| Get RTC write tick. More...
__STATIC_INLINE uint32_t | ll_rtc_get_read_tick (rtc_regs_t *RTCx)
| Get RTC read tick. More...
__STATIC_INLINE uint32_t | ll_rtc_get_wrapcnt (rtc_regs_t *RTCx)
| Get the RTC wrap-around value. More...
__STATIC_INLINE uint32_t | ll_rtc_is_busy (rtc_regs_t *RTCx)
| The RTC is busy. More...
__STATIC_INLINE uint32_t | ll_rtc_is_running (rtc_regs_t *RTCx)
| The RTC is running. More...
__STATIC_INLINE void | ll_rtc_clear_wrap (rtc_regs_t *RTCx)
| CLear RTC wrap. More...
__STATIC_INLINE void | ll_rtc_clear_wrap_set (rtc_regs_t *RTCx)
__STATIC_INLINE void | ll_rtc_set_clock_div (rtc_regs_t *RTCx, uint32_t div)
| Select the RTC clock divider. More...
__STATIC_INLINE void | ll_rtc_set_alarm (rtc_regs_t *RTCx, uint32_t value)
| Set RTC alarm. More...
__STATIC_INLINE void | ll_rtc_clear_alarm_set (rtc_regs_t *RTCx)
__STATIC_INLINE void | ll_rtc_it_enable_alarm (rtc_regs_t *RTCx)
| Enable RTC alarm interrupt. More...
__STATIC_INLINE void | ll_rtc_disable_alarm (rtc_regs_t *RTCx)
| Disable RTC alarm. More...
__STATIC_INLINE void | ll_rtc_it_disable_alarm (rtc_regs_t *RTCx)
| Disable RTC alarm interrupt. More...
__STATIC_INLINE uint32_t | ll_rtc_it_is_enabled_alarm (rtc_regs_t *RTCx)
| Check if the RTC alarm interrupt is enabled or disabled. More...
__STATIC_INLINE void | ll_rtc_enable_tick (rtc_regs_t *RTCx)
| Set RTCx tick mode. More...
__STATIC_INLINE void | ll_rtc_set_tick_mode (rtc_regs_t *RTCx, uint8_t tick_mode)
| Set RTCx alarm_mode. More...
__STATIC_INLINE void | ll_rtc_it_enable_tick (rtc_regs_t *RTCx)
| Enable RTC tick interrupt. More...
__STATIC_INLINE void | ll_rtc_disable_tick (rtc_regs_t *RTCx)
| Disable RTCx tick. More...
__STATIC_INLINE void | ll_rtc_it_disable_tick (rtc_regs_t *RTCx)
| Disable RTC tick interrupt. More...
__STATIC_INLINE uint32_t | ll_rtc_it_is_enabled_tick (rtc_regs_t *RTCx)
| Check if the RTC alarm interrupt is enabled or disabled. More...
__STATIC_INLINE void | ll_rtc_reload_tick_and_request (rtc_regs_t *RTCx, uint32_t tick_reload)
| Reloads RTCx tick counter and request. More...
__STATIC_INLINE void | ll_rtc_restart_tick (rtc_regs_t *RTCx)
| Restart RTCx tick counter and request. More...
__STATIC_INLINE void | ll_rtc_clear_tick_set (rtc_regs_t *RTCx)
| Disable RTCx tick value setting. More...
__STATIC_INLINE void | ll_rtc_it_enable_wrap (rtc_regs_t *RTCx)
| Enable RTC wrap interrupt. More...
__STATIC_INLINE void | ll_rtc_it_disable_wrap (rtc_regs_t *RTCx)
| Disable RTC wrap interrupt. More...
__STATIC_INLINE uint32_t | ll_rtc_it_is_enabled_wrap (rtc_regs_t *RTCx)
| Check if the RTC wrap interrupt is enabled or disabled. More...

## Detailed Description

## Function Documentation

## ◆ ll_rtc1_timer_get_clk()

__STATIC_INLINE uint32_t ll_rtc1_timer_get_clk | ( | rtc_regs_t * | RTCx | ) |

Get the RTC Timer clock.

Register|BitsName --------|-------- RTC_CLK | RTC_timer_clk_sel

Parameters

  RTCx | instance

Return values

  RTC | Timer clock source,the value can be the one of the following: LL_RTC_TIMER_CLK_SEL_RNG LL_RTC_TIMER_CLK_SEL_XO LL_RTC_TIMER_CLK_SEL_RNG2 LL_RTC_TIMER_CLK_SEL_RTC

Definition at line 154 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_alarm_value_set_and_request()

__STATIC_INLINE void ll_rtc_alarm_value_set_and_request | ( | rtc_regs_t * | RTCx,
|  | uint32_t | alarm_value
| ) |  |

Reloads RTC alarm and request.

Register|BitsName --------|-------- RTC_ALARM_W | ALARM_VAL_LOAD RTC_CFG0 | ALARM_VALUE

Parameters

  RTCx | instance
  alarm_value | RTC alarm

Return values

  None |

Definition at line 281 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_clear_alarm_set()

__STATIC_INLINE void ll_rtc_clear_alarm_set | ( | rtc_regs_t * | RTCx | ) |

Definition at line 503 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_clear_counter_set()

__STATIC_INLINE void ll_rtc_clear_counter_set | ( | rtc_regs_t * | RTCx | ) |

Clear RTC counter.

Register|BitsName --------|-------- RTC_CFG0 | VAL_LOAD

Parameters

  RTCx | instance

Return values

  None |

Definition at line 248 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_clear_tick_set()

__STATIC_INLINE void ll_rtc_clear_tick_set | ( | rtc_regs_t * | RTCx | ) |

Disable RTCx tick value setting.

Register|BitsName --------|-------- RTCx_CFG0 | RTC_CFG0_TICK_EN

Parameters

  RTCx | instance

Return values

  None |

Definition at line 718 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_clear_wrap()

__STATIC_INLINE void ll_rtc_clear_wrap | ( | rtc_regs_t * | RTCx | ) |

CLear RTC wrap.

Register|BitsName --------|-------- RTC_CFG0 | Wrap counter clear

Parameters

  RTCx | instance

Return values

  None |

Definition at line 452 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_clear_wrap_set()

__STATIC_INLINE void ll_rtc_clear_wrap_set | ( | rtc_regs_t * | RTCx | ) |

Definition at line 457 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_disable()

__STATIC_INLINE void ll_rtc_disable | ( | rtc_regs_t * | RTCx | ) |

Disable RTC counter.

Register|BitsName --------|-------- RTC_CFG0 | EN

Parameters

  RTCx | instance

Return values

  None |

Definition at line 184 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_disable_alarm()

__STATIC_INLINE void ll_rtc_disable_alarm | ( | rtc_regs_t * | RTCx | ) |

Disable RTC alarm.

Register|BitsName --------|-------- RTC_TIMER_CTL | ALARM_DISBALE

Parameters

  RTCx | instance

Return values

  None |

Definition at line 533 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_disable_tick()

__STATIC_INLINE void ll_rtc_disable_tick | ( | rtc_regs_t * | RTCx | ) |

Disable RTCx tick.

Register|BitsName --------|-------- RTCx_TIMER_CTL | TICK_EN

Parameters

  RTCx | instance

Return values

  None |

Definition at line 636 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_enable()

__STATIC_INLINE void ll_rtc_enable | ( | rtc_regs_t * | RTCx | ) |

Enable RTC counter.

Register|BitsName --------|-------- RTC_CFG0 | EN

Parameters

  RTCx | instance

Return values

  None |

Definition at line 169 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_enable_tick()

__STATIC_INLINE void ll_rtc_enable_tick | ( | rtc_regs_t * | RTCx | ) |

Set RTCx tick mode.

Register|BitsName --------|-------- RTCx_TIMER_CTL | TICK_EN

Parameters

  RTCx | instance

Return values

  None |

Definition at line 580 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_get_read_alarm()

__STATIC_INLINE uint32_t ll_rtc_get_read_alarm | ( | rtc_regs_t * | RTCx | ) |

Read the RTC counter current alarm value.

Register|BitsName --------|-------- RTC_ALARM_R | CAL_ALARM

Parameters

  RTCx | instance

Return values

  Value | for current alarm which should ranging between 0 ~ 0xFFFF_FFFF

Definition at line 360 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_get_read_counter()

__STATIC_INLINE uint32_t ll_rtc_get_read_counter | ( | rtc_regs_t * | RTCx | ) |

Read the RTC counter current value.

Register|BitsName --------|-------- RTC_TIMER_R | TIMER_VAL_READ

Parameters

  RTCx | instance

Return values

  Value | for current counter which should ranging between 0 ~ 0xFFFF_FFFF

Definition at line 330 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_get_read_tick()

__STATIC_INLINE uint32_t ll_rtc_get_read_tick | ( | rtc_regs_t * | RTCx | ) |

Get RTC read tick.

Register|BitsName --------|-------- RTCx_TIMER_W | TIMER_VALUE

Parameters

  RTCx | instance

Return values

  Value | for current read tick

Definition at line 390 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_get_wrapcnt()

__STATIC_INLINE uint32_t ll_rtc_get_wrapcnt | ( | rtc_regs_t * | RTCx | ) |

Get the RTC wrap-around value.

Note
  The value should be read multiple times until get the same value in at least two reads.

Register|BitsName --------|-------- RTC_STAT | WRAP_CNT

Parameters

  RTCx | instance

Return values

  Value | between Min_Data=0 and Max_Data=0xF

Definition at line 406 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_get_write_alarm()

__STATIC_INLINE uint32_t ll_rtc_get_write_alarm | ( | rtc_regs_t * | RTCx | ) |

Read the RTC counter config alarm value.

Register|BitsName --------|-------- RTC_ALARM_W | CAL_ALARM

Parameters

  RTCx | instance

Return values

  Value | for current alarm which should ranging between 0 ~ 0xFFFF_FFFF

Definition at line 345 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_get_write_counter()

__STATIC_INLINE uint32_t ll_rtc_get_write_counter | ( | rtc_regs_t * | RTCx | ) |

Read the RTC counter config value.

Register|BitsName --------|-------- RTC_TIMER_W | TIMER_VAL_READ

Parameters

  RTCx | instance

Return values

  Value | for current counter which should ranging between 0 ~ 0xFFFF_FFFF

Definition at line 315 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_get_write_tick()

__STATIC_INLINE uint32_t ll_rtc_get_write_tick | ( | rtc_regs_t * | RTCx | ) |

Get RTC write tick.

Register|BitsName --------|-------- RTCx_TIMER_W | TIMER_VALUE

Parameters

  RTCx | instance

Return values

  Value | for current write tick

Definition at line 375 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_is_busy()

__STATIC_INLINE uint32_t ll_rtc_is_busy | ( | rtc_regs_t * | RTCx | ) |

The RTC is busy.

Register|BitsName --------|-------- RTC_STAT | BUSY

Parameters

  RTCx | instance

Return values

  Value | between Min_Data=0 and Max_Data=0xF

Definition at line 421 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_is_enabled()

__STATIC_INLINE uint32_t ll_rtc_is_enabled | ( | rtc_regs_t * | RTCx | ) |

Check if the RTC peripheral is enabled or disabled.

Register|BitsName --------|-------- RTC_CFG0 | EN

Parameters

  RTCx | instance

Return values

  State | of bit (1 or 0).

Definition at line 199 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_is_running()

__STATIC_INLINE uint32_t ll_rtc_is_running | ( | rtc_regs_t * | RTCx | ) |

The RTC is running.

Register|BitsName --------|-------- RTC_STAT | RUNNING

Parameters

  RTCx | instance

Return values

  Value | between Min_Data=0 and Max_Data=0xF

Definition at line 436 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_it_disable_alarm()

__STATIC_INLINE void ll_rtc_it_disable_alarm | ( | rtc_regs_t * | RTCx | ) |

Disable RTC alarm interrupt.

Register|BitsName --------|-------- RTC_INT_EN | ALARM_INT_EN

Parameters

  RTCx | instance

Return values

  None |

Definition at line 549 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_it_disable_tick()

__STATIC_INLINE void ll_rtc_it_disable_tick | ( | rtc_regs_t * | RTCx | ) |

Disable RTC tick interrupt.

Register|BitsName --------|-------- RTC_INT_EN | TICK0_INT_EN

Parameters

  RTCx | instance

Return values

  None |

Definition at line 652 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_it_disable_wrap()

__STATIC_INLINE void ll_rtc_it_disable_wrap | ( | rtc_regs_t * | RTCx | ) |

Disable RTC wrap interrupt.

Register|BitsName --------|-------- RTC_TIMER_CTL | WRAP_INT_EN

Parameters

  RTCx | instance

Return values

  None |

Definition at line 748 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_it_enable_alarm()

__STATIC_INLINE void ll_rtc_it_enable_alarm | ( | rtc_regs_t * | RTCx | ) |

Enable RTC alarm interrupt.

Register|BitsName --------|-------- RTC_TIMER_CTL | ALARM_INT_EN

Parameters

  RTCx | instance

Return values

  None |

Definition at line 518 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_it_enable_tick()

__STATIC_INLINE void ll_rtc_it_enable_tick | ( | rtc_regs_t * | RTCx | ) |

Enable RTC tick interrupt.

Register|BitsName --------|-------- RTC_INT_EN | TICK_INT_EN

Parameters

  RTCx | instance

Return values

  None |

Definition at line 621 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_it_enable_wrap()

__STATIC_INLINE void ll_rtc_it_enable_wrap | ( | rtc_regs_t * | RTCx | ) |

Enable RTC wrap interrupt.

Register|BitsName --------|-------- RTC_TIMER_CTL | WRAP_INT_EN

Parameters

  RTCx | instance

Return values

  None |

Definition at line 733 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_it_is_enabled_alarm()

__STATIC_INLINE uint32_t ll_rtc_it_is_enabled_alarm | ( | rtc_regs_t * | RTCx | ) |

Check if the RTC alarm interrupt is enabled or disabled.

Register|BitsName --------|-------- RTC_TIMER_CTL | ALARM_INT_EN

Parameters

  RTCx | instance

Return values

  State | of bit (1 or 0).

Definition at line 564 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_it_is_enabled_tick()

__STATIC_INLINE uint32_t ll_rtc_it_is_enabled_tick | ( | rtc_regs_t * | RTCx | ) |

Check if the RTC alarm interrupt is enabled or disabled.

Register|BitsName --------|-------- RTC_TIMER_CTL | TICK_EN RTC_INT_EN | TICK_INT_EN

Parameters

  RTCx | instance

Return values

  State | of bit (1 or 0).

Definition at line 668 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_it_is_enabled_wrap()

__STATIC_INLINE uint32_t ll_rtc_it_is_enabled_wrap | ( | rtc_regs_t * | RTCx | ) |

Check if the RTC wrap interrupt is enabled or disabled.

Register|BitsName --------|-------- RTC_TIMER_CTL | WRAP_INT_EN

Parameters

  RTCx | instance

Return values

  State | of bit (1 or 0).

Definition at line 763 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_reload_counter()

__STATIC_INLINE void ll_rtc_reload_counter | ( | rtc_regs_t * | RTCx,
|  | uint32_t | counter
| ) |  |

Reloads RTC counter.

Register|BitsName --------|-------- RTC_TIMER_W | TIMER_VALUE

Parameters

  RTCx | instance
  counter | RTC counter

Return values

  None |

Definition at line 215 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_reload_tick()

__STATIC_INLINE void ll_rtc_reload_tick | ( | rtc_regs_t * | RTCx,
|  | uint32_t | tick
| ) |  |

Reloads RTC perd_alarm.

Register|BitsName --------|-------- RTC_TIMER_W | ALARM_VAL_LOAD

Parameters

  RTCx | instance
  tick | RTC perd_alarm

Return values

  None |

Definition at line 298 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_reload_tick_and_request()

__STATIC_INLINE void ll_rtc_reload_tick_and_request | ( | rtc_regs_t * | RTCx,
|  | uint32_t | tick_reload
| ) |  |

Reloads RTCx tick counter and request.

Register|BitsName --------|-------- RTCx_TIMER_W | TIMER_VALUE RTCx_CFG0 | VAL_LOAD

Parameters

  RTCx | instance
  tick_reload | RTC tick counter

Return values

  None |

Definition at line 686 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_restart_tick()

__STATIC_INLINE void ll_rtc_restart_tick | ( | rtc_regs_t * | RTCx | ) |

Restart RTCx tick counter and request.

Register|BitsName --------|-------- RTCx_CFG0 | RTC_CFG0_TICK_EN

Parameters

  RTCx | instance

Return values

  None |

Definition at line 702 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_set_alarm()

__STATIC_INLINE void ll_rtc_set_alarm | ( | rtc_regs_t * | RTCx,
|  | uint32_t | value
| ) |  |

Set RTC alarm.

Register|BitsName --------|-------- RTC_TIMER_CTL | ALARM_EN

Parameters

  RTCx | instance
  value | RTC alarm

Return values

  None |

Definition at line 497 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_set_clock_div()

__STATIC_INLINE void ll_rtc_set_clock_div | ( | rtc_regs_t * | RTCx,
|  | uint32_t | div
| ) |  |

Select the RTC clock divider.

Register|BitsName --------|-------- RTC_CFG1 | CLK_SEL

Parameters

  RTCx | instance
  div | This parameter can be one of the following values: LL_RTC_DIV_NONE LL_RTC_DIV_2 LL_RTC_DIV_4 LL_RTC_DIV_8 LL_RTC_DIV_16 LL_RTC_DIV_32 LL_RTC_DIV_64 LL_RTC_DIV_128

Return values

  None |

Definition at line 481 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_set_tick_mode()

__STATIC_INLINE void ll_rtc_set_tick_mode | ( | rtc_regs_t * | RTCx,
|  | uint8_t | tick_mode
| ) |  |

Set RTCx alarm_mode.

Register|BitsName --------|-------- RTCx_TIMER_CTL | TICK_EN

Parameters

  RTCx | instance
  tick_mode | This parameter can be a one of the following values: LL_RTCx_TIMER_TICK_TYPE_SINGLE LL_RTCx_TIMER_TICK_TYPE_AUTO

Return values

  None |

Definition at line 599 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_start_value_set_and_request()

__STATIC_INLINE void ll_rtc_start_value_set_and_request | ( | rtc_regs_t * | RTCx,
|  | uint32_t | start_value
| ) |  |

Reloads RTC counter and request.

Register|BitsName --------|-------- RTC_TIMER_W | TIMER_VALUE RTC_CFG0 | VAL_LOAD

Parameters

  RTCx | instance
  start_value | RTC counter

Return values

  None |

Definition at line 232 of file gr55xx_ll_rtc.h.

## ◆ ll_rtc_timer_set_clk()

__STATIC_INLINE void ll_rtc_timer_set_clk | ( | rtc_regs_t * | RTCx,
|  | uint32_t | value
| ) |  |

Set the RTC Timer clock.

Register|BitsName --------|-------- RTC_CLK | RTC_timer_clk_sel

Parameters

  RTCx | instance
  value | This parameter can be a one of the following values: LL_RTC_TIMER_CLK_SEL_RNG LL_RTC_TIMER_CLK_SEL_XO LL_RTC_TIMER_CLK_SEL_RNG2 LL_RTC_TIMER_CLK_SEL_RTC

Return values

  None |

Definition at line 135 of file gr55xx_ll_rtc.h.