-
Notifications
You must be signed in to change notification settings - Fork 0
/
RCC_private.h
143 lines (128 loc) · 2.55 KB
/
RCC_private.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/*
* private.h
*
* Created on: 4 Aug 2019
* Author: Yahia
*/
#ifndef RCC_PRIVATE_H_
#define RCC_PRIVATE_H_
#include "std_types.h"
#include "common_macros.h"
/* Define the size of register in STM32F103C8T6 */
#define SIZE_OF_REGISTER 32
/* Check if the peripheral id is in the RCC_APB2RSTR register */
#define PERIPHERAL_IN_RCC_APB2RSTR (peripheralIdx < 32)
/* Check if the peripheral id is in the RCC_APB1RSTR register */
#define PERIPHERAL_IN_RCC_APB1RSTR (peripheralIdx < 64)
/* Check if the peripheral id is in the RCC_AHBENR register */
#define PERIPHERAL_IN_RCC_AHBENR (peripheralIdx < 32)
/* Check if the peripheral id is in the RCC_APB2ENR register */
#define PERIPHERAL_IN_RCC_APB2ENR (peripheralIdx < 64)
/* Check if the peripheral id is in the RCC_APB1ENR register */
#define PERIPHERAL_IN_RCC_APB1ENR (peripheralIdx < 96)
/* * * * * * * * * * * * * * * * * * * * * *
* Clock control register (RCC_CR) Pins *
* * * * * * * * * * * * * * * * * * * * * */
enum{
HSION,
HSIRDY,
HSITRIM0 = 3,
HSITRIM1,
HSITRIM2,
HSITRIM3,
HSITRIM4,
HSICAL0,
HSICAL1,
HSICAL2,
HSICAL3,
HSICAL4,
HSICAL5,
HSICAL6,
HSICAL7,
HSEON,
HSERDY,
HSEBYP,
CSSON,
PLLON = 24,
PLLRDY
};
/* * * * * * * * * * * * * * * * * * * * * * * * * *
* Clock configuration register (RCC_CFGR) Pins *
* * * * * * * * * * * * * * * * * * * * * * * * * */
enum{
SW0,
SW1,
SWS0,
SWS1,
HPRE0,
HPRE1,
HPRE2,
HPRE3,
PPRE10,
PPRE11,
PPRE12,
PPRE20,
PPRE21,
PPRE22,
ADCPRE0,
ADCPRE1,
PLLSRC,
PLLXTPRE,
PLLMUL0,
PLLMUL1,
PLLMUL2,
PLLMUL3,
USBPRE,
MCO0 = 24,
MCO1,
MCO2
};
/* * * * * * * * * * * * * * * * * * * * * * * *
* Clock interrupt register (RCC_CIR) Pins *
* * * * * * * * * * * * * * * * * * * * * * * */
enum{
LSIRDYF,
LSERDYF,
HSIRDYF,
HSERDYF,
PLLRDYF,
CSSF = 7,
LSIRDYIE,
LSERDYIE,
HSIRDYIE,
HSERDYIE,
PLLRDYIE,
LSIRDYC = 16,
LSERDYC,
HSIRDYC,
HSERDYC,
PLLRDYC,
CSSC = 23
};
/* * * * * * * * * * * * * * * * * * * * * * * * * * *
* Backup domain control register (RCC_BDCR) Pins *
* * * * * * * * * * * * * * * * * * * * * * * * * * */
enum{
LSEON,
LSERDY,
LSEBYP,
RTCSEL0 = 8,
RTCSEL1,
RTCEN = 15,
BDRST
};
/* * * * * * * * * * * * * * * * * * * * * * *
* Control/status register (RCC_CSR) Pins *
* * * * * * * * * * * * * * * * * * * * * * */
enum{
LSION,
LSIRDY,
RMVF = 24,
PINRSTF = 26,
PORRSTF,
SFTRSTF,
IWDGRSTF,
WWDGRSTF,
LPWRRSTF
};
#endif /* PRIVATE_H_ */