Wirepas SDK
board.h File Reference

Detailed Description

Template to be used for nRF52 board definitions

Definition in file board.h.

Go to the source code of this file.

Macros

#define BOARD_USART_TX_PIN   6
 Transmission pin number. More...
 
#define BOARD_USART_RX_PIN   8
 Reception pin number. More...
 
#define BOARD_USART_CTS_PIN   7
 CTS pin number, for USE_USART_HW_FLOW_CONTROL. More...
 
#define BOARD_USART_RTS_PIN   5
 RTS pin number, for USE_USART_HW_FLOW_CONTROL. 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_LED2   2
 
#define BOARD_GPIO_ID_LED3   3
 
#define BOARD_GPIO_ID_BUTTON0   4
 
#define BOARD_GPIO_ID_BUTTON1   5
 
#define BOARD_GPIO_ID_BUTTON2   6
 
#define BOARD_GPIO_ID_BUTTON3   7
 
#define BOARD_GPIO_ID_USART_WAKEUP   8
 
#define BOARD_GPIO_ID_UART_IRQ   9
 
#define BOARD_LED_ID_LIST   {BOARD_GPIO_ID_LED0, BOARD_GPIO_ID_LED1, BOARD_GPIO_ID_LED2, BOARD_GPIO_ID_LED3}
 LED definitions. More...
 
#define BOARD_LED_ACTIVE_LOW   true
 LED GPIO polarity. More...
 
#define BOARD_BUTTON_ID_LIST   {BOARD_GPIO_ID_BUTTON0, BOARD_GPIO_ID_BUTTON1, BOARD_GPIO_ID_BUTTON2, BOARD_GPIO_ID_BUTTON3}
 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 nRF52 boards, such as the PCA10040 and PCA10056. Otherwise, if a button press pulls the GPIO pin high, this setting should be set to false.

Definition at line 117 of file board.h.

◆ BOARD_BUTTON_ID_LIST

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 108 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 127 of file board.h.

◆ BOARD_GPIO_ID_BUTTON0

#define BOARD_GPIO_ID_BUTTON0   4

Definition at line 70 of file board.h.

◆ BOARD_GPIO_ID_BUTTON1

#define BOARD_GPIO_ID_BUTTON1   5

Definition at line 71 of file board.h.

◆ BOARD_GPIO_ID_BUTTON2

#define BOARD_GPIO_ID_BUTTON2   6

Definition at line 72 of file board.h.

◆ BOARD_GPIO_ID_BUTTON3

#define BOARD_GPIO_ID_BUTTON3   7

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

◆ BOARD_GPIO_ID_LED1

#define BOARD_GPIO_ID_LED1   1

Definition at line 67 of file board.h.

◆ BOARD_GPIO_ID_LED2

#define BOARD_GPIO_ID_LED2   2

Definition at line 68 of file board.h.

◆ BOARD_GPIO_ID_LED3

#define BOARD_GPIO_ID_LED3   3

Definition at line 69 of file board.h.

◆ BOARD_GPIO_ID_UART_IRQ

#define BOARD_GPIO_ID_UART_IRQ   9

Definition at line 75 of file board.h.

◆ BOARD_GPIO_ID_USART_WAKEUP

#define BOARD_GPIO_ID_USART_WAKEUP   8

Definition at line 74 of file board.h.

◆ BOARD_GPIO_PIN_LIST

#define BOARD_GPIO_PIN_LIST
Value:
{17, /* P0.17 */\
18, /* P0.18 */\
19, /* P0.19 */\
20, /* P0.20 */\
13, /* P0.13 */\
14, /* P0.14 */\
15, /* P0.15 */\
16, /* P0.16 */\
8, /* P0.08. required by the dual_mcu app. usart wakeup pin (= BOARD_USART_RX) */\
11} /* P0.11. 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 Nordic nRF52 family, GPIOs are defined as list of GPIO pin numbers

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

Definition at line 49 of file board.h.

◆ BOARD_LED_ACTIVE_LOW

#define BOARD_LED_ACTIVE_LOW   true

LED GPIO polarity.

If LEDs turn on when the GPIO pin is driven low, this setting is true. This is the case for many nRF52 boards, such as the PCA10040 and PCA10056. Otherwise, if a LED is lit when the the GPIO pin is driven high, this setting should be set to false.

Definition at line 96 of file board.h.

◆ BOARD_LED_ID_LIST

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 86 of file board.h.

◆ BOARD_USART_CTS_PIN

#define BOARD_USART_CTS_PIN   7

CTS pin number, for USE_USART_HW_FLOW_CONTROL.

Definition at line 31 of file board.h.

◆ BOARD_USART_RTS_PIN

#define BOARD_USART_RTS_PIN   5

RTS pin number, for USE_USART_HW_FLOW_CONTROL.

Definition at line 35 of file board.h.

◆ BOARD_USART_RX_PIN

#define BOARD_USART_RX_PIN   8

Reception pin number.

Definition at line 27 of file board.h.

◆ BOARD_USART_TX_PIN

#define BOARD_USART_TX_PIN   6

Transmission pin number.

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

Definition at line 23 of file board.h.