aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gdisp/ILI9320
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gdisp/ILI9320')
-rw-r--r--drivers/gdisp/ILI9320/gdisp_lld.c48
-rw-r--r--drivers/gdisp/ILI9320/gdisp_lld_board_example.h12
-rw-r--r--drivers/gdisp/ILI9320/gdisp_lld_board_olimex_stm32_lcd.h12
-rw-r--r--drivers/gdisp/ILI9320/gdisp_lld_config.h1
4 files changed, 36 insertions, 37 deletions
diff --git a/drivers/gdisp/ILI9320/gdisp_lld.c b/drivers/gdisp/ILI9320/gdisp_lld.c
index 202f06dd..6a324cd4 100644
--- a/drivers/gdisp/ILI9320/gdisp_lld.c
+++ b/drivers/gdisp/ILI9320/gdisp_lld.c
@@ -81,28 +81,28 @@ static __inline void lld_lcdDelay(uint16_t us) {
}
static __inline void lld_lcdWriteIndex(uint16_t index) {
- GDISP_LLD(write_index)(index);
+ lld_gdisp_write_index(index);
}
static __inline void lld_lcdWriteData(uint16_t data) {
- GDISP_LLD(write_data)(data);
+ lld_gdisp_write_data(data);
}
static __inline void lld_lcdWriteReg(uint16_t lcdReg, uint16_t lcdRegValue) {
- GDISP_LLD(write_index)(lcdReg);
- GDISP_LLD(write_data)(lcdRegValue);
+ lld_gdisp_write_index(lcdReg);
+ lld_gdisp_write_data(lcdRegValue);
}
static __inline uint16_t lld_lcdReadData(void) {
/* fix this! */
- //return GDISP_LLD(read_data);
+ //return lld_gdisp_read_data;
return GDISP_RAM;
}
static __inline uint16_t lld_lcdReadReg(uint16_t lcdReg) {
volatile uint16_t dummy;
- GDISP_LLD(write_index)(lcdReg);
+ lld_gdisp_write_index(lcdReg);
dummy = lld_lcdReadData();
(void)dummy;
@@ -143,14 +143,14 @@ static __inline void lld_lcdReadStream(uint16_t *buffer, size_t size) {
buffer[i] = lld_lcdReadData();
}
-bool_t GDISP_LLD(init)(void) {
+bool_t lld_gdisp_init(void) {
/* Initialise your display */
- GDISP_LLD(init_board)();
+ lld_gdisp_init_board();
/* Hardware reset */
- GDISP_LLD(setpin_reset)(TRUE);
+ lld_gdisp_reset_pin(TRUE);
lld_lcdDelay(1000);
- GDISP_LLD(setpin_reset)(FALSE);
+ lld_gdisp_reset_pin(FALSE);
lld_lcdDelay(1000);
DISPLAY_CODE = lld_lcdReadReg(0);
@@ -215,7 +215,7 @@ bool_t GDISP_LLD(init)(void) {
lld_lcdWriteReg(0x0007, 0x0173); //display On
// Turn on the backlight
- GDISP_LLD(set_backlight)(GDISP_INITIAL_BACKLIGHT);
+ lld_gdisp_backlight(GDISP_INITIAL_BACKLIGHT);
/* Initialise the GDISP structure */
GDISP.Width = GDISP_SCREEN_WIDTH;
@@ -298,7 +298,7 @@ static __inline void lld_lcdResetViewPort(void) {
}
}
-void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
+void lld_gdisp_draw_pixel(coord_t x, coord_t y, color_t color) {
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
if (x < GDISP.clipx0 || y < GDISP.clipy0 || x >= GDISP.clipx1 || y >= GDISP.clipy1) return;
#endif
@@ -307,7 +307,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
}
#if GDISP_HARDWARE_CLEARS || defined(__DOXYGEN__)
- void GDISP_LLD(clear)(color_t color) {
+ void lld_gdisp_clear(color_t color) {
unsigned i;
lld_lcdSetCursor(0, 0);
@@ -321,7 +321,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
#endif
#if GDISP_HARDWARE_FILLS || defined(__DOXYGEN__)
- void GDISP_LLD(fillarea)(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color) {
+ void lld_gdisp_fill_area(coord_t x, coord_t y, coord_t cx, coord_t cy, color_t color) {
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
if (x < GDISP.clipx0) { cx -= GDISP.clipx0 - x; x = GDISP.clipx0; }
if (y < GDISP.clipy0) { cy -= GDISP.clipy0 - y; y = GDISP.clipy0; }
@@ -343,7 +343,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
#endif
#if GDISP_HARDWARE_BITFILLS || defined(__DOXYGEN__)
- void GDISP_LLD(blitareaex)(coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t srcx, coord_t srcy, coord_t srccx, const pixel_t *buffer) {
+ void lld_gdisp_blit_area_ex(coord_t x, coord_t y, coord_t cx, coord_t cy, coord_t srcx, coord_t srcy, coord_t srccx, const pixel_t *buffer) {
coord_t endx, endy;
unsigned lg;
@@ -372,7 +372,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
#endif
#if (GDISP_NEED_PIXELREAD && GDISP_HARDWARE_PIXELREAD) || defined(__DOXYGEN__)
- color_t GDISP_LLD(getpixelcolor)(coord_t x, coord_t y) {
+ color_t lld_gdisp_get_pixel_color(coord_t x, coord_t y) {
color_t color;
#if GDISP_NEED_VALIDATION || GDISP_NEED_CLIP
@@ -392,7 +392,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
#endif
#if (GDISP_NEED_SCROLL && GDISP_HARDWARE_SCROLL) || defined(__DOXYGEN__)
- void GDISP_LLD(verticalscroll)(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) {
+ void lld_gdisp_vertical_scroll(coord_t x, coord_t y, coord_t cx, coord_t cy, int lines, color_t bgcolor) {
static color_t buf[((GDISP_SCREEN_HEIGHT > GDISP_SCREEN_WIDTH ) ? GDISP_SCREEN_HEIGHT : GDISP_SCREEN_WIDTH)];
coord_t row0, row1;
unsigned i, gap, abslines;
@@ -445,7 +445,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
#endif
#if (GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL) || defined(__DOXYGEN__)
- void GDISP_LLD(control)(unsigned what, void *value) {
+ void lld_gdisp_control(unsigned what, void *value) {
switch(what) {
case GDISP_CONTROL_POWER:
if(GDISP.Powermode == (gdisp_powermode_t)value)
@@ -457,7 +457,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
lld_lcdWriteReg(0x0011, 0x0000);
lld_lcdWriteReg(0x0012, 0x0000);
lld_lcdWriteReg(0x0013, 0x0000);
- GDISP_LLD(set_backlight)(0);
+ lld_gdisp_backlight(0);
break;
case powerOn:
@@ -476,9 +476,9 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
lld_lcdWriteReg(0x0029, 0x0009); /* VCM[4:0] for VCOMH */
lld_lcdDelay(500);
lld_lcdWriteReg(0x0007, 0x0173); /* 262K color and display ON */
- GDISP_LLD(set_backlight)(GDISP.Backlight);
+ lld_gdisp_backlight(GDISP.Backlight);
if(GDISP.Powermode != powerSleep || GDISP.Powermode != powerDeepSleep)
- GDISP_LLD(init)();
+ lld_gdisp_init();
break;
case powerSleep:
@@ -489,7 +489,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
lld_lcdWriteReg(0x0013, 0x0000); /* VDV[4:0] for VCOM amplitude */
lld_lcdDelay(2000); /* Dis-charge capacitor power voltage */
lld_lcdWriteReg(0x0010, 0x0002); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
- GDISP_LLD(set_backlight)(0);
+ lld_gdisp_backlight(0);
break;
case powerDeepSleep:
@@ -500,7 +500,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
lld_lcdWriteReg(0x0013, 0x0000); /* VDV[4:0] for VCOM amplitude */
lld_lcdDelay(2000); /* Dis-charge capacitor power voltage */
lld_lcdWriteReg(0x0010, 0x0004); /* SAP, BT[3:0], APE, AP, DSTB, SLP */
- GDISP_LLD(set_backlight)(0);
+ lld_gdisp_backlight(0);
break;
default:
@@ -554,7 +554,7 @@ void GDISP_LLD(drawpixel)(coord_t x, coord_t y, color_t color) {
case GDISP_CONTROL_BACKLIGHT:
if((unsigned)value > 100) value = (void *)100;
- GDISP_LLD(set_backlight)((unsigned)value);
+ lld_gdisp_backlight((unsigned)value);
GDISP.Backlight = (unsigned)value;
break;
diff --git a/drivers/gdisp/ILI9320/gdisp_lld_board_example.h b/drivers/gdisp/ILI9320/gdisp_lld_board_example.h
index a79e557b..f07b34c6 100644
--- a/drivers/gdisp/ILI9320/gdisp_lld_board_example.h
+++ b/drivers/gdisp/ILI9320/gdisp_lld_board_example.h
@@ -29,28 +29,28 @@
#ifndef GDISP_LLD_BOARD_H
#define GDISP_LLD_BOARD_H
-static __inline void GDISP_LLD(init_board)(void) {
+static __inline void lld_gdisp_init_board(void) {
#error "ILI9320: You must implement the init_board routine for your board"
}
-static __inline void GDISP_LLD(setpin_reset)(bool_t state) {
+static __inline void lld_gdisp_reset_pin(bool_t state) {
#error "ILI9320: You must implement setpin_reset routine for your board"
}
-static __inline void GDISP_LLD(write_index)(uint16_t data) {
+static __inline void lld_gdisp_write_index(uint16_t data) {
#error "ILI9320: You must implement write_index routine for your board"
}
-static __inline void GDISP_LLD(write_data)(uint16_t data) {
+static __inline void lld_gdisp_write_data(uint16_t data) {
#error "ILI9320: You must implement write_data routine for your board"
}
-static __inline uint16_t GDISP_LLD(read_data)(void) {
+static __inline uint16_t lld_gdisp_read_data(void) {
#error "ILI9320: You must implement read_data routine for your board"
}
/* if not available, just ignore the argument and return */
-static __inline uint16_t GDISP_LLD(set_backlight)(uint8_t percentage) {
+static __inline uint16_t lld_gdisp_backlight(uint8_t percentage) {
#error "ILI9320: You must implement set_backlight routine for your board"
}
diff --git a/drivers/gdisp/ILI9320/gdisp_lld_board_olimex_stm32_lcd.h b/drivers/gdisp/ILI9320/gdisp_lld_board_olimex_stm32_lcd.h
index a6d9d631..d2d54ce9 100644
--- a/drivers/gdisp/ILI9320/gdisp_lld_board_olimex_stm32_lcd.h
+++ b/drivers/gdisp/ILI9320/gdisp_lld_board_olimex_stm32_lcd.h
@@ -32,7 +32,7 @@
#define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */
#define GDISP_RAM (*((volatile uint16_t *) 0x60100000)) /* RS = 1 */
-static __inline void GDISP_LLD(init_board)(void) {
+static __inline void lld_gdisp_init_board(void) {
/* FSMC setup for F1 */
rccEnableAHB(RCC_AHBENR_FSMCEN, 0);
@@ -54,26 +54,26 @@ static __inline void GDISP_LLD(init_board)(void) {
FSMC_Bank1->BTCR[FSMC_Bank] = FSMC_BCR1_MWID_0 | FSMC_BCR1_WREN | FSMC_BCR1_MBKEN;
}
-static __inline void GDISP_LLD(setpin_reset)(bool_t state) {
+static __inline void lld_gdisp_reset_pin(bool_t state) {
if(state)
palClearPad(GPIOE, GPIOE_TFT_RST);
else
palSetPad(GPIOE, GPIOE_TFT_RST);
}
-static __inline void GDISP_LLD(write_index)(uint16_t reg) {
+static __inline void lld_gdisp_write_index(uint16_t reg) {
GDISP_REG = reg;
}
-static __inline void GDISP_LLD(write_data)(uint16_t data) {
+static __inline void lld_gdisp_write_data(uint16_t data) {
GDISP_RAM = data;
}
-static __inline uint16_t GDISP_LLD(read_data)(void) {
+static __inline uint16_t lld_gdisp_read_data(void) {
return GDISP_RAM;
}
-static __inline void GDISP_LLD(set_backlight)(uint8_t percent) {
+static __inline void lld_gdisp_backlight(uint8_t percent) {
if(percent == 100)
palClearPad(GPIOD, GPIOD_TFT_LIGHT);
else
diff --git a/drivers/gdisp/ILI9320/gdisp_lld_config.h b/drivers/gdisp/ILI9320/gdisp_lld_config.h
index d55f2115..1606ce95 100644
--- a/drivers/gdisp/ILI9320/gdisp_lld_config.h
+++ b/drivers/gdisp/ILI9320/gdisp_lld_config.h
@@ -36,7 +36,6 @@
/*===========================================================================*/
#define GDISP_DRIVER_NAME "ILI9320"
-#define GDISP_LLD(x) gdisp_lld_##x##_ILI9320
#define GDISP_HARDWARE_CLEARS TRUE
#define GDISP_HARDWARE_FILLS TRUE