Dropped framebuffer from GDx display driver
This commit is contained in:
parent
7fc16388e0
commit
b416585819
|
|
@ -28,13 +28,6 @@
|
||||||
#include <interfaces/delays.h>
|
#include <interfaces/delays.h>
|
||||||
#include <hwconfig.h>
|
#include <hwconfig.h>
|
||||||
|
|
||||||
/*
|
|
||||||
* LCD framebuffer, statically allocated.
|
|
||||||
* Pixel format is black and white, one bit per pixel
|
|
||||||
*/
|
|
||||||
#define FB_SIZE (((CONFIG_SCREEN_HEIGHT * CONFIG_SCREEN_WIDTH) / 8 ) + 1)
|
|
||||||
static uint8_t frameBuffer[FB_SIZE];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \internal
|
* \internal
|
||||||
* Send one byte to display controller, via bit banging.
|
* Send one byte to display controller, via bit banging.
|
||||||
|
|
@ -69,7 +62,7 @@ static void sendByteToController(uint8_t value)
|
||||||
*
|
*
|
||||||
* @param row: pixel row to be be sent.
|
* @param row: pixel row to be be sent.
|
||||||
*/
|
*/
|
||||||
static void display_renderRow(uint8_t row)
|
static void display_renderRow(uint8_t row, uint8_t *frameBuffer)
|
||||||
{
|
{
|
||||||
/* magic stuff */
|
/* magic stuff */
|
||||||
uint8_t *buf = (frameBuffer + 128 * row);
|
uint8_t *buf = (frameBuffer + 128 * row);
|
||||||
|
|
@ -141,7 +134,7 @@ void display_terminate()
|
||||||
gpio_setMode(LCD_DAT, INPUT);
|
gpio_setMode(LCD_DAT, INPUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void display_renderRows(uint8_t startRow, uint8_t endRow)
|
void display_renderRows(uint8_t startRow, uint8_t endRow, void *fb)
|
||||||
{
|
{
|
||||||
for(uint8_t row = startRow; row < endRow; row++)
|
for(uint8_t row = startRow; row < endRow; row++)
|
||||||
{
|
{
|
||||||
|
|
@ -150,19 +143,14 @@ void display_renderRows(uint8_t startRow, uint8_t endRow)
|
||||||
sendByteToController(0x10); /* Set X position */
|
sendByteToController(0x10); /* Set X position */
|
||||||
sendByteToController(0x04);
|
sendByteToController(0x04);
|
||||||
gpio_setPin(LCD_RS); /* RS high -> data mode */
|
gpio_setPin(LCD_RS); /* RS high -> data mode */
|
||||||
display_renderRow(row);
|
display_renderRow(row, (uint8_t *) fb);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void display_render()
|
void display_render(void *fb)
|
||||||
{
|
{
|
||||||
display_renderRows(0, CONFIG_SCREEN_HEIGHT / 8);
|
display_renderRows(0, CONFIG_SCREEN_HEIGHT / 8, fb);
|
||||||
}
|
|
||||||
|
|
||||||
void *display_getFrameBuffer()
|
|
||||||
{
|
|
||||||
return (void *)(frameBuffer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void display_setContrast(uint8_t contrast)
|
void display_setContrast(uint8_t contrast)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue