diff options
author | inmarket <andrewh@inmarket.com.au> | 2013-10-19 15:36:05 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2013-10-19 15:36:05 +1000 |
commit | 87a6af81f4edd9f638238d785aae716749a7fc13 (patch) | |
tree | 0da0bcebb880331f2a1c4aeb6d911c9398d5b190 /drivers/gdisp/HX8347D/board_HX8347D_stm32f4discovery.h | |
parent | 443d14c21f10fea9b0c6fc5559ec4c6b31f99546 (diff) | |
download | uGFX-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/HX8347D/board_HX8347D_stm32f4discovery.h')
-rw-r--r-- | drivers/gdisp/HX8347D/board_HX8347D_stm32f4discovery.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/gdisp/HX8347D/board_HX8347D_stm32f4discovery.h b/drivers/gdisp/HX8347D/board_HX8347D_stm32f4discovery.h index 4899baa5..daabe75d 100644 --- a/drivers/gdisp/HX8347D/board_HX8347D_stm32f4discovery.h +++ b/drivers/gdisp/HX8347D/board_HX8347D_stm32f4discovery.h @@ -64,17 +64,13 @@ static const SPIConfig spi1cfg_16bit = { SPI_CR1_DFF //SPI_CR1_BR_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) { - - /** - * Set up for Display 0 - */ - + switch(g->controllerdisplay) { + case 0: // Set up for Display 0 /* Display backlight control */ /* TIM4 is an alternate function 2 (AF2) */ pwmStart(&PWMD4, &pwmcfg); @@ -96,6 +92,7 @@ static inline void init_board(GDisplay *g, unsigned display) { palSetPadMode(GPIOA, 5, PAL_MODE_ALTERNATE(5)|PAL_STM32_OSPEED_HIGHEST); /* SCK. */ palSetPadMode(GPIOA, 6, PAL_MODE_ALTERNATE(5)); /* MISO. */ palSetPadMode(GPIOA, 7, PAL_MODE_ALTERNATE(5)|PAL_STM32_OSPEED_HIGHEST); /* MOSI. */ + break; } } |