diff options
Diffstat (limited to 'lib/chibios/os/hal/boards/EA_LPCXPRESSO_LPC812/board.h')
-rw-r--r-- | lib/chibios/os/hal/boards/EA_LPCXPRESSO_LPC812/board.h | 125 |
1 files changed, 125 insertions, 0 deletions
diff --git a/lib/chibios/os/hal/boards/EA_LPCXPRESSO_LPC812/board.h b/lib/chibios/os/hal/boards/EA_LPCXPRESSO_LPC812/board.h new file mode 100644 index 000000000..559ac7a04 --- /dev/null +++ b/lib/chibios/os/hal/boards/EA_LPCXPRESSO_LPC812/board.h | |||
@@ -0,0 +1,125 @@ | |||
1 | /* | ||
2 | ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio | ||
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 | /* | ||
21 | * Setup for Embedded Artists LPCXpresso LPC812 board. | ||
22 | */ | ||
23 | |||
24 | /* | ||
25 | * Board identifiers. | ||
26 | */ | ||
27 | #define BOARD_EA_LPC812 | ||
28 | #define BOARD_NAME "Embedded Artists LPCXpresso LPC812" | ||
29 | |||
30 | /* | ||
31 | * Board frequencies. | ||
32 | */ | ||
33 | #define SYSOSCCLK 12000000 | ||
34 | |||
35 | |||
36 | /* | ||
37 | * I/O ports initial setup, this configuration is established soon after reset | ||
38 | * in the initialization code. | ||
39 | * Please refer to the LPC8xx Reference Manual for details. | ||
40 | */ | ||
41 | /* Pull-up/down */ | ||
42 | #define PIN_MODE_NOPULL (0<<3) | ||
43 | #define PIN_MODE_PULLDOWN (1<<3) | ||
44 | #define PIN_MODE_PULLUP (2<<3) | ||
45 | #define PIN_MODE_REPEATER (3<<3) | ||
46 | /* Hysteresis */ | ||
47 | #define PIN_HYS_EN (1<<5) | ||
48 | /* Invert Input */ | ||
49 | #define PIN_INV_INPUT (1<<6) | ||
50 | /* Reserved bits */ | ||
51 | #define PIN_RSVD (1<<7) | ||
52 | /* I2C Mode */ | ||
53 | #define PIN_I2CMODE_STD (0<<8) | ||
54 | #define PIN_I2CMODE_STDIO (1<<8) | ||
55 | #define PIN_I2CMODE_FAST (2<<8) | ||
56 | /* Open Drain */ | ||
57 | #define PIN_OPEN_DRAIN (1<<10) | ||
58 | /* Input Filter Sample Clocks */ | ||
59 | #define PIN_SMODE_FILTER(n) ((n)<<11) | ||
60 | /* Input Filter clock divider */ | ||
61 | #define PIN_CLKDIV_FILTER(n) ((n)<<13) | ||
62 | |||
63 | /* | ||
64 | * Pin definitions. | ||
65 | */ | ||
66 | #define LED_RED 7 | ||
67 | #define LED_BLUE 16 | ||
68 | #define LED_GREEN 17 | ||
69 | |||
70 | |||
71 | /* | ||
72 | * GPIO 0 initial setup. | ||
73 | */ | ||
74 | /*#define VAL_PIO0_0 PIN_MODE_PULLUP*/ | ||
75 | /*#define VAL_PIO0_1 PIN_MODE_PULLUP*/ | ||
76 | /*#define VAL_PIO0_2 PIN_MODE_PULLUP*/ | ||
77 | /*#define VAL_PIO0_3 PIN_MODE_PULLUP*/ | ||
78 | /*#define VAL_PIO0_4 PIN_MODE_PULLUP*/ | ||
79 | /*#define VAL_PIO0_5 PIN_MODE_PULLUP*/ | ||
80 | /*#define VAL_PIO0_6 PIN_MODE_PULLUP*/ | ||
81 | #define VAL_PIO0_7 PIN_MODE_NOPULL | ||
82 | /*#define VAL_PIO0_8 PIN_MODE_PULLUP*/ | ||
83 | /*#define VAL_PIO0_9 PIN_MODE_PULLUP*/ | ||
84 | /*#define VAL_PIO0_10 PIN_MODE_PULLUP*/ | ||
85 | /*#define VAL_PIO0_11 PIN_MODE_PULLUP*/ | ||
86 | /*#define VAL_PIO0_12 PIN_MODE_PULLUP*/ | ||
87 | /*#define VAL_PIO0_13 PIN_MODE_PULLUP*/ | ||
88 | /*#define VAL_PIO0_14 PIN_MODE_PULLUP*/ | ||
89 | /*#define VAL_PIO0_15 PIN_MODE_PULLUP*/ | ||
90 | #define VAL_PIO0_16 PIN_MODE_NOPULL | ||
91 | #define VAL_PIO0_17 PIN_MODE_NOPULL | ||
92 | |||
93 | /* UART0: TXD = P0.4, RXD = P0.0)*/ | ||
94 | #define VAL_PINASSIGN0 ((0xFFFF0000) | (0<<8) | (4)) | ||
95 | /*#define VAL_PINASSIGN1 0xFFFFFFFF*/ | ||
96 | /*#define VAL_PINASSIGN2 0xFFFFFFFF*/ | ||
97 | /*#define VAL_PINASSIGN3 0xFFFFFFFF*/ | ||
98 | /*#define VAL_PINASSIGN4 0xFFFFFFFF*/ | ||
99 | /*#define VAL_PINASSIGN5 0xFFFFFFFF*/ | ||
100 | /*#define VAL_PINASSIGN6 0xFFFFFFFF*/ | ||
101 | /*#define VAL_PINASSIGN7 0xFFFFFFFF*/ | ||
102 | /*#define VAL_PINASSIGN8 0xFFFFFFFF*/ | ||
103 | |||
104 | |||
105 | #define VAL_GPIO0DIR (PAL_PORT_BIT(LED_RED) | \ | ||
106 | PAL_PORT_BIT(LED_BLUE) | \ | ||
107 | PAL_PORT_BIT(LED_GREEN)) | ||
108 | |||
109 | #define VAL_GPIO0DATA (PAL_PORT_BIT(LED_RED) | \ | ||
110 | PAL_PORT_BIT(LED_BLUE) | \ | ||
111 | PAL_PORT_BIT(LED_GREEN)) | ||
112 | |||
113 | |||
114 | #if !defined(_FROM_ASM_) | ||
115 | #ifdef __cplusplus | ||
116 | extern "C" { | ||
117 | #endif | ||
118 | void boardInit(void); | ||
119 | #ifdef __cplusplus | ||
120 | } | ||
121 | #endif | ||
122 | #endif /* _FROM_ASM_ */ | ||
123 | |||
124 | |||
125 | #endif /* _BOARD_H_ */ | ||