Classes | Macros | Typedefs | Functions
gr55xx_hal_calendar.h File Reference

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

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

Go to the source code of this file.

## Classes
struct | _calendar_time
| CALENDAR_Time calendar time structure definition. More...
struct | _calendar_alarm
| CALENDAR_Alarm calendar alarm structure definition. More...
struct | _calendar_handle
| CALENDAR handle Structure definition. More...
struct | _hal_calendar_callback
| HAL_CALENDAR Callback function definition. More...

## Macros
#define | CALENDAR_IT_ALARM RTC_INT_EN_ALARM
| Alarm interrupt More...
#define | CALENDAR_IT_WARP RTC_INT_EN_WRAP
| Warp interrupt More...
#define | CALENDAR_IT_TICK RTC_INT_EN_TICK
| Tick interrupt More...
#define | CALENDAR_FLAG_ALARM RTC_INT_STAT_ALARM
| Alarm interrupt flag More...
#define | CALENDAR_FLAG_WARP RTC_INT_STAT_WRAP
| Warp interrupt flag More...
#define | CALENDAR_FLAG_TICK RTC_INT_STAT_TICK
| Tick interrupt flag More...
#define | CALENDAR_ALARM_SEL_DATE (0UL)
| Alarm in date More...
#define | CALENDAR_ALARM_SEL_WEEKDAY (1UL)
| Alarm in weekday. More...
#define | CALENDAR_ALARM_WEEKDAY_SUN (0x01ul)
| Alarm weekday mask Sunday More...
#define | CALENDAR_ALARM_WEEKDAY_MON (0x02ul)
| Alarm weekday mask Monday More...
#define | CALENDAR_ALARM_WEEKDAY_TUE (0x04ul)
| Alarm weekday mask Tuesday More...
#define | CALENDAR_ALARM_WEEKDAY_WED (0x08ul)
| Alarm weekday mask Wednesday. More...
#define | CALENDAR_ALARM_WEEKDAY_THU (0x10ul)
| Alarm weekday mask Thursday More...
#define | CALENDAR_ALARM_WEEKDAY_FRI (0x20ul)
| Alarm weekday mask Friday More...
#define | CALENDAR_ALARM_WEEKDAY_SAT (0x40ul)
| Alarm weekday mask Saturday More...
#define | CALENDAR_ALARM_DISABLE_DATE (1UL)
| Disable date alarm. More...
#define | CALENDAR_ALARM_DISABLE_TICK (2UL)
| Disable tick 0 alarm. More...
#define | CALENDAR_ALARM_DISABLE_ALL (CALENDAR_ALARM_DISABLE_DATE | CALENDAR_ALARM_DISABLE_TICK)
| Disable all alarm. More...
#define | CALENDAR_TICK_SINGLE LL_CLDR_TIMER_TICK_TYPE_SINGLE
| Alarm tick reload single More...
#define | CALENDAR_TICK_AUTO LL_CLDR_TIMER_TICK_TYPE_AUTO
| Alarm tick reload auto More...
#define | __HAL_CALENDAR_ENABLE() WRITE_REG(CALENDAR->CFG0, RTC_CFG0_CFG | RTC_CFG0_EN)
| Enable the specified CALENDAR peripheral. More...
#define | __HAL_CALENDAR_DISABLE() MODIFY_REG(CALENDAR->CFG0, 0xFFFFFFFF, RTC_CFG0_CFG);
| Disable the specified CALENDAR peripheral. More...
#define | __HAL_CALENDAR_ENABLE_IT(__INTERRUPT__) SET_BITS(CALENDAR->INT_EN, (__INTERRUPT__))
| Enable the specified CALENDAR interrupts. More...
#define | __HAL_CALENDAR_DISABLE_IT(__INTERRUPT__) CLEAR_BITS(CALENDAR->INT_EN, (__INTERRUPT__))
| Disable the specified CALENDAR interrupts. More...
#define | __HAL_CALENDAR_GET_IT_SOURCE(__FLAG__) (READ_BITS(CALENDAR->INT_STAT, (__FLAG__)) == (__FLAG__))
| Check whether the specified CALENDAR interrupt flag is set or not. More...
#define | __HAL_CALENDAR_CLEAR_FLAG(__FLAG__) WRITE_REG(CALENDAR->INT_STAT, (__FLAG__))
| Clear the specified CALENDAR flag. More...
#define | __HAL_CALENDAR_BUSY_FLAG() ((READ_BITS(CALENDAR->STAT, RTC_STAT_BUSY) == RTC_STAT_BUSY))
| Get the CALENDAR busy flag. More...
#define | IS_CALENDAR_ALARM_TYPE(__TYPE__)
| Check if CALENDAR Alarm Type is valid. More...
#define | IS_CALENDAR_DATE(__DATE__) (((__DATE__) > 0) && ((__DATE__) <= 31))
| Check if CALENDAR Date is valid. More...
#define | IS_CALENDAR_WEEKDAY(__WEEKDAY__) (((__WEEKDAY__) >= 0) && ((__WEEKDAY__) <= 6))
| Check if CALENDAR Weekday is valid. More...
#define | IS_CALENDAR_LEAP_YEAR(__YEAR__)
| Check if CALENDAR year is leap year. More...

## Typedefs
typedef struct _calendar_time | calendar_time_t
| CALENDAR_Time calendar time structure definition. More...
typedef struct _calendar_alarm | calendar_alarm_t
| CALENDAR_Alarm calendar alarm structure definition. More...
typedef struct _calendar_handle | calendar_handle_t
| CALENDAR handle Structure definition. More...
typedef struct _hal_calendar_callback | hal_calendar_callback_t
| HAL_CALENDAR Callback function definition. More...

## Functions
hal_status_t | hal_calendar_init (calendar_handle_t *p_calendar)
| Initialize the CALENDAR according to the specified parameters in the calendar_init_t of associated handle. More...
hal_status_t | hal_calendar_deinit (calendar_handle_t *p_calendar)
| De-initialize the CALENDAR peripheral. More...
hal_status_t | hal_calendar_init_time (calendar_handle_t *p_calendar, calendar_time_t *p_time)
| Initialize the CALENDAR time. More...
hal_status_t | hal_calendar_get_time (calendar_handle_t *p_calendar, calendar_time_t *p_time)
| Get current CALENDAR time. More...
hal_status_t | hal_calendar_set_alarm (calendar_handle_t *p_calendar, calendar_alarm_t *p_alarm)
| Set a CALENDAR date alarm. More...
hal_status_t | hal_calendar_set_tick (calendar_handle_t *p_calendar, uint32_t interval)
| Set a CALENDAR tick 0 alarm. More...
hal_status_t | hal_calendar_disable_event (calendar_handle_t *p_calendar, uint32_t disable_mode)
| Disable CALENDAR alarm event. More...
hal_status_t | hal_calendar_sync_time (calendar_handle_t *p_calendar, float SlowClockFreq)
| Sync slow clock to calendar. More...
void | hal_calendar_irq_handler (calendar_handle_t *p_calendar)
| Handle CALENDAR interrupt request. More...
void | hal_calendar_alarm_callback (calendar_handle_t *p_calendar)
| CALENDAR date count complete (counter reaches to alarm) callback. More...
void | hal_calendar_tick_callback (calendar_handle_t *p_calendar)
| CALENDAR milliseconds count complete (counter reaches to 0) callback. More...
void | hal_calendar_overflow_callback (calendar_handle_t *p_calendar)
| CALENDAR overflow callback. More...

## Detailed Description

Header file containing functions prototypes of CALENDAR 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_calendar.h.