Classes | Macros | Typedefs | Enumerations | Functions
gr55xx_hal_rtc.h File Reference

Header file containing functions prototypes of RTC HAL library. More...

`#include "gr55xx_ll_rtc.h"`
`#include "gr55xx_hal_def.h"`
Include dependency graph for gr55xx_hal_rtc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Classes
struct | _rtc_init_t
| rtc init params More...
struct | _tick_handle_t
| rtc tick handle definition More...
struct | _alarm_handle_t
| rtc alarm handle definition More...
struct | _rtc_handle_t
| rtc handle definition More...
struct | _hal_rtc_callback
| HAL_RTC Callback function definition. More...

## Macros
#define | RTC_FLAG_ALARM RTC_INT_STAT_ALARM
| Alarm interrupt flag More...
#define | RTC_FLAG_WRAP RTC_INT_STAT_WRAP
| Wrap interrupt flag More...
#define | RTC_FLAG_TICK RTC_INT_STAT_TICK
| Tick interrupt flag More...
#define | RTC_IT_ALARM RTC_INT_EN_ALARM
| Alarm interrupt More...
#define | RTC_IT_WRAP RTC_INT_EN_WRAP
| Wrap interrupt More...
#define | RTC_IT_TICK RTC_INT_EN_TICK
| Tick interrupt More...
#define | HAL_RTC_ERROR_NONE (0x00000000U)
| No error More...
#define | HAL_RTC_ERROR_INVALID_PARAM (0x00000001U)
| Invalid parameter error More...
#define | HAL_RTC_ERROR_TIMEOUT (0x00000002U)
| Timeout error More...
#define | RTC_DIV_NONE LL_RTC_DIV_NONE
| Select SLP_CLK More...
#define | RTC_DIV_2 LL_RTC_DIV_2
| Select 1/32 divider More...
#define | RTC_DIV_4 LL_RTC_DIV_4
| Select 1/32 divider More...
#define | RTC_DIV_8 LL_RTC_DIV_8
| Select 1/32 divider More...
#define | RTC_DIV_16 LL_RTC_DIV_16
| Select 1/32 divider More...
#define | RTC_DIV_32 LL_RTC_DIV_32
| Select 1/64 divider More...
#define | RTC_DIV_64 LL_RTC_DIV_64
| Select 1/128 divider. More...
#define | RTC_DIV_128 LL_RTC_DIV_128
| Select 1/256 divider. More...
#define | ONE_TIME LL_RTC_TIMER_TICK_TYPE_SINGLE
| Select periodic alarm one-time More...
#define | AUTO_RELOAD LL_RTC_TIMER_TICK_TYPE_AUTO
| Select periodic alarm auto-reload More...
#define | __HAL_RTC_DISABLE(RTCx) MODIFY_REG(RTCx->CFG0, 0xFFFFFFFF, RTC_CFG0_CFG);
| Disable RTC. More...
#define | __HAL_RTC_ENABLE(RTCx) SET_BITS(RTCx->CFG0, RTC_CFG0_CFG | RTC_CFG0_EN);
| Enable RTC. More...
#define | __HAL_RTC_BUSY_FLAG(RTCx) ((READ_BITS(RTCx->STAT, RTC_STAT_BUSY) == RTC_STAT_BUSY))
| Check RTC busy state. More...
#define | __HAL_RTC_CLEAR_FLAG(RTCx, __FLAG__) WRITE_REG(RTCx->INT_STAT, (__FLAG__))
| Clear RTC flag. More...
#define | __HAL_RTC_ENABLE_IT(RTCx, __INTERRUPT__) SET_BITS(RTCx->INT_EN, (__INTERRUPT__))
| Enable RTC interrupt. More...
#define | __HAL_RTC_DISABLE_IT(RTCx, __INTERRUPT__) CLEAR_BITS(RTCx->INT_EN, (__INTERRUPT__))
| Disable RTC interrupt. More...
#define | __HAL_RTC_GET_IT_SOURCE(RTCx, __FLAG__) (READ_BITS(RTCx->INT_STAT, (__FLAG__)) == (__FLAG__))
| Get RTC interrupt source. More...
#define | __HAL_RTC_CFG_EFFECT(RTCx) SET_BITS(RTCx->CFG0, RTC_CFG0_CFG)
| Set RTC config takes effect. More...

## Typedefs
typedef struct _rtc_init_t | rtc_init_t
| rtc init params More...
typedef struct _tick_handle_t | tick_handle_t
| rtc tick handle definition More...
typedef struct _alarm_handle_t | alarm_handle_t
| rtc alarm handle definition More...
typedef struct _rtc_handle_t | rtc_handle_t
| rtc handle definition More...
typedef struct _hal_rtc_callback | hal_rtc_callback_t
| HAL_RTC Callback function definition. More...

## Enumerations
enum | hal_rtc_state_t { HAL_RTC_READY = 0x00U, HAL_RTC_RESET, HAL_RTC_RUNNING, HAL_RTC_ERROR }
| hal_rtc_state definition More...
enum | rtc_tick_state_t { TICK_READY = 0x00U, TICK_RUNNING, TICK_ERROR }
| rtc_tick_state definition More...
enum | rtc_alarm_state_t { ALARM_READY = 0x00U, ALARM_RUNNING, ALARM_ERROR }
| rtc_alarm_state definition More...
enum | overflow_det_t { CLOSED = 0x00U, OPENED = !CLOSED }
| overflow config More...

## Functions
hal_status_t | hal_rtc_init (rtc_handle_t *p_rtc)
| Initialize the RTC according to the specified parameters in the rtc_init_t of associated handle.counter start after hal_rtc_init. More...
hal_status_t | hal_rtc_deinit (rtc_handle_t *p_rtc)
| DeInitialize the RTC according to the specified parameters in the rtc_init_t of associated handle.counter stop after hal_rtc_deinit. More...
hal_status_t | hal_rtc_set_tick_and_start (rtc_handle_t *p_rtc, uint8_t mode, uint32_t value)
| Start counting down for tick module. More...
hal_status_t | hal_rtc_stop_tick (rtc_handle_t *p_rtc)
| Stop counting down for tick module. More...
hal_status_t | hal_rtc_restart_tick (rtc_handle_t *p_rtc)
| Restart tick module and continue run with the previous settings. More...
hal_status_t | hal_rtc_set_alarm (rtc_handle_t *p_rtc, uint32_t value)
| Compare counter with alarm_value for alarm module. More...
hal_status_t | hal_rtc_stop_alarm (rtc_handle_t *p_rtc)
| Stop counting up and compare with alarm_value for alarm module. More...
hal_status_t | hal_rtc_clear_wrap (rtc_handle_t *p_rtc)
| Clear wrap count. More...
uint32_t | hal_rtc_get_wrap_count (rtc_handle_t *p_rtc)
| Get the times of overflow. More...
uint32_t | hal_rtc_get_cur_count (rtc_handle_t *p_rtc)
| Get_cur_count_value. More...
uint32_t | hal_rtc_get_cur_tick (rtc_handle_t *p_rtc)
| Get_cur_tick_value. More...
uint32_t | hal_rtc_get_alarm_value (rtc_handle_t *p_rtc)
| Get_alarm_value. More...
hal_rtc_state_t | hal_rtc_get_state (rtc_handle_t *p_rtc)
| Get_cur_rtc_state. More...
void | hal_rtc_irq_handler (rtc_handle_t *p_rtc)
| RTC_IRQHandler. More...
void | hal_rtc_alarm_callback (rtc_handle_t *p_rtc)
| alarm_callback More...
void | hal_rtc_overflow_callback (rtc_handle_t *p_rtc)
| overflow_callback More...
void | hal_rtc_tick_callback (rtc_handle_t *p_rtc)
| tick_callback More...

## Detailed Description

Header file containing functions prototypes of RTC HAL library.

Author
  BLE Driver Team

Attention

  ##### Copyright (c) 2019 GOODIX

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of GOODIX nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file gr55xx_hal_rtc.h.