Implement RTC module's registers
This commit is contained in:
parent
699569ec99
commit
a02bcecaec
125
drv/rtc_regs.h
Normal file
125
drv/rtc_regs.h
Normal file
@ -0,0 +1,125 @@
|
||||
/** @file rtc_regs.h
|
||||
* Module defining the Real-Time Clock (RTC) registers.
|
||||
*
|
||||
* Mainly made to be used by the rtc module. It is recommanded to go through
|
||||
* the functions provided by that module instead of directly using the registers
|
||||
* defined here.
|
||||
*/
|
||||
|
||||
#ifndef _RTC_REGS_H_
|
||||
#define _RTC_REGS_H_
|
||||
|
||||
//--includes--------------------------------------------------------------------
|
||||
|
||||
#include "stdint.h"
|
||||
|
||||
|
||||
//--type definitions------------------------------------------------------------
|
||||
|
||||
#define RTC_BASE_ADDRESS 0x40002800
|
||||
|
||||
union RTC_CRH {
|
||||
struct {
|
||||
uint32_t SECIE:1;
|
||||
uint32_t ALRIE:1;
|
||||
uint32_t OWIE:1;
|
||||
uint32_t reserved1:29;
|
||||
};
|
||||
uint32_t word;
|
||||
};
|
||||
|
||||
union RTC_CRL {
|
||||
struct {
|
||||
uint32_t SECF:1;
|
||||
uint32_t ALRF:1;
|
||||
uint32_t OWF:1;
|
||||
uint32_t RSF:1;
|
||||
uint32_t CNF:1;
|
||||
uint32_t RTOFF:1;
|
||||
uint32_t reserved1:26;
|
||||
};
|
||||
uint32_t word;
|
||||
};
|
||||
|
||||
union RTC_PRLH {
|
||||
struct {
|
||||
uint32_t PRL:4;
|
||||
uint32_t reserved1:28;
|
||||
};
|
||||
uint32_t word;
|
||||
};
|
||||
|
||||
union RTC_PRLL {
|
||||
struct {
|
||||
uint32_t PRL:16;
|
||||
uint32_t reserved1:16;
|
||||
};
|
||||
uint32_t word;
|
||||
};
|
||||
|
||||
union RTC_DIVH {
|
||||
struct {
|
||||
uint32_t RTC_DIV:4;
|
||||
uint32_t reserved1:28;
|
||||
};
|
||||
uint32_t word;
|
||||
};
|
||||
|
||||
union RTC_DIVL {
|
||||
struct {
|
||||
uint32_t RTC_DIV:16;
|
||||
uint32_t reserved1:16;
|
||||
};
|
||||
uint32_t word;
|
||||
};
|
||||
|
||||
union RTC_CNTH {
|
||||
struct {
|
||||
uint32_t RTC_CNT:16;
|
||||
uint32_t reserved1:16;
|
||||
};
|
||||
uint32_t word;
|
||||
};
|
||||
|
||||
union RTC_CNTL {
|
||||
struct {
|
||||
uint32_t RTC_CNT:16;
|
||||
uint32_t reserved1:16;
|
||||
};
|
||||
uint32_t word;
|
||||
};
|
||||
|
||||
union RTC_ALRH {
|
||||
struct {
|
||||
uint32_t RTC_ALR:16;
|
||||
uint32_t reserved1:16;
|
||||
};
|
||||
uint32_t word;
|
||||
};
|
||||
|
||||
union RTC_ALRL {
|
||||
struct {
|
||||
uint32_t RTC_ALR:16;
|
||||
uint32_t reserved1:16;
|
||||
};
|
||||
uint32_t word;
|
||||
};
|
||||
|
||||
struct RTC {
|
||||
union RTC_CRH CRH;
|
||||
union RTC_CRL CRL;
|
||||
union RTC_PRLH PRLH;
|
||||
union RTC_PRLL PRLL;
|
||||
union RTC_DIVH DIVH;
|
||||
union RTC_DIVL DIVL;
|
||||
union RTC_CNTH CNTH;
|
||||
union RTC_CNTL CNTL;
|
||||
union RTC_ALRH ALRH;
|
||||
union RTC_ALRL ALRL;
|
||||
};
|
||||
|
||||
|
||||
//--functions-------------------------------------------------------------------
|
||||
|
||||
#endif //_RTC_REGS_H_
|
||||
|
||||
Loading…
Reference in New Issue
Block a user