Kamcho Library 02.00.03  lib.kamcho.02.00.03.287
timer_sfrs.h
Go to the documentation of this file.
1 
12 #ifndef __TIMER_SFRS_H__
13 #define __TIMER_SFRS_H__
14 
18 typedef struct {
19  __IO int32_t COUNT;
20  __IO uint8_t CFG;
21 } TIMER_SFRS_t;
22 
26 #define TIMER0_SFRS ((TIMER_SFRS_t *) (TIMER_BASE + 0x00))
27 
31 #define TIMER1_SFRS ((TIMER_SFRS_t *) (TIMER_BASE + 0x08))
32 
36 #define TIMER2_SFRS ((TIMER_SFRS_t *) (TIMER_BASE + 0x10))
37 
38 
42 static __INLINE void f_Timer0_Start(void)
43 {
44  TIMER0_SFRS->CFG = 1;
45 }
46 
50 static __INLINE void f_Timer0_Stop(void)
51 {
52  TIMER0_SFRS->CFG = 0;
53 }
54 
58 static __INLINE void f_Timer0_LoadCounter(uint32_t cnt)
59 {
60  TIMER0_SFRS->COUNT = cnt;
61 }
62 
66 static __INLINE void f_Timer1_Start(void)
67 {
68  TIMER1_SFRS->CFG = 1;
69 }
70 
74 static __INLINE void f_Timer1_Stop(void)
75 {
76  TIMER1_SFRS->CFG = 0;
77 }
78 
82 static __INLINE void f_Timer1_LoadCounter(uint32_t cnt)
83 {
84  TIMER1_SFRS->COUNT = cnt;
85 }
86 
90 static __INLINE void f_Timer2_Start(void)
91 {
92  TIMER2_SFRS->CFG = 1;
93 }
94 
98 static __INLINE void f_Timer2_Stop(void)
99 {
100  TIMER2_SFRS->CFG = 0;
101 }
102 
106 static __INLINE void f_Timer2_LoadCounter(uint32_t cnt)
107 {
108  TIMER2_SFRS->COUNT = cnt;
109 }
110 #endif /* __TIMER_SFRS_H__ */
static __INLINE void f_Timer0_Start(void)
Start timer 0.
Definition: timer_sfrs.h:42
#define TIMER1_SFRS
Starting address for Timer1 SFRS.
Definition: timer_sfrs.h:31
#define TIMER2_SFRS
Starting address for Timer2 SFRS.
Definition: timer_sfrs.h:36
static __INLINE void f_Timer0_Stop(void)
Stop timer 0.
Definition: timer_sfrs.h:50
static __INLINE void f_Timer2_Start(void)
Start timer 2.
Definition: timer_sfrs.h:90
static __INLINE void f_Timer2_LoadCounter(uint32_t cnt)
Load timing setting for timer 2.
Definition: timer_sfrs.h:106
__IO uint8_t CFG
Definition: timer_sfrs.h:20
static __INLINE void f_Timer1_Stop(void)
Stop timer 1.
Definition: timer_sfrs.h:74
static __INLINE void f_Timer1_LoadCounter(uint32_t cnt)
Load timing setting for timer 1.
Definition: timer_sfrs.h:82
static __INLINE void f_Timer1_Start(void)
Start timer 1.
Definition: timer_sfrs.h:66
static __INLINE void f_Timer2_Stop(void)
Stop timer 2.
Definition: timer_sfrs.h:98
__IO int32_t COUNT
Definition: timer_sfrs.h:19
A structure to represent Special Function Registers for timers.
Definition: timer_sfrs.h:18
static __INLINE void f_Timer0_LoadCounter(uint32_t cnt)
Load timing setting for timer 0.
Definition: timer_sfrs.h:58
#define TIMER0_SFRS
Starting address for Timer0 SFRS.
Definition: timer_sfrs.h:26