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_GPIO_PORT   GPIOA
 GPIO port used. 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_PIN   0
 Transmission pin number. More...
 
#define BOARD_USART_RX_PIN   1
 Reception pin number. More...
 
#define BOARD_UART_INT_PIN   8
 Interrupt pin for dual mcu app, unread indication. More...
 
#define BOARD_UART_INT_PORT   GPIOD
 
#define BOARD_LED_PIN_LIST   {{GPIOF, 4}, {GPIOF, 5}}
 LED definitions. More...
 
#define BOARD_LED_ACTIVE_LOW   false
 LED GPIO polarity. More...
 
#define BOARD_BUTTON_PIN_LIST   {{4, GPIOF, 6}, {6, GPIOF, 7}}
 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...
 
#define BOARD_BUTTON_USE_EVEN_INT   true
 Button GPIO interrupt even/odd selection. 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 116 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 126 of file board.h.

◆ BOARD_BUTTON_PIN_LIST

#define BOARD_BUTTON_PIN_LIST   {{4, GPIOF, 6}, {6, GPIOF, 7}}

Button definitions.

Any buttons present on the board are defined here. If not defined, a dummy button driver is compiled, so that applications can use the button driver unconditionally.

For Silabs EFR32 family, the list contains GPIO external interrupt numbers, GPIO ports and pins. See BOARD_BUTTON_USE_EVEN_INT below for extra considerations when selecting external interrupt numbers.

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

Definition at line 106 of file board.h.

◆ BOARD_BUTTON_USE_EVEN_INT

#define BOARD_BUTTON_USE_EVEN_INT   true

Button GPIO interrupt even/odd selection.

The EFR32 GPIO block has 16 configurable external interrupt sources. Even and odd numbered interrupt sources are routed to separate interrupt vectors in the processor. If this setting is true, the button interrupts use the even interrupt vector GPIO_EVEN_IRQn, otherwise GPIO_ODD_IRQn.

Not all GPIO pins can be mapped to all even or odd external interrupt sources. Please see the GPIO_EXTIPINSELL and GPIO_EXTIPINSELH register documentation in the EFR32xG12 Wireless Gecko Reference Manual.

The external interrupt source in BOARD_BUTTON_PIN_LIST above should match this definition, otherwise the buttons won't work.

Definition at line 143 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 90 of file board.h.

◆ BOARD_LED_PIN_LIST

#define BOARD_LED_PIN_LIST   {{GPIOF, 4}, {GPIOF, 5}}

LED definitions.

If board contains LEDs, they are defined here. If not defined, a dummy LED driver is compiled, so that applications can use the LED driver unconditionally.

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

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

Definition at line 81 of file board.h.

◆ BOARD_UART_INT_PIN

#define BOARD_UART_INT_PIN   8

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. If not present, no irq pin is present

Definition at line 66 of file board.h.

◆ BOARD_UART_INT_PORT

#define BOARD_UART_INT_PORT   GPIOD

Definition at line 67 of file board.h.

◆ BOARD_USART_GPIO_PORT

#define BOARD_USART_GPIO_PORT   GPIOA

GPIO port used.

Valid values: GPIOA, GPIOB, ...

Definition at line 32 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 39 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 46 of file board.h.

◆ BOARD_USART_RX_PIN

#define BOARD_USART_RX_PIN   1

Reception pin number.

Definition at line 55 of file board.h.

◆ BOARD_USART_TX_PIN

#define BOARD_USART_TX_PIN   0

Transmission pin number.

Definition at line 51 of file board.h.