board.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Beuth Hochschule für Technik 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 "lpc23xx.h"
23 #include "mtd.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
33 #define LED0_PIN GPIO_PIN(2, 0)
34 #define LED1_PIN GPIO_PIN(2, 1)
35 #define LED2_PIN GPIO_PIN(2, 2)
36 #define LED3_PIN GPIO_PIN(2, 3)
37 #define LED4_PIN GPIO_PIN(2, 4)
38 #define LED5_PIN GPIO_PIN(2, 5)
39 #define LED6_PIN GPIO_PIN(2, 6)
40 #define LED7_PIN GPIO_PIN(2, 7)
41 
42 #define LED0_MASK (BIT0)
43 #define LED1_MASK (BIT1)
44 #define LED2_MASK (BIT2)
45 #define LED3_MASK (BIT3)
46 #define LED4_MASK (BIT4)
47 #define LED5_MASK (BIT5)
48 #define LED6_MASK (BIT6)
49 #define LED7_MASK (BIT7)
50 
51 #define LED0_ON (FIO2SET = LED0_MASK)
52 #define LED0_OFF (FIO2CLR = LED0_MASK)
53 #define LED0_TOGGLE (FIO2PIN ^= LED0_MASK)
54 
55 #define LED1_ON (FIO2SET = LED1_MASK)
56 #define LED1_OFF (FIO2CLR = LED1_MASK)
57 #define LED1_TOGGLE (FIO2PIN ^= LED1_MASK)
58 
59 #define LED2_ON (FIO2SET = LED2_MASK)
60 #define LED2_OFF (FIO2CLR = LED2_MASK)
61 #define LED2_TOGGLE (FIO2PIN ^= LED2_MASK)
62 
63 #define LED3_ON (FIO2SET = LED3_MASK)
64 #define LED3_OFF (FIO2CLR = LED3_MASK)
65 #define LED3_TOGGLE (FIO2PIN ^= LED3_MASK)
66 
67 #define LED4_ON (FIO2SET = LED4_MASK)
68 #define LED4_OFF (FIO2CLR = LED4_MASK)
69 #define LED4_TOGGLE (FIO2PIN ^= LED4_MASK)
70 
71 #define LED5_ON (FIO2SET = LED5_MASK)
72 #define LED5_OFF (FIO2CLR = LED5_MASK)
73 #define LED5_TOGGLE (FIO2PIN ^= LED5_MASK)
74 
75 #define LED6_ON (FIO2SET = LED6_MASK)
76 #define LED6_OFF (FIO2CLR = LED6_MASK)
77 #define LED6_TOGGLE (FIO2PIN ^= LED6_MASK)
78 
79 #define LED7_ON (FIO2SET = LED7_MASK)
80 #define LED7_OFF (FIO2CLR = LED7_MASK)
81 #define LED7_TOGGLE (FIO2PIN ^= LED7_MASK)
82 
88 #define BTN0_PIN GPIO_PIN(2, 10)
89 #define BTN0_MODE GPIO_IN
90 #define BTN0_INT_FLANK GPIO_FALLING
91 
97 #define HD44780_PARAM_COLS (16U)
98 #define HD44780_PARAM_ROWS (2U)
99 #define HD44780_PARAM_PIN_RS GPIO_PIN(1, 28)
100 #define HD44780_PARAM_PIN_RW GPIO_PIN(1, 29)
101 #define HD44780_PARAM_PIN_ENABLE GPIO_PIN(1, 31)
102 #define HD44780_PARAM_PINS_DATA { GPIO_PIN(1,24), GPIO_PIN(1,25), \
103  GPIO_PIN(1,26), GPIO_PIN(1,27), \
104  GPIO_UNDEF, GPIO_UNDEF, \
105  GPIO_UNDEF, GPIO_UNDEF }
106 
112 #ifdef MODULE_MTD_MCI
113 extern mtd_dev_t *mtd0;
114 #define MTD_0 mtd0
115 #endif
116 
118 #ifdef __cplusplus
119 }
120 #endif
121 
122 #endif /* BOARD_H */
123 
mtd_dev_t
MTD device descriptor.
Definition: mtd.h:58
mtd0
mtd_dev_t * mtd0
mtd flash emulation device