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_BRD2610B_BOARD_H_
15 #define BOARD_SILABS_BRD2610B_BOARD_H_
16 
17 // VCOM port only supports 115200 baudrate
18 // This speed will be used independently of UART_BAUDRATE flag value
19 #define BOARD_USART_FORCE_BAUDRATE 115200
20 
21 #define BOARD_SPI USART0
22 #define BOARD_SPIROUTE GPIO->USARTROUTE[0]
23 #define BOARD_SPI_MOSI_PORT GPIO_PORTC // SPI_COPI name in schema
24 #define BOARD_SPI_MISO_PORT GPIO_PORTC // SPI_CIPO name in schema
25 #define BOARD_SPI_SCKL_PORT GPIO_PORTC
26 #define BOARD_SPI_MOSI_PIN 3
27 #define BOARD_SPI_MISO_PIN 2
28 #define BOARD_SPI_SCKL_PIN 1
29 
30 
31 
32 #define USE_I2C1
33 #define BOARD_I2C_GPIO_PORT GPIOC
34 #define BOARD_I2C_SDA_PIN 4
35 #define BOARD_I2C_SCL_PIN 5
36 #define BOARD_I2C_ROUTELOC_SDALOC I2C_ROUTELOC0_SDALOC_LOC17
37 #define BOARD_I2C_ROUTELOC_SCLLOC I2C_ROUTELOC0_SCLLOC_LOC17
38 
39 
40 
41 // Serial port
42 #define BOARD_USART_ID 0
43 #define BOARD_USART_TX_PORT GPIO_PORTA
44 #define BOARD_USART_TX_PIN 5 // UART_TX VCOM & Mini Simplicity
45 #define BOARD_USART_RX_PORT GPIO_PORTA
46 #define BOARD_USART_RX_PIN 6 // UART_RX VCOM & Mini Simplicity
47 
48 // List of GPIO pins
49 #define BOARD_GPIO_PIN_LIST {{GPIO_PORTD, 2}, /* PD02 Red LED */ \
50  {GPIO_PORTA, 3}, /* PA04 Green LED */ \
51  {GPIO_PORTB, 0}, /* PB00 BLue LED */\
52  {GPIO_PORTB, 2}, /* PB01 Button0 */\
53  {GPIO_PORTB, 3}, /* PB01 Button1 */ \
54  {GPIO_PORTA, 7}, /* PA07. IMU CS, needs SENSOR_ENABLE to be set true to work */\
55  {GPIO_PORTA, 6}, /* PA06 USART wake-up */\
56  {GPIO_PORTC, 0}, /* PD04. SPI_FLASH_CS */ \
57  {GPIO_PORTC, 8}, /* PC08. I2C_MICS_ENABLE */ \
58  {GPIO_PORTD, 5}, /* PD05. I2C_WSE */ \
59  {GPIO_PORTC, 9}, /* PC09. SENSOR_ENABLE */ \
60  {GPIO_PORTA, 0}} /* PA00. ADC_VREF_ENABLE */ \
61 
62 
63 
64 
65 // User friendly name for GPIOs (IDs mapped to the BOARD_GPIO_PIN_LIST table)
66 #define BOARD_GPIO_ID_LED_RED 0 // mapped to pin PD02
67 #define BOARD_GPIO_ID_LED_GREEN 1 // mapped to pin PA04
68 #define BOARD_GPIO_ID_LED_BLUE 2 // mapped to pin PB00
69 
70 #define BOARD_GPIO_ID_BUTTON0 3 // mapped to pin PB02
71 #define BOARD_GPIO_ID_BUTTON1 4 // mapped to pin PB03
72 
73 #define BOARD_SPI_CS_IMU 5 // mapped to pin PA07 NOTE! Needs SENSOR_ENABLE to be set also
74 #define BOARD_GPIO_ID_USART_WAKEUP 6 // mapped to pin PA06
75 #define BOARD_SPI_FLASH_CS 7 // mapped to pin PC00 32 MBit serial Flash
76 
77 #define BOARD_I2C_MICS_ENABLE 8 // mapped to pin PC08, both mics 1 = powered, 0 = not powered
78 #define BOARD_I2C_WSE 9 // mapped to pin PD05, selects which mic is readed with i2c
79 
80 #define BOARD_SENSOR_ENABLE 10 // mapped to pin PC09, Enables next sensors to i2c bus:
81  // Temperature, Humidity, Hall effect, Ambient light, Barometric pressure.
82  // Signal enables 6-Axis Inertia sensor to SPI bus
83 
84 #define BOARD_ADC_VREF_ENABLE 11 // mapped to pin PA00, 1 = reference is enabled, 0 = reference is not enabled
85 
86 // List of LED IDs
87 #define BOARD_LED_ID_LIST {BOARD_GPIO_ID_LED_RED, BOARD_GPIO_ID_LED_GREEN, BOARD_GPIO_ID_LED_BLUE}
88 
89 // Active high polarity for LEDs
90 #define BOARD_LED_ACTIVE_LOW false
91 
92 // List of button IDs
93 #define BOARD_BUTTON_ID_LIST {BOARD_GPIO_ID_BUTTON0, BOARD_GPIO_ID_BUTTON1}
94 
95 // Active button connects signal to ground
96 #define BOARD_BUTTON_ACTIVE_LOW true
97 
98 // Board has external pull-up for buttons, internal pull-ups are not needed
99 #define BOARD_BUTTON_INTERNAL_PULL false
100 
101 #endif /* BOARD_SILABS_BRD2610B_BOARD_H_ */