aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c')
-rw-r--r--drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c74
1 files changed, 37 insertions, 37 deletions
diff --git a/drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c b/drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c
index 8cefac96..1ae57273 100644
--- a/drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c
+++ b/drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c
@@ -15,13 +15,13 @@
typedef struct LCD_Parameters
{
- uint8_t curXPtr;
- uint8_t startXPtr; /* The area start bit position in the start column */
- uint8_t endXPtr; /* The area end bit position in the end column */
- uint8_t curCol;
- uint8_t startCol; /* The area start column */
- uint8_t endCol; /* The area end column */
- uint8_t curYPtr;
+ gU8 curXPtr;
+ gU8 startXPtr; /* The area start bit position in the start column */
+ gU8 endXPtr; /* The area end bit position in the end column */
+ gU8 curCol;
+ gU8 startCol; /* The area start column */
+ gU8 endCol; /* The area end column */
+ gU8 curYPtr;
} LCD_Parameters;
#include "board_SSD1848.h"
@@ -61,7 +61,7 @@ typedef struct LCD_Parameters
/* Some common routines and macros */
#define PRM(g) ((LCD_Parameters *)g->priv)
-#define RAM(g) ((uint8_t *)(PRM(g)+1))
+#define RAM(g) ((gU8 *)(PRM(g)+1))
#define write_cmd2(g, cmd1, cmd2) { spi_write_cmd (g, cmd1); spi_write_data (g, cmd2); }
#define write_cmd3(g, cmd1, cmd2, cmd3) { spi_write_cmd (g, cmd1); spi_write_data2 (g, cmd2, cmd3); }
@@ -76,7 +76,7 @@ static void set_viewport (GDisplay* g)
default:
case gOrientation0:
spi_write_cmd (g, SSD1848_HV_COLUMN_ADDRESS);
- spi_write_data2 (g, (uint8_t) (g->p.x / 8), (uint8_t) ((g->p.x + g->p.cx - 1) / 8));
+ spi_write_data2 (g, (gU8) (g->p.x / 8), (gU8) ((g->p.x + g->p.cx - 1) / 8));
spi_write_cmd (g, SSD1848_HV_PAGE_ADDRESS);
spi_write_data2 (g, g->p.y, g->p.y + g->p.cy - 1);
spi_write_cmd (g, SSD1848_WRITE_DISP_DATA);
@@ -118,7 +118,7 @@ static void set_viewport (GDisplay* g)
LLDSPEC gBool gdisp_lld_init (GDisplay *g)
{
- uint8_t temp [5] = { 0 };
+ gU8 temp [5] = { 0 };
/* The private area is the display surface. */
g->priv = gfxAlloc (sizeof(DisplayData) + GDISP_SCREEN_WIDTH / 8 * GDISP_SCREEN_HEIGHT);
@@ -226,18 +226,18 @@ LLDSPEC void gdisp_lld_write_start (GDisplay *g)
acquire_bus (g);
set_viewport (g);
- PRM(g)->curCol = PRM(g)->startCol = (uint8_t) (g->p.x / 8);
- PRM(g)->endCol = (uint8_t) ((g->p.x + g->p.cx - 1) / 8);
- PRM(g)->curXPtr = PRM(g)->startXPtr = (uint8_t) (g->p.x % 8);
- PRM(g)->endXPtr = (uint8_t) ((g->p.x + g->p.cx - 1) % 8);
+ PRM(g)->curCol = PRM(g)->startCol = (gU8) (g->p.x / 8);
+ PRM(g)->endCol = (gU8) ((g->p.x + g->p.cx - 1) / 8);
+ PRM(g)->curXPtr = PRM(g)->startXPtr = (gU8) (g->p.x % 8);
+ PRM(g)->endXPtr = (gU8) ((g->p.x + g->p.cx - 1) % 8);
PRM(g)->curYPtr = g->p.y;
}
LLDSPEC void gdisp_lld_write_color (GDisplay *g)
{
- uint8_t temp;
- uint8_t a;
- uint16_t y = PRM(g)->curYPtr;
- uint16_t c = PRM(g)->curCol;
+ gU8 temp;
+ gU8 a;
+ gU16 y = PRM(g)->curYPtr;
+ gU16 c = PRM(g)->curCol;
temp = RAM (g)[y * 16 + c];
if (gdispColor2Native (g->p.color))
@@ -286,7 +286,7 @@ LLDSPEC void gdisp_lld_write_stop (GDisplay *g)
#if GDISP_HARDWARE_FLUSH
LLDSPEC void gdisp_lld_flush (GDisplay *g)
{
- uint8_t * ram;
+ gU8 * ram;
unsigned pages;
/* Don't flush if we don't need it. */
@@ -312,7 +312,7 @@ LLDSPEC void gdisp_lld_flush (GDisplay *g)
#if GDISP_HARDWARE_CLEARS
LLDSPEC void gdisp_lld_clear (GDisplay *g)
{
- uint16_t area = GDISP_SCREEN_WIDTH / 8 * GDISP_SCREEN_HEIGHT;
+ gU16 area = GDISP_SCREEN_WIDTH / 8 * GDISP_SCREEN_HEIGHT;
if (gdispColor2Native (g->p.color))
{
@@ -343,13 +343,13 @@ LLDSPEC void gdisp_lld_fill_area (GDisplay *g)
{
gCoord scol, ecol, sx, ex;
gCoord y, col, x;
- uint16_t area = (uint16_t) g->p.cx * g->p.cy;
- uint8_t temp;
+ gU16 area = (gU16) g->p.cx * g->p.cy;
+ gU8 temp;
- col = scol = (uint8_t) (g->p.x / 8);
- ecol = (uint8_t) ((g->p.x + g->p.cx - 1) / 8);
- x = sx = (uint8_t) (g->p.x % 8);
- ex = (uint8_t) ((g->p.x + g->p.cx - 1) % 8);
+ col = scol = (gU8) (g->p.x / 8);
+ ecol = (gU8) ((g->p.x + g->p.cx - 1) / 8);
+ x = sx = (gU8) (g->p.x % 8);
+ ex = (gU8) ((g->p.x + g->p.cx - 1) % 8);
y = g->p.y;
@@ -534,9 +534,9 @@ LLDSPEC void gdisp_lld_control (GDisplay *g)
g->p.ptr = (void *) 100;
acquire_bus (g);
spi_write_cmd (g, SSD1848_SETCONTRAST);
- spi_write_data (g, (((uint16_t) g->p.ptr) << 8) / 101);
+ spi_write_data (g, (((gU16) g->p.ptr) << 8) / 101);
release_bus (g);
- g->g.Contrast = (uint8_t) g->p.ptr;
+ g->g.Contrast = (gU8) g->p.ptr;
return;
/* Our own special controller code to inverse the display */
@@ -556,12 +556,12 @@ LLDSPEC void gdisp_lld_blit_area (GDisplay *g)
{
gCoord scol, ecol, sx;
gCoord y, col;
- uint16_t area;
- uint8_t temp, temp2, i;
+ gU16 area;
+ gU8 temp, temp2, i;
- col = scol = (uint8_t) (g->p.x / 8);
- ecol = (uint8_t) ((g->p.x + g->p.cx - 1) / 8);
- sx = (uint8_t) (g->p.x % 8);
+ col = scol = (gU8) (g->p.x / 8);
+ ecol = (gU8) ((g->p.x + g->p.cx - 1) / 8);
+ sx = (gU8) (g->p.x % 8);
y = g->p.y;
area = (ecol - scol + 1) * (g->p.cy);
@@ -574,7 +574,7 @@ LLDSPEC void gdisp_lld_blit_area (GDisplay *g)
{
for (; area; area--)
{
- temp = RAM (g)[y * 16 + col] = *((uint8_t *) g->p.ptr)++;
+ temp = RAM (g)[y * 16 + col] = *((gU8 *) g->p.ptr)++;
spi_write_data (g, temp);
if (col == ecol)
{
@@ -595,13 +595,13 @@ LLDSPEC void gdisp_lld_blit_area (GDisplay *g)
temp = RAM (g)[y * 16 + col];
if (col != ecol)
{
- temp |= (*((uint8_t *) g->p.ptr) >> sx);
+ temp |= (*((gU8 *) g->p.ptr) >> sx);
RAM (g)[y * 16 + col] = temp;
temp2 = RAM (g)[y * 16 + col + 1];
- temp2 |= (*((uint8_t *) g->p.ptr) << (8-sx));
+ temp2 |= (*((gU8 *) g->p.ptr) << (8-sx));
RAM (g)[y * 16 + col + 1] = temp2;
- ((uint8_t *) g->p.ptr)++;
+ ((gU8 *) g->p.ptr)++;
}
spi_write_data (g, temp);