Wirepas SDK
board.h File Reference

Detailed Description

Template to be used for EFR32 board definitions

Definition in file board.h.

Go to the source code of this file.

Macros

#define BOARD_USART_ID   0
 USART ID. More...
 
#define BOARD_USART_ROUTELOC_RXLOC   USART_ROUTELOC0_RXLOC_LOC0
 RX routeloc definition. More...
 
#define BOARD_USART_ROUTELOC_TXLOC   USART_ROUTELOC0_TXLOC_LOC0
 TX routeloc definition. More...
 
#define BOARD_USART_TX_PORT   GPIOA
 Transmission pin port. More...
 
#define BOARD_USART_TX_PIN   0
 Transmission pin number. More...
 
#define BOARD_USART_RX_PORT   GPIOA
 Reception pin port. More...
 
#define BOARD_USART_RX_PIN   1
 Reception pin number. More...
 
#define BOARD_GPIO_PIN_LIST
 GPIO definitions. More...
 
#define BOARD_GPIO_ID_LED0   0
 GPIO IDs. More...
 
#define BOARD_GPIO_ID_LED1   1
 
#define BOARD_GPIO_ID_BUTTON0   2
 
#define BOARD_GPIO_ID_BUTTON1   3
 
#define BOARD_GPIO_ID_USART_WAKEUP   4
 pin for dual mcu app, usart wakeup More...
 
#define BOARD_GPIO_ID_UART_IRQ   5
 Interrupt pin for dual mcu app, unread indication. More...
 
#define BOARD_LED_PIN_LIST   {BOARD_GPIO_ID_LED0, BOARD_GPIO_ID_LED1}
 LED definitions. More...
 
#define BOARD_LED_ACTIVE_LOW   false
 LED GPIO polarity. More...
 
#define BOARD_BUTTON_ID_LIST   {BOARD_GPIO_ID_BUTTON0, BOARD_GPIO_ID_BUTTON1}
 Button definitions. More...
 
#define BOARD_BUTTON_ACTIVE_LOW   true
 Button GPIO polarity. More...
 
#define BOARD_BUTTON_INTERNAL_PULL   true
 Button GPIO internal pull up/down. More...
 

Macro Definition Documentation

◆ BOARD_BUTTON_ACTIVE_LOW

#define BOARD_BUTTON_ACTIVE_LOW   true

Button GPIO polarity.

If a button press pulls the GPIO pin low, this setting is true. This is the case for many EFR32 boards, such as the Thunderboard Sense 2 and the BRD4001 Evaluation Board. Otherwise, if a button press pulls the GPIO pin high, this setting should be set to false.

Definition at line 151 of file board.h.

◆ BOARD_BUTTON_ID_LIST

#define BOARD_BUTTON_ID_LIST   {BOARD_GPIO_ID_BUTTON0, BOARD_GPIO_ID_BUTTON1}

Button definitions.

If board contains buttons, The button IDs list is defined here. The button IDs are mapped to GPIO IDs. If not defined, a dummy button driver is compiled, so that applications can use the button driver unconditionally.

Note
in order for application to use buttons, see here.

Definition at line 141 of file board.h.

◆ BOARD_BUTTON_INTERNAL_PULL

#define BOARD_BUTTON_INTERNAL_PULL   true

Button GPIO internal pull up/down.

Some buttons don't have any pull-up or pull-down resistor installed on the board. They need it to be setup in software. Set BOARD_BUTTON_INTERNAL_PULL to true to enable internal pull-up(down). Pull-up(down) is enabled when BOARD_BUTTON_ACTIVE_LOW is true(false).

Definition at line 161 of file board.h.

◆ BOARD_GPIO_ID_BUTTON0

#define BOARD_GPIO_ID_BUTTON0   2

Definition at line 86 of file board.h.

◆ BOARD_GPIO_ID_BUTTON1

#define BOARD_GPIO_ID_BUTTON1   3

Definition at line 87 of file board.h.

◆ BOARD_GPIO_ID_LED0

#define BOARD_GPIO_ID_LED0   0

GPIO IDs.

User friendly name for GPIOs (IDs mapped to the BOARD_GPIO_PIN_LIST table)

Definition at line 84 of file board.h.

◆ BOARD_GPIO_ID_LED1

#define BOARD_GPIO_ID_LED1   1

Definition at line 85 of file board.h.

◆ BOARD_GPIO_ID_UART_IRQ

#define BOARD_GPIO_ID_UART_IRQ   5

Interrupt pin for dual mcu app, unread indication.

This only used in dualmcu_app application to announce with GPIO pin that there is incoming indication to be read from device.

It is optional definition.

Definition at line 108 of file board.h.

◆ BOARD_GPIO_ID_USART_WAKEUP

#define BOARD_GPIO_ID_USART_WAKEUP   4

pin for dual mcu app, usart wakeup

This only used in dualmcu_app application to wake up the usart driver when detecting a transition on the usart RX pin.

It is optional definition.

Definition at line 97 of file board.h.

◆ BOARD_GPIO_PIN_LIST

#define BOARD_GPIO_PIN_LIST
Value:
{{GPIOF, 4}, /* PF04 */\
{GPIOF, 5}, /* PF05 */\
{GPIOF, 6}, /* PF06 */\
{GPIOF, 7}, /* PF07 */\
{GPIOA, 1}, /* PA01. required by the dual_mcu app. usart wakeup pin (= BOARD_USART_RX) */\
{GPIOD, 8}} /* PD08. required by the dual_mcu app (indication signal) */

GPIO definitions.

If board needs GPIOs, they are defined here. If not defined, a dummy GPIO driver is compiled, so that applications can use the GPIO driver unconditionally.

For Silabs EFR32 family, the list contains GPIO port/pin number pairs.

Note
in order for application to use GPIOs, see here.

Definition at line 71 of file board.h.

◆ BOARD_LED_ACTIVE_LOW

#define BOARD_LED_ACTIVE_LOW   false

LED GPIO polarity.

If LEDs turn on when the GPIO pin is driven low, this setting is true. Many EFR32 boards, such as the Thunderboard Sense 2 and the BRD4001 Evaluation Board have active high LEDs, so this setting should remain false.

Definition at line 129 of file board.h.

◆ BOARD_LED_PIN_LIST

#define BOARD_LED_PIN_LIST   {BOARD_GPIO_ID_LED0, BOARD_GPIO_ID_LED1}

LED definitions.

If board contains LEDs, The LED IDs list is defined here. The LED IDs are mapped to GPIO IDs. If not defined, a dummy LED driver is compiled, so that applications can use the LED driver unconditionally.

Note
in order for application to use LEDs, see here.

Definition at line 120 of file board.h.

◆ BOARD_USART_ID

#define BOARD_USART_ID   0

USART ID.

Valid values: 0, 1, ... (to match BOARD_USART)

Note
in order for application to use USART, see here.

Definition at line 25 of file board.h.

◆ BOARD_USART_ROUTELOC_RXLOC

#define BOARD_USART_ROUTELOC_RXLOC   USART_ROUTELOC0_RXLOC_LOC0

RX routeloc definition.

Valid values: USART_ROUTELOC0_RXLOC_LOC0, USART_ROUTELOC0_RXLOC_LOC1, ...

Definition at line 33 of file board.h.

◆ BOARD_USART_ROUTELOC_TXLOC

#define BOARD_USART_ROUTELOC_TXLOC   USART_ROUTELOC0_TXLOC_LOC0

TX routeloc definition.

Valid values: USART_ROUTELOC0_TXLOC_LOC0, USART_ROUTELOC0_TXLOC_LOC1, ...

Definition at line 40 of file board.h.

◆ BOARD_USART_RX_PIN

#define BOARD_USART_RX_PIN   1

Reception pin number.

Definition at line 57 of file board.h.

◆ BOARD_USART_RX_PORT

#define BOARD_USART_RX_PORT   GPIOA

Reception pin port.

Definition at line 53 of file board.h.

◆ BOARD_USART_TX_PIN

#define BOARD_USART_TX_PIN   0

Transmission pin number.

Definition at line 49 of file board.h.

◆ BOARD_USART_TX_PORT

#define BOARD_USART_TX_PORT   GPIOA

Transmission pin port.

Definition at line 45 of file board.h.