diff options
Diffstat (limited to 'drivers/gdisp')
-rw-r--r-- | drivers/gdisp/HX8347D/gdisp_lld.c | 6 | ||||
-rw-r--r-- | drivers/gdisp/ILI9320/gdisp_lld.c | 4 | ||||
-rw-r--r-- | drivers/gdisp/ILI9325/gdisp_lld.c | 4 | ||||
-rw-r--r-- | drivers/gdisp/ILI9481/gdisp_lld.c | 6 | ||||
-rw-r--r-- | drivers/gdisp/ILI9481/gdisp_lld_board_example_fsmc.h | 2 | ||||
-rw-r--r-- | drivers/gdisp/Nokia6610GE12/gdisp_lld.c | 4 | ||||
-rw-r--r-- | drivers/gdisp/Nokia6610GE8/gdisp_lld.c | 4 | ||||
-rw-r--r-- | drivers/gdisp/S6D1121/gdisp_lld.c | 6 | ||||
-rw-r--r-- | drivers/gdisp/SSD1289/gdisp_lld.c | 6 | ||||
-rw-r--r-- | drivers/gdisp/SSD1289/gdisp_lld_board_example_fsmc.h | 14 | ||||
-rw-r--r-- | drivers/gdisp/SSD1963/gdisp_lld.c | 18 | ||||
-rw-r--r-- | drivers/gdisp/SSD1963/gdisp_lld_board_example_fsmc.h | 14 | ||||
-rw-r--r-- | drivers/gdisp/SSD2119/gdisp_lld.c | 6 | ||||
-rw-r--r-- | drivers/gdisp/TestStub/gdisp_lld.c | 2 |
14 files changed, 37 insertions, 59 deletions
diff --git a/drivers/gdisp/HX8347D/gdisp_lld.c b/drivers/gdisp/HX8347D/gdisp_lld.c index 8443ca3d..2d9720bc 100644 --- a/drivers/gdisp/HX8347D/gdisp_lld.c +++ b/drivers/gdisp/HX8347D/gdisp_lld.c @@ -13,8 +13,6 @@ * @{
*/
-#include "ch.h"
-#include "hal.h"
#include "gfx.h"
#include "HX8347D.h"
@@ -57,8 +55,8 @@ #define write_ram(color1, color2) { write_index(0x22); write_ram8(color1,color2); }
#define stream_start() { write_index(0x22); spiStart(&SPID1, &spi1cfg2); }
#define stream_stop() {while(((SPI1->SR & SPI_SR_TXE) == 0) || ((SPI1->SR & SPI_SR_BSY) != 0));palSetPad(GPIOA, 4);spiStart(&SPID1, &spi1cfg1); }
-#define delay(us) chThdSleepMicroseconds(us)
-#define delayms(ms) chThdSleepMilliseconds(ms)
+#define delay(us) gfxSleepMicroseconds(us)
+#define delayms(ms) gfxSleepMilliseconds(ms)
static inline void set_cursor(coord_t x, coord_t y) {
write_reg(HX8347D_REG_SCL, (uint8_t) x);
diff --git a/drivers/gdisp/ILI9320/gdisp_lld.c b/drivers/gdisp/ILI9320/gdisp_lld.c index b2e47c22..8c9dbed7 100644 --- a/drivers/gdisp/ILI9320/gdisp_lld.c +++ b/drivers/gdisp/ILI9320/gdisp_lld.c @@ -13,8 +13,6 @@ * @{ */ -#include "ch.h" -#include "hal.h" #include "gfx.h" #if GFX_USE_GDISP /*|| defined(__DOXYGEN__)*/ @@ -66,7 +64,7 @@ uint32_t DISPLAY_CODE; /* Driver local functions. */ /*===========================================================================*/ static inline void lld_lcdDelay(uint16_t us) { - chThdSleepMicroseconds(us); + gfxSleepMicroseconds(us); } static inline void lld_lcdWriteIndex(uint16_t index) { diff --git a/drivers/gdisp/ILI9325/gdisp_lld.c b/drivers/gdisp/ILI9325/gdisp_lld.c index 1603b0b0..4ca5fe78 100644 --- a/drivers/gdisp/ILI9325/gdisp_lld.c +++ b/drivers/gdisp/ILI9325/gdisp_lld.c @@ -13,8 +13,6 @@ * @{ */ -#include "ch.h" -#include "hal.h" #include "gfx.h" #if GFX_USE_GDISP /*|| defined(__DOXYGEN__)*/ @@ -64,7 +62,7 @@ uint32_t DISPLAY_CODE; /* Driver local functions. */ /*===========================================================================*/ static inline void lld_lcdDelay(uint16_t us) { - chThdSleepMicroseconds(us); + gfxSleepMicroseconds(us); } static inline void lld_lcdWriteIndex(uint16_t index) { diff --git a/drivers/gdisp/ILI9481/gdisp_lld.c b/drivers/gdisp/ILI9481/gdisp_lld.c index 2534dcbd..47e5f679 100644 --- a/drivers/gdisp/ILI9481/gdisp_lld.c +++ b/drivers/gdisp/ILI9481/gdisp_lld.c @@ -14,8 +14,6 @@ * @{ */ -#include "ch.h" -#include "hal.h" #include "gfx.h" #if GFX_USE_GDISP /*|| defined(__DOXYGEN__)*/ @@ -60,8 +58,8 @@ #define write_reg(reg, data) { write_index(reg); write_data(data); } #define stream_start() write_index(0x2C); #define stream_stop() -#define delay(us) chThdSleepMicroseconds(us) -#define delayms(ms) chThdSleepMilliseconds(ms) +#define delay(us) gfxSleepMicroseconds(us) +#define delayms(ms) gfxSleepMilliseconds(ms) static inline void set_cursor(coord_t x, coord_t y) { write_index(0x2A); diff --git a/drivers/gdisp/ILI9481/gdisp_lld_board_example_fsmc.h b/drivers/gdisp/ILI9481/gdisp_lld_board_example_fsmc.h index 7e9ce2b4..51013d87 100644 --- a/drivers/gdisp/ILI9481/gdisp_lld_board_example_fsmc.h +++ b/drivers/gdisp/ILI9481/gdisp_lld_board_example_fsmc.h @@ -45,7 +45,7 @@ static inline void init_board(void) { rccEnableAHB3(RCC_AHB3ENR_FSMCEN, 0); #if defined(GDISP_USE_DMA) && defined(GDISP_DMA_STREAM) - if (dmaStreamAllocate(GDISP_DMA_STREAM, 0, NULL, NULL)) chSysHalt(); + if (dmaStreamAllocate(GDISP_DMA_STREAM, 0, NULL, NULL)) gfxExit(); dmaStreamSetMemory0(GDISP_DMA_STREAM, &GDISP_RAM); dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_DIR_M2M); #endif diff --git a/drivers/gdisp/Nokia6610GE12/gdisp_lld.c b/drivers/gdisp/Nokia6610GE12/gdisp_lld.c index dead6bab..860c3ca3 100644 --- a/drivers/gdisp/Nokia6610GE12/gdisp_lld.c +++ b/drivers/gdisp/Nokia6610GE12/gdisp_lld.c @@ -13,8 +13,6 @@ * @{ */ -#include "ch.h" -#include "hal.h" #include "gfx.h" #if GFX_USE_GDISP /*|| defined(__DOXYGEN__)*/ @@ -67,7 +65,7 @@ #endif // Some macros just to make reading the code easier -#define delayms(ms) chThdSleepMilliseconds(ms) +#define delayms(ms) gfxSleepMilliseconds(ms) #define write_data2(d1, d2) { write_data(d1); write_data(d2); } #define write_data3(d1, d2, d3) { write_data(d1); write_data(d2); write_data(d3); } #define write_cmd1(cmd, d1) { write_cmd(cmd); write_data(d1); } diff --git a/drivers/gdisp/Nokia6610GE8/gdisp_lld.c b/drivers/gdisp/Nokia6610GE8/gdisp_lld.c index c4264bc2..64f65ae7 100644 --- a/drivers/gdisp/Nokia6610GE8/gdisp_lld.c +++ b/drivers/gdisp/Nokia6610GE8/gdisp_lld.c @@ -13,8 +13,6 @@ * @{ */ -#include "ch.h" -#include "hal.h" #include "gfx.h" #if GFX_USE_GDISP /*|| defined(__DOXYGEN__)*/ @@ -72,7 +70,7 @@ #endif // Some macros just to make reading the code easier -#define delayms(ms) chThdSleepMilliseconds(ms) +#define delayms(ms) gfxSleepMilliseconds(ms) #define write_data2(d1, d2) { write_data(d1); write_data(d2); } #define write_data3(d1, d2, d3) { write_data(d1); write_data(d2); write_data(d3); } #define write_data4(d1, d2, d3, d4) { write_data(d1); write_data(d2); write_data(d3); write_data(d4); } diff --git a/drivers/gdisp/S6D1121/gdisp_lld.c b/drivers/gdisp/S6D1121/gdisp_lld.c index a76cdde0..e8099ff6 100644 --- a/drivers/gdisp/S6D1121/gdisp_lld.c +++ b/drivers/gdisp/S6D1121/gdisp_lld.c @@ -13,8 +13,6 @@ * @{ */ -#include "ch.h" -#include "hal.h" #include "gfx.h" #if GFX_USE_GDISP /*|| defined(__DOXYGEN__)*/ @@ -58,8 +56,8 @@ #define write_reg(reg, data) { write_index(reg); write_data(data); } #define stream_start() write_index(0x0022); #define stream_stop() -#define delay(us) chThdSleepMicroseconds(us) -#define delayms(ms) chThdSleepMilliseconds(ms) +#define delay(us) gfxSleepMicroseconds(us) +#define delayms(ms) gfxSleepMilliseconds(ms) static inline void set_cursor(coord_t x, coord_t y) { /* R20h - 8 bit diff --git a/drivers/gdisp/SSD1289/gdisp_lld.c b/drivers/gdisp/SSD1289/gdisp_lld.c index a3daeb88..7b603520 100644 --- a/drivers/gdisp/SSD1289/gdisp_lld.c +++ b/drivers/gdisp/SSD1289/gdisp_lld.c @@ -13,8 +13,6 @@ * @{ */ -#include "ch.h" -#include "hal.h" #include "gfx.h" #if GFX_USE_GDISP /*|| defined(__DOXYGEN__)*/ @@ -54,8 +52,8 @@ #define write_reg(reg, data) { write_index(reg); write_data(data); } #define stream_start() write_index(0x0022); #define stream_stop() -#define delay(us) chThdSleepMicroseconds(us) -#define delayms(ms) chThdSleepMilliseconds(ms) +#define delay(us) gfxSleepMicroseconds(us) +#define delayms(ms) gfxSleepMilliseconds(ms) static inline void set_cursor(coord_t x, coord_t y) { /* Reg 0x004E is an 8 bit value diff --git a/drivers/gdisp/SSD1289/gdisp_lld_board_example_fsmc.h b/drivers/gdisp/SSD1289/gdisp_lld_board_example_fsmc.h index 7223a507..48891078 100644 --- a/drivers/gdisp/SSD1289/gdisp_lld_board_example_fsmc.h +++ b/drivers/gdisp/SSD1289/gdisp_lld_board_example_fsmc.h @@ -1,9 +1,9 @@ -/* - * This file is subject to the terms of the GFX License, v1.0. If a copy of - * the license was not distributed with this file, you can obtain one at: - * - * http://chibios-gfx.com/license.html - */ +/*
+ * This file is subject to the terms of the GFX License, v1.0. If a copy of
+ * the license was not distributed with this file, you can obtain one at:
+ *
+ * http://chibios-gfx.com/license.html
+ */
/**
* @file drivers/gdisp/SSD1289/gdisp_lld_board_example_fsmc.h
@@ -44,7 +44,7 @@ static inline void init_board(void) { rccEnableAHB3(RCC_AHB3ENR_FSMCEN, 0);
#if defined(GDISP_USE_DMA) && defined(GDISP_DMA_STREAM)
- if (dmaStreamAllocate(GDISP_DMA_STREAM, 0, NULL, NULL)) chSysHalt();
+ if (dmaStreamAllocate(GDISP_DMA_STREAM, 0, NULL, NULL)) gfxExit();
dmaStreamSetMemory0(GDISP_DMA_STREAM, &GDISP_RAM);
dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_DIR_M2M);
#endif
diff --git a/drivers/gdisp/SSD1963/gdisp_lld.c b/drivers/gdisp/SSD1963/gdisp_lld.c index 8d12cf60..0a70406c 100644 --- a/drivers/gdisp/SSD1963/gdisp_lld.c +++ b/drivers/gdisp/SSD1963/gdisp_lld.c @@ -13,8 +13,6 @@ * @{ */ -#include "ch.h" -#include "hal.h" #include "gfx.h" #if GFX_USE_GDISP /*|| defined(__DOXYGEN__)*/ @@ -61,7 +59,7 @@ bool_t gdisp_lld_init(void) { init_board(); write_index(SSD1963_SOFT_RESET); - chThdSleepMicroseconds(100); + gfxSleepMicroseconds(100); /* Driver PLL config */ write_index(SSD1963_SET_PLL_MN); @@ -71,14 +69,14 @@ bool_t gdisp_lld_init(void) { write_index(SSD1963_SET_PLL); // Enable PLL write_data(0x01); - chThdSleepMicroseconds(200); + gfxSleepMicroseconds(200); write_index(SSD1963_SET_PLL); // Use PLL write_data(0x03); - chThdSleepMicroseconds(200); + gfxSleepMicroseconds(200); write_index(SSD1963_SOFT_RESET); - chThdSleepMicroseconds(100); + gfxSleepMicroseconds(100); /* Screen size */ write_index(SSD1963_SET_GDISP_MODE); @@ -362,13 +360,13 @@ void gdisp_lld_draw_pixel(coord_t x, coord_t y, color_t color) { switch((gdisp_powermode_t)value) { case powerOff: write_index(SSD1963_EXIT_SLEEP_MODE); // leave sleep mode - chThdSleepMilliseconds(5); + gfxSleepMilliseconds(5); write_index(SSD1963_SET_DISPLAY_OFF); write_index(SSD1963_SET_DEEP_SLEEP); // enter deep sleep mode break; case powerOn: - read_reg(0x0000); chThdSleepMilliseconds(5); // 2x Dummy reads to wake up from deep sleep - read_reg(0x0000); chThdSleepMilliseconds(5); + read_reg(0x0000); gfxSleepMilliseconds(5); // 2x Dummy reads to wake up from deep sleep + read_reg(0x0000); gfxSleepMilliseconds(5); if (GDISP.Powermode != powerSleep) gdisp_lld_init(); write_index(SSD1963_SET_DISPLAY_ON); @@ -377,7 +375,7 @@ void gdisp_lld_draw_pixel(coord_t x, coord_t y, color_t color) { case powerSleep: write_index(SSD1963_SET_DISPLAY_OFF); write_index(SSD1963_ENTER_SLEEP_MODE); // enter sleep mode - chThdSleepMilliseconds(5); + gfxSleepMilliseconds(5); break; default: return; diff --git a/drivers/gdisp/SSD1963/gdisp_lld_board_example_fsmc.h b/drivers/gdisp/SSD1963/gdisp_lld_board_example_fsmc.h index 0e310482..cfb3eb60 100644 --- a/drivers/gdisp/SSD1963/gdisp_lld_board_example_fsmc.h +++ b/drivers/gdisp/SSD1963/gdisp_lld_board_example_fsmc.h @@ -1,9 +1,9 @@ -/* - * This file is subject to the terms of the GFX License, v1.0. If a copy of - * the license was not distributed with this file, you can obtain one at: - * - * http://chibios-gfx.com/license.html - */ +/*
+ * This file is subject to the terms of the GFX License, v1.0. If a copy of
+ * the license was not distributed with this file, you can obtain one at:
+ *
+ * http://chibios-gfx.com/license.html
+ */
/**
* @file drivers/gdisp/SSD1289/gdisp_lld_board_example_fsmc.h
@@ -76,7 +76,7 @@ static inline void init_board(void) { rccEnableAHB3(RCC_AHB3ENR_FSMCEN, 0);
#if defined(GDISP_USE_DMA) && defined(GDISP_DMA_STREAM)
- if (dmaStreamAllocate(GDISP_DMA_STREAM, 0, NULL, NULL)) chSysHalt();
+ if (dmaStreamAllocate(GDISP_DMA_STREAM, 0, NULL, NULL)) gfxExit();
dmaStreamSetMemory0(GDISP_DMA_STREAM, &GDISP_RAM);
dmaStreamSetMode(GDISP_DMA_STREAM, STM32_DMA_CR_PL(0) | STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD | STM32_DMA_CR_DIR_M2M);
#endif
diff --git a/drivers/gdisp/SSD2119/gdisp_lld.c b/drivers/gdisp/SSD2119/gdisp_lld.c index 282331cf..565edc1a 100644 --- a/drivers/gdisp/SSD2119/gdisp_lld.c +++ b/drivers/gdisp/SSD2119/gdisp_lld.c @@ -13,8 +13,6 @@ * @{ */ -#include "ch.h" -#include "hal.h" #include "gfx.h" #include "ssd2119.h" @@ -56,8 +54,8 @@ #define write_reg(reg, data) { write_index(reg); write_data(data); } #define stream_start() write_index(SSD2119_REG_RAM_DATA); #define stream_stop() -#define delay(us) chThdSleepMicroseconds(us) -#define delayms(ms) chThdSleepMilliseconds(ms) +#define delay(us) gfxSleepMicroseconds(us) +#define delayms(ms) gfxSleepMilliseconds(ms) static inline void set_cursor(coord_t x, coord_t y) { /* Reg SSD2119_REG_X_RAM_ADDR is 9 bit value diff --git a/drivers/gdisp/TestStub/gdisp_lld.c b/drivers/gdisp/TestStub/gdisp_lld.c index ecb23862..ccc8074b 100644 --- a/drivers/gdisp/TestStub/gdisp_lld.c +++ b/drivers/gdisp/TestStub/gdisp_lld.c @@ -13,8 +13,6 @@ * @{ */ -#include "ch.h" -#include "hal.h" #include "gfx.h" #if GFX_USE_GDISP /*|| defined(__DOXYGEN__)*/ |