summaryrefslogtreecommitdiff
path: root/src/stm-vga
diff options
context:
space:
mode:
Diffstat (limited to 'src/stm-vga')
-rw-r--r--src/stm-vga/Makefile8
-rw-r--r--src/stm-vga/ao_demo.c81
-rw-r--r--src/stm-vga/ao_pins.h1
3 files changed, 74 insertions, 16 deletions
diff --git a/src/stm-vga/Makefile b/src/stm-vga/Makefile
index 5db8c641..2a600330 100644
--- a/src/stm-vga/Makefile
+++ b/src/stm-vga/Makefile
@@ -14,6 +14,7 @@ INC = \
ao_product.h \
ao_vga.h \
ao_draw.h \
+ ao_draw_int.h \
ao_font.h
#
@@ -32,16 +33,19 @@ ALTOS_SRC = \
ao_timer.c \
ao_lcd_stm.c \
ao_lcd_font.c \
+ ao_vga.c \
ao_blt.c \
+ ao_copy.c \
+ ao_rect.c \
ao_text.c \
+ ao_line.c \
ao_mutex.c \
ao_dma_stm.c \
ao_adc_stm.c \
ao_data.c \
ao_i2c_stm.c \
ao_usb_stm.c \
- ao_exti_stm.c \
- ao_vga.c
+ ao_exti_stm.c
PRODUCT=StmVga-v0.0
IDPRODUCT=0x000a
diff --git a/src/stm-vga/ao_demo.c b/src/stm-vga/ao_demo.c
index 3b582cc2..eaeaf070 100644
--- a/src/stm-vga/ao_demo.c
+++ b/src/stm-vga/ao_demo.c
@@ -46,21 +46,33 @@ ao_ball(void)
while (!ball_enable)
ao_sleep(&ball_enable);
for (;;) {
- ao_solid(AO_ALLONES,
- AO_ALLONES,
- ao_vga_fb + ball_y * AO_VGA_STRIDE,
- AO_VGA_STRIDE,
- ball_x,
- BALL_WIDTH,
- BALL_HEIGHT);
+ ao_line(&ao_vga_bitmap,
+ -100, -100, ball_x*2, ball_y*2,
+ 1, AO_XOR);
+ ao_text(&ao_vga_bitmap,
+ ball_x, ball_y - 10,
+ "Hello, Bdale!",
+ 1, AO_XOR);
+ ao_rect(&ao_vga_bitmap,
+ ball_x, ball_y,
+ BALL_WIDTH,
+ BALL_HEIGHT,
+ 1,
+ AO_XOR);
ao_delay(AO_MS_TO_TICKS(10));
- ao_solid(AO_ALLONES,
- AO_ALLONES,
- ao_vga_fb + ball_y * AO_VGA_STRIDE,
- AO_VGA_STRIDE,
- ball_x,
- BALL_WIDTH,
- BALL_HEIGHT);
+ ao_rect(&ao_vga_bitmap,
+ ball_x, ball_y,
+ BALL_WIDTH,
+ BALL_HEIGHT,
+ 1,
+ AO_XOR);
+ ao_text(&ao_vga_bitmap,
+ ball_x, ball_y - 10,
+ "Hello, Bdale!",
+ 1, AO_XOR);
+ ao_line(&ao_vga_bitmap,
+ -100, -100, ball_x*2, ball_y*2,
+ 1, AO_XOR);
if (!ball_enable)
break;
ball_x += ball_dx;
@@ -86,9 +98,50 @@ ao_ball(void)
}
static void
+ao_fb_init(void)
+{
+ ao_rect(&ao_vga_bitmap,
+ 0, 0, AO_VGA_WIDTH, AO_VGA_HEIGHT,
+ 1, AO_COPY);
+
+ ao_rect(&ao_vga_bitmap,
+ 10, 10, 10, 10,
+ 0, AO_COPY);
+
+ ao_rect(&ao_vga_bitmap,
+ AO_VGA_WIDTH - 20, 10, 10, 10,
+ 0, AO_COPY);
+
+ ao_rect(&ao_vga_bitmap,
+ 10, AO_VGA_HEIGHT - 20, 10, 10,
+ 0, AO_COPY);
+
+ ao_rect(&ao_vga_bitmap,
+ AO_VGA_WIDTH - 20, AO_VGA_HEIGHT - 20, 10, 10,
+ 0, AO_COPY);
+
+ ao_text(&ao_vga_bitmap,
+ 20, 100,
+ "Hello, Bdale!",
+ 0, AO_COPY);
+
+ ao_text(&ao_vga_bitmap,
+ 1, ao_font.ascent,
+ "UL",
+ 0, AO_COPY);
+
+ ao_text(&ao_vga_bitmap,
+ 1, AO_VGA_HEIGHT - ao_font.descent,
+ "BL",
+ 0, AO_COPY);
+}
+
+static void
ao_video_toggle(void)
{
ao_cmd_decimal();
+ if (ao_cmd_lex_i)
+ ao_fb_init();
ao_vga_enable(ao_cmd_lex_i);
}
diff --git a/src/stm-vga/ao_pins.h b/src/stm-vga/ao_pins.h
index 0e5a1903..f543ef53 100644
--- a/src/stm-vga/ao_pins.h
+++ b/src/stm-vga/ao_pins.h
@@ -68,6 +68,7 @@
#define HAS_USB 1
#define HAS_BEEP 0
#define PACKET_HAS_SLAVE 0
+#define HAS_TASK_QUEUE 1
#define STM_DMA1_3_STOLEN 1