RTC driver APIs. More...
Data Structures | |
| struct | rtc_alarm_config_t |
| RTC alarm configuration. More... | |
Macros | |
| #define | RTC_ALARM_TYPE_ONE_SHOT (0U) |
| RTC Alarm type. More... | |
| #define | RTC_ALARM_TYPE_PERIODIC (1U) |
| #define | RTC_ALARM_TYPE_ABSOLUTE_TIME_ONE_SHOT (2U) |
| #define | ALARM_PERIOD_ONE_SEC (1UL) |
| Typical RTC alarm period definitions. More... | |
| #define | ALARM_PERIOD_ONE_MIN (60UL) |
| #define | ALARM_PERIOD_ONE_HOUR (3600U) |
| #define | ALARM_PERIOD_ONE_DAY (ALARM_PERIOD_ONE_HOUR * 24UL) |
Functions | |
| hpm_stat_t | rtc_config_time (RTC_Type *base, time_t time) |
| Configure the RTC time. More... | |
| hpm_stat_t | rtc_config_alarm (RTC_Type *base, rtc_alarm_config_t *config) |
| Configure RTC Alarm. More... | |
| time_t | rtc_get_time (RTC_Type *base) |
| Get the time returned by RTC module. More... | |
| struct timeval | rtc_get_timeval (RTC_Type *base) |
| Get accurate time return by RTC module. More... | |
| static void | rtc_enable_alarm_interrupt (RTC_Type *base, uint32_t index, bool enable) |
| Enable RTC alarm interrupt. More... | |
| static void | rtc_clear_alarm_flag (RTC_Type *base, uint32_t index) |
| Clear RTC alarm flag based on alarm index. More... | |
| static void | rtc_clear_alarm_flags (RTC_Type *base, uint32_t masks) |
| Clear RTC alarm flags based on flag masks. More... | |
| static bool | rtc_is_alarm_flag_asserted (RTC_Type *base, uint32_t index) |
| Check whether RTC alarm flag is set or not. More... | |
| static uint32_t | rtc_get_alarm_flags (RTC_Type *base) |
| Get the RTC alarm flags. More... | |
RTC driver APIs.
| #define ALARM_PERIOD_ONE_DAY (ALARM_PERIOD_ONE_HOUR * 24UL) |
#include <drivers/inc/hpm_rtc_drv.h>
Alarm period: 1 day
| #define ALARM_PERIOD_ONE_HOUR (3600U) |
#include <drivers/inc/hpm_rtc_drv.h>
Alarm period: 1 hour
| #define ALARM_PERIOD_ONE_MIN (60UL) |
#include <drivers/inc/hpm_rtc_drv.h>
Alarm period: 1 minute
| #define ALARM_PERIOD_ONE_SEC (1UL) |
| #define RTC_ALARM_TYPE_ABSOLUTE_TIME_ONE_SHOT (2U) |
#include <drivers/inc/hpm_rtc_drv.h>
The RTC alarm will be triggered via the absolute time provided via period
| #define RTC_ALARM_TYPE_ONE_SHOT (0U) |
| #define RTC_ALARM_TYPE_PERIODIC (1U) |
#include <drivers/inc/hpm_rtc_drv.h>
The RTC alarm will be triggered periodically
|
inlinestatic |
#include <drivers/inc/hpm_rtc_drv.h>
Clear RTC alarm flag based on alarm index.
| [in] | base | RTC base address |
| [in] | index | RTC alarm index, valid value is 0 or 1 |
|
inlinestatic |
#include <drivers/inc/hpm_rtc_drv.h>
Clear RTC alarm flags based on flag masks.
| [in] | base | RTC base address |
| [in] | masks | RTC alarm masks |
| hpm_stat_t rtc_config_alarm | ( | RTC_Type * | base, |
| rtc_alarm_config_t * | config | ||
| ) |
#include <drivers/inc/hpm_rtc_drv.h>
Configure RTC Alarm.
| [in] | base | RTC base address |
| [in] | config | RTC alarm configuration pointer |
| API | execution status status_success or status_invalid_argument; |
| hpm_stat_t rtc_config_time | ( | RTC_Type * | base, |
| time_t | time | ||
| ) |
#include <drivers/inc/hpm_rtc_drv.h>
Configure the RTC time.
| [in] | base | RTC base address |
| [in] | time | seconds since 1970.1.1, 0:0:0 |
| API | execution status status_success or status_invalid_argument |
|
inlinestatic |
#include <drivers/inc/hpm_rtc_drv.h>
Enable RTC alarm interrupt.
| [in] | base | RTC base address |
| [in] | index | RTC alarm index, valid value is 0 or 1 |
| [in] | enable | RTC alarm enable flag
|
|
inlinestatic |
#include <drivers/inc/hpm_rtc_drv.h>
Get the RTC alarm flags.
| [in] | base | RTC base address |
| time_t rtc_get_time | ( | RTC_Type * | base | ) |
#include <drivers/inc/hpm_rtc_drv.h>
Get the time returned by RTC module.
| [in] | base | RTC base address |
| RTC | time |
| struct timeval rtc_get_timeval | ( | RTC_Type * | base | ) |
#include <drivers/inc/hpm_rtc_drv.h>
Get accurate time return by RTC module.
| [in] | base | RTC base address |
|
inlinestatic |
#include <drivers/inc/hpm_rtc_drv.h>
Check whether RTC alarm flag is set or not.
| [in] | base | RTC base address |
| [in] | index | RTC alarm index, valid value is 0 or 1 |
| RTC | alarm flag. Valid value is true or false |