aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gdisp/S6D1121
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gdisp/S6D1121')
-rw-r--r--drivers/gdisp/S6D1121/gdisp_lld.c9
-rw-r--r--drivers/gdisp/S6D1121/gdisp_lld.mk10
-rw-r--r--drivers/gdisp/S6D1121/gdisp_lld_board_olimex_e407.h150
-rw-r--r--drivers/gdisp/S6D1121/gdisp_lld_board_template.h (renamed from drivers/gdisp/S6D1121/gdisp_lld_board_example.h)206
-rw-r--r--drivers/gdisp/S6D1121/gdisp_lld_config.h68
-rw-r--r--drivers/gdisp/S6D1121/readme.txt8
6 files changed, 215 insertions, 236 deletions
diff --git a/drivers/gdisp/S6D1121/gdisp_lld.c b/drivers/gdisp/S6D1121/gdisp_lld.c
index 93f94d94..84b494d9 100644
--- a/drivers/gdisp/S6D1121/gdisp_lld.c
+++ b/drivers/gdisp/S6D1121/gdisp_lld.c
@@ -43,14 +43,7 @@
/* Driver local definitions. */
/*===========================================================================*/
-#if defined(GDISP_USE_CUSTOM_BOARD) && GDISP_USE_CUSTOM_BOARD
- /* Include the user supplied board definitions */
- #include "gdisp_lld_board.h"
-#elif defined(BOARD_OLIMEX_STM32_E407)
- #include "gdisp_lld_board_olimex_e407.h"
-#else
- #include "gdisp_lld_board.h"
-#endif
+#include "gdisp_lld_board.h"
/* Some common routines and macros */
#define write_reg(reg, data) { write_index(reg); write_data(data); }
diff --git a/drivers/gdisp/S6D1121/gdisp_lld.mk b/drivers/gdisp/S6D1121/gdisp_lld.mk
index 38c23c43..07f9c380 100644
--- a/drivers/gdisp/S6D1121/gdisp_lld.mk
+++ b/drivers/gdisp/S6D1121/gdisp_lld.mk
@@ -1,5 +1,5 @@
-# List the required driver.
-GFXSRC += $(GFXLIB)/drivers/gdisp/S6D1121/gdisp_lld.c
-
-# Required include directories
-GFXINC += $(GFXLIB)/drivers/gdisp/S6D1121
+# List the required driver.
+GFXSRC += $(GFXLIB)/drivers/gdisp/S6D1121/gdisp_lld.c
+
+# Required include directories
+GFXINC += $(GFXLIB)/drivers/gdisp/S6D1121
diff --git a/drivers/gdisp/S6D1121/gdisp_lld_board_olimex_e407.h b/drivers/gdisp/S6D1121/gdisp_lld_board_olimex_e407.h
index f4f2bc75..836a6d69 100644
--- a/drivers/gdisp/S6D1121/gdisp_lld_board_olimex_e407.h
+++ b/drivers/gdisp/S6D1121/gdisp_lld_board_olimex_e407.h
@@ -4,78 +4,78 @@
*
* http://chibios-gfx.com/license.html
*/
-
-/**
- * @file drivers/gdisp/S6D1121/gdisp_lld_board_olimex_e407.h
- * @brief GDISP Graphic Driver subsystem board interface for the S6D1121 display
- *
- * @addtogroup GDISP
- * @{
- */
-
-#ifndef _GDISP_LLD_BOARD_H
-#define _GDISP_LLD_BOARD_H
-
-#define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */
-#define GDISP_RAM (*((volatile uint16_t *) 0x60020000)) /* RS = 1 */
-
-static inline void init_board(void) {
- int FSMC_Bank = 0;
-
- /* STM32F4 FSMC init */
- rccEnableAHB3(RCC_AHB3ENR_FSMCEN, 0);
-
- /* set pins to FSMC mode */
- IOBus busD = {GPIOD, (1 << 0) | (1 << 1) | (1 << 4) | (1 << 5) | (1 << 7) | (1 << 8) |
- (1 << 9) | (1 << 10) | (1 << 11) | (1 << 14) | (1 << 15), 0};
-
- IOBus busE = {GPIOE, (1 << 7) | (1 << 8) | (1 << 9) | (1 << 10) | (1 << 11) | (1 << 12) |
- (1 << 13) | (1 << 14) | (1 << 15), 0};
-
- palSetBusMode(&busD, PAL_MODE_ALTERNATE(12));
- palSetBusMode(&busE, PAL_MODE_ALTERNATE(12));
-
- /* FSMC timing */
- FSMC_Bank1->BTCR[FSMC_Bank+1] = (6) | (10 << 8) | (10 << 16);
-
- /* Bank1 NOR/SRAM control register configuration */
- FSMC_Bank1->BTCR[FSMC_Bank] = FSMC_BCR1_MWID_0 | FSMC_BCR1_WREN | FSMC_BCR1_MBKEN;
-}
-
-static inline void setpin_reset(bool_t state) {
- (void)state;
-
- /* Nothing to do here */
-}
-
-static inline void set_backlight(uint8_t percent) {
- (void)percent;
-
- /* Nothing to do here */
-}
-
-static inline void acquire_bus(void) {
- /* Nothing to do here */
-}
-
-static inline void release_bus(void) {
- /* Nothing to do here */
-}
-
-static inline void write_index(uint16_t index) {
- GDISP_REG = index;
-}
-
-static inline void write_data(uint16_t data) {
- GDISP_RAM = data;
-}
-
-#if GDISP_HARDWARE_READPIXEL || GDISP_HARDWARE_SCROLL || defined(__DOXYGEN__)
-static inline uint16_t read_data(void) {
- return GDISP_RAM;
-}
-#endif
-
-#endif /* _GDISP_LLD_BOARD_H */
-/** @} */
-
+
+/**
+ * @file drivers/gdisp/S6D1121/gdisp_lld_board_olimex_e407.h
+ * @brief GDISP Graphic Driver subsystem board interface for the S6D1121 display
+ *
+ * @addtogroup GDISP
+ * @{
+ */
+
+#ifndef _GDISP_LLD_BOARD_H
+#define _GDISP_LLD_BOARD_H
+
+#define GDISP_REG (*((volatile uint16_t *) 0x60000000)) /* RS = 0 */
+#define GDISP_RAM (*((volatile uint16_t *) 0x60020000)) /* RS = 1 */
+
+static inline void init_board(void) {
+ int FSMC_Bank = 0;
+
+ /* STM32F4 FSMC init */
+ rccEnableAHB3(RCC_AHB3ENR_FSMCEN, 0);
+
+ /* set pins to FSMC mode */
+ IOBus busD = {GPIOD, (1 << 0) | (1 << 1) | (1 << 4) | (1 << 5) | (1 << 7) | (1 << 8) |
+ (1 << 9) | (1 << 10) | (1 << 11) | (1 << 14) | (1 << 15), 0};
+
+ IOBus busE = {GPIOE, (1 << 7) | (1 << 8) | (1 << 9) | (1 << 10) | (1 << 11) | (1 << 12) |
+ (1 << 13) | (1 << 14) | (1 << 15), 0};
+
+ palSetBusMode(&busD, PAL_MODE_ALTERNATE(12));
+ palSetBusMode(&busE, PAL_MODE_ALTERNATE(12));
+
+ /* FSMC timing */
+ FSMC_Bank1->BTCR[FSMC_Bank+1] = (6) | (10 << 8) | (10 << 16);
+
+ /* Bank1 NOR/SRAM control register configuration */
+ FSMC_Bank1->BTCR[FSMC_Bank] = FSMC_BCR1_MWID_0 | FSMC_BCR1_WREN | FSMC_BCR1_MBKEN;
+}
+
+static inline void setpin_reset(bool_t state) {
+ (void)state;
+
+ /* Nothing to do here */
+}
+
+static inline void set_backlight(uint8_t percent) {
+ (void)percent;
+
+ /* Nothing to do here */
+}
+
+static inline void acquire_bus(void) {
+ /* Nothing to do here */
+}
+
+static inline void release_bus(void) {
+ /* Nothing to do here */
+}
+
+static inline void write_index(uint16_t index) {
+ GDISP_REG = index;
+}
+
+static inline void write_data(uint16_t data) {
+ GDISP_RAM = data;
+}
+
+#if GDISP_HARDWARE_READPIXEL || GDISP_HARDWARE_SCROLL || defined(__DOXYGEN__)
+static inline uint16_t read_data(void) {
+ return GDISP_RAM;
+}
+#endif
+
+#endif /* _GDISP_LLD_BOARD_H */
+/** @} */
+
diff --git a/drivers/gdisp/S6D1121/gdisp_lld_board_example.h b/drivers/gdisp/S6D1121/gdisp_lld_board_template.h
index 0ba5f973..b4e192dc 100644
--- a/drivers/gdisp/S6D1121/gdisp_lld_board_example.h
+++ b/drivers/gdisp/S6D1121/gdisp_lld_board_template.h
@@ -4,109 +4,103 @@
*
* http://chibios-gfx.com/license.html
*/
-
-/**
- * @file drivers/gdisp/S6D1121/gdisp_lld_board_example.h
- * @brief GDISP Graphic Driver subsystem board interface for the S6D1121 display.
- *
- * @addtogroup GDISP
- * @{
- */
-
-#ifndef _GDISP_LLD_BOARD_H
-#define _GDISP_LLD_BOARD_H
-
-/**
- * @brief Initialise the board for the display.
- *
- * @notapi
- */
-static inline void init_board(void) {
- /* Code here */
-#error "SSD1289: You must supply a definition for init_board for your board"
-}
-
-/**
- * @brief Set or clear the lcd reset pin.
- *
- * @param[in] state TRUE = lcd in reset, FALSE = normal operation
- *
- * @notapi
- */
-static inline void setpin_reset(bool_t state) {
- /* Code here */
-#error "SSD1289: You must supply a definition for setpin_reset for your board"
-}
-
-/**
- * @brief Set the lcd back-light level.
- *
- * @param[in] percent 0 to 100%
- *
- * @notapi
- */
-static inline void set_backlight(uint8_t percent) {
- /* Code here */
-#error "SSD1289: You must supply a definition for set_backlight for your board"
-}
-
-/**
- * @brief Take exclusive control of the bus
- *
- * @notapi
- */
-static inline void acquire_bus(void) {
-#error "SSD1289: You must supply a definition for acquire_bus for your board"
-}
-
-/**
- * @brief Release exclusive control of the bus
- *
- * @notapi
- */
-static inline void release_bus(void) {
-#error "SSD1289: You must supply a definition for release_bus for your board"
-}
-
-/**
- * @brief Send data to the index register.
- *
- * @param[in] index The index register to set
- *
- * @notapi
- */
-static inline void write_index(uint16_t index) {
- /* Code here */
-#error "SSD1289: You must supply a definition for write_index for your board"
-}
-
-/**
- * @brief Send data to the lcd.
- *
- * @param[in] data The data to send
- *
- * @notapi
- */
-static inline void write_data(uint16_t data) {
- /* Code here */
-#error "SSD1289: You must supply a definition for write_data for your board"
-}
-
-#if GDISP_HARDWARE_READPIXEL || GDISP_HARDWARE_SCROLL || defined(__DOXYGEN__)
-/**
- * @brief Read data from the lcd.
- *
- * @return The data from the lcd
- * @note The chip select may need to be asserted/de-asserted
- * around the actual spi read
- *
- * @notapi
- */
-static inline uint16_t read_data(void) {
- /* Code here */
-#error "SSD1289: You must supply a definition for read_data for your board"
-}
-#endif
-
-#endif /* _GDISP_LLD_BOARD_H */
-/** @} */
+
+/**
+ * @file drivers/gdisp/S6D1121/gdisp_lld_board_template.h
+ * @brief GDISP Graphic Driver subsystem board interface for the S6D1121 display.
+ *
+ * @addtogroup GDISP
+ * @{
+ */
+
+#ifndef _GDISP_LLD_BOARD_H
+#define _GDISP_LLD_BOARD_H
+
+/**
+ * @brief Initialise the board for the display.
+ *
+ * @notapi
+ */
+static inline void init_board(void) {
+
+}
+
+/**
+ * @brief Set or clear the lcd reset pin.
+ *
+ * @param[in] state TRUE = lcd in reset, FALSE = normal operation
+ *
+ * @notapi
+ */
+static inline void setpin_reset(bool_t state) {
+
+}
+
+/**
+ * @brief Set the lcd back-light level.
+ *
+ * @param[in] percent 0 to 100%
+ *
+ * @notapi
+ */
+static inline void set_backlight(uint8_t percent) {
+
+}
+
+/**
+ * @brief Take exclusive control of the bus
+ *
+ * @notapi
+ */
+static inline void acquire_bus(void) {
+
+}
+
+/**
+ * @brief Release exclusive control of the bus
+ *
+ * @notapi
+ */
+static inline void release_bus(void) {
+
+}
+
+/**
+ * @brief Send data to the index register.
+ *
+ * @param[in] index The index register to set
+ *
+ * @notapi
+ */
+static inline void write_index(uint16_t index) {
+
+}
+
+/**
+ * @brief Send data to the lcd.
+ *
+ * @param[in] data The data to send
+ *
+ * @notapi
+ */
+static inline void write_data(uint16_t data) {
+
+}
+
+#if GDISP_HARDWARE_READPIXEL || GDISP_HARDWARE_SCROLL || defined(__DOXYGEN__)
+/**
+ * @brief Read data from the lcd.
+ *
+ * @return The data from the lcd
+ * @note The chip select may need to be asserted/de-asserted
+ * around the actual spi read
+ *
+ * @notapi
+ */
+static inline uint16_t read_data(void) {
+
+}
+#endif
+
+#endif /* _GDISP_LLD_BOARD_H */
+/** @} */
diff --git a/drivers/gdisp/S6D1121/gdisp_lld_config.h b/drivers/gdisp/S6D1121/gdisp_lld_config.h
index 630f73dd..cbb63546 100644
--- a/drivers/gdisp/S6D1121/gdisp_lld_config.h
+++ b/drivers/gdisp/S6D1121/gdisp_lld_config.h
@@ -4,37 +4,37 @@
*
* http://chibios-gfx.com/license.html
*/
-
-/**
- * @file drivers/gdisp/S6D1121/gdisp_lld_config.h
- * @brief GDISP Graphic Driver subsystem low level driver header for the S6D1121 display.
- *
- * @addtogroup GDISP
- * @{
- */
-
-#ifndef _GDISP_LLD_CONFIG_H
-#define _GDISP_LLD_CONFIG_H
-
-#if GFX_USE_GDISP
-
-/*===========================================================================*/
-/* Driver hardware support. */
-/*===========================================================================*/
-
-#define GDISP_DRIVER_NAME "S6D1121"
-
-#define GDISP_HARDWARE_CLEARS TRUE
-#define GDISP_HARDWARE_FILLS TRUE
-#define GDISP_HARDWARE_BITFILLS TRUE
-#define GDISP_HARDWARE_SCROLL TRUE
-#define GDISP_HARDWARE_PIXELREAD FALSE
-#define GDISP_HARDWARE_CONTROL TRUE
-
-#define GDISP_PIXELFORMAT GDISP_PIXELFORMAT_RGB565
-
-#endif /* GFX_USE_GDISP */
-
-#endif /* _GDISP_LLD_CONFIG_H */
-/** @} */
-
+
+/**
+ * @file drivers/gdisp/S6D1121/gdisp_lld_config.h
+ * @brief GDISP Graphic Driver subsystem low level driver header for the S6D1121 display.
+ *
+ * @addtogroup GDISP
+ * @{
+ */
+
+#ifndef _GDISP_LLD_CONFIG_H
+#define _GDISP_LLD_CONFIG_H
+
+#if GFX_USE_GDISP
+
+/*===========================================================================*/
+/* Driver hardware support. */
+/*===========================================================================*/
+
+#define GDISP_DRIVER_NAME "S6D1121"
+
+#define GDISP_HARDWARE_CLEARS TRUE
+#define GDISP_HARDWARE_FILLS TRUE
+#define GDISP_HARDWARE_BITFILLS TRUE
+#define GDISP_HARDWARE_SCROLL TRUE
+#define GDISP_HARDWARE_PIXELREAD FALSE
+#define GDISP_HARDWARE_CONTROL TRUE
+
+#define GDISP_PIXELFORMAT GDISP_PIXELFORMAT_RGB565
+
+#endif /* GFX_USE_GDISP */
+
+#endif /* _GDISP_LLD_CONFIG_H */
+/** @} */
+
diff --git a/drivers/gdisp/S6D1121/readme.txt b/drivers/gdisp/S6D1121/readme.txt
deleted file mode 100644
index 54bb3091..00000000
--- a/drivers/gdisp/S6D1121/readme.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-To use this driver:
-
-1. Add in your gfxconf.h:
- a) #define GFX_USE_GDISP TRUE
- b) Any optional high level driver defines (see gdisp.h) eg: GDISP_NEED_MULTITHREAD
-
-2. To your makefile add the following lines:
- include $(GFXLIB)/drivers/gdisp/S6D1121/gdisp_lld.mk