board.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Inria
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
19 #ifndef BOARD_H
20 #define BOARD_H
21 
22 #include "cpu.h"
23 #include "board_common.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
33 #define LED0_PIN GPIO_PIN(1, 1)
34 #define LED0_MASK (1 << 1)
35 #define LED0_ON (NRF_P1->OUTSET = LED0_MASK)
36 #define LED0_OFF (NRF_P1->OUTCLR = LED0_MASK)
37 #define LED0_TOGGLE (NRF_P1->OUT ^= LED0_MASK)
38 
44 #define BTN0_PIN GPIO_PIN(1, 2) /* Button A */
45 #define BTN0_MODE GPIO_IN_PU
46 
47 #define BTN1_PIN GPIO_PIN(1, 10) /* Button B */
48 #define BTN1_MODE GPIO_IN_PU
49 
55 #define APDS99XX_PARAM_DEV I2C_DEV(1)
56 #define APDS99XX_PARAM_INT_PIN GPIO_PIN(0, 9)
57 
63 #define BMX280_PARAM_I2C_DEV I2C_DEV(1)
64 
69 #define LIS3MDL_PARAM_I2C I2C_DEV(1)
70 #define LIS3MDL_PARAM_ADDR (0x1C)
71 
76 #define SHT3X_PARAM_I2C_DEV I2C_DEV(1)
77 #define SHT3X_PARAM_I2C_ADDR (SHT3X_I2C_ADDR_1)
78 
84 #define SPKR_PIN GPIO_PIN(1, 0)
85 
91 #define BACKLIGHT_PIN GPIO_PIN(1, 5)
92 #define BACKLIGHT_MASK (1 << 5)
93 #define BACKLIGHT_ON (NRF_P1->OUTSET = BACKLIGHT_MASK)
94 #define BACKLIGHT_OFF (NRF_P1->OUTCLR = BACKLIGHT_MASK)
95 
101 #define ILI9341_PARAM_SPI SPI_DEV(1)
102 #define ILI9341_PARAM_CS GPIO_PIN(0, 12)
103 #define ILI9341_PARAM_DCX GPIO_PIN(0, 13)
104 #define ILI9341_PARAM_RST GPIO_PIN(1, 3)
105 #define ILI9341_PARAM_NUM_LINES (240U)
106 #define ILI9341_PARAM_RGB (1)
107 #define ILI9341_PARAM_INVERTED (1)
108 
110 #ifdef __cplusplus
111 }
112 #endif
113 
114 #endif /* BOARD_H */
115