aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gdisp/SSD1289
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/SSD1289
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/SSD1289')
-rw-r--r--drivers/gdisp/SSD1289/board_SSD1289_firebullstm32f103.h10
-rw-r--r--drivers/gdisp/SSD1289/board_SSD1289_stm32f4discovery.h9
-rw-r--r--drivers/gdisp/SSD1289/board_SSD1289_template.h4
-rw-r--r--drivers/gdisp/SSD1289/gdisp_lld.c4
4 files changed, 11 insertions, 16 deletions
diff --git a/drivers/gdisp/SSD1289/board_SSD1289_firebullstm32f103.h b/drivers/gdisp/SSD1289/board_SSD1289_firebullstm32f103.h
index df7594f8..338d9799 100644
--- a/drivers/gdisp/SSD1289/board_SSD1289_firebullstm32f103.h
+++ b/drivers/gdisp/SSD1289/board_SSD1289_firebullstm32f103.h
@@ -24,16 +24,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);
@@ -45,6 +42,7 @@ static inline void init_board(GDisplay *g, unsigned display) {
SET_RD;
SET_WR;
CLR_CS;
+ break;
}
}
diff --git a/drivers/gdisp/SSD1289/board_SSD1289_stm32f4discovery.h b/drivers/gdisp/SSD1289/board_SSD1289_stm32f4discovery.h
index 84082089..d1e23c4a 100644
--- a/drivers/gdisp/SSD1289/board_SSD1289_stm32f4discovery.h
+++ b/drivers/gdisp/SSD1289/board_SSD1289_stm32f4discovery.h
@@ -34,16 +34,14 @@ static const PWMConfig pwmcfg = {
0
};
-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) {
-
+ switch(g->controllerdisplay) {
+ case 0: // Set up for Display 0
/**
- * Set up for Display 0
- *
* Performs the following functions:
* 1. initialise the io port used by the display
* 2. initialise the reset pin (initial state not-in-reset)
@@ -95,6 +93,7 @@ static inline void init_board(GDisplay *g, unsigned display) {
pwmStart(&PWMD3, &pwmcfg);
palSetPadMode(GPIOB, 0, PAL_MODE_ALTERNATE(2));
pwmEnableChannel(&PWMD3, 2, 100);
+ break;
}
}
diff --git a/drivers/gdisp/SSD1289/board_SSD1289_template.h b/drivers/gdisp/SSD1289/board_SSD1289_template.h
index b24789ea..8bef95b9 100644
--- a/drivers/gdisp/SSD1289/board_SSD1289_template.h
+++ b/drivers/gdisp/SSD1289/board_SSD1289_template.h
@@ -20,16 +20,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/SSD1289/gdisp_lld.c b/drivers/gdisp/SSD1289/gdisp_lld.c
index dca11d5d..b376083c 100644
--- a/drivers/gdisp/SSD1289/gdisp_lld.c
+++ b/drivers/gdisp/SSD1289/gdisp_lld.c
@@ -114,9 +114,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);