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,1,28,248 // mipirffe device configuration
23// AT%XMIPIRFFECTRL= // antenna tuning config set
24// 1, -- <dev_id>
25// 1, -- <phase#> = 1 → ON phase
26// 1, -- <n> = 1 activation pair
27// 28,56, -- <act_addr_0>=28, <act_data_0>=56
28// 13, -- <k> = 13 frequency entries
29// 0,0, -- <addr_0>=0, <addr_1>=0
30// 0,8,715, -- data_0_0=0, data_1_0=8, freq_0=715
31// 4,4,770, -- data_0_1=4, data_1_1=4, freq_1=770
32// 12,12,829, -- data_0_2=12, data_1_2=12, freq_2=829
33// 11,11,863, -- data_0_3=11, data_1_3=11, freq_3=863
34// 130,130,892,-- data_0_4=130, data_1_4=130, freq_4=892
35// 1,1,939, -- data_0_5=1, data_1_5=1, freq_5=939
36// 129,129,978,-- data_0_6=129, data_1_6=129, freq_6=978
37// 26,26,1042, -- data_0_7=26, data_1_7=26, freq_7=1042
38// 8,8,1118, -- data_0_8=8, data_1_8=8, freq_8=1118
39// 4,4,1270, -- data_0_9=4, data_1_9=4, freq_9=1270
40// 12,12,1386, -- data_0_10=12, data_1_10=12, freq_10=1386
41// 14,14,1523, -- data_0_11=14, data_1_11=14, freq_11=1523
42// 130,130,2200-- data_0_12=130,data_1_12=130,freq_12=2200
43// AT%XMIPIRFFECTRL=1,2,1,28,184 // mipirffe device configuration
44// AT%XMIPIRFFECTRL=1,3,1,28,184 // mipirffe device configuration
45
46#define BOARD_AT_COMMANDS "AT%XMIPIRFFEDEV=1,4,71,198,248\0" \
47 "AT%XMIPIRFFECTRL=1,0,1,28,248\0" \
48 "AT%XMIPIRFFECTRL=1,1,1,28,56,13,0,0,8,8,715,4,4,770,12,12,829,11,11,863,130,130,892,1,1,939,129,129,978,26,26,1042,8,8,1118,4,4,1270,12,12,1386,14,14,1523,130,130,2200\0" \
49 "AT%XMIPIRFFECTRL=1,2,1,28,184\0" \
50 "AT%XMIPIRFFECTRL=1,3,1,28,184\0\0"
51
52// NRF_GPIO is mapped to NRF_P0 , for pins P0.00 ... P0.31
53// With nrf_gpio.h, use SW_pin (logical pins, port-aware)
54
92// Serial port pins
93#define BOARD_USART_TX_PIN 1 // P0.01 Inverse from schematics
94#define BOARD_USART_RX_PIN 0 // P0.00
95
96// List of GPIO pins
97#define BOARD_GPIO_PIN_LIST {29, /* P0.29 Red led */\
98 30, /* P0.30 Blue led */\
99 31, /* P0.31 Green led */\
100 26, /* P0.26 Button */\
101 /* Required by dual_mcu app, \
102 * USART wakeup pin */\
103 BOARD_USART_RX_PIN, \
104 }
105
106// User friendly name for GPIOs (IDs mapped to the BOARD_GPIO_PIN_LIST table)
107#define BOARD_GPIO_ID_LED1 0 // mapped to pin P0.29
108#define BOARD_GPIO_ID_LED2 1 // mapped to pin P0.30
109#define BOARD_GPIO_ID_LED3 2 // mapped to pin P0.31
110#define BOARD_GPIO_ID_BUTTON1 3 // mapped to pin P0.26
111#define BOARD_GPIO_ID_USART_WAKEUP 4 // mapped to usart rx pin
112
113// List of LED IDs mapped to GPIO IDs: LED 1 to LED 3
114#define BOARD_LED_ID_LIST {BOARD_GPIO_ID_LED1, BOARD_GPIO_ID_LED2, BOARD_GPIO_ID_LED3}
115
116// List of button IDs mapped to GPIO IDs
117#define BOARD_BUTTON_ID_LIST {BOARD_GPIO_ID_BUTTON1}
118
119// Active low polarity for LEDs
120#define BOARD_LED_ACTIVE_LOW false
121
122// Active low polarity for buttons
123#define BOARD_BUTTON_ACTIVE_LOW true
124
125// Active internal pull-up for buttons
126#define BOARD_BUTTON_INTERNAL_PULL true
127
128// The board supports DCDC (#define BOARD_SUPPORT_DCDC)
129// Since SDK v1.2 (bootloader > v7) this option has been move to
130// board/<board_name>/config.mk. Set board_hw_dcdc to yes to enable DCDC.
131#ifdef BOARD_SUPPORT_DCDC
132#error This option has been moved to board/<board_name>/config.mk
133#endif
134
138#define BOARD_SPI_SCK_PIN 13
139#define BOARD_SPI_MOSI_PIN 14
140#define BOARD_SPI_MISO_PIN 15
141
153#define EXT_FLASH_SPI_SCK BOARD_SPI_SCK_PIN // P0.13
154#define EXT_FLASH_SPI_MOSI BOARD_SPI_MOSI_PIN // P0.14
155#define EXT_FLASH_SPI_MISO BOARD_SPI_MISO_PIN // P0.15
156#define EXT_FLASH_CS 12 // P0.12
157#define EXT_FLASH_SPIM_P NRF_SPIM1
158
159/*
160 * Last 30mb in the external flash after scratchpad is
161 * freely at the disposal of the application.
162 */
163#define EXT_FLASH_USER_FIRST_ADDRESS 0x200000
164#define EXT_FLASH_USER_LAST_ADDRESS 0x1FFFFFF
165
170#define USE_I2C2
171
172// I2C Port pin
173#define BOARD_I2C_SCL_PIN 8 // P0.08
174#define BOARD_I2C_SDA_PIN 9 // P0.09
176#define BOARD_I2C_PIN_PULLUP true
177
178// I2C address for environment sensor
179#define BME688_I2C_ADDRESS 0x76
180
181// I2C address for accelerometer
182#define ADXL367_I2C_ADDRESS 0x1D
183
184#endif /* BOARD_PCA20065_BOARD_H_ */