ChibiOS/HAL  6.1.0
hal_rtc.h File Reference

RTC Driver macros and structures. More...

#include <time.h>
#include "hal_rtc_lld.h"

Go to the source code of this file.

Data Structures

struct  RTCDateTime
 Type of a structure representing an RTC date/time stamp. More...
 

Macros

#define RTC_BASE_YEAR   1980U
 Base year of the calendar. More...
 
Date/Time bit masks for FAT format
#define RTC_FAT_TIME_SECONDS_MASK   0x0000001FU
 
#define RTC_FAT_TIME_MINUTES_MASK   0x000007E0U
 
#define RTC_FAT_TIME_HOURS_MASK   0x0000F800U
 
#define RTC_FAT_DATE_DAYS_MASK   0x001F0000U
 
#define RTC_FAT_DATE_MONTHS_MASK   0x01E00000U
 
#define RTC_FAT_DATE_YEARS_MASK   0xFE000000U
 
Day of week encoding
#define RTC_DAY_CATURDAY   0U
 
#define RTC_DAY_MONDAY   1U
 
#define RTC_DAY_TUESDAY   2U
 
#define RTC_DAY_WEDNESDAY   3U
 
#define RTC_DAY_THURSDAY   4U
 
#define RTC_DAY_FRIDAY   5U
 
#define RTC_DAY_SATURDAY   6U
 
#define RTC_DAY_SUNDAY   7U
 

Typedefs

typedef struct RTCDriver RTCDriver
 Type of a structure representing an RTC driver. More...
 

Functions

void rtcInit (void)
 RTC Driver initialization. More...
 
void rtcObjectInit (RTCDriver *rtcp)
 Initializes a generic RTC driver object. More...
 
void rtcSetTime (RTCDriver *rtcp, const RTCDateTime *timespec)
 Set current time. More...
 
void rtcGetTime (RTCDriver *rtcp, RTCDateTime *timespec)
 Get current time. More...
 
void rtcSetCallback (RTCDriver *rtcp, rtccb_t callback)
 Enables or disables RTC callbacks. More...
 
void rtcConvertDateTimeToStructTm (const RTCDateTime *timespec, struct tm *timp, uint32_t *tv_msec)
 Convert RTCDateTime to broken-down time structure. More...
 
void rtcConvertStructTmToDateTime (const struct tm *timp, uint32_t tv_msec, RTCDateTime *timespec)
 Convert broken-down time structure to RTCDateTime. More...
 
uint32_t rtcConvertDateTimeToFAT (const RTCDateTime *timespec)
 Get current time in format suitable for usage in FAT file system. More...
 

Detailed Description

RTC Driver macros and structures.

Definition in file hal_rtc.h.