@@ -35,54 +35,54 @@ GPIO_TypeDef *get_GPIO_Port(uint32_t port_idx) {
35
35
GPIO_TypeDef * gpioPort = 0 ;
36
36
switch (port_idx ) {
37
37
case PortA :
38
- gpioPort = GPIOA_BASE ;
38
+ gpioPort = ( GPIO_TypeDef * ) GPIOA_BASE ;
39
39
break ;
40
40
case PortB :
41
- gpioPort = GPIOB_BASE ;
41
+ gpioPort = ( GPIO_TypeDef * ) GPIOB_BASE ;
42
42
break ;
43
43
#if defined GPIOC_BASE
44
44
case PortC :
45
- gpioPort = GPIOC_BASE ;
45
+ gpioPort = ( GPIO_TypeDef * ) GPIOC_BASE ;
46
46
break ;
47
47
#endif
48
48
#if defined GPIOD_BASE
49
49
case PortD :
50
- gpioPort = GPIOD_BASE ;
50
+ gpioPort = ( GPIO_TypeDef * ) GPIOD_BASE ;
51
51
break ;
52
52
#endif
53
53
#if defined GPIOE_BASE
54
54
case PortE :
55
- gpioPort = GPIOE_BASE ;
55
+ gpioPort = ( GPIO_TypeDef * ) GPIOE_BASE ;
56
56
break ;
57
57
#endif
58
58
#if defined GPIOF_BASE
59
59
case PortF :
60
- gpioPort = GPIOF_BASE ;
60
+ gpioPort = ( GPIO_TypeDef * ) GPIOF_BASE ;
61
61
break ;
62
62
#endif
63
63
#if defined GPIOG_BASE
64
64
case PortG :
65
- gpioPort = GPIOG_BASE ;
65
+ gpioPort = ( GPIO_TypeDef * ) GPIOG_BASE ;
66
66
break ;
67
67
#endif
68
68
#if defined GPIOH_BASE
69
69
case PortH :
70
- gpioPort = GPIOH_BASE ;
70
+ gpioPort = ( GPIO_TypeDef * ) GPIOH_BASE ;
71
71
break ;
72
72
#endif
73
73
#if defined GPIOI_BASE
74
74
case PortI :
75
- gpioPort = GPIOI_BASE ;
75
+ gpioPort = ( GPIO_TypeDef * ) GPIOI_BASE ;
76
76
break ;
77
77
#endif
78
78
#if defined GPIOJ_BASE
79
79
case PortJ :
80
- gpioPort = GPIOJ_BASE ;
80
+ gpioPort = ( GPIO_TypeDef * ) GPIOJ_BASE ;
81
81
break ;
82
82
#endif
83
83
#if defined GPIOK_BASE
84
84
case PortK :
85
- gpioPort = GPIOK_BASE ;
85
+ gpioPort = ( GPIO_TypeDef * ) GPIOK_BASE ;
86
86
break ;
87
87
#endif
88
88
default :
@@ -99,64 +99,64 @@ GPIO_TypeDef *set_GPIO_Port_Clock(uint32_t port_idx) {
99
99
GPIO_TypeDef * gpioPort = 0 ;
100
100
switch (port_idx ) {
101
101
case PortA :
102
- gpioPort = GPIOA_BASE ;
102
+ gpioPort = ( GPIO_TypeDef * ) GPIOA_BASE ;
103
103
__HAL_RCC_GPIOA_CLK_ENABLE ();
104
104
break ;
105
105
case PortB :
106
- gpioPort = GPIOB_BASE ;
106
+ gpioPort = ( GPIO_TypeDef * ) GPIOB_BASE ;
107
107
__HAL_RCC_GPIOB_CLK_ENABLE ();
108
108
break ;
109
109
#if defined GPIOC_BASE
110
110
case PortC :
111
- gpioPort = GPIOC_BASE ;
111
+ gpioPort = ( GPIO_TypeDef * ) GPIOC_BASE ;
112
112
__HAL_RCC_GPIOC_CLK_ENABLE ();
113
113
break ;
114
114
#endif
115
115
#if defined GPIOD_BASE
116
116
case PortD :
117
- gpioPort = GPIOD_BASE ;
117
+ gpioPort = ( GPIO_TypeDef * ) GPIOD_BASE ;
118
118
__HAL_RCC_GPIOD_CLK_ENABLE ();
119
119
break ;
120
120
#endif
121
121
#if defined GPIOE_BASE
122
122
case PortE :
123
- gpioPort = GPIOE_BASE ;
123
+ gpioPort = ( GPIO_TypeDef * ) GPIOE_BASE ;
124
124
__HAL_RCC_GPIOE_CLK_ENABLE ();
125
125
break ;
126
126
#endif
127
127
#if defined GPIOF_BASE
128
128
case PortF :
129
- gpioPort = GPIOF_BASE ;
129
+ gpioPort = ( GPIO_TypeDef * ) GPIOF_BASE ;
130
130
__HAL_RCC_GPIOF_CLK_ENABLE ();
131
131
break ;
132
132
#endif
133
133
#if defined GPIOG_BASE
134
134
case PortG :
135
- gpioPort = GPIOG_BASE ;
135
+ gpioPort = ( GPIO_TypeDef * ) GPIOG_BASE ;
136
136
__HAL_RCC_GPIOG_CLK_ENABLE ();
137
137
break ;
138
138
#endif
139
139
#if defined GPIOH_BASE
140
140
case PortH :
141
- gpioPort = GPIOH_BASE ;
141
+ gpioPort = ( GPIO_TypeDef * ) GPIOH_BASE ;
142
142
__HAL_RCC_GPIOH_CLK_ENABLE ();
143
143
break ;
144
144
#endif
145
145
#if defined GPIOI_BASE
146
146
case PortI :
147
- gpioPort = GPIOI_BASE ;
147
+ gpioPort = ( GPIO_TypeDef * ) GPIOI_BASE ;
148
148
__HAL_RCC_GPIOI_CLK_ENABLE ();
149
149
break ;
150
150
#endif
151
151
#if defined GPIOJ_BASE
152
152
case PortJ :
153
- gpioPort = GPIOJ_BASE ;
153
+ gpioPort = ( GPIO_TypeDef * ) GPIOJ_BASE ;
154
154
__HAL_RCC_GPIOJ_CLK_ENABLE ();
155
155
break ;
156
156
#endif
157
157
#if defined GPIOK_BASE
158
158
case PortK :
159
- gpioPort = GPIOK_BASE ;
159
+ gpioPort = ( GPIO_TypeDef * ) GPIOK_BASE ;
160
160
__HAL_RCC_GPIOK_CLK_ENABLE ();
161
161
break ;
162
162
#endif
0 commit comments