Header file containing functions prototypes of CALENDAR HAL library. More...
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 AON_CALENDAR_TIMER_CTL_ALARM_INT_EN |
#define | CALENDAR_IT_WARP AON_CALENDAR_TIMER_CTL_WRAP_INT_EN |
#define | CALENDAR_FLAG_ALARM AON_SLP_EVENT_CALENDAR_TIMER_ALARM |
#define | CALENDAR_FLAG_WARP AON_SLP_EVENT_CALENDAR_TIMER_WRAP |
#define | CALENDAR_ALARM_SEL_DATE (0UL) |
#define | CALENDAR_ALARM_SEL_WEEKDAY (1UL) |
#define | CALENDAR_ALARM_WEEKDAY_SUN (0x01ul) |
#define | CALENDAR_ALARM_WEEKDAY_MON (0x02ul) |
#define | CALENDAR_ALARM_WEEKDAY_TUE (0x04ul) |
#define | CALENDAR_ALARM_WEEKDAY_WED (0x08ul) |
#define | CALENDAR_ALARM_WEEKDAY_THU (0x10ul) |
#define | CALENDAR_ALARM_WEEKDAY_FRI (0x20ul) |
#define | CALENDAR_ALARM_WEEKDAY_SAT (0x40ul) |
#define | CALENDAR_ALARM_DISABLE_DATE (1UL) |
#define | CALENDAR_ALARM_DISABLE_TICK (2UL) |
#define | CALENDAR_ALARM_DISABLE_ALL ((CALENDAR_ALARM_DISABLE_DATE) | CALENDAR_ALARM_DISABLE_TICK) |
#define | __HAL_CALENDAR_ENABLE() SET_BITS(AON->CALENDAR_TIMER_CTL, AON_CALENDAR_TIMER_CTL_EN) |
Enable the specified CALENDAR peripheral. More... | |
#define | __HAL_CALENDAR_DISABLE() CLEAR_BITS(AON->CALENDAR_TIMER_CTL, AON_CALENDAR_TIMER_CTL_EN) |
Disable the specified CALENDAR peripheral. More... | |
#define | __HAL_CALENDAR_ENABLE_IT(__INTERRUPT__) SET_BITS(AON->CALENDAR_TIMER_CTL, (__INTERRUPT__)) |
Enable the specified CALENDAR interrupts. More... | |
#define | __HAL_CALENDAR_DISABLE_IT(__INTERRUPT__) CLEAR_BITS(AON->CALENDAR_TIMER_CTL, (__INTERRUPT__)) |
Disable the specified CALENDAR interrupts. More... | |
#define | __HAL_CALENDAR_GET_IT_SOURCE(__FLAG__) (READ_BITS(AON->SLP_EVENT, (__FLAG__)) == (__FLAG__)) |
Check whether the specified CALENDAR interrupt flag is set or not. More... | |
#define | __HAL_CALENDAR_CLEAR_FLAG(__FLAG__) WRITE_REG(AON->SLP_EVENT, ~(__FLAG__)) |
Clear the specified CALENDAR 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... | |
Enumerations | |
enum | hal_calender_state_t { HAL_CALENDAR_STATE_RESET = 0x00, HAL_CALENDAR_STATE_READY = 0x01, HAL_CALENDAR_STATE_ERROR = 0x04 } |
HAL CALENDAR State Enumerations 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 alarm. More... | |
hal_status_t | hal_calendar_disable_event (calendar_handle_t *p_calendar, uint32_t disable_mode) |
Disable CALENDAR alarm event. 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 callback. More... | |
void | hal_calendar_tick_callback (calendar_handle_t *p_calendar) |
CALENDAR milliseconds count complete callback. More... | |
void | hal_calendar_overflow_callback (calendar_handle_t *p_calendar) |
CALENDAR overflow callback. More... | |
Header file containing functions prototypes of CALENDAR HAL library.
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.