comparison src/cs/drivers/drv_core/armio/armio.c @ 81:8e5096429fd3

armio.c: first cleaning step
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 02 Oct 2016 07:07:03 +0000
parents 945cf7f506b2
children e3768114db59
comparison
equal deleted inserted replaced
80:d6e59be562fd 81:8e5096429fd3
18 #include "l1_macro.h" 18 #include "l1_macro.h"
19 #include "l1_confg.h" 19 #include "l1_confg.h"
20 #endif 20 #endif
21 #include "board.cfg" 21 #include "board.cfg"
22 #include "chipset.cfg" 22 #include "chipset.cfg"
23 #include "fc-target.cfg"
23 24
24 #if (OP_L1_STANDALONE == 0) 25 #if (OP_L1_STANDALONE == 0)
25 #include "main/sys_types.h" 26 #include "main/sys_types.h"
26 #else 27 #else
27 #include "sys_types.h" 28 #include "sys_types.h"
155 { 156 {
156 *((volatile SYS_UWORD16 *) ARMIO_CNTL_REG) |= ARMIO_CLOCKEN; // set to 1 bit 5 157 *((volatile SYS_UWORD16 *) ARMIO_CNTL_REG) |= ARMIO_CLOCKEN; // set to 1 bit 5
157 } 158 }
158 159
159 160
160 #if (BOARD == 7)
161 /*
162 * AI_InitIOConfig
163 *
164 * Configure all GPIOs at initialization in order to optimize the power consumption
165 * of the B-Sample :
166 * - select IOs 8,9,10,11,12 and 13 on the pins instead of MCSI and MCUEN signals.
167 * - configure these IOs in output high.
168 * - configure the IOs 0 and 1 in output low.
169 */
170 void AI_InitIOConfig(void)
171 {
172 // reset the IOs config
173 AI_ResetIoConfig();
174
175 // CLKM_IO_CNTL register configuration :
176 // select IOs 8,9,10,11,12 and 13 on the pins instead of MCSI and MCUEN signals.
177 #if (CHIPSET != 12)
178 AI_EnableBit(4);
179 #endif
180
181 /* Bits 5,6,7,8 are used to output I/O 9,10,11,12 or MCSI pins */
182 /* If Bluetooth, IO should be disabled, outputting MCSI used for Bluetooth voice */
183 #ifdef BTEMOBILE
184 #if (CHIPSET != 12)
185 AI_DisableBit(5);
186 AI_DisableBit(6);
187 AI_DisableBit(7);
188 AI_DisableBit(8);
189 #endif
190 #else
191 #if (CHIPSET != 12)
192 AI_EnableBit(5);
193 AI_EnableBit(6);
194 AI_EnableBit(7);
195 AI_EnableBit(8);
196 #endif
197 #endif
198
199 #if (CHIPSET != 12)
200 AI_EnableBit(9);
201 #endif
202
203 // ARMIO_OUT register configuration :
204 // reset the general output latchs.
205 *((volatile SYS_UWORD16 *) ARMIO_OUT) = 0x3F00;
206
207 // ARMIO_CNTL_REG register configuration :
208 // set IOs 0,1,8,9,10,11,12 and 13 as ouputs.
209 AI_ConfigBitAsOutput(0); // vibrator
210 AI_ConfigBitAsOutput(1); // LCD_A0
211 AI_ConfigBitAsOutput(8);
212 AI_ConfigBitAsOutput(9);
213 AI_ConfigBitAsOutput(10);
214 AI_ConfigBitAsOutput(11);
215 AI_ConfigBitAsOutput(12);
216 AI_ConfigBitAsOutput(13);
217 }
218
219 #elif ((BOARD == 8) || (BOARD == 9) || (BOARD == 40) || (BOARD == 41) || (BOARD == 42) || (BOARD == 43) || (BOARD == 45))
220 /* 161 /*
221 * AI_InitIOConfig 162 * AI_InitIOConfig
222 * 163 *
223 * Configure all GPIOs at initialization in order to optimize the power consumption 164 * Configure all GPIOs at initialization in order to optimize the power consumption
224 * of the C-Sample : 165 * of the C-Sample :
240 181
241 /* Bits 5,6,7,8 are used to output I/O 9,10,11,12 or MCSI pins */ 182 /* Bits 5,6,7,8 are used to output I/O 9,10,11,12 or MCSI pins */
242 /* If Bluetooth, IO should be disabled, outputting MCSI used for Bluetooth voice */ 183 /* If Bluetooth, IO should be disabled, outputting MCSI used for Bluetooth voice */
243 #ifdef BTEMOBILE 184 #ifdef BTEMOBILE
244 #if (CHIPSET != 12) 185 #if (CHIPSET != 12)
245 AI_DisableBit(5); 186 AI_DisableBit(5);
246 AI_DisableBit(6); 187 AI_DisableBit(6);
247 AI_DisableBit(7); 188 AI_DisableBit(7);
248 AI_DisableBit(8); 189 AI_DisableBit(8);
249 #endif 190 #endif
250 #else 191 #else
251 #if (CHIPSET != 12) 192 #if (CHIPSET != 12)
252 AI_EnableBit(5); 193 AI_EnableBit(5);
253 AI_EnableBit(6); 194 AI_EnableBit(6);
254 AI_EnableBit(7); 195 AI_EnableBit(7);
255 AI_EnableBit(8); 196 AI_EnableBit(8);
256 #endif 197 #endif
257 #endif 198 #endif
258 199
259 #if (CHIPSET != 12) 200 #if (CHIPSET != 12)
260 AI_EnableBit(9); 201 AI_EnableBit(9);
261 #endif 202 #endif
395 void AI_UnmaskIT(SYS_UWORD16 d_io_number) { 336 void AI_UnmaskIT(SYS_UWORD16 d_io_number) {
396 GPIO_INTERRUPT_MASK_REG &= ~(1 << d_io_number); 337 GPIO_INTERRUPT_MASK_REG &= ~(1 << d_io_number);
397 } /* f_gpio_unmask_it() */ 338 } /* f_gpio_unmask_it() */
398 339
399 #endif 340 #endif
400
401 #endif /* BOARD 8, 9, 40, 41, 42, 43 or 45*/