mirror of
git://projects.qi-hardware.com/ben-blinkenlights.git
synced 2024-11-19 06:41:53 +02:00
9412c9debe
- ubb-vga.c (CYCLES), ubb-vga.h: corrected conversion and moved to ubb-vga.h - tstimg.c (printc): added characters '=' and '+' - tstimg.c (tstimg): print detailed horizontal and vertical timing
72 lines
1.5 KiB
C
72 lines
1.5 KiB
C
/*
|
|
* ubb-vga.h - Output video on UBB with more or less VGA timing
|
|
*
|
|
* Written 2011 by Werner Almesberger
|
|
* Copyright 2011 Werner Almesberger
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*/
|
|
|
|
#ifndef UBB_VGA_H
|
|
#define UBB_VGA_H
|
|
|
|
#include <stdint.h>
|
|
#include <sys/types.h>
|
|
|
|
|
|
#define R_VAL (1 << 3)
|
|
#define G_VAL (1 << 0)
|
|
#define B_VAL (1 << 1)
|
|
#define Y_VAL (1 << 2)
|
|
|
|
|
|
struct mode {
|
|
const char *name; /* NULL for end of table */
|
|
int xres, yres;
|
|
int clkdiv; /* pixel clock = 336 MHz/(clkdiv+1) */
|
|
int vsync_lines; /* 2 lines, for official VGA */
|
|
int vfront_lines; /* 32 lines */
|
|
int vback_lines; /* 14 lines */
|
|
uint16_t hsync_cycles; /* 3.77 us */
|
|
uint16_t hback_cycles; /* 0.79 us */
|
|
uint16_t line_cycles; /* 31.77 us */
|
|
};
|
|
|
|
extern const struct mode *mode;
|
|
|
|
|
|
void *map(off_t addr, size_t size);
|
|
|
|
|
|
#define CYCLES(cy) ((cy)/112.0)
|
|
|
|
|
|
/* ccube.c */
|
|
|
|
uint8_t ccube_map(uint8_t r, uint8_t g, uint8_t b);
|
|
void ccube_init(void);
|
|
|
|
/* physmem.c */
|
|
|
|
void **calloc_phys_vec(size_t n, size_t size);
|
|
unsigned long *xlat_virt(void *const *v, size_t n);
|
|
|
|
/* grabfb.c */
|
|
|
|
void grabfb(void **f, int xres, int yres);
|
|
|
|
/* tstimg.c */
|
|
|
|
void tstimg(void **f, int xres, int yres);
|
|
|
|
/* ppmimg.c */
|
|
|
|
extern char *img_name;
|
|
|
|
void ppmimg(void **f, int xres, int yres);
|
|
|
|
#endif /* !UBB_VGA_H */
|