libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
f1/rtc.h File Reference
Include dependency graph for f1/rtc.h:

Go to the source code of this file.

Macros

#define RTC_CRH   MMIO32(RTC_BASE + 0x00)
 
#define RTC_CRL   MMIO32(RTC_BASE + 0x04)
 
#define RTC_PRLH   MMIO32(RTC_BASE + 0x08)
 
#define RTC_PRLL   MMIO32(RTC_BASE + 0x0c)
 
#define RTC_DIVH   MMIO32(RTC_BASE + 0x10)
 
#define RTC_DIVL   MMIO32(RTC_BASE + 0x14)
 
#define RTC_CNTH   MMIO32(RTC_BASE + 0x18)
 
#define RTC_CNTL   MMIO32(RTC_BASE + 0x1c)
 
#define RTC_ALRH   MMIO32(RTC_BASE + 0x20)
 
#define RTC_ALRL   MMIO32(RTC_BASE + 0x24)
 
#define RTC_CRH_OWIE   (1 << 2)
 
#define RTC_CRH_ALRIE   (1 << 1)
 
#define RTC_CRH_SECIE   (1 << 0)
 
#define RTC_CRL_RTOFF   (1 << 5)
 
#define RTC_CRL_CNF   (1 << 4)
 
#define RTC_CRL_RSF   (1 << 3)
 
#define RTC_CRL_OWF   (1 << 2)
 
#define RTC_CRL_ALRF   (1 << 1)
 
#define RTC_CRL_SECF   (1 << 0)
 

Enumerations

enum  rtcflag_t { RTC_SEC , RTC_ALR , RTC_OW }
 RTC Interrupt Flags. More...
 

Functions

void rtc_awake_from_off (enum rcc_osc clock_source)
 RTC Set Operational from the Off state. More...
 
void rtc_enter_config_mode (void)
 RTC Enter Configuration Mode. More...
 
void rtc_exit_config_mode (void)
 RTC Leave Configuration Mode. More...
 
void rtc_set_alarm_time (uint32_t alarm_time)
 RTC Set the Alarm Time. More...
 
void rtc_enable_alarm (void)
 RTC Enable the Alarm. More...
 
void rtc_disable_alarm (void)
 RTC Disable the Alarm. More...
 
void rtc_set_prescale_val (uint32_t prescale_val)
 RTC Set the prescaler Value. More...
 
uint32_t rtc_get_counter_val (void)
 RTC return the Counter Value. More...
 
uint32_t rtc_get_prescale_div_val (void)
 RTC return the prescaler Value. More...
 
uint32_t rtc_get_alarm_val (void)
 RTC return the Alarm Value. More...
 
void rtc_set_counter_val (uint32_t counter_val)
 RTC set the Counter. More...
 
void rtc_interrupt_enable (rtcflag_t flag_val)
 RTC Enable Interrupt. More...
 
void rtc_interrupt_disable (rtcflag_t flag_val)
 RTC Disable Interrupt. More...
 
void rtc_clear_flag (rtcflag_t flag_val)
 RTC Clear an Interrupt Flag. More...
 
uint32_t rtc_check_flag (rtcflag_t flag_val)
 RTC Return a Flag Setting. More...
 
void rtc_awake_from_standby (void)
 RTC Start RTC after Standby Mode. More...
 
void rtc_auto_awake (enum rcc_osc clock_source, uint32_t prescale_val)
 RTC Configuration on Wakeup. More...