CommonPIC32

include/display.h

50:ad11390f6d08
2018-10-24 Paul Boddie Extracted the display state machine, moving it into a separate library module.
     1 /*     2  * Common display-related functions.     3  *     4  * Copyright (C) 2018 Paul Boddie <paul@boddie.org.uk>     5  *     6  * This program is free software: you can redistribute it and/or modify     7  * it under the terms of the GNU General Public License as published by     8  * the Free Software Foundation, either version 3 of the License, or     9  * (at your option) any later version.    10  *    11  * This program is distributed in the hope that it will be useful,    12  * but WITHOUT ANY WARRANTY; without even the implied warranty of    13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    14  * GNU General Public License for more details.    15  *    16  * You should have received a copy of the GNU General Public License    17  * along with this program.  If not, see <http://www.gnu.org/licenses/>.    18  */    19     20 #ifndef __DISPLAY_H__    21 #define __DISPLAY_H__    22     23 #include <stdint.h>    24     25     26     27 /* Display configuration type. */    28     29 typedef struct    30 {    31     /* Framebuffer pointer and size. */    32     33     uint8_t *framebuffer;    34     uint32_t screen_size;    35     uint32_t line_length, line_count;   /* width, height */    36     37     /* Screen start/top and limit pointers. */    38     39     uint8_t *screen_start, *screen_limit;    40     41     /* Number of scanlines per display line. */    42     43     int line_multiplier;    44     45     /* Number of consecutive pixels provided by a framebuffer region. */    46     47     int cell_size;    48     49     /* Display region scanline positions. */    50     51     uint32_t visible_start, vfp_start, vsync_start, vsync_end;    52     53 } display_config_t;    54     55     56     57 /* Access functions. */    58     59 int get_position(display_config_t *cfg, int x);    60 void test_linedata(display_config_t *cfg);    61     62 #endif /* __DISPLAY_H__ */