GPS Device
Loading...
Searching...
No Matches
stm32f401re_rtc.h
Go to the documentation of this file.
1
31
37
38#ifndef STM32F401RE_RTC_H__
39#define STM32F401RE_RTC_H__
40
41#include <stdint.h>
42#include "err.h"
43
50
67
87
96typedef struct {
97 uint8_t hours;
98 uint8_t minutes;
99 uint8_t seconds;
100} TIME_ts;
101
110typedef struct {
111 uint16_t year;
114 uint8_t date;
116
118
125
149ERR_te rtc_init(void);
150
163void rtc_set_calendar(CALENDAR_ts const *date);
164
175void rtc_set_time(TIME_ts const *time);
176
189void rtc_get_time(TIME_ts *time);
190
192
193#endif
194
System-wide error code definitions.
ERR_te
Standard return type used by all public API functions.
Definition err.h:35
void rtc_get_time(TIME_ts *time)
Reads the current time from the RTC.
void rtc_set_calendar(CALENDAR_ts const *date)
Sets the RTC calendar (date and weekday).
void rtc_set_time(TIME_ts const *time)
Sets the RTC time (hours, minutes, seconds).
ERR_te rtc_init(void)
Initializes the RTC peripheral.
WEEK_DAYS_te
Day of the week.
MONTHS_te
Month of the year.
@ WEEK_DAYS_MONDAY
@ WEEK_DAYS_SATURDAY
@ WEEK_DAYS_THURSDAY
@ WEEK_DAYS_SUNDAY
@ WEEK_DAYS_FRIDAY
@ WEEK_DAYS_TUESDAY
@ WEEK_DAYS_WEDNESDAY
@ MONTHS_MARCH
@ MONTHS_AUGUST
@ MONTHS_SEPTEMBER
@ MONTHS_DECEMBER
@ MONTHS_JULE
@ MONTHS_NOVEMBER
@ MONTHS_JUNE
@ MONTHS_MAY
@ MONTHS_APRIL
@ MONTHS_JANUARY
@ MONTHS_OCTOBER
@ MONTHS_FEBRUARY
Holds a calendar date (year, month, day, weekday).
MONTHS_te months
WEEK_DAYS_te week_days
Holds a time-of-day value (hours, minutes, seconds).
uint8_t seconds
uint8_t hours
uint8_t minutes