Use new Makefile.defs in stm-demo
[fw/altos] / src / stm-demo / ao_pins.h
1 /*
2  * Copyright © 2012 Keith Packard <keithp@keithp.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; version 2 of the License.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11  * General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License along
14  * with this program; if not, write to the Free Software Foundation, Inc.,
15  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
16  */
17
18 #ifndef _AO_PINS_H_
19 #define _AO_PINS_H_
20
21 #define HAS_SERIAL_1            1
22 #define USE_SERIAL_1_STDIN      1
23 #define SERIAL_1_PB6_PB7        1
24 #define SERIAL_1_PA9_PA10       0
25
26 #define HAS_SERIAL_2            0
27 #define USE_SERIAL_2_STDIN      1
28 #define SERIAL_2_PA2_PA3        0
29 #define SERIAL_2_PD5_PD6        1
30
31 #define HAS_SERIAL_3            0
32 #define USE_SERIAL_3_STDIN      1
33 #define SERIAL_3_PB10_PB11      0
34 #define SERIAL_3_PC10_PC11      0
35 #define SERIAL_3_PD8_PD9        1
36
37 #define HAS_USB                 0
38 #define HAS_BEEP                0
39 #define PACKET_HAS_SLAVE        0
40
41 #define LOW_LEVEL_DEBUG         1
42
43 #define LED_PORT_ENABLE         STM_RCC_AHBENR_GPIOBEN
44 #define LED_PORT                stm_gpiob
45 #define LED_PIN_GREEN           7
46 #define LED_PIN_BLUE            6
47 #define AO_LED_GREEN            (1 << LED_PIN_GREEN)
48 #define AO_LED_BLUE             (1 << LED_PIN_BLUE)
49
50 #define AO_LED_RED              AO_LED_BLUE     /* a patent lie */
51
52 #define LEDS_AVAILABLE          (AO_LED_BLUE | AO_LED_GREEN)
53
54 #define AO_LCD_STM_SEG_ENABLED_0 (              \
55                 (1 << 0) | /* PA1 */            \
56                 (1 << 1) | /* PA2 */            \
57                 (1 << 2) | /* PA3 */            \
58                 (0 << 3) | /* PA6 */            \
59                 (0 << 4) | /* PA7 */            \
60                 (0 << 5) | /* PB0 */            \
61                 (0 << 6) | /* PB1 */            \
62                 (1 << 7) | /* PB3 */            \
63                 (1 << 8) | /* PB4 */            \
64                 (1 << 9) | /* PB5 */            \
65                 (1 << 10) | /* PB10 */          \
66                 (1 << 11) | /* PB11 */          \
67                 (1 << 12) | /* PB12 */          \
68                 (1 << 13) | /* PB13 */          \
69                 (1 << 14) | /* PB14 */          \
70                 (1 << 15) | /* PB15 */          \
71                 (1 << 16) | /* PB8 */           \
72                 (1 << 17) | /* PA15 */          \
73                 (1 << 18) | /* PC0 */           \
74                 (1 << 19) | /* PC1 */           \
75                 (1 << 20) | /* PC2 */           \
76                 (1 << 21) | /* PC3 */           \
77                 (0 << 22) | /* PC4 */           \
78                 (0 << 23) | /* PC5 */           \
79                 (1 << 24) | /* PC6 */           \
80                 (1 << 25) | /* PC7 */           \
81                 (1 << 26) | /* PC8 */           \
82                 (1 << 27) | /* PC9 */           \
83                 (1 << 28) | /* PC10 or PD8 */   \
84                 (1 << 29) | /* PC11 or PD9 */   \
85                 (0 << 30) | /* PC12 or PD10 */  \
86                 (0 << 31))  /* PD2 or PD11 */
87
88 #define AO_LCD_STM_SEG_ENABLED_1 (              \
89                 (0 << 0) | /* PD12 */           \
90                 (0 << 1) | /* PD13 */           \
91                 (0 << 2) | /* PD14 */           \
92                 (0 << 3) | /* PD15 */           \
93                 (0 << 4) | /* PE0 */            \
94                 (0 << 5) | /* PE1 */            \
95                 (0 << 6) | /* PE2 */            \
96                 (0 << 7))  /* PE3 */
97
98 #define AO_LCD_STM_COM_ENABLED (                \
99                 (1 << 0) | /* PA8 */            \
100                 (1 << 1) | /* PA9 */            \
101                 (1 << 2) | /* PA10 */           \
102                 (1 << 3) | /* PB9 */            \
103                 (0 << 4) | /* PC10 */           \
104                 (0 << 5) | /* PC11 */           \
105                 (0 << 6)) /* PC12 */
106
107 #define AO_LCD_28_ON_C  1
108
109 #endif /* _AO_PINS_H_ */