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_PCA20064_BOARD_H_
14#define BOARD_PCA20064_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#define BOARD_USART_CTS_PIN 2 // P0.02. For USE_USART_HW_FLOW_CONTROL
73#define BOARD_USART_RTS_PIN 3 // P0.03. For USE_USART_HW_FLOW_CONTROL
74
75#define BOARD_UART_IRQ_PIN 10 // P0.10. Empty in the schematics,
76 // as in 9161-DK,
77 // where IRQ is 10
78
79// List of GPIO pins
80#define BOARD_GPIO_PIN_LIST {29, /* P0.29 Red led */\
81 30, /* P0.30 Blue led */\
82 31, /* P0.31 Green led */\
83 26, /* P0.26 Button */\
84 /* Required by dual_mcu app, \
85 * USART wakeup pin */\
86 BOARD_USART_RX_PIN, \
87 /* Required by the dual_mcu app,\
88 * indication signal */\
89 BOARD_UART_IRQ_PIN} \
91// User friendly name for GPIOs (IDs mapped to the BOARD_GPIO_PIN_LIST table)
92#define BOARD_GPIO_ID_LED1 0 // mapped to pin P0.29
93#define BOARD_GPIO_ID_LED2 1 // mapped to pin P0.30
94#define BOARD_GPIO_ID_LED3 2 // mapped to pin P0.31
95#define BOARD_GPIO_ID_BUTTON1 3 // mapped to pin P0.26
96#define BOARD_GPIO_ID_USART_WAKEUP 4 // mapped to usart rx pin
97#define BOARD_GPIO_ID_UART_IRQ 5 // mapped to pin P0.10
99// List of LED IDs mapped to GPIO IDs: LED 1 to LED 3
100#define BOARD_LED_ID_LIST {BOARD_GPIO_ID_LED1, BOARD_GPIO_ID_LED2, BOARD_GPIO_ID_LED3}
102// List of button IDs mapped to GPIO IDs
103#define BOARD_BUTTON_ID_LIST {BOARD_GPIO_ID_BUTTON1}
105// Active low polarity for LEDs
106#define BOARD_LED_ACTIVE_LOW false
108// Active low polarity for buttons
109#define BOARD_BUTTON_ACTIVE_LOW true
111// Active internal pull-up for buttons
112#define BOARD_BUTTON_INTERNAL_PULL true
113
114// The board supports DCDC (#define BOARD_SUPPORT_DCDC)
115// Since SDK v1.2 (bootloader > v7) this option has been move to
116// board/<board_name>/config.mk. Set board_hw_dcdc to yes to enable DCDC.
117#ifdef BOARD_SUPPORT_DCDC
118#error This option has been moved to board/<board_name>/config.mk
119#endif
120
124#define BOARD_SPI_SCK_PIN 13
125#define BOARD_SPI_MOSI_PIN 14
126#define BOARD_SPI_MISO_PIN 15
127
139#define EXT_FLASH_SPI_SCK BOARD_SPI_SCK_PIN // P0.13 TP34
140#define EXT_FLASH_SPI_MOSI BOARD_SPI_MOSI_PIN // P0.14 TP35
141#define EXT_FLASH_SPI_MISO BOARD_SPI_MISO_PIN // P0.15 TP36
142#define EXT_FLASH_CS 12 // P0.12 TP33
143#define EXT_FLASH_SPIM_P NRF_SPIM1
144
145/*
146 * Last 30mb in the external flash after scratchpad is
147 * freely at the disposal of the application.
148 */
149#define EXT_FLASH_USER_FIRST_ADDRESS 0x200000
150#define EXT_FLASH_USER_LAST_ADDRESS 0x1FFFFFF
151
156#define USE_I2C2
158// I2C Port pin
159#define BOARD_I2C_SCL_PIN 8 // P0.08
160#define BOARD_I2C_SDA_PIN 9 // P0.09
161
162#define BOARD_I2C_PIN_PULLUP true
164// I2C address for environment sensor
165#define BME688_I2C_ADDRESS 0x76
167// I2C address for accelerometer
168#define ADXL367_I2C_ADDRESS 0x1D
169
170#endif /* BOARD_PCA20064_BOARD_H_ */