1.1 --- a/include/vga_display.h Sat Nov 10 21:39:51 2018 +0100
1.2 +++ b/include/vga_display.h Sat Nov 10 22:11:32 2018 +0100
1.3 @@ -20,8 +20,9 @@
1.4 #ifndef __VGA_DISPLAY_H__
1.5 #define __VGA_DISPLAY_H__
1.6
1.7 +#include "display.h"
1.8 #include "pic32_c.h"
1.9 -#include "display.h"
1.10 +#include "vga.h"
1.11
1.12
1.13
1.14 @@ -41,6 +42,7 @@
1.15 /* DMA transfer properties. */
1.16
1.17 int line_channels, transfer_int_num;
1.18 + uint32_t transfer_cell_size;
1.19
1.20 /* Horizontal and vertical sync peripherals. */
1.21
1.22 @@ -62,11 +64,37 @@
1.23
1.24 display_config_t *display_config;
1.25
1.26 + /* Display line positions. */
1.27 +
1.28 + uint32_t hfreq_limit, hsync_start, hsync_end;
1.29 +
1.30 + /* Display region scanline positions. */
1.31 +
1.32 + uint32_t visible_start, vfp_start, vsync_start, vsync_end;
1.33 +
1.34 } vga_display_t;
1.35
1.36
1.37
1.38 -/* Initialisation. */
1.39 +/* Initialise a VGA display object with timing and pixel transfer details.
1.40 + This macro depends on the VGA timing constants being defined, and they are
1.41 + included above.
1.42 +
1.43 + VGA_Display(<name>)
1.44 +*/
1.45 +
1.46 +#define VGA_Display(NAME) \
1.47 + vga_display_t NAME = { \
1.48 + .transfer_cell_size = TRANSFER_CELL_SIZE, \
1.49 + .hfreq_limit = HFREQ_LIMIT, \
1.50 + .hsync_start = HSYNC_START, \
1.51 + .hsync_end = HSYNC_END, \
1.52 + .visible_start = VISIBLE_START, \
1.53 + .vfp_start = VFP_START, \
1.54 + .vsync_start = VSYNC_START, \
1.55 + .vsync_end = VSYNC_END};
1.56 +
1.57 +/* Initialisation functions. */
1.58
1.59 void init_vga(display_config_t *display_config, int line_channels,
1.60 int line_timer, int transfer_int_num);