diff options
author | inmarket <andrewh@inmarket.com.au> | 2013-05-25 01:26:52 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2013-05-25 01:26:52 +1000 |
commit | 7fbfde42aabbcd30cffba2fba35158236c0a6c6c (patch) | |
tree | e85c90a4f21974b706315d64209021e0b2bde764 /drivers | |
parent | 42006a67b5ccfd86f30d8a91cc474681c437eaf6 (diff) | |
download | uGFX-7fbfde42aabbcd30cffba2fba35158236c0a6c6c.tar.gz uGFX-7fbfde42aabbcd30cffba2fba35158236c0a6c6c.tar.bz2 uGFX-7fbfde42aabbcd30cffba2fba35158236c0a6c6c.zip |
GOS module, for operating system independance
GMISC fast floating point trig
GMISC fast fixed point trig
Diffstat (limited to 'drivers')
27 files changed, 95 insertions, 137 deletions
diff --git a/drivers/gadc/AT91SAM7/gadc_lld.c b/drivers/gadc/AT91SAM7/gadc_lld.c index 00af65a5..3425cbf0 100644 --- a/drivers/gadc/AT91SAM7/gadc_lld.c +++ b/drivers/gadc/AT91SAM7/gadc_lld.c @@ -14,8 +14,6 @@ * @{ */ -#include "ch.h" -#include "hal.h" #include "gfx.h" #if GFX_USE_GADC diff --git a/drivers/gaudin/gadc/gaudin_lld.c b/drivers/gaudin/gadc/gaudin_lld.c index 42b4aafc..db7a2bb2 100644 --- a/drivers/gaudin/gadc/gaudin_lld.c +++ b/drivers/gaudin/gadc/gaudin_lld.c @@ -13,8 +13,6 @@ * * @{ */ -#include "ch.h" -#include "hal.h" /** * We are now implementing the driver - pull in our channel table 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__)*/ diff --git a/drivers/ginput/dial/GADC/ginput_lld_dial.c b/drivers/ginput/dial/GADC/ginput_lld_dial.c index e9dc8a3f..96ac8675 100644 --- a/drivers/ginput/dial/GADC/ginput_lld_dial.c +++ b/drivers/ginput/dial/GADC/ginput_lld_dial.c @@ -14,8 +14,6 @@ * @{ */ -#include "ch.h" -#include "hal.h" #include "gfx.h" #if GFX_USE_GINPUT && GINPUT_NEED_DIAL diff --git a/drivers/ginput/toggle/Pal/ginput_lld_toggle.c b/drivers/ginput/toggle/Pal/ginput_lld_toggle.c index 9797b3c5..038253a4 100644 --- a/drivers/ginput/toggle/Pal/ginput_lld_toggle.c +++ b/drivers/ginput/toggle/Pal/ginput_lld_toggle.c @@ -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/ginput/toggle/Pal/ginput_lld_toggle.c
@@ -14,8 +14,6 @@ * @{
*/
-#include "ch.h"
-#include "hal.h"
#include "gfx.h"
#if (GFX_USE_GINPUT && GINPUT_NEED_TOGGLE) /*|| defined(__DOXYGEN__)*/
diff --git a/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c b/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c index ed4a3c32..7fedaa63 100644 --- a/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c +++ b/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c @@ -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/ginput/touch/ADS7843/ginput_lld_mouse.c
@@ -14,8 +14,6 @@ * @{
*/
-#include "ch.h"
-#include "hal.h"
#include "gfx.h"
#if (GFX_USE_GINPUT && GINPUT_NEED_MOUSE) /*|| defined(__DOXYGEN__)*/
diff --git a/drivers/ginput/touch/MCU/ginput_lld_mouse.c b/drivers/ginput/touch/MCU/ginput_lld_mouse.c index 7289f077..a5588b57 100644 --- a/drivers/ginput/touch/MCU/ginput_lld_mouse.c +++ b/drivers/ginput/touch/MCU/ginput_lld_mouse.c @@ -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/ginput/touch/MCU/ginput_lld_mouse.c
@@ -15,8 +15,6 @@ * @{
*/
-#include "ch.h"
-#include "hal.h"
#include "gfx.h"
#if (GFX_USE_GINPUT && GINPUT_NEED_MOUSE) /*|| defined(__DOXYGEN__)*/
diff --git a/drivers/ginput/touch/MCU/ginput_lld_mouse_board_olimex_stm32_lcd.h b/drivers/ginput/touch/MCU/ginput_lld_mouse_board_olimex_stm32_lcd.h index dddd4a7c..49a86380 100644 --- a/drivers/ginput/touch/MCU/ginput_lld_mouse_board_olimex_stm32_lcd.h +++ b/drivers/ginput/touch/MCU/ginput_lld_mouse_board_olimex_stm32_lcd.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/ginput/touch/MCU/ginput_lld_mouse_board_olimex_stm32_lcd.h
@@ -105,13 +105,13 @@ static inline uint16_t read_x_value(void) { palSetPad(GPIOC, 2);
palClearPad(GPIOC, 3);
- chThdSleepMilliseconds(1);
+ gfxSleepMilliseconds(1);
adcConvert(&ADCD1, &adc_x_config, samples, ADC_BUF_DEPTH);
val1 = ((samples[0] + samples[1])/2);
palClearPad(GPIOC, 2);
palSetPad(GPIOC, 3);
- chThdSleepMilliseconds(1);
+ gfxSleepMilliseconds(1);
adcConvert(&ADCD1, &adc_x_config, samples, ADC_BUF_DEPTH);
val2 = ((samples[0] + samples[1])/2);
@@ -135,13 +135,13 @@ static inline uint16_t read_y_value(void) { palSetPad(GPIOC, 1);
palClearPad(GPIOC, 0);
- chThdSleepMilliseconds(1);
+ gfxSleepMilliseconds(1);
adcConvert(&ADCD1, &adc_y_config, samples, ADC_BUF_DEPTH);
val1 = ((samples[0] + samples[1])/2);
palClearPad(GPIOC, 1);
palSetPad(GPIOC, 0);
- chThdSleepMilliseconds(1);
+ gfxSleepMilliseconds(1);
adcConvert(&ADCD1, &adc_y_config, samples, ADC_BUF_DEPTH);
val2 = ((samples[0] + samples[1])/2);
diff --git a/drivers/ginput/touch/STMPE811/ginput_lld_mouse.c b/drivers/ginput/touch/STMPE811/ginput_lld_mouse.c index 88eceb39..be8ed207 100644 --- a/drivers/ginput/touch/STMPE811/ginput_lld_mouse.c +++ b/drivers/ginput/touch/STMPE811/ginput_lld_mouse.c @@ -14,8 +14,6 @@ * @{ */ -#include "ch.h" -#include "hal.h" #include "gfx.h" #include "stmpe811.h" @@ -61,7 +59,7 @@ void ginput_lld_mouse_init(void) init_board(); write_reg(STMPE811_REG_SYS_CTRL1, 1, 0x02); // Software chip reset - chThdSleepMilliseconds(10); + gfxSleepMilliseconds(10); write_reg(STMPE811_REG_SYS_CTRL2, 1, 0x0C); // Temperature sensor clock off, GPIO clock off, touch clock on, ADC clock on #if STMP811_NO_GPIO_IRQPIN @@ -70,7 +68,7 @@ void ginput_lld_mouse_init(void) write_reg(STMPE811_REG_INT_EN, 1, 0x01); // Interrupt on INT pin when touch is detected #endif write_reg(STMPE811_REG_ADC_CTRL1, 1, 0x48); // ADC conversion time = 80 clock ticks, 12-bit ADC, internal voltage refernce - chThdSleepMilliseconds(2); + gfxSleepMilliseconds(2); write_reg(STMPE811_REG_ADC_CTRL2, 1, 0x01); // ADC speed 3.25MHz write_reg(STMPE811_REG_GPIO_AF, 1, 0x00); // GPIO alternate function - OFF diff --git a/drivers/multiple/Win32/gdisp_lld.c b/drivers/multiple/Win32/gdisp_lld.c index e8b55e45..221442ef 100644 --- a/drivers/multiple/Win32/gdisp_lld.c +++ b/drivers/multiple/Win32/gdisp_lld.c @@ -13,8 +13,6 @@ * @{ */ -#include "ch.h" -#include "hal.h" #include "gfx.h" #if GFX_USE_GDISP /*|| defined(__DOXYGEN__)*/ @@ -173,7 +171,7 @@ static LRESULT myWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) mousex = (coord_t)LOWORD(lParam); mousey = (coord_t)HIWORD(lParam); #if GINPUT_MOUSE_POLL_PERIOD == TIME_INFINITE - ginputMouseWakeup(); + ginputMouseWakeupI(); #endif break; #endif diff --git a/drivers/multiple/X/gdisp_lld.c b/drivers/multiple/X/gdisp_lld.c index 139cc420..c431c30c 100644 --- a/drivers/multiple/X/gdisp_lld.c +++ b/drivers/multiple/X/gdisp_lld.c @@ -10,8 +10,6 @@ * @brief GDISP Graphics Driver subsystem low level driver source for X. */ -#include "ch.h" -#include "hal.h" #include "gfx.h" #if GFX_USE_GDISP @@ -119,12 +117,12 @@ static void ProcessEvent(void) { /* this is the X11 thread which keeps track of all events */ #if GDISP_THREAD_CHIBIOS - static WORKING_AREA(waXThread, 1024); - static msg_t ThreadX(void *arg) { + static DECLARESTACK(waXThread, 1024); + static threadreturn_t ThreadX(void *arg) { (void)arg; while(1) { - chThdSleepMilliseconds(100); + gfxSleepMilliseconds(100); while(XPending(dis)) { XNextEvent(dis, &evt); ProcessEvent(); @@ -230,7 +228,7 @@ bool_t gdisp_lld_init(void) ExposureMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask); #if GDISP_THREAD_CHIBIOS - if (!chThdCreateStatic(waXThread, sizeof(waXThread), HIGHPRIO, ThreadX, 0)) { + if (!gfxCreateThread(waXThread, sizeof(waXThread), HIGH_PRIORITY, ThreadX, 0)) { #else if (pthread_attr_init(&thattr) || pthread_attr_setdetachstate(&thattr, PTHREAD_CREATE_DETACHED) diff --git a/drivers/tdisp/HD44780/tdisp_lld.c b/drivers/tdisp/HD44780/tdisp_lld.c index bfe202fc..6ffadc65 100644 --- a/drivers/tdisp/HD44780/tdisp_lld.c +++ b/drivers/tdisp/HD44780/tdisp_lld.c @@ -13,8 +13,6 @@ * @{ */ -#include "ch.h" -#include "hal.h" #include "gfx.h" #if GFX_USE_TDISP /*|| defined(__DOXYGEN__)*/ @@ -70,7 +68,7 @@ bool_t tdisp_lld_init(void) { */ /* Give the LCD a little time to wake up */ - chThdSleepMilliseconds(15); + gfxSleepMilliseconds(15); /* write three times 0x03 to display * with RS = low. @@ -107,20 +105,20 @@ bool_t tdisp_lld_init(void) { /* END OF INITIALISATION */ // /* wait some time */ -// chThdSleepMilliseconds(50); +// gfxSleepMilliseconds(50); // // write_cmd(0x38); -// chThdSleepMilliseconds(64); +// gfxSleepMilliseconds(64); // // displaycontrol = TDISP_DISPLAY_ON | TDISP_CURSOR_ON | TDISP_CURSOR_BLINK; // The default displaycontrol // write_cmd(0x08 | displaycontrol); -// chThdSleepMicroseconds(50); +// gfxSleepMicroseconds(50); // // write_cmd(0x01); // Clear the screen -// chThdSleepMilliseconds(5); +// gfxSleepMilliseconds(5); // // write_cmd(0x06); -// chThdSleepMicroseconds(50); +// gfxSleepMicroseconds(50); return TRUE; } @@ -131,7 +129,7 @@ bool_t tdisp_lld_init(void) { */ void tdisp_lld_clear(void) { write_cmd(0x01); -// chThdSleepMilliseconds(LONG_DELAY_MS); +// gfxSleepMilliseconds(LONG_DELAY_MS); } void tdisp_lld_draw_char(char c) { diff --git a/drivers/tdisp/HD44780/tdisp_lld_board_olimex_e407.h b/drivers/tdisp/HD44780/tdisp_lld_board_olimex_e407.h index 5cc0f9f0..7b1789cf 100644 --- a/drivers/tdisp/HD44780/tdisp_lld_board_olimex_e407.h +++ b/drivers/tdisp/HD44780/tdisp_lld_board_olimex_e407.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/tdisp/HD44780/tdisp_lld_board_olimex_e407.h
@@ -33,9 +33,9 @@ static void init_board(void) { static void writeToLCD(uint8_t data) {
palWritePort(PORT_DATA, data);
palSetPad(PORT_CTRL, PIN_EN);
- chThdSleepMicroseconds(1);
+ gfxSleepMicroseconds(1);
palClearPad(PORT_CTRL, PIN_EN);
- chThdSleepMicroseconds(5);
+ gfxSleepMicroseconds(5);
}
static void write_cmd(uint8_t data) {
diff --git a/drivers/tdisp/HD44780/tdisp_lld_board_st_stm32f4_discovery.h b/drivers/tdisp/HD44780/tdisp_lld_board_st_stm32f4_discovery.h index 84d92a0f..4b7dfacb 100644 --- a/drivers/tdisp/HD44780/tdisp_lld_board_st_stm32f4_discovery.h +++ b/drivers/tdisp/HD44780/tdisp_lld_board_st_stm32f4_discovery.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/tdisp/HD44780/tdisp_lld_board_st_stm32f4_discovery.h
@@ -69,10 +69,10 @@ static void init_board(void) { static void writeToLCD(uint8_t data) {
palWritePort(PORT_DATA, data<<hardware_offset);
palSetPad(PORT_CTRL, PIN_EN);
- chThdSleepMicroseconds(1);
+ gfxSleepMicroseconds(1);
palClearPad(PORT_CTRL, PIN_EN);
/* wait a little while so that de display can process the data */
- chThdSleepMicroseconds(5);
+ gfxSleepMicroseconds(5);
}
/* Writes a command to the display. The
|