#ifndef RTC_H_
#include "boardcfg.h"
//#include <stdint.h>
//#include <stdbool.h>
#define BKP_DR1                           ((u16)0x0004)

typedef struct {
	u16 year;	/* 1..4095 */
	u8  month;	/* 1..12 */
	u8  mday;	/* 1.. 31 */
	u8  wday;	/* 0..6, Sunday = 0*/
	u8  hour;	/* 0..23 */
	u8  min;	/* 0..59 */
	u8  sec;	/* 0..59 */
	u8  dst;	/* 0 Winter, !=0 Summer */
} RTC_t;

int rtc_init(void);
bool rtc_gettime (RTC_t*);					/* Get time */
bool rtc_settime (const RTC_t*);				/* Set time */

#endif
