Add more RTC functions and an RTC example.
Thanks Lord James <lordjames@y7mail.com> for the patch!
This commit is contained in:
@@ -401,5 +401,6 @@ u32 rcc_get_system_clock_source(int i);
|
||||
void rcc_clock_setup_in_hsi_out_64mhz(void);
|
||||
void rcc_clock_setup_in_hse_8mhz_out_72mhz(void);
|
||||
void rcc_clock_setup_in_hse_16mhz_out_72mhz(void);
|
||||
void rcc_backupdomain_reset(void);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#include <libopenstm32/memorymap.h>
|
||||
#include <libopenstm32/common.h>
|
||||
#include <libopenstm32/pwr.h>
|
||||
|
||||
/* --- RTC registers ------------------------------------------------------- */
|
||||
|
||||
@@ -120,6 +121,26 @@
|
||||
|
||||
/* --- Function prototypes --------------------------------------------------*/
|
||||
|
||||
/* TODO */
|
||||
typedef enum {
|
||||
RTC_SEC, RTC_ALR, RTC_OW,
|
||||
} rtcflag_t;
|
||||
|
||||
void rtc_awake_from_off(osc_t clock_source);
|
||||
void rtc_enter_config_mode(void);
|
||||
void rtc_exit_config_mode(void);
|
||||
void rtc_set_alarm_time(u32 alarm_time);
|
||||
void rtc_enable_alarm(void);
|
||||
void rtc_disable_alarm(void);
|
||||
void rtc_set_prescale_val(u32 prescale_val);
|
||||
u32 rtc_get_counter_val(void);
|
||||
u32 rtc_get_prescale_div_val(void);
|
||||
u32 rtc_get_alarm_val(void);
|
||||
void rtc_set_counter_val(u32 counter_val);
|
||||
void rtc_interrupt_enable(rtcflag_t flag_val);
|
||||
void rtc_interrupt_disable(rtcflag_t flag_val);
|
||||
void rtc_clear_flag(rtcflag_t flag_val);
|
||||
u32 rtc_check_flag(rtcflag_t flag_val);
|
||||
void rtc_awake_from_standby(void);
|
||||
void rtc_auto_awake(osc_t clock_source, u32 prescale_val);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user