Crate vga_framebuffer
source ·Expand description
VGA Frame Buffer for Embedded Microcontrollers
Generates an 800 x 600 @ 60 Hz SVGA signal from a 48 column x 36 row monochrome text buffer. The image has a border.
TODO: Implement smooth scrolling in the vertical direction with an extra text row.
Width = 400 double width pixels => 400 = 8 + (48 x 8) + 8
Height = 600 pixels => 600 = 12 + (36 x 16) + 12
<-------------- 400 px, pixel doubled to 800 px ------------->
+------------------------------------------------------------+
|<--> 8 pixel border ^ 8 pixel border <-->|
| | 12 px border |
| v |
| +--------------------------------------------------+ |
| | <--^------ 48 chars x 8 px = 384 px ----------->| |
| | | | |
| | | | |
| | | 36 rows x 16 px = 576 px | |
| | | | |
| | | | |
| | v | |
| +--------------------------------------------------+ |
| ^ |
| | 12 px border |
| v |
+------------------------------------------------------------+
Requires pixels to be emitted with a 20 MHz pixel clock (against a nominal 40 MHz pixel clock, in order to acheive the horizontal doubling).
In order to maintain performance, only one font size is supported: 8x16 pixels. But you can substitute your own font if required (e.g. for Teletext support).
There is optional cursor support. Rather than try and check each text cell at render time to see if it is in the cursor position, we swap chars in and out of the text buffer as the cursor moves. It’s a little more expensive, but the cost is at text write time, not at render time (and so it won’t break sync).
See https://github.com/thejpster/monotron for an example.
Modules
Structs
Enums
Constants
Traits
BaseConsole
which supports 8-bit characters. Use this is
you are implementing an old-fashioned ASCII console (including extended
ASCII, like Code Page 850, or ISO 8859-1).UnicodeConsole
or AsciiConsole
depending
on whether you want full Unicode support (&str
, char
, etc), or just
8-bit characters (&[u8]
and u8
).BaseConsole
which supports Unicode characters. Use this is
you are implementing a modern console with Unicode support.