aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gdisp/ILI9325
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/ILI9325
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/ILI9325')
-rw-r--r--drivers/gdisp/ILI9325/board_ILI9325_hy_stm32_100p.h11
-rw-r--r--drivers/gdisp/ILI9325/board_ILI9325_template.h4
-rw-r--r--drivers/gdisp/ILI9325/gdisp_lld.c4
3 files changed, 7 insertions, 12 deletions
diff --git a/drivers/gdisp/ILI9325/board_ILI9325_hy_stm32_100p.h b/drivers/gdisp/ILI9325/board_ILI9325_hy_stm32_100p.h
index 166ebc33..ae9e96fc 100644
--- a/drivers/gdisp/ILI9325/board_ILI9325_hy_stm32_100p.h
+++ b/drivers/gdisp/ILI9325/board_ILI9325_hy_stm32_100p.h
@@ -31,17 +31,13 @@
#define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */
#define GDISP_RAM (*((volatile uint16_t *) 0x60020000)) /* RS = 1 */
-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
/* FSMC setup for F1 */
rccEnableAHB(RCC_AHBENR_FSMCEN, 0);
@@ -61,6 +57,7 @@ static inline void init_board(GDisplay *g, unsigned display) {
/* Bank1 NOR/SRAM control register configuration
* This is actually not needed as already set by default after reset */
FSMC_Bank1->BTCR[FSMC_Bank] = FSMC_BCR1_MWID_0 | FSMC_BCR1_WREN | FSMC_BCR1_MBKEN;
+ break;
}
}
diff --git a/drivers/gdisp/ILI9325/board_ILI9325_template.h b/drivers/gdisp/ILI9325/board_ILI9325_template.h
index 7b067293..65ab5704 100644
--- a/drivers/gdisp/ILI9325/board_ILI9325_template.h
+++ b/drivers/gdisp/ILI9325/board_ILI9325_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/ILI9325/gdisp_lld.c b/drivers/gdisp/ILI9325/gdisp_lld.c
index 42acdc46..8a4b8603 100644
--- a/drivers/gdisp/ILI9325/gdisp_lld.c
+++ b/drivers/gdisp/ILI9325/gdisp_lld.c
@@ -96,11 +96,11 @@ static void set_viewport(GDisplay* g) {
}
}
-LLDSPEC bool_t gdisp_lld_init(GDisplay *g, unsigned display) {
+LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
uint16_t cver;
/* Initialise your display */
- init_board(g, display);
+ init_board(g);
/* Hardware reset */
setpin_reset(g, TRUE);