diff options
Diffstat (limited to 'drivers/gdisp/Nokia6610GE8')
-rw-r--r-- | drivers/gdisp/Nokia6610GE8/board_Nokia6610GE8_template.h | 72 | ||||
-rw-r--r-- | drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c | 61 | ||||
-rw-r--r-- | drivers/gdisp/Nokia6610GE8/gdisp_lld_config.h | 9 |
3 files changed, 41 insertions, 101 deletions
diff --git a/drivers/gdisp/Nokia6610GE8/board_Nokia6610GE8_template.h b/drivers/gdisp/Nokia6610GE8/board_Nokia6610GE8_template.h index 28fc9f70..0545fcd5 100644 --- a/drivers/gdisp/Nokia6610GE8/board_Nokia6610GE8_template.h +++ b/drivers/gdisp/Nokia6610GE8/board_Nokia6610GE8_template.h @@ -5,14 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/Nokia6610GE8/board_Nokia6610GE8_template.h - * @brief GDISP Graphic Driver subsystem board interface for the Nokia6610 GE12 display. - * - * @addtogroup GDISP - * @{ - */ - #ifndef _GDISP_LLD_BOARD_H #define _GDISP_LLD_BOARD_H @@ -28,104 +20,40 @@ //#define GDISP_INITIAL_CONTRAST 50 // The initial contrast percentage //#define GDISP_INITIAL_BACKLIGHT 100 // The initial backlight percentage -/** - * @brief Initialise the board for the display. - * - * @param[in] g The GDisplay structure - * - * @note Set the g->board member to whatever is appropriate. For multiple - * displays this might be a pointer to the appropriate register set. - * - * @notapi - */ static inline void init_board(GDisplay *g) { (void) g; } -/** - * @brief After the initialisation. - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void post_init_board(GDisplay *g) { (void) g; } -/** - * @brief Set or clear the lcd reset pin. - * - * @param[in] g The GDisplay structure - * @param[in] state TRUE = lcd in reset, FALSE = normal operation - * - * @notapi - */ static inline void setpin_reset(GDisplay *g, bool_t state) { (void) g; (void) state; } -/** - * @brief Set the lcd back-light level. - * - * @param[in] g The GDisplay structure - * @param[in] percent 0 to 100% - * - * @notapi - */ static inline void set_backlight(GDisplay *g, uint8_t percent) { (void) g; (void) percent; } -/** - * @brief Take exclusive control of the bus - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void acquire_bus(GDisplay *g) { (void) g; } -/** - * @brief Release exclusive control of the bus - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void release_bus(GDisplay *g) { (void) g; } -/** - * @brief Send data to the index register. - * - * @param[in] g The GDisplay structure - * @param[in] index The index register to set - * - * @notapi - */ static inline void write_index(GDisplay *g, uint16_t index) { (void) g; (void) index; } -/** - * @brief Send data to the lcd. - * - * @param[in] g The GDisplay structure - * @param[in] data The data to send - * - * @notapi - */ static inline void write_data(GDisplay *g, uint16_t data) { (void) g; (void) data; } #endif /* _GDISP_LLD_BOARD_H */ -/** @} */ diff --git a/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c b/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c index 0e2c7e4e..cd265e00 100644 --- a/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c +++ b/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c @@ -5,19 +5,11 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/Nokia6610GE8/gdisp_lld.c - * @brief GDISP Graphics Driver subsystem low level driver source for the Nokia6610 GE8 display. - * - * @addtogroup GDISP - * @{ - */ - #include "gfx.h" #if GFX_USE_GDISP -/** +/* * This is for the EPSON (GE8) controller driving a Nokia6610 color LCD display. * Note that there is also a PHILIPS (GE12) controller for the same display that this code * does not support. @@ -136,25 +128,55 @@ #define write_cmd3(g, cmd, d1, d2, d3) { write_index(g, cmd); write_data3(g, d1, d2, d3); } #define write_cmd4(g, cmd, d1, d2, d3, d4) { write_index(g, cmd); write_data4(g, d1, d2, d3, d4); } +#if GDISP_HARDWARE_DRAWPIXEL + static inline void set_viewpoint(GDisplay* g) { + #if GDISP_NOKIA_ORIENTATION && GDISP_NEED_CONTROL + switch(g->g.Orientation) { + default: + case GDISP_ROTATE_0: + write_cmd2(g, CASET, GDISP_RAM_X_OFFSET+g->p.x, GDISP_RAM_X_OFFSET+g->p.x); // Column address set + write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET+g->p.y, GDISP_RAM_Y_OFFSET+g->p.y); // Page address set + break; + case GDISP_ROTATE_90: + write_cmd2(g, CASET, GDISP_RAM_X_OFFSET+g->p.y, GDISP_RAM_X_OFFSET+g->p.y); + write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET-1+g->g.Width-g->p.x, GDISP_RAM_Y_OFFSET-1+g->g.Width-g->p.x); + break; + case GDISP_ROTATE_180: + write_cmd2(g, CASET, GDISP_RAM_X_OFFSET-1+g->g.Width-g->p.x, GDISP_RAM_X_OFFSET-1+g->g.Width-g->p.x); + write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET-1+g->g.Height-g->p.y, GDISP_RAM_Y_OFFSET-1+g->g.Height-g->p.y); + break; + case GDISP_ROTATE_270: + write_cmd2(g, CASET, GDISP_RAM_X_OFFSET-1+g->g.Height-g->p.y, GDISP_RAM_X_OFFSET-1+g->g.Height-g->p.y); + write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET+g->p.x, GDISP_RAM_Y_OFFSET+g->p.x); + break; + } + #else + write_cmd2(g, CASET, GDISP_RAM_X_OFFSET+g->p.x, GDISP_RAM_X_OFFSET+g->p.x); // Column address set + write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET+g->p.y, GDISP_RAM_Y_OFFSET+g->p.y); // Page address set + #endif + write_index(g, RAMWR); + } +#endif + static inline void set_viewport(GDisplay* g) { #if GDISP_NOKIA_ORIENTATION && GDISP_NEED_CONTROL switch(g->g.Orientation) { default: case GDISP_ROTATE_0: - write_cmd2(g, CASET, GDISP_RAM_X_OFFSET+g->p.x, GDISP_RAM_X_OFFSET+g->p.x); // Column address set - write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET+g->p.y, GDISP_RAM_Y_OFFSET+g->p.y); // Page address set + write_cmd2(g, CASET, GDISP_RAM_X_OFFSET+g->p.x, GDISP_RAM_X_OFFSET+g->p.x+g->p.cx-1); // Column address set + write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET+g->p.y, GDISP_RAM_Y_OFFSET+g->p.y+g->p.cy-1); // Page address set break; case GDISP_ROTATE_90: - write_cmd2(g, CASET, GDISP_RAM_X_OFFSET+g->p.y, GDISP_RAM_X_OFFSET+g->p.y); - write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET-1+g->g.Width-g->p.x, GDISP_RAM_Y_OFFSET-1+g->g.Width-g->p.x); + write_cmd2(g, CASET, GDISP_RAM_X_OFFSET+g->p.y, GDISP_RAM_X_OFFSET+g->p.y+g->p.cy-1); + write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET+g->g.Width-g->p.x-g->p.cx, GDISP_RAM_Y_OFFSET-1+g->g.Width-g->p.x); break; case GDISP_ROTATE_180: - write_cmd2(g, CASET, GDISP_RAM_X_OFFSET-1+g->g.Width-g->p.x, GDISP_RAM_X_OFFSET-1+g->g.Width-g->p.x); - write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET-1+g->g.Height-g->p.y, GDISP_RAM_Y_OFFSET-1+g->g.Height-g->p.y); + write_cmd2(g, CASET, GDISP_RAM_X_OFFSET+g->g.Width-g->p.x-g->p.cx, GDISP_RAM_X_OFFSET-1+g->g.Width-g->p.x); + write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET+g->g.Height-g->p.y-g->p.cy, GDISP_RAM_Y_OFFSET-1+g->g.Height-g->p.y); break; case GDISP_ROTATE_270: - write_cmd2(g, CASET, GDISP_RAM_X_OFFSET-1+g->g.Height-g->p.y, GDISP_RAM_X_OFFSET-1+g->g.Height-g->p.y); - write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET+g->p.x, GDISP_RAM_Y_OFFSET+g->p.x); + write_cmd2(g, CASET, GDISP_RAM_X_OFFSET+g->g.Height-g->p.y-g->p.cy, GDISP_RAM_X_OFFSET-1+g->g.Height-g->p.y); + write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET+g->p.x, GDISP_RAM_Y_OFFSET+g->p.x+g->p.cx-1); break; } #else @@ -292,8 +314,8 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { c = gdispColor2Native(g->p.color); acquire_bus(g); - set_viewport(g); - write_data3(g, 0, (c>>8) & 0x0F, c & 0xFF); + set_viewpoint(g); + write_data3(g, 0, ((c>>8) & 0x0F), (c & 0xFF)); release_bus(g); } #endif @@ -569,4 +591,3 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { #endif #endif /* GFX_USE_GDISP */ -/** @} */ diff --git a/drivers/gdisp/Nokia6610GE8/gdisp_lld_config.h b/drivers/gdisp/Nokia6610GE8/gdisp_lld_config.h index 1476dbcf..b90314d6 100644 --- a/drivers/gdisp/Nokia6610GE8/gdisp_lld_config.h +++ b/drivers/gdisp/Nokia6610GE8/gdisp_lld_config.h @@ -5,14 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/Nokia6610GE8/gdisp_lld_config.h - * @brief GDISP Graphic Driver subsystem low level driver header for the Nokia6610 GE8 display. - * - * @addtogroup GDISP - * @{ - */ - #ifndef _GDISP_LLD_CONFIG_H #define _GDISP_LLD_CONFIG_H @@ -46,4 +38,3 @@ #endif /* GFX_USE_GDISP */ #endif /* _GDISP_LLD_CONFIG_H */ -/** @} */ |