summaryrefslogtreecommitdiff
path: root/src/stm-demo
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-03-22 19:43:29 -0700
committerKeith Packard <keithp@keithp.com>2012-03-28 21:37:03 -0700
commit6da2f5846f2d28ea1f09f60ef2cc3f68113ac62a (patch)
tree4edfd17c4d1d02ae23917a4face8363b79762f7a /src/stm-demo
parenta953ac32033ded18adf0cb3ca20134385fcd0a6d (diff)
Add LCD device driver to STM32L port
This enables the 6-digit 14-character display on the STM32L discovery board and provides an ascii output to it. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/stm-demo')
-rw-r--r--src/stm-demo/Makefile6
-rw-r--r--src/stm-demo/ao_demo.c5
-rw-r--r--src/stm-demo/ao_pins.h59
3 files changed, 64 insertions, 6 deletions
diff --git a/src/stm-demo/Makefile b/src/stm-demo/Makefile
index 9e4f9e38..ecdf6b7f 100644
--- a/src/stm-demo/Makefile
+++ b/src/stm-demo/Makefile
@@ -42,14 +42,16 @@ ALTOS_SRC = \
ao_stdio.c \
ao_panic.c \
ao_timer.c \
- ao_serial_stm.c
+ ao_serial_stm.c \
+ ao_lcd_stm.c \
+ ao_lcd_font.c
PRODUCT=StmDemo-v0.0
PRODUCT_DEF=-DSTM_DEMO
IDPRODUCT=0x000a
CPU=cortex-m3
CFLAGS = $(PRODUCT_DEF) -I. -I../stm -I../core -I..
-CFLAGS += -g -std=gnu99 -Os -mlittle-endian -mcpu=cortex-m3 -mthumb -ffreestanding -nostdlib -I../stm $(CINC)
+CFLAGS += -g -std=gnu99 -O0 -mlittle-endian -mcpu=cortex-m3 -mthumb -ffreestanding -nostdlib -I../stm $(CINC)
NICKLE=nickle
diff --git a/src/stm-demo/ao_demo.c b/src/stm-demo/ao_demo.c
index 94527089..24566f9b 100644
--- a/src/stm-demo/ao_demo.c
+++ b/src/stm-demo/ao_demo.c
@@ -47,8 +47,9 @@ main(void)
ao_serial_init();
ao_timer_init();
ao_cmd_init();
- ao_led_init(LEDS_AVAILABLE);
- ao_add_task(&demo_task, ao_demo, "demo");
+// ao_led_init(LEDS_AVAILABLE);
+ ao_lcd_stm_init();
+// ao_add_task(&demo_task, ao_demo, "demo");
ao_start_scheduler();
return 0;
diff --git a/src/stm-demo/ao_pins.h b/src/stm-demo/ao_pins.h
index c72cd04b..8d7ed76b 100644
--- a/src/stm-demo/ao_pins.h
+++ b/src/stm-demo/ao_pins.h
@@ -19,8 +19,8 @@
#define _AO_PINS_H_
#define HAS_SERIAL_1 1
-#define HAS_SERIAL_2 1
-#define HAS_SERIAL_3 1
+#define HAS_SERIAL_2 0
+#define HAS_SERIAL_3 0
#define USE_SERIAL_STDIN 1
#define HAS_USB 0
#define HAS_BEEP 0
@@ -39,4 +39,59 @@
#define LEDS_AVAILABLE (AO_LED_BLUE | AO_LED_GREEN)
+#define AO_LCD_STM_SEG_ENABLED_0 ( \
+ (1 << 0) | /* PA1 */ \
+ (1 << 1) | /* PA2 */ \
+ (1 << 2) | /* PA3 */ \
+ (0 << 3) | /* PA6 */ \
+ (0 << 4) | /* PA7 */ \
+ (0 << 5) | /* PB0 */ \
+ (0 << 6) | /* PB1 */ \
+ (1 << 7) | /* PB3 */ \
+ (1 << 8) | /* PB4 */ \
+ (1 << 9) | /* PB5 */ \
+ (1 << 10) | /* PB10 */ \
+ (1 << 11) | /* PB11 */ \
+ (1 << 12) | /* PB12 */ \
+ (1 << 13) | /* PB13 */ \
+ (1 << 14) | /* PB14 */ \
+ (1 << 15) | /* PB15 */ \
+ (1 << 16) | /* PB8 */ \
+ (1 << 17) | /* PA15 */ \
+ (1 << 18) | /* PC0 */ \
+ (1 << 19) | /* PC1 */ \
+ (1 << 20) | /* PC2 */ \
+ (1 << 21) | /* PC3 */ \
+ (0 << 22) | /* PC4 */ \
+ (0 << 23) | /* PC5 */ \
+ (1 << 24) | /* PC6 */ \
+ (1 << 25) | /* PC7 */ \
+ (1 << 26) | /* PC8 */ \
+ (1 << 27) | /* PC9 */ \
+ (1 << 28) | /* PC10 or PD8 */ \
+ (1 << 29) | /* PC11 or PD9 */ \
+ (0 << 30) | /* PC12 or PD10 */ \
+ (0 << 31)) /* PD2 or PD11 */
+
+#define AO_LCD_STM_SEG_ENABLED_1 ( \
+ (0 << 0) | /* PD12 */ \
+ (0 << 1) | /* PD13 */ \
+ (0 << 2) | /* PD14 */ \
+ (0 << 3) | /* PD15 */ \
+ (0 << 4) | /* PE0 */ \
+ (0 << 5) | /* PE1 */ \
+ (0 << 6) | /* PE2 */ \
+ (0 << 7)) /* PE3 */
+
+#define AO_LCD_STM_COM_ENABLED ( \
+ (1 << 0) | /* PA8 */ \
+ (1 << 1) | /* PA9 */ \
+ (1 << 2) | /* PA10 */ \
+ (1 << 3) | /* PB9 */ \
+ (0 << 4) | /* PC10 */ \
+ (0 << 5) | /* PC11 */ \
+ (0 << 6)) /* PC12 */
+
+#define AO_LCD_28_ON_C 1
+
#endif /* _AO_PINS_H_ */