Wirepas SDK
board.h
Go to the documentation of this file.
1 /* Copyright 2018 Wirepas Ltd. All Rights Reserved.
2  *
3  * See file LICENSE.txt for full license details.
4  *
5  */
6 
13 #ifndef BOARD_TBSENSE2_BOARD_H_
14 #define BOARD_TBSENSE2_BOARD_H_
15 
16 // Waps usart defines
17 #if defined USE_FTDI
18 #define BOARD_USART_ID 1
19 #define BOARD_USART_GPIO_PORT GPIOF
20 #define BOARD_USART_TX_PIN 3
21 #define BOARD_USART_RX_PIN 4
22 // ROUTELOC are dependent on GPIO defined above and mapping
23 // can be founded chip datasheet from Silabs
24 #define BOARD_USART_ROUTELOC_RXLOC USART_ROUTELOC0_RXLOC_LOC27
25 #define BOARD_USART_ROUTELOC_TXLOC USART_ROUTELOC0_TXLOC_LOC27
26 
27 #else
28 #define BOARD_USART_ID 0
29 #define BOARD_USART_GPIO_PORT GPIOA
30 #define BOARD_USART_TX_PIN 0
31 #define BOARD_USART_RX_PIN 1
32 
33 // VCOM port only supports 115200 baudrate
34 // This speed will be used independently of UART_BAUDRATE flag value
35 #define BOARD_USART_FORCE_BAUDRATE 115200
36 
37 // ROUTELOC are dependent on GPIO defined above and mapping
38 // can be founded chip datasheet from Silabs
39 #define BOARD_USART_ROUTELOC_RXLOC USART_ROUTELOC0_RXLOC_LOC0
40 #define BOARD_USART_ROUTELOC_TXLOC USART_ROUTELOC0_TXLOC_LOC0
41 #endif
42 
43 // Interrupt pin for dual mcu app, unread indication
44 #define BOARD_UART_INT_PIN 6
45 #define BOARD_UART_INT_PORT GPIOF
46 
47 // I2C configuration: SDA on PC4, SCL on PC5 (ENV_I2C on Thunderboard Sense 2)
48 #define USE_I2C1
49 #define BOARD_I2C_GPIO_PORT GPIOC
50 #define BOARD_I2C_SDA_PIN 4
51 #define BOARD_I2C_SCL_PIN 5
52 #define BOARD_I2C_ROUTELOC_SDALOC I2C_ROUTELOC0_SDALOC_LOC17
53 #define BOARD_I2C_ROUTELOC_SCLLOC I2C_ROUTELOC0_SCLLOC_LOC17
54 
55 // List of GPIO ports and pins for the LEDs on the board: red LED, green LED
56 #define BOARD_LED_PIN_LIST {{GPIOD, 8}, {GPIOD, 9}}
57 
58 // Active high polarity for LEDs
59 #define BOARD_LED_ACTIVE_LOW false
60 
61 // List of ext. ints, GPIO ports and pins for buttons on the board: BTN0, BTN1
62 #define BOARD_BUTTON_PIN_LIST {{12, GPIOD, 14}, {14, GPIOD, 15}}
63 
64 // Active low polarity for buttons
65 #define BOARD_BUTTON_ACTIVE_LOW true
66 
67 // Board has external pull-up for buttons
68 #define BOARD_BUTTON_INTERNAL_PULL false
69 
70 // Buttons use even external interrupts
71 #define BOARD_BUTTON_USE_EVEN_INT true
72 
73 
74 #endif /* BOARD_TBSENSE2_BOARD_H_ */