paul@80 | 1 | /* |
paul@80 | 2 | * Generate a VGA signal using a PIC32 microcontroller. |
paul@80 | 3 | * |
paul@80 | 4 | * Copyright (C) 2017, 2018 Paul Boddie <paul@boddie.org.uk> |
paul@80 | 5 | * |
paul@80 | 6 | * This program is free software: you can redistribute it and/or modify |
paul@80 | 7 | * it under the terms of the GNU General Public License as published by |
paul@80 | 8 | * the Free Software Foundation, either version 3 of the License, or |
paul@80 | 9 | * (at your option) any later version. |
paul@80 | 10 | * |
paul@80 | 11 | * This program is distributed in the hope that it will be useful, |
paul@80 | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
paul@80 | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
paul@80 | 14 | * GNU General Public License for more details. |
paul@80 | 15 | * |
paul@80 | 16 | * You should have received a copy of the GNU General Public License |
paul@80 | 17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
paul@80 | 18 | */ |
paul@80 | 19 | |
paul@80 | 20 | #ifndef __VGA_COMMON_H__ |
paul@80 | 21 | #define __VGA_COMMON_H__ |
paul@80 | 22 | |
paul@80 | 23 | /* Number of raster scan lines to be used. */ |
paul@80 | 24 | |
paul@80 | 25 | #define SCANLINES 512 |
paul@80 | 26 | |
paul@80 | 27 | /* Horizontal lines, back porch end. */ |
paul@80 | 28 | |
paul@80 | 29 | #define VISIBLE_START 72 |
paul@80 | 30 | |
paul@80 | 31 | /* Horizontal lines, front porch start. */ |
paul@80 | 32 | |
paul@80 | 33 | #define VFP_START (VISIBLE_START + SCANLINES) |
paul@80 | 34 | |
paul@80 | 35 | /* Horizontal lines, front porch end. */ |
paul@80 | 36 | |
paul@80 | 37 | #define VSYNC_START 620 |
paul@80 | 38 | |
paul@80 | 39 | /* Horizontal lines, back porch start. */ |
paul@80 | 40 | |
paul@80 | 41 | #define VSYNC_END 622 |
paul@80 | 42 | |
paul@123 | 43 | /* Define DMA channels if not indicated in the build configuration. */ |
paul@123 | 44 | |
paul@123 | 45 | /* CPU-based transfers: no channels. */ |
paul@123 | 46 | |
paul@123 | 47 | #ifdef TRANSFER_CPU |
paul@123 | 48 | #define LINE_CHANNELS 0 |
paul@123 | 49 | |
paul@123 | 50 | /* DMA-based transfers: single channel by default. */ |
paul@123 | 51 | |
paul@123 | 52 | #else |
paul@123 | 53 | |
paul@123 | 54 | #ifndef LINE_CHANNELS |
paul@123 | 55 | #define LINE_CHANNELS 1 |
paul@123 | 56 | #endif |
paul@123 | 57 | |
paul@123 | 58 | #endif /* TRANSFER_CPU */ |
paul@123 | 59 | |
paul@80 | 60 | #endif /* __VGA_COMMON_H__ */ |