Fix for x86_64 build fail
[platform/upstream/connectedhomeip.git] / examples / platform / efr32 / efr32mg12 / BRD4164A / hal-config.h
1 /*
2  *
3  *    Copyright (c) 2020 Project CHIP Authors
4  *    All rights reserved.
5  *
6  *    Licensed under the Apache License, Version 2.0 (the "License");
7  *    you may not use this file except in compliance with the License.
8  *    You may obtain a copy of the License at
9  *
10  *        http://www.apache.org/licenses/LICENSE-2.0
11  *
12  *    Unless required by applicable law or agreed to in writing, software
13  *    distributed under the License is distributed on an "AS IS" BASIS,
14  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  *    See the License for the specific language governing permissions and
16  *    limitations under the License.
17  */
18 /*******************************************************************************
19  * @file
20  * @brief hal-config.h
21  *******************************************************************************
22  * # License
23  * <b>Copyright 2018 Silicon Laboratories Inc. www.silabs.com</b>
24  *******************************************************************************
25  *
26  * The licensor of this software is Silicon Laboratories Inc. Your use of this
27  * software is governed by the terms of Silicon Labs Master Software License
28  * Agreement (MSLA) available at
29  * www.silabs.com/about-us/legal/master-software-license-agreement. This
30  * software is distributed to you in Source Code format and is governed by the
31  * sections of the MSLA applicable to Source Code.
32  *
33  ******************************************************************************/
34
35 #ifndef HAL_CONFIG_H
36 #define HAL_CONFIG_H
37
38 #include "board_features.h"
39 #include "em_device.h"
40 #include "hal-config-app-common.h"
41 #include "hal-config-types.h"
42
43 #define HAL_CLK_HFCLK_SOURCE (HAL_CLK_HFCLK_SOURCE_HFXO)
44 #define HAL_CLK_LFECLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO)
45 #define HAL_CLK_LFBCLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO)
46 #define HAL_CLK_LFACLK_SOURCE (HAL_CLK_LFCLK_SOURCE_LFRCO)
47 #define HAL_CLK_HFXO_AUTOSTART (HAL_CLK_HFXO_AUTOSTART_NONE)
48
49 #define HAL_DCDC_BYPASS (0)
50
51 #define HAL_LED_COUNT (2U)
52 #define HAL_LED_ENABLE                                                                                                             \
53     {                                                                                                                              \
54         0, 1                                                                                                                       \
55     }
56
57 #define HAL_PA_ENABLE (1)
58
59 #define HAL_PTI_ENABLE (1)
60 #define HAL_PTI_MODE (HAL_PTI_MODE_UART)
61
62 #define HAL_SERIAL_RXWAKE_ENABLE (0)
63 #define HAL_SERIAL_IDLE_WAKE_ENABLE (1)
64 #define HAL_SERIAL_LEUART0_ENABLE (0)
65 #define HAL_SERIAL_USART0_ENABLE (0)
66 #define HAL_SERIAL_USART1_ENABLE (0)
67 #define HAL_SERIAL_USART2_ENABLE (0)
68 #define HAL_SERIAL_USART3_ENABLE (0)
69
70 #define HAL_SERIAL_APP_BAUD_RATE (115200UL)
71 #define HAL_SERIAL_APP_FLOW_CONTROL (HAL_USART_FLOW_CONTROL_NONE)
72 #define HAL_SERIAL_APP_RXSTOP (16UL)
73 #define HAL_SERIAL_APP_RXSTART (16UL)
74 #define HAL_SERIAL_APP_TX_QUEUE_SIZE (128UL)
75 #define HAL_SERIAL_APP_RX_QUEUE_SIZE (128UL)
76
77 #define HAL_USART0_ENABLE (1)
78 #define HAL_USART0_BAUD_RATE (115200UL)
79 #define HAL_USART0_FLOW_CONTROL (HAL_USART_FLOW_CONTROL_NONE)
80 #define HAL_USART0_RXSTOP (16UL)
81 #define HAL_USART0_RXSTART (16UL)
82 #define HAL_USART0_TX_QUEUE_SIZE (128UL)
83 #define HAL_USART0_RX_QUEUE_SIZE (128UL)
84
85 #ifndef HAL_VCOM_ENABLE
86 #define HAL_VCOM_ENABLE (1)
87 #endif
88 #ifndef HAL_I2CSENSOR_ENABLE
89 #define HAL_I2CSENSOR_ENABLE (0)
90 #endif
91
92 #ifndef HAL_SPIDISPLAY_ENABLE
93 #define HAL_SPIDISPLAY_ENABLE (1)
94 #endif
95 #define HAL_SPIDISPLAY_EXTCOMIN_CALLBACK
96 #if defined(FEATURE_IOEXPANDER)
97 #define HAL_SPIDISPLAY_EXTMODE_EXTCOMIN (0)
98 #else
99 #define HAL_SPIDISPLAY_EXTMODE_EXTCOMIN (1)
100 #endif
101 #define HAL_SPIDISPLAY_EXTMODE_SPI (0)
102 #define HAL_SPIDISPLAY_EXTCOMIN_USE_PRS (0)
103 #define HAL_SPIDISPLAY_EXTCOMIN_USE_CALLBACK (0)
104 #define HAL_SPIDISPLAY_FREQUENCY (1000000)
105
106 // $[BTL_BUTTON]
107
108 #define BSP_BTL_BUTTON_PIN (6U)
109 #define BSP_BTL_BUTTON_PORT (gpioPortF)
110
111 // [BTL_BUTTON]$
112
113 // $[BUTTON]
114 #define BSP_BUTTON_PRESENT (1)
115
116 #define BSP_BUTTON0_PIN (6U)
117 #define BSP_BUTTON0_PORT (gpioPortF)
118
119 #define BSP_BUTTON1_PIN (7U)
120 #define BSP_BUTTON1_PORT (gpioPortF)
121
122 #define BSP_BUTTON_COUNT (2U)
123 #define BSP_BUTTON_INIT                                                                                                            \
124     {                                                                                                                              \
125         { BSP_BUTTON0_PORT, BSP_BUTTON0_PIN }, { BSP_BUTTON1_PORT, BSP_BUTTON1_PIN }                                               \
126     }
127 #define BSP_BUTTON_GPIO_DOUT (HAL_GPIO_DOUT_LOW)
128 #define BSP_BUTTON_GPIO_MODE (HAL_GPIO_MODE_INPUT)
129 // [BUTTON]$
130
131 // $[CMU]
132 #define BSP_CLK_HFXO_PRESENT (1)
133 #define BSP_CLK_HFXO_FREQ (38400000UL)
134 #define BSP_CLK_HFXO_INIT CMU_HFXOINIT_DEFAULT
135 #define BSP_CLK_HFXO_CTUNE (327)
136 #define BSP_CLK_LFXO_PRESENT (1)
137 #define BSP_CLK_LFXO_INIT CMU_LFXOINIT_DEFAULT
138 #define BSP_CLK_LFXO_FREQ (32768U)
139 #define BSP_CLK_LFXO_CTUNE (32U)
140 // [CMU]$
141
142 // $[DCDC]
143 #define BSP_DCDC_PRESENT (1)
144
145 #define BSP_DCDC_INIT EMU_DCDCINIT_DEFAULT
146 // [DCDC]$
147
148 // $[EXTFLASH]
149 #define BSP_EXTFLASH_CS_PIN (4U)
150 #define BSP_EXTFLASH_CS_PORT (gpioPortA)
151
152 #define BSP_EXTFLASH_INTERNAL (0)
153 #define BSP_EXTFLASH_USART (HAL_SPI_PORT_USART1)
154 #define BSP_EXTFLASH_MOSI_PIN (6U)
155 #define BSP_EXTFLASH_MOSI_PORT (gpioPortC)
156 #define BSP_EXTFLASH_MOSI_LOC (11U)
157
158 #define BSP_EXTFLASH_MISO_PIN (7U)
159 #define BSP_EXTFLASH_MISO_PORT (gpioPortC)
160 #define BSP_EXTFLASH_MISO_LOC (11U)
161
162 #define BSP_EXTFLASH_CLK_PIN (8U)
163 #define BSP_EXTFLASH_CLK_PORT (gpioPortC)
164 #define BSP_EXTFLASH_CLK_LOC (11U)
165
166 // [EXTFLASH]$
167
168 // $[GPIO]
169 #define PORTIO_GPIO_SWV_PIN (2U)
170 #define PORTIO_GPIO_SWV_PORT (gpioPortF)
171 #define PORTIO_GPIO_SWV_LOC (0U)
172
173 #define BSP_TRACE_SWO_PIN (2U)
174 #define BSP_TRACE_SWO_PORT (gpioPortF)
175 #define BSP_TRACE_SWO_LOC (0U)
176
177 // [GPIO]$
178
179 // $[I2C0]
180 #define PORTIO_I2C0_SCL_PIN (10U)
181 #define PORTIO_I2C0_SCL_PORT (gpioPortC)
182 #define PORTIO_I2C0_SCL_LOC (14U)
183
184 #define PORTIO_I2C0_SDA_PIN (11U)
185 #define PORTIO_I2C0_SDA_PORT (gpioPortC)
186 #define PORTIO_I2C0_SDA_LOC (16U)
187
188 #define BSP_I2C0_SCL_PIN (10U)
189 #define BSP_I2C0_SCL_PORT (gpioPortC)
190 #define BSP_I2C0_SCL_LOC (14U)
191
192 #define BSP_I2C0_SDA_PIN (11U)
193 #define BSP_I2C0_SDA_PORT (gpioPortC)
194 #define BSP_I2C0_SDA_LOC (16U)
195
196 // [I2C0]$
197
198 // $[I2CSENSOR]
199
200 #define BSP_I2CSENSOR_ENABLE_PIN (10U)
201 #define BSP_I2CSENSOR_ENABLE_PORT (gpioPortB)
202
203 #define BSP_I2CSENSOR_PERIPHERAL (HAL_I2C_PORT_I2C0)
204 #define BSP_I2CSENSOR_SCL_PIN (10U)
205 #define BSP_I2CSENSOR_SCL_PORT (gpioPortC)
206 #define BSP_I2CSENSOR_SCL_LOC (14U)
207
208 #define BSP_I2CSENSOR_SDA_PIN (11U)
209 #define BSP_I2CSENSOR_SDA_PORT (gpioPortC)
210 #define BSP_I2CSENSOR_SDA_LOC (16U)
211
212 // [I2CSENSOR]$
213
214 // $[LED]
215 #define BSP_LED_PRESENT (1)
216
217 #define BSP_LED0_PIN (4U)
218 #define BSP_LED0_PORT (gpioPortF)
219
220 #define BSP_LED1_PIN (5U)
221 #define BSP_LED1_PORT (gpioPortF)
222
223 #define BSP_LED_COUNT (2U)
224 #define BSP_LED_INIT                                                                                                               \
225     {                                                                                                                              \
226         { BSP_LED0_PORT, BSP_LED0_PIN }, { BSP_LED1_PORT, BSP_LED1_PIN }                                                           \
227     }
228 #define BSP_LED_POLARITY (1)
229 // [LED]$
230
231 // $[PA]
232
233 #define BSP_PA_VOLTAGE (3300U)
234 // [PA]$
235
236 // $[PRS]
237 #define PORTIO_PRS_CH4_PIN (13U)
238 #define PORTIO_PRS_CH4_PORT (gpioPortD)
239 #define PORTIO_PRS_CH4_LOC (4U)
240
241 // [PRS]$
242
243 // $[PTI]
244 #define PORTIO_PTI_DFRAME_PIN (13U)
245 #define PORTIO_PTI_DFRAME_PORT (gpioPortB)
246 #define PORTIO_PTI_DFRAME_LOC (6U)
247
248 #define PORTIO_PTI_DOUT_PIN (12U)
249 #define PORTIO_PTI_DOUT_PORT (gpioPortB)
250 #define PORTIO_PTI_DOUT_LOC (6U)
251
252 #define BSP_PTI_DFRAME_PIN (13U)
253 #define BSP_PTI_DFRAME_PORT (gpioPortB)
254 #define BSP_PTI_DFRAME_LOC (6U)
255
256 #define BSP_PTI_DOUT_PIN (12U)
257 #define BSP_PTI_DOUT_PORT (gpioPortB)
258 #define BSP_PTI_DOUT_LOC (6U)
259
260 // [PTI]$
261
262 // $[SERIAL]
263 #define BSP_SERIAL_APP_TX_PIN (0U)
264 #define BSP_SERIAL_APP_TX_PORT (gpioPortA)
265 #define BSP_SERIAL_APP_TX_LOC (0U)
266
267 #define BSP_SERIAL_APP_RX_PIN (1U)
268 #define BSP_SERIAL_APP_RX_PORT (gpioPortA)
269 #define BSP_SERIAL_APP_RX_LOC (0U)
270
271 #define BSP_SERIAL_APP_CTS_PIN (2U)
272 #define BSP_SERIAL_APP_CTS_PORT (gpioPortA)
273 #define BSP_SERIAL_APP_CTS_LOC (30U)
274
275 #define BSP_SERIAL_APP_RTS_PIN (3U)
276 #define BSP_SERIAL_APP_RTS_PORT (gpioPortA)
277 #define BSP_SERIAL_APP_RTS_LOC (30U)
278
279 // [SERIAL]$
280
281 // $[SPIDISPLAY]
282
283 #define BSP_SPIDISPLAY_CS_PIN (14U)
284 #define BSP_SPIDISPLAY_CS_PORT (gpioPortD)
285
286 #define BSP_SPIDISPLAY_ENABLE_PIN (15U)
287 #define BSP_SPIDISPLAY_ENABLE_PORT (gpioPortD)
288
289 #define BSP_SPIDISPLAY_EXTCOMIN_PIN (13U)
290 #define BSP_SPIDISPLAY_EXTCOMIN_PORT (gpioPortD)
291 #define BSP_SPIDISPLAY_EXTCOMIN_LOC (4U)
292
293 #define BSP_SPIDISPLAY_DISPLAY (HAL_DISPLAY_SHARP_LS013B7DH03)
294 #define BSP_SPIDISPLAY_USART (HAL_SPI_PORT_USART1)
295 #define BSP_SPIDISPLAY_EXTCOMIN_CHANNEL (4)
296 #define BSP_SPIDISPLAY_MOSI_PIN (6U)
297 #define BSP_SPIDISPLAY_MOSI_PORT (gpioPortC)
298 #define BSP_SPIDISPLAY_MOSI_LOC (11U)
299
300 #define BSP_SPIDISPLAY_MISO_PIN (7U)
301 #define BSP_SPIDISPLAY_MISO_PORT (gpioPortC)
302 #define BSP_SPIDISPLAY_MISO_LOC (11U)
303
304 #define BSP_SPIDISPLAY_CLK_PIN (8U)
305 #define BSP_SPIDISPLAY_CLK_PORT (gpioPortC)
306 #define BSP_SPIDISPLAY_CLK_LOC (11U)
307
308 // [SPIDISPLAY]$
309
310 // $[SPINCP]
311 #define BSP_SPINCP_NHOSTINT_PIN (10U)
312 #define BSP_SPINCP_NHOSTINT_PORT (gpioPortD)
313
314 #define BSP_SPINCP_NWAKE_PIN (11U)
315 #define BSP_SPINCP_NWAKE_PORT (gpioPortD)
316
317 #define BSP_SPINCP_USART_PORT (HAL_SPI_PORT_USART2)
318 #define BSP_SPINCP_MOSI_PIN (6U)
319 #define BSP_SPINCP_MOSI_PORT (gpioPortA)
320 #define BSP_SPINCP_MOSI_LOC (1U)
321
322 #define BSP_SPINCP_MISO_PIN (7U)
323 #define BSP_SPINCP_MISO_PORT (gpioPortA)
324 #define BSP_SPINCP_MISO_LOC (1U)
325
326 #define BSP_SPINCP_CLK_PIN (8U)
327 #define BSP_SPINCP_CLK_PORT (gpioPortA)
328 #define BSP_SPINCP_CLK_LOC (1U)
329
330 #define BSP_SPINCP_CS_PIN (9U)
331 #define BSP_SPINCP_CS_PORT (gpioPortA)
332 #define BSP_SPINCP_CS_LOC (1U)
333
334 // [SPINCP]$
335
336 // $[UARTNCP]
337 #define BSP_UARTNCP_USART_PORT (HAL_SERIAL_PORT_USART0)
338 #define BSP_UARTNCP_TX_PIN (0U)
339 #define BSP_UARTNCP_TX_PORT (gpioPortA)
340 #define BSP_UARTNCP_TX_LOC (0U)
341
342 #define BSP_UARTNCP_RX_PIN (1U)
343 #define BSP_UARTNCP_RX_PORT (gpioPortA)
344 #define BSP_UARTNCP_RX_LOC (0U)
345
346 #define BSP_UARTNCP_CTS_PIN (2U)
347 #define BSP_UARTNCP_CTS_PORT (gpioPortA)
348 #define BSP_UARTNCP_CTS_LOC (30U)
349
350 #define BSP_UARTNCP_RTS_PIN (3U)
351 #define BSP_UARTNCP_RTS_PORT (gpioPortA)
352 #define BSP_UARTNCP_RTS_LOC (30U)
353
354 // [UARTNCP]$
355
356 // $[USART0]
357 #define PORTIO_USART0_CTS_PIN (2U)
358 #define PORTIO_USART0_CTS_PORT (gpioPortA)
359 #define PORTIO_USART0_CTS_LOC (30U)
360
361 #define PORTIO_USART0_RTS_PIN (3U)
362 #define PORTIO_USART0_RTS_PORT (gpioPortA)
363 #define PORTIO_USART0_RTS_LOC (30U)
364
365 #define PORTIO_USART0_RX_PIN (1U)
366 #define PORTIO_USART0_RX_PORT (gpioPortA)
367 #define PORTIO_USART0_RX_LOC (0U)
368
369 #define PORTIO_USART0_TX_PIN (0U)
370 #define PORTIO_USART0_TX_PORT (gpioPortA)
371 #define PORTIO_USART0_TX_LOC (0U)
372
373 #define BSP_USART0_TX_PIN (0U)
374 #define BSP_USART0_TX_PORT (gpioPortA)
375 #define BSP_USART0_TX_LOC (0U)
376
377 #define BSP_USART0_RX_PIN (1U)
378 #define BSP_USART0_RX_PORT (gpioPortA)
379 #define BSP_USART0_RX_LOC (0U)
380
381 #define BSP_USART0_CTS_PIN (2U)
382 #define BSP_USART0_CTS_PORT (gpioPortA)
383 #define BSP_USART0_CTS_LOC (30U)
384
385 #define BSP_USART0_RTS_PIN (3U)
386 #define BSP_USART0_RTS_PORT (gpioPortA)
387 #define BSP_USART0_RTS_LOC (30U)
388
389 // [USART0]$
390
391 // $[USART1]
392 #define PORTIO_USART1_CLK_PIN (8U)
393 #define PORTIO_USART1_CLK_PORT (gpioPortC)
394 #define PORTIO_USART1_CLK_LOC (11U)
395
396 #define PORTIO_USART1_CS_PIN (9U)
397 #define PORTIO_USART1_CS_PORT (gpioPortC)
398 #define PORTIO_USART1_CS_LOC (11U)
399
400 #define PORTIO_USART1_RX_PIN (7U)
401 #define PORTIO_USART1_RX_PORT (gpioPortC)
402 #define PORTIO_USART1_RX_LOC (11U)
403
404 #define PORTIO_USART1_TX_PIN (6U)
405 #define PORTIO_USART1_TX_PORT (gpioPortC)
406 #define PORTIO_USART1_TX_LOC (11U)
407
408 #define BSP_USART1_MOSI_PIN (6U)
409 #define BSP_USART1_MOSI_PORT (gpioPortC)
410 #define BSP_USART1_MOSI_LOC (11U)
411
412 #define BSP_USART1_MISO_PIN (7U)
413 #define BSP_USART1_MISO_PORT (gpioPortC)
414 #define BSP_USART1_MISO_LOC (11U)
415
416 #define BSP_USART1_CLK_PIN (8U)
417 #define BSP_USART1_CLK_PORT (gpioPortC)
418 #define BSP_USART1_CLK_LOC (11U)
419
420 #define BSP_USART1_CS_PIN (9U)
421 #define BSP_USART1_CS_PORT (gpioPortC)
422 #define BSP_USART1_CS_LOC (11U)
423
424 // [USART1]$
425
426 // $[USART2]
427 #define PORTIO_USART2_CLK_PIN (8U)
428 #define PORTIO_USART2_CLK_PORT (gpioPortA)
429 #define PORTIO_USART2_CLK_LOC (1U)
430
431 #define PORTIO_USART2_CS_PIN (9U)
432 #define PORTIO_USART2_CS_PORT (gpioPortA)
433 #define PORTIO_USART2_CS_LOC (1U)
434
435 #define PORTIO_USART2_RX_PIN (7U)
436 #define PORTIO_USART2_RX_PORT (gpioPortA)
437 #define PORTIO_USART2_RX_LOC (1U)
438
439 #define PORTIO_USART2_TX_PIN (6U)
440 #define PORTIO_USART2_TX_PORT (gpioPortA)
441 #define PORTIO_USART2_TX_LOC (1U)
442
443 #define BSP_USART2_MOSI_PIN (6U)
444 #define BSP_USART2_MOSI_PORT (gpioPortA)
445 #define BSP_USART2_MOSI_LOC (1U)
446
447 #define BSP_USART2_MISO_PIN (7U)
448 #define BSP_USART2_MISO_PORT (gpioPortA)
449 #define BSP_USART2_MISO_LOC (1U)
450
451 #define BSP_USART2_CLK_PIN (8U)
452 #define BSP_USART2_CLK_PORT (gpioPortA)
453 #define BSP_USART2_CLK_LOC (1U)
454
455 #define BSP_USART2_CS_PIN (9U)
456 #define BSP_USART2_CS_PORT (gpioPortA)
457 #define BSP_USART2_CS_LOC (1U)
458
459 // [USART2]$
460
461 // $[USART3]
462 #define PORTIO_USART3_CTS_PIN (8U)
463 #define PORTIO_USART3_CTS_PORT (gpioPortD)
464 #define PORTIO_USART3_CTS_LOC (28U)
465
466 #define PORTIO_USART3_RTS_PIN (9U)
467 #define PORTIO_USART3_RTS_PORT (gpioPortD)
468 #define PORTIO_USART3_RTS_LOC (28U)
469
470 #define PORTIO_USART3_RX_PIN (7U)
471 #define PORTIO_USART3_RX_PORT (gpioPortB)
472 #define PORTIO_USART3_RX_LOC (10U)
473
474 #define PORTIO_USART3_TX_PIN (6U)
475 #define PORTIO_USART3_TX_PORT (gpioPortB)
476 #define PORTIO_USART3_TX_LOC (10U)
477
478 #define BSP_USART3_TX_PIN (6U)
479 #define BSP_USART3_TX_PORT (gpioPortB)
480 #define BSP_USART3_TX_LOC (10U)
481
482 #define BSP_USART3_RX_PIN (7U)
483 #define BSP_USART3_RX_PORT (gpioPortB)
484 #define BSP_USART3_RX_LOC (10U)
485
486 #define BSP_USART3_CTS_PIN (8U)
487 #define BSP_USART3_CTS_PORT (gpioPortD)
488 #define BSP_USART3_CTS_LOC (28U)
489
490 #define BSP_USART3_RTS_PIN (9U)
491 #define BSP_USART3_RTS_PORT (gpioPortD)
492 #define BSP_USART3_RTS_LOC (28U)
493
494 // [USART3]$
495
496 // $[VCOM]
497
498 #define BSP_VCOM_ENABLE_PIN (5U)
499 #define BSP_VCOM_ENABLE_PORT (gpioPortA)
500
501 // [VCOM]$
502
503 #if defined(_SILICON_LABS_MODULE)
504 #include "sl_module.h"
505 #endif
506
507 #endif