aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gdisp/ILI9481
diff options
context:
space:
mode:
authorinmarket <andrewh@inmarket.com.au>2013-10-19 15:36:05 +1000
committerinmarket <andrewh@inmarket.com.au>2013-10-19 15:36:05 +1000
commit87a6af81f4edd9f638238d785aae716749a7fc13 (patch)
tree0da0bcebb880331f2a1c4aeb6d911c9398d5b190 /drivers/gdisp/ILI9481
parent443d14c21f10fea9b0c6fc5559ec4c6b31f99546 (diff)
downloaduGFX-87a6af81f4edd9f638238d785aae716749a7fc13.tar.gz
uGFX-87a6af81f4edd9f638238d785aae716749a7fc13.tar.bz2
uGFX-87a6af81f4edd9f638238d785aae716749a7fc13.zip
Change to gdisp low level driver API. Display number is now in the GDriver structure (It was required for a Nokia driver).
Diffstat (limited to 'drivers/gdisp/ILI9481')
-rw-r--r--drivers/gdisp/ILI9481/board_ILI9481_firebullstm32f103.h10
-rw-r--r--drivers/gdisp/ILI9481/board_ILI9481_template.h4
-rw-r--r--drivers/gdisp/ILI9481/gdisp_lld.c4
3 files changed, 7 insertions, 11 deletions
diff --git a/drivers/gdisp/ILI9481/board_ILI9481_firebullstm32f103.h b/drivers/gdisp/ILI9481/board_ILI9481_firebullstm32f103.h
index 6614d578..9933d17b 100644
--- a/drivers/gdisp/ILI9481/board_ILI9481_firebullstm32f103.h
+++ b/drivers/gdisp/ILI9481/board_ILI9481_firebullstm32f103.h
@@ -25,16 +25,13 @@
#define SET_RD palSetPad(GPIOD, 15);
#define CLR_RD palClearPad(GPIOD, 15);
-static inline void init_board(GDisplay *g, unsigned display) {
+static inline void init_board(GDisplay *g) {
// As we are not using multiple displays we set g->priv to NULL as we don't use it.
g->priv = 0;
- if (display == 0) {
-
- /**
- * Set up for Display 0
- */
+ switch(g->controllerdisplay) {
+ case 0: // Set up for Display 0
palSetGroupMode(GPIOE, PAL_WHOLE_PORT, 0, PAL_MODE_OUTPUT_PUSHPULL);
palSetPadMode(GPIOD, 12, PAL_MODE_OUTPUT_PUSHPULL);
palSetPadMode(GPIOD, 13, PAL_MODE_OUTPUT_PUSHPULL);
@@ -46,6 +43,7 @@ static inline void init_board(GDisplay *g, unsigned display) {
SET_RD;
SET_WR;
CLR_CS;
+ break;
}
}
diff --git a/drivers/gdisp/ILI9481/board_ILI9481_template.h b/drivers/gdisp/ILI9481/board_ILI9481_template.h
index f3f8bbb7..8dcee19c 100644
--- a/drivers/gdisp/ILI9481/board_ILI9481_template.h
+++ b/drivers/gdisp/ILI9481/board_ILI9481_template.h
@@ -21,16 +21,14 @@
* @brief Initialise the board for the display.
*
* @param[in] g The GDisplay structure
- * @param[in] display The display number on this controller (0..n)
*
* @note Set the g->priv 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, unsigned display) {
+static inline void init_board(GDisplay *g) {
(void) g;
- (void) display;
}
/**
diff --git a/drivers/gdisp/ILI9481/gdisp_lld.c b/drivers/gdisp/ILI9481/gdisp_lld.c
index 06a9e681..fc00be10 100644
--- a/drivers/gdisp/ILI9481/gdisp_lld.c
+++ b/drivers/gdisp/ILI9481/gdisp_lld.c
@@ -70,9 +70,9 @@ static void set_viewport(GDisplay* g) {
/* Driver exported functions. */
/*===========================================================================*/
-LLDSPEC bool_t gdisp_lld_init(GDisplay *g, unsigned display) {
+LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
/* Initialise your display */
- init_board(g, display);
+ init_board(g);
/* Hardware reset */
setpin_reset(g, TRUE);