Wirepas SDK
board.h
Go to the documentation of this file.
1/* Copyright 2023 Wirepas Ltd. All Rights Reserved.
2 *
3 * See file LICENSE.txt for full license details.
4 *
5 */
6
14#ifndef BOARD_SILABS_BRD4158A_BOARD_H_
15#define BOARD_SILABS_BRD4158A_BOARD_H_
16
17// By default VCOM port is configured to 115200
18// This speed will be used independently of UART_BAUDRATE flag value
19#define BOARD_USART_FORCE_BAUDRATE 115200
20
21// Serial port
22#define BOARD_USART_ID 0
23#define BOARD_USART_TX_PORT GPIOA
24#define BOARD_USART_TX_PIN 0
25#define BOARD_USART_RX_PORT GPIOA
26#define BOARD_USART_RX_PIN 1
27
28// ROUTELOC are dependent on GPIO defined above and mapping
29// can be founded chip datasheet from Silabs
30#define BOARD_USART_ROUTELOC_RXLOC USART_ROUTELOC0_RXLOC_LOC0
31#define BOARD_USART_ROUTELOC_TXLOC USART_ROUTELOC0_TXLOC_LOC0
32
33// List of GPIO pins
34#define BOARD_GPIO_PIN_LIST {{GPIOF, 4}, /* PF04 LED0 */\
35 {GPIOF, 5}, /* PF05 LED1 */\
36 {GPIOF, 6}, /* PF06 BUTTON0 */\
37 {GPIOF, 7}, /* PF07 BUTTON1 */\
38 {GPIOA, 1}, /* PA01. required by the dual_mcu app. usart wakeup pin (= BOARD_USART_RX) */\
39 {GPIOA, 5}} /* PA05 (USART VCOM enable pin) */
40
41// User friendly name for GPIOs (IDs mapped to the BOARD_GPIO_PIN_LIST table)
42#define BOARD_GPIO_ID_LED0 0 // mapped to pin PF04
43#define BOARD_GPIO_ID_LED1 1 // mapped to pin PF05
44#define BOARD_GPIO_ID_BUTTON0 2 // mapped to pin PF06
45#define BOARD_GPIO_ID_BUTTON1 3 // mapped to pin PF07
46#define BOARD_GPIO_ID_USART_WAKEUP 4 // mapped to pin PA01
47#define BOARD_GPIO_ID_VCOM_ENABLE 5 // mapped to pin PA05
48
49// List of LED IDs
50#define BOARD_LED_ID_LIST {BOARD_GPIO_ID_LED0, BOARD_GPIO_ID_LED1}
51
52// Active high polarity for LEDs
53#define BOARD_LED_ACTIVE_LOW false
54
55// List of button IDs
56#define BOARD_BUTTON_ID_LIST {BOARD_GPIO_ID_BUTTON0, BOARD_GPIO_ID_BUTTON1}
57
58// Active low polarity for buttons
59#define BOARD_BUTTON_ACTIVE_LOW true
60
61// Handle button pull up/down in SW
62#define BOARD_BUTTON_INTERNAL_PULL false
63
64#endif // BOARD_SILABS_BRD4158A_BOARD_H_