diff options
Diffstat (limited to 'lib/chibios-contrib/os/hal/boards/NRF52-E73-2G4M04S/board.h')
-rw-r--r-- | lib/chibios-contrib/os/hal/boards/NRF52-E73-2G4M04S/board.h | 164 |
1 files changed, 164 insertions, 0 deletions
diff --git a/lib/chibios-contrib/os/hal/boards/NRF52-E73-2G4M04S/board.h b/lib/chibios-contrib/os/hal/boards/NRF52-E73-2G4M04S/board.h new file mode 100644 index 000000000..c78909f27 --- /dev/null +++ b/lib/chibios-contrib/os/hal/boards/NRF52-E73-2G4M04S/board.h | |||
@@ -0,0 +1,164 @@ | |||
1 | /* | ||
2 | Copyright (C) 2016 Stephane D'Alu | ||
3 | |||
4 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | you may not use this file except in compliance with the License. | ||
6 | You may obtain a copy of the License at | ||
7 | |||
8 | http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | |||
10 | Unless required by applicable law or agreed to in writing, software | ||
11 | distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | See the License for the specific language governing permissions and | ||
14 | limitations under the License. | ||
15 | */ | ||
16 | |||
17 | #ifndef _BOARD_H_ | ||
18 | #define _BOARD_H_ | ||
19 | |||
20 | /* Board identifier. */ | ||
21 | #define BOARD_NRF52_EBYTE_E73 | ||
22 | #define BOARD_NAME "nRF52 EBYTE E73-2G4M04S" | ||
23 | |||
24 | /* Board oscillators-related settings. */ | ||
25 | #define NRF5_XTAL_VALUE 32000000 | ||
26 | #define NRF5_HFCLK_SOURCE NRF5_HFCLK_HFXO | ||
27 | #define NRF5_LFCLK_SOURCE NRF5_LFCLK_XTAL | ||
28 | |||
29 | #define NRF5_HFCLK_HFINT 0 | ||
30 | #define NRF5_HFCLK_HFXO 1 | ||
31 | |||
32 | #define NRF5_LFCLK_RC 0 | ||
33 | #define NRF5_LFCLK_XTAL 1 | ||
34 | #define NRF5_LFCLK_SYNTH 2 | ||
35 | |||
36 | /* | ||
37 | * GPIO pins. | ||
38 | */ | ||
39 | /* Defined by board */ | ||
40 | #define BTN1 13U | ||
41 | #define BTN2 14U | ||
42 | #define BTN3 15U | ||
43 | #define BTN4 16U | ||
44 | #define LED1 17U | ||
45 | #define LED2 18U | ||
46 | #define LED3 19U | ||
47 | #define LED4 20U | ||
48 | #define UART_RTS 5U | ||
49 | #define UART_TX 6U | ||
50 | #define UART_CTS 7U | ||
51 | #define UART_RX 8U | ||
52 | #define NFC1 9U | ||
53 | #define NFC2 10U | ||
54 | #define I2C_SCL 27U | ||
55 | #define I2C_SDA 26U | ||
56 | |||
57 | /* Our definitions */ | ||
58 | #define SPI_SCK 25U | ||
59 | #define SPI_MOSI 24U | ||
60 | #define SPI_MISO 23U | ||
61 | #define SPI_SS 22U | ||
62 | |||
63 | /* Analog input */ | ||
64 | #define AIN0 2U | ||
65 | #define AIN1 3U | ||
66 | #define AIN2 4U | ||
67 | #define AIN3 5U | ||
68 | #define AIN4 28U | ||
69 | #define AIN5 29U | ||
70 | #define AIN6 30U | ||
71 | #define AIN7 31U | ||
72 | #define AREF0 AIN0 | ||
73 | #define AREF1 AIN1 | ||
74 | |||
75 | /* | ||
76 | * IO pins assignments. | ||
77 | */ | ||
78 | /* Defined by board */ | ||
79 | #define IOPORT1_BTN1 13U | ||
80 | #define IOPORT1_BTN2 14U | ||
81 | #define IOPORT1_BTN3 15U | ||
82 | #define IOPORT1_BTN4 16U | ||
83 | #define IOPORT1_LED1 17U | ||
84 | #define IOPORT1_LED2 18U | ||
85 | #define IOPORT1_LED3 19U | ||
86 | #define IOPORT1_LED4 20U | ||
87 | #define IOPORT1_UART_RTS 5U | ||
88 | #define IOPORT1_UART_TX 6U | ||
89 | #define IOPORT1_UART_CTS 7U | ||
90 | #define IOPORT1_UART_RX 8U | ||
91 | #define IOPORT1_NFC1 9U | ||
92 | #define IOPORT1_NFC2 10U | ||
93 | #define IOPORT1_I2C_SCL 27U | ||
94 | #define IOPORT1_I2C_SDA 26U | ||
95 | #define IOPORT1_RESET 21U | ||
96 | |||
97 | /* Our definitions */ | ||
98 | #define IOPORT1_SPI_SCK 25U | ||
99 | #define IOPORT1_SPI_MOSI 24U | ||
100 | #define IOPORT1_SPI_MISO 23U | ||
101 | #define IOPORT1_SPI_SS 22U | ||
102 | |||
103 | /* Analog inpupt */ | ||
104 | #define IOPORT1_AIN0 2U | ||
105 | #define IOPORT1_AIN1 3U | ||
106 | #define IOPORT1_AIN2 4U | ||
107 | #define IOPORT1_AIN3 5U | ||
108 | #define IOPORT1_AIN4 28U | ||
109 | #define IOPORT1_AIN5 29U | ||
110 | #define IOPORT1_AIN6 30U | ||
111 | #define IOPORT1_AIN7 31U | ||
112 | #define IOPORT1_AREF0 IOPORT1_AIN0 | ||
113 | #define IOPORT1_AREF1 IOPORT1_AIN1 | ||
114 | |||
115 | /* | ||
116 | * IO lines assignments. | ||
117 | */ | ||
118 | /* Board defined */ | ||
119 | #define LINE_BTN1 PAL_LINE(IOPORT1, IOPORT1_BTN1) | ||
120 | #define LINE_BTN2 PAL_LINE(IOPORT1, IOPORT1_BTN2) | ||
121 | #define LINE_BTN3 PAL_LINE(IOPORT1, IOPORT1_BTN3) | ||
122 | #define LINE_BTN4 PAL_LINE(IOPORT1, IOPORT1_BTN4) | ||
123 | #define LINE_LED1 PAL_LINE(IOPORT1, IOPORT1_LED1) | ||
124 | #define LINE_LED2 PAL_LINE(IOPORT1, IOPORT1_LED2) | ||
125 | #define LINE_LED3 PAL_LINE(IOPORT1, IOPORT1_LED3) | ||
126 | #define LINE_LED4 PAL_LINE(IOPORT1, IOPORT1_LED4) | ||
127 | #define LINE_UART_RTS PAL_LINE(IOPORT1, IOPORT1_UART_RTS) | ||
128 | #define LINE_UART_TX PAL_LINE(IOPORT1, IOPORT1_UART_TX) | ||
129 | #define LINE_UART_CTS PAL_LINE(IOPORT1, IOPORT1_UART_CTS) | ||
130 | #define LINE_UART_RX PAL_LINE(IOPORT1, IOPORT1_UART_RX) | ||
131 | #define LINE_NFC1 PAL_LINE(IOPORT1, IOPORT1_NFC1) | ||
132 | #define LINE_NFC2 PAL_LINE(IOPORT1, IOPORT1_NFC2) | ||
133 | #define LINE_I2C_SCL PAL_LINE(IOPORT1, IOPORT1_I2C_SCL) | ||
134 | #define LINE_I2C_SDA PAL_LINE(IOPORT1, IOPORT1_I2C_SDA) | ||
135 | |||
136 | /* Our definitions */ | ||
137 | #define LINE_SPI_SCK PAL_LINE(IOPORT1, IOPORT1_SPI_SCK) | ||
138 | #define LINE_SPI_MOSI PAL_LINE(IOPORT1, IOPORT1_SPI_MOSI) | ||
139 | #define LINE_SPI_MISO PAL_LINE(IOPORT1, IOPORT1_SPI_MISO) | ||
140 | #define LINE_SPI_SS PAL_LINE(IOPORT1, IOPORT1_SPI_SS) | ||
141 | |||
142 | /* Analog line */ | ||
143 | #define LINE_AIN0 PAL_LINE(IOPORT1, IOPORT1_AIN0) | ||
144 | #define LINE_AIN1 PAL_LINE(IOPORT1, IOPORT1_AIN1) | ||
145 | #define LINE_AIN2 PAL_LINE(IOPORT1, IOPORT1_AIN2) | ||
146 | #define LINE_AIN3 PAL_LINE(IOPORT1, IOPORT1_AIN3) | ||
147 | #define LINE_AIN4 PAL_LINE(IOPORT1, IOPORT1_AIN4) | ||
148 | #define LINE_AIN5 PAL_LINE(IOPORT1, IOPORT1_AIN5) | ||
149 | #define LINE_AIN6 PAL_LINE(IOPORT1, IOPORT1_AIN6) | ||
150 | #define LINE_AIN7 PAL_LINE(IOPORT1, IOPORT1_AIN7) | ||
151 | #define LINE_AREF0 PAL_LINE(IOPORT1, IOPORT1_AREF0) | ||
152 | #define LINE_AREF1 PAL_LINE(IOPORT1, IOPORT1_AREF1) | ||
153 | |||
154 | #if !defined(_FROM_ASM_) | ||
155 | #ifdef __cplusplus | ||
156 | extern "C" { | ||
157 | #endif | ||
158 | void boardInit(void); | ||
159 | #ifdef __cplusplus | ||
160 | } | ||
161 | #endif | ||
162 | #endif /* _FROM_ASM_ */ | ||
163 | |||
164 | #endif /* _BOARD_H_ */ | ||