Kamcho Library 02.00.03  lib.kamcho.02.00.03.287
rtc_sfrs.h
Go to the documentation of this file.
1 
12 #ifndef __RTC_SFRS_H__
13 #define __RTC_SFRS_H__
14 
18 typedef struct {
19  union {
20  struct {
21  uint8_t TRIM:2;
22  uint8_t DIV:2;
23  uint8_t RESERVED:4;
24  };
25  uint8_t BYTE;
26  } RTCCTRL;
27 } RTC_SFRS_t;
28 
32 #define RTC_SFRS ((__IO RTC_SFRS_t *)(ASIC_16B_BASE + 0x801A))
33 
34 #define E_RTC_DIV_128 0
35 #define E_RTC_DIV_2048 1
36 #define E_RTC_DIV_32768 2
37 #define E_RTC_DIV_524288 3
38 
39 #define E_RTC_TRIM_150K 0
40 #define E_RTC_TRIM_200K 1
41 #define E_RTC_TRIM_250K 2
42 #define E_RTC_TRIM_350K 3
43 
49 static __INLINE void f_RTC_Div(uint8_t val)
50 {
51  RTC_SFRS->RTCCTRL.DIV = val;
52 }
53 
59 static __INLINE void f_RTC_Trim(uint8_t val)
60 {
61  RTC_SFRS->RTCCTRL.TRIM = val;
62 }
63 #endif /* __RTC_SFRS_H__ */
A structure to represent Special Function Registers for RTC.
Definition: rtc_sfrs.h:18
#define RTC_SFRS
The starting address of RTC SFRS.
Definition: rtc_sfrs.h:32
uint8_t BYTE
Definition: rtc_sfrs.h:25
static __INLINE void f_RTC_Trim(uint8_t val)
Set RTC trim value.
Definition: rtc_sfrs.h:59
static __INLINE void f_RTC_Div(uint8_t val)
Set RTC clock divider.
Definition: rtc_sfrs.h:49