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 
13 #ifndef BOARD_PCA20065_BOARD_H_
14 #define BOARD_PCA20065_BOARD_H_
15 
16 // Thingy91+ modem initialization AT commands to define antenna path.
17 // BOARD_AT_COMMANDS is list of AT commands, where
18 // each AT command is separated by null character ('\0'), and
19 // end of the list is indicated with double null characters ("\0\0")
20 
21 // AT%XMIPIRFFEDEV=1,4,71,198,248        // mipirffe device configuration
22 // AT%XMIPIRFFECTRL=1,0,2,28,248,0,130  // init phase (this setting should be good for frequencies 864-891 and 1523-2200 MHz)
23 // AT%XMIPIRFFECTRL=1,3,2,28,184,0,0     // pwroff phase
24 
25 #define BOARD_AT_COMMANDS "AT%XMIPIRFFEDEV=1,4,71,198,248\0" \
26  "AT%XMIPIRFFECTRL=1,0,2,28,248,0,130\0" \
27  "AT%XMIPIRFFECTRL=1,3,2,28,184,0,0\0"
28 
29 // NRF_GPIO is mapped to NRF_P0 , for pins P0.00 ... P0.31
30 // With nrf_gpio.h, use SW_pin (logical pins, port-aware)
31 
69 // Serial port pins
70 #define BOARD_USART_TX_PIN 1 // P0.01 Inverse from schematics
71 #define BOARD_USART_RX_PIN 0 // P0.00
72 
73 // List of GPIO pins
74 #define BOARD_GPIO_PIN_LIST {29, /* P0.29 Red led */\
75  30, /* P0.30 Blue led */\
76  31, /* P0.31 Green led */\
77  26, /* P0.26 Button */\
78  /* Required by dual_mcu app, \
79  * USART wakeup pin */\
80  BOARD_USART_RX_PIN, \
81  }
82 
83 // User friendly name for GPIOs (IDs mapped to the BOARD_GPIO_PIN_LIST table)
84 #define BOARD_GPIO_ID_LED1 0 // mapped to pin P0.29
85 #define BOARD_GPIO_ID_LED2 1 // mapped to pin P0.30
86 #define BOARD_GPIO_ID_LED3 2 // mapped to pin P0.31
87 #define BOARD_GPIO_ID_BUTTON1 3 // mapped to pin P0.26
88 #define BOARD_GPIO_ID_USART_WAKEUP 4 // mapped to usart rx pin
89 
90 // List of LED IDs mapped to GPIO IDs: LED 1 to LED 3
91 #define BOARD_LED_ID_LIST {BOARD_GPIO_ID_LED1, BOARD_GPIO_ID_LED2, BOARD_GPIO_ID_LED3}
92 
93 // List of button IDs mapped to GPIO IDs
94 #define BOARD_BUTTON_ID_LIST {BOARD_GPIO_ID_BUTTON1}
95 
96 // Active low polarity for LEDs
97 #define BOARD_LED_ACTIVE_LOW false
98 
99 // Active low polarity for buttons
100 #define BOARD_BUTTON_ACTIVE_LOW true
101 
102 // Active internal pull-up for buttons
103 #define BOARD_BUTTON_INTERNAL_PULL true
104 
105 // The board supports DCDC (#define BOARD_SUPPORT_DCDC)
106 // Since SDK v1.2 (bootloader > v7) this option has been move to
107 // board/<board_name>/config.mk. Set board_hw_dcdc to yes to enable DCDC.
108 #ifdef BOARD_SUPPORT_DCDC
109 #error This option has been moved to board/<board_name>/config.mk
110 #endif
111 
115 #define BOARD_SPI_SCK_PIN 13
116 #define BOARD_SPI_MOSI_PIN 14
117 #define BOARD_SPI_MISO_PIN 15
118 
130 #define EXT_FLASH_SPI_SCK BOARD_SPI_SCK_PIN // P0.13
131 #define EXT_FLASH_SPI_MOSI BOARD_SPI_MOSI_PIN // P0.14
132 #define EXT_FLASH_SPI_MISO BOARD_SPI_MISO_PIN // P0.15
133 #define EXT_FLASH_CS 12 // P0.12
134 #define EXT_FLASH_SPIM_P NRF_SPIM1
135 
136 /*
137  * Last 30mb in the external flash after scratchpad is
138  * freely at the disposal of the application.
139  */
140 #define EXT_FLASH_USER_FIRST_ADDRESS 0x200000
141 #define EXT_FLASH_USER_LAST_ADDRESS 0x1FFFFFF
142 
147 #define USE_I2C2
148 
149 // I2C Port pin
150 #define BOARD_I2C_SCL_PIN 8 // P0.08
151 #define BOARD_I2C_SDA_PIN 9 // P0.09
152 
153 #define BOARD_I2C_PIN_PULLUP true
154 
155 // I2C address for environment sensor
156 #define BME688_I2C_ADDRESS 0x76
157 
158 // I2C address for accelerometer
159 #define ADXL367_I2C_ADDRESS 0x1D
160 
161 #endif /* BOARD_PCA20065_BOARD_H_ */