aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gdisp/RA8875
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/RA8875
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/RA8875')
-rw-r--r--drivers/gdisp/RA8875/board_RA8875_marlin.h11
-rw-r--r--drivers/gdisp/RA8875/board_RA8875_template.h25
-rw-r--r--drivers/gdisp/RA8875/gdisp_lld.c4
3 files changed, 20 insertions, 20 deletions
diff --git a/drivers/gdisp/RA8875/board_RA8875_marlin.h b/drivers/gdisp/RA8875/board_RA8875_marlin.h
index 95fb7f9d..88523060 100644
--- a/drivers/gdisp/RA8875/board_RA8875_marlin.h
+++ b/drivers/gdisp/RA8875/board_RA8875_marlin.h
@@ -20,17 +20,13 @@
#define FSMC_BANK 4
-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
/* set pins to FSMC mode */
IOBus busD = {GPIOD, (1 << 0) | (1 << 1) | (1 << 4) | (1 << 5) | (1 << 8) |
(1 << 9) | (1 << 10) | (1 << 11) | (1 << 14) | (1 << 15), 0};
@@ -52,6 +48,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/RA8875/board_RA8875_template.h b/drivers/gdisp/RA8875/board_RA8875_template.h
index 564f60c0..32d12de5 100644
--- a/drivers/gdisp/RA8875/board_RA8875_template.h
+++ b/drivers/gdisp/RA8875/board_RA8875_template.h
@@ -20,14 +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;
}
/**
@@ -38,6 +38,7 @@ static inline void init_board(GDisplay *g, unsigned display) {
* @notapi
*/
static inline void post_init_board(GDisplay *g) {
+ (void) g;
}
/**
@@ -49,7 +50,8 @@ static inline void post_init_board(GDisplay *g) {
* @notapi
*/
static inline void setpin_reset(GDisplay *g, bool_t state) {
-
+ (void) g;
+ (void) state;
}
/**
@@ -60,7 +62,7 @@ static inline void setpin_reset(GDisplay *g, bool_t state) {
* @notapi
*/
static inline void acquire_bus(GDisplay *g) {
-
+ (void) g;
}
/**
@@ -71,7 +73,7 @@ static inline void acquire_bus(GDisplay *g) {
* @notapi
*/
static inline void release_bus(GDisplay *g) {
-
+ (void) g;
}
/**
@@ -83,7 +85,8 @@ static inline void release_bus(GDisplay *g) {
* @notapi
*/
static inline void write_index(GDisplay *g, uint16_t index) {
-
+ (void) g;
+ (void) index;
}
/**
@@ -95,7 +98,8 @@ static inline void write_index(GDisplay *g, uint16_t index) {
* @notapi
*/
static inline void write_data(GDisplay *g, uint16_t data) {
-
+ (void) g;
+ (void) data;
}
/**
@@ -106,7 +110,7 @@ static inline void write_data(GDisplay *g, uint16_t data) {
* @notapi
*/
static inline void setreadmode(GDisplay *g) {
-
+ (void) g;
}
/**
@@ -117,7 +121,7 @@ static inline void setreadmode(GDisplay *g) {
* @notapi
*/
static inline void setwritemode(GDisplay *g) {
-
+ (void) g;
}
/**
@@ -132,9 +136,8 @@ static inline void setwritemode(GDisplay *g) {
* @notapi
*/
static inline uint16_t read_data(GDisplay *g) {
-
+ (void) g;
}
#endif /* _GDISP_LLD_BOARD_H */
/** @} */
-
diff --git a/drivers/gdisp/RA8875/gdisp_lld.c b/drivers/gdisp/RA8875/gdisp_lld.c
index 4c146321..6697d9fd 100644
--- a/drivers/gdisp/RA8875/gdisp_lld.c
+++ b/drivers/gdisp/RA8875/gdisp_lld.c
@@ -106,9 +106,9 @@ static inline void set_backlight(GDisplay* g, uint8_t percent) {
/* 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);