RTC
RTC API Status
API |
BK7258_AP |
|---|---|
Y |
|
Y |
|
Y |
|
Y |
|
Y |
|
Y |
RTC API Reference
Header File
Functions
-
uint64_t bk_aon_rtc_get_current_tick(aon_rtc_id_t id)
Get AON RTC current tick with 64 bits AON RTC uses 32 Bits counter with 32K clock, the max time is about 36.4 hours. The 32K clock really frequency is 32768 HZ(External 32K XTL) or 32000 HZ(Internel ROSC). Set upper interrupt as the 0xFFFFFFFF ticks as one round. @id: register to which aon_rtc id.
- 返回
BK_OK: succeed
others: other errors.
-
bk_err_t bk_rtc_gettimeofday(struct timeval *tv, void *ptz)
Get time of day.
@tv: Define parameters according to “structure timeval”
- 返回
BK_OK: succeed
others: other errors.
-
bk_err_t bk_rtc_settimeofday(const struct timeval *tv, const struct timezone *tz)
Set time of day.
@tv: Define parameters according to “structure timeval” @tz: Define parameters according to “structure timezone”
- 返回
BK_OK: succeed
others: other errors.
-
float bk_rtc_get_ms_tick_count(void)
Get aon rtc ticks of per ms.
- 返回
aon rtc ticks of per ms |- EXTERN 32K: 32.768 |- Default: 32.000
-
uint32_t bk_rtc_get_clock_freq(void)
Get aon rtc clock freq.
- 返回
aon rtc clock freq |- EXTERN 32K: 32768 |- Default: 32000
-
uint64_t bk_aon_rtc_get_us(void)
Get AON RTC current us with 64 bits AON RTC uses 32 Bits counter with 32K clock, the max time is about 36.4 hours. The 32K clock really frequency is 32768 HZ(External 32K XTL) or 32000 HZ(Internel ROSC). Set upper interrupt as the 0xFFFFFFFF ticks as one round. @id: use AON_RTC_ID_1.
- 返回
AON RTC current us with 64 bits with about +30us/-30us presision
-
uint64_t bk_aon_rtc_get_ms(void)
Get AON RTC current ms with 64 bits AON RTC uses 32 Bits counter with 32K clock, the max time is about 36.4 hours. The 32K clock really frequency is 32768 HZ(External 32K XTL) or 32000 HZ(Internel ROSC). Set upper interrupt as the 0xFFFFFFFF ticks as one round. @id: use AON_RTC_ID_1.
- 返回
AON RTC current us with 64 bits with about +30us/-30us presision
RTC API Typedefs
Header File
Structures
-
struct aon_rtc_int_config_t
-
struct _alarm_info_t
-
struct _alarm_node_t
Macros
-
ALARM_NAME_MAX_LEN
-
ALARM_LOOP_FOREVER
-
AON_RTC_EXTERN_32K_CLOCK_FREQ
-
AON_RTC_DEFAULT_CLOCK_FREQ
-
AON_RTC_MS_TICK_CNT
-
AON_RTC_PRECISION_TICK
-
AON_RTC_ROUND_TICK
-
AON_RTC_MAX_ALARM_CNT
-
BK_ERR_AON_RTC_DRIVER_NOT_INIT
AON RTC interrupt service routine.
AON_RTC driver not init
Type Definitions
-
typedef uint32_t rtc_tick_t
-
typedef void (*aon_rtc_isr_t)(aon_rtc_id_t id, uint8_t *name_p, void *param)
-
typedef struct _alarm_info_t alarm_info_t
-
typedef struct _alarm_node_t alarm_node_t