board.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Freie Universität Berlin
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 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
32 #define LED0_PIN GPIO_PIN(0, 11)
33 #define LED1_PIN GPIO_PIN(0, 12)
34 #define LED2_PIN GPIO_PIN(1, 9)
35 #define LED3_PIN GPIO_PIN(0, 13)
36 
37 #define LED0_MASK (1 << 11)
38 #define LED1_MASK (1 << 12)
39 #define LED2_MASK (1 << 9)
40 #define LED3_MASK (1 << 13)
41 #define LED_MASK_P0 (LED0_MASK | LED1_MASK | LED3_MASK)
42 #define LED_MASK_P1 (LED2_MASK)
43 
44 #define LED0_ON (NRF_P0->OUTCLR = LED0_MASK)
45 #define LED0_OFF (NRF_P0->OUTSET = LED0_MASK)
46 #define LED0_TOGGLE (NRF_P0->OUT ^= LED0_MASK)
47 
48 #define LED1_ON (NRF_P0->OUTCLR = LED1_MASK)
49 #define LED1_OFF (NRF_P0->OUTSET = LED1_MASK)
50 #define LED1_TOGGLE (NRF_P0->OUT ^= LED1_MASK)
51 
52 #define LED2_ON (NRF_P1->OUTCLR = LED2_MASK)
53 #define LED2_OFF (NRF_P1->OUTSET = LED2_MASK)
54 #define LED2_TOGGLE (NRF_P1->OUT ^= LED2_MASK)
55 
56 #define LED3_ON (NRF_P0->OUTCLR = LED3_MASK)
57 #define LED3_OFF (NRF_P0->OUTSET = LED3_MASK)
58 #define LED3_TOGGLE (NRF_P0->OUT ^= LED3_MASK)
59 
65 #define BTN0_PIN GPIO_PIN(0, 7)
66 #define BTN0_MODE GPIO_IN_PU
67 
73 #define SSD1673_SPI SPI_DEV(0)
74 #define SSD1673_CS GPIO_PIN(0, 17)
75 #define SSD1673_BUSY GPIO_PIN(0, 14)
76 #define SSD1673_RESET GPIO_PIN(0, 15)
77 #define SSD1673_DC_INPUT GPIO_PIN(0, 16)
78 
84 #define HDC1010_PARAM_I2C I2C_DEV(0)
85 #define HDC1010_PARAM_ADDR (0x43)
86 #define HDC1010_PIN_DRDY GPIO_PIN(0, 22)
87 
93 #define MMA8X5X_PARAM_I2C I2C_DEV(0)
94 #define MMA8X5X_PARAM_ADDR (0x1d)
95 #define MMA8X5X_PARAM_PIN_INT1 GPIO_PIN(0, 24)
96 #define MMA8X5X_PARAM_PIN_INT2 GPIO_PIN(0, 25)
97 
102 #define ADPS9960_PARAM_I2C I2C_DEV(0)
103 #define ADPS9960_PARAM_ADDR (0x29)
104 #define ADPS9960_PARAM_PIN_INT GPIO_PIN(0, 23)
105 
110 void board_init(void);
111 
112 #ifdef __cplusplus
113 }
114 #endif
115 
116 #endif /* BOARD_H */
117 
board_init
void board_init(void)
Board level initialization.