1.1 --- a/examples/vga/main.c Thu Oct 25 21:11:22 2018 +0200
1.2 +++ b/examples/vga/main.c Thu Oct 25 21:19:01 2018 +0200
1.3 @@ -33,6 +33,22 @@
1.4
1.5
1.6
1.7 +/* Define timers if not indicated in the build configuration. */
1.8 +
1.9 +#ifndef LINE_CHANNELS
1.10 +#define LINE_CHANNELS 1
1.11 +#endif
1.12 +
1.13 +#ifndef LINE_TIMER
1.14 +#define LINE_TIMER 2
1.15 +#endif
1.16 +
1.17 +#ifndef TRANSFER_TIMER
1.18 +#define TRANSFER_TIMER 0
1.19 +#endif
1.20 +
1.21 +
1.22 +
1.23 /* Blink an attached LED with delays implemented using a loop. */
1.24
1.25 static void blink(uint32_t delay, uint32_t port, uint32_t pins)
1.26 @@ -72,16 +88,17 @@
1.27
1.28 init_dma();
1.29
1.30 - /* Initialise VGA output structures with a single line channel and no
1.31 - initiating channel. */
1.32 + /* Initialise VGA output with one or two line channels, configuring a line
1.33 + timer and any transfer timer, with an initiating channel being introduced
1.34 + if a transfer timer is specified. */
1.35
1.36 - init_vga(&display_config, 1, -1);
1.37 + init_vga_with_timers(&display_config, LINE_CHANNELS, LINE_TIMER, TRANSFER_TIMER);
1.38
1.39 - /* Configure VGA output transfer details along with a timer and output
1.40 - compare units for horizontal and vertical sync. */
1.41 + /* Configure VGA output transfer to the output register, also configuring
1.42 + output compare units for horizontal and vertical sync. */
1.43
1.44 - vga_configure_transfer(T2, PORTB);
1.45 - vga_configure_sync(1, 2, 2);
1.46 + vga_configure_transfer(PORTB);
1.47 + vga_configure_sync(1, 2);
1.48
1.49 uart_init(1, FPB, 115200);
1.50 uart_on(1);