|new 0.8.1||Jul 13, 2019|
|0.7.5||Apr 18, 2019|
|0.7.4||Oct 22, 2018|
|0.4.0||Jul 27, 2018|
#38 in Embedded development
129 downloads per month
Used in 2 crates
This crate implements basic VGA text output on an embedded microcontroller, using nothing more than some timer peripherals and a few GPIO pins.
This crate is written to be hardware-agnostic.
- You supply an object implementing the
- The function
isr_sol()must be called at the start of every scan-line, e.g. with a Timer interrupt.
- This will then call
write_pixels()on the given
Hardwareobject with the RGB values for every byte in that scan-line.
- These pixel values should be buffered (e.g. in an SPI FIFO) and then sent to
the screen at the appropriate moment (e.g. when the
configure()callback gives you the appropriate timings for all of this.
- 800 x 600 @ 60 Hz output signal with a 40 MHz pixel clock
- 400 x 600 effective resolution (runs pixel clock at half-speed)
- 8-colour RGB output (Red, Green, Blue, Cyan, Magenta, Yellow, Black and White)
- 8x16 bitmap glyphs, from FreeBSD console font
- MS-DOS CodePage 850 character set
- 48 column x 36 row text output
- One foreground/background pair stored per character cell
unsafemutation of a static, but the worst case scenario is a minor screen glitch which is fixed on the next frame
- Optional Mono 384x288 framebuffer, coloured with text-mode attributes.
- Doubles each horizontal line to keep memory usage down
- Uses an extra 13,824 bytes over text mode
- Will suffer terrible attribute-clash, just like a ZX Spectrum :)
- Can set a start and end scan-line for the graphics mode, to allow a mixed text/graphics split-screen with reduced memory consumption
The pixels are double-width as I was unable to get 40 MHz SPI output functioning correctly on my particular micro. 20 MHz works just fine.
Tested on Monotron using a Texas Instruments Tiva-C TM4C123 clocked at 80 MHz.
- Optional 3-bits-per-pixel RGB 192x288 framebuffer mode.
- Uses an extra 20,736 bytes over text mode.
- No attribute clash, but half the resolution.
- 8x8 pixel font, more suited to the graphics modes
I'll happy accept a patches to enable other resolutions and/or other text resolutions.