SDK4.0
This document shows Ameba SDK 4.0 APIs
Data Structures | Variables

rtc functions More...

Data Structures

struct  alarm_s
 

Variables

uint32_t yday
 
uint32_t hour
 
uint32_t min
 
uint32_t sec
 

AmebaZ Only

typedef void(* alarm_irq_handler) (void)
 
typedef struct alarm_s alarm_t
 
u32 rtc_set_alarm (alarm_t *alrm, alarm_irq_handler alarmHandler)
 Set the specified RTC Alarm and interrupt. More...
 
void rtc_disable_alarm (void)
 Disable RTC Alarm and function. More...
 

Ameba Common

void rtc_init (void)
 Initializes the RTC device, include clock, RTC registers and function. More...
 
void rtc_free (void)
 Deinitializes the RTC device. More...
 
int rtc_isenabled (void)
 This function tells whether RTC is enabled or not. More...
 
time_t rtc_read (void)
 Get current timestamp in seconds from RTC. More...
 
void rtc_write (time_t t)
 Set the specified timestamp in seconds to RTC. More...
 

Detailed Description

rtc functions

Function Documentation

void rtc_disable_alarm ( void  )

Disable RTC Alarm and function.

Parameters
none
Return values
none
void rtc_free ( void  )

Deinitializes the RTC device.

Parameters
none
Return values
none
void rtc_init ( void  )

Initializes the RTC device, include clock, RTC registers and function.

Parameters
none
Return values
none
int rtc_isenabled ( void  )

This function tells whether RTC is enabled or not.

Parameters
none
Return values
1RTC is enable.
0RTC is disable.
time_t rtc_read ( void  )

Get current timestamp in seconds from RTC.

Parameters
none
Return values
The current timestamp in seconds which is calculated from 1970.1.1 00:00:00.
u32 rtc_set_alarm ( alarm_t alrm,
alarm_irq_handler  alarmHandler 
)

Set the specified RTC Alarm and interrupt.

Parameters
alarmalarm object define in application software.
alarmHandleralarm interrupt callback function.
Return values
status
  • 1: success
  • Others: failure
void rtc_write ( time_t  t)

Set the specified timestamp in seconds to RTC.

Parameters
tSeconds from 1970.1.1 00:00:00 to specified data and time which is to be set.
Return values
none