From 7c5a6c928fa7129cf754c9c73c5c7ae39372ba9d Mon Sep 17 00:00:00 2001 From: inmarket Date: Sat, 3 Nov 2018 10:51:23 +1000 Subject: For all source files update integer types to the new gI8 etc type names --- drivers/gadc/AT91SAM7/gadc_lld_AT91SAM7.c | 8 +-- drivers/gaudio/Win32/gaudio_play_Win32.c | 6 +- drivers/gaudio/Win32/gaudio_record_Win32.c | 2 +- drivers/gaudio/gadc/gaudio_record_board_template.h | 2 +- drivers/gaudio/gadc/gaudio_record_gadc.c | 2 +- drivers/gaudio/pwm/gaudio_play_board_template.h | 4 +- drivers/gaudio/pwm/gaudio_play_pwm.c | 14 ++-- drivers/gaudio/vs1053/gaudio_play_board_template.h | 4 +- drivers/gaudio/vs1053/gaudio_play_vs1053.c | 52 +++++++-------- .../board_alteraframereader_template.h | 4 +- .../gdisp_lld_alteraframereader.c | 6 +- drivers/gdisp/ED060SC4/board_ED060SC4_example.h | 2 +- drivers/gdisp/ED060SC4/board_ED060SC4_template.h | 2 +- drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c | 16 ++--- drivers/gdisp/Fb24bpp/board_fb24bpp_template.h | 4 +- drivers/gdisp/Fb24bpp/gdisp_lld_fb24bpp.c | 6 +- drivers/gdisp/HX8347D/board_HX8347D_template.h | 8 +-- drivers/gdisp/ILI9225/gdisp_lld_ili9225.c | 2 +- drivers/gdisp/ILI9320/board_ILI9320_template.h | 8 +-- drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c | 6 +- drivers/gdisp/ILI9325/board_ILI9325_template.h | 8 +-- drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c | 6 +- drivers/gdisp/ILI9341/board_ILI9341_template.h | 8 +-- drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c | 14 ++-- drivers/gdisp/ILI9342/gdisp_lld_ILI9342.c | 12 ++-- drivers/gdisp/ILI93xx/board_ILI93xx_template.h | 8 +-- drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c | 6 +- drivers/gdisp/ILI9481/board_ILI9481_template.h | 8 +-- drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c | 6 +- drivers/gdisp/ILI9488/board_ILI9488_template.h | 8 +-- drivers/gdisp/ILI9488/gdisp_lld_ILI9488.c | 4 +- drivers/gdisp/KS0108/board_KS0108_example.h | 40 ++++++------ drivers/gdisp/KS0108/gdisp_lld_KS0108.c | 12 ++-- drivers/gdisp/LGDP4532/board_LGDP4532_template.h | 8 +-- drivers/gdisp/LGDP4532/gdisp_lld_LGDP4532.c | 4 +- .../Nokia6610GE12/board_Nokia6610GE12_template.h | 6 +- .../gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c | 6 +- .../Nokia6610GE8/board_Nokia6610GE8_template.h | 6 +- .../gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c | 22 +++---- drivers/gdisp/PCD8544/board_PCD8544_template.h | 6 +- drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c | 2 +- drivers/gdisp/PCF8812/board_PCF8812_template.h | 4 +- drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c | 2 +- drivers/gdisp/R61505U/board_R61505U_template.h | 8 +-- drivers/gdisp/R61505U/gdisp_lld_R61505U.c | 6 +- drivers/gdisp/RA6963/board_RA6963.h | 16 ++--- drivers/gdisp/RA6963/gdisp_lld_RA6963.c | 32 ++++----- drivers/gdisp/RA8875/board_RA8875_template.h | 6 +- drivers/gdisp/RA8875/gdisp_lld_RA8875.c | 6 +- drivers/gdisp/S6D1121/board_S6D1121_template.h | 8 +-- drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c | 4 +- .../gdisp/SPFD54124B/board_SPFD54124B_template.h | 6 +- drivers/gdisp/SPFD54124B/gdisp_lld_SPFD54124B.c | 10 +-- drivers/gdisp/SSD1289/board_SSD1289_template.h | 8 +-- drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c | 4 +- drivers/gdisp/SSD1306/board_SSD1306_template.h | 4 +- drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c | 10 +-- drivers/gdisp/SSD1322/board_SSD1322_template.h | 6 +- drivers/gdisp/SSD1322/gdisp_lld_SSD1322.c | 6 +- drivers/gdisp/SSD1331/board_SSD1331_template.h | 4 +- drivers/gdisp/SSD1331/gdisp_lld_SSD1331.c | 4 +- drivers/gdisp/SSD1351/board_SSD1351_template.h | 8 +-- drivers/gdisp/SSD1351/gdisp_lld_SSD1351.c | 4 +- drivers/gdisp/SSD1848/board_ssd1848_template.h | 8 +-- drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c | 74 ++++++++++----------- drivers/gdisp/SSD1963/board_SSD1963_template.h | 4 +- drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c | 24 +++---- drivers/gdisp/SSD2119/board_SSD2119_template.h | 8 +-- drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c | 4 +- drivers/gdisp/ST7565/board_ST7565_template.h | 4 +- drivers/gdisp/ST7565/gdisp_lld_ST7565.c | 4 +- drivers/gdisp/ST7735/gdisp_lld_ST7735.c | 4 +- drivers/gdisp/STM32LTDC/board_STM32LTDC_template.h | 2 +- drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c | 76 +++++++++++----------- drivers/gdisp/STM32LTDC/stm32_dma2d.h | 4 +- drivers/gdisp/TLS8204/board_TLS8204_template.h | 6 +- drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c | 4 +- drivers/gdisp/UC1601s/board_UC1601s_template.h | 4 +- drivers/gdisp/UC1601s/gdisp_lld_UC1601s.c | 6 +- drivers/gdisp/UC1610/board_UC1610_template.h | 4 +- drivers/gdisp/UC1610/gdisp_lld_UC1610.c | 12 ++-- drivers/gdisp/UC8173/UC8173_waveform_examples.h | 18 ++--- drivers/gdisp/UC8173/board_UC8173_template.h | 8 +-- drivers/gdisp/UC8173/gdisp_lld_UC8173.c | 36 +++++----- drivers/gdisp/WS29EPD/board_WS29EPD_template.h | 8 +-- drivers/gdisp/WS29EPD/gdisp_lld_WS29EPD.c | 26 ++++---- .../gdisp/framebuffer/board_framebuffer_template.h | 4 +- drivers/ginput/dial/GADC/ginput_lld_dial_GADC.c | 2 +- .../ADS7843/gmouse_lld_ADS7843_board_template.h | 2 +- drivers/ginput/touch/EXC7200/gmouse_lld_EXC7200.c | 2 +- .../EXC7200/gmouse_lld_EXC7200_board_template.h | 6 +- .../FT5336/gmouse_lld_FT5336_board_template.h | 10 +-- .../FT5x06/gmouse_lld_FT5x06_board_template.h | 6 +- .../FT6x06/gmouse_lld_FT6x06_board_template.h | 6 +- .../ginput/touch/MAX11802/gmouse_lld_MAX11802.c | 12 ++-- .../MAX11802/gmouse_lld_MAX11802_board_template.h | 6 +- drivers/ginput/touch/QWidget/example/mywidget.cpp | 2 +- drivers/ginput/touch/QWidget/gmouse_lld_QWidget.c | 2 +- .../ginput/touch/STMPE610/gmouse_lld_STMPE610.c | 2 +- .../STMPE610/gmouse_lld_STMPE610_board_template.h | 6 +- .../ginput/touch/STMPE811/gmouse_lld_STMPE811.c | 2 +- .../STMPE811/gmouse_lld_STMPE811_board_template.h | 6 +- drivers/multiple/SDL/gdisp_lld_SDL.c | 28 ++++---- drivers/multiple/Win32/gdisp_lld_Win32.c | 24 +++---- drivers/multiple/Win32/gdisp_lld_config.h | 4 +- drivers/multiple/X/gdisp_lld_X.c | 12 ++-- drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c | 34 +++++----- .../uGFXnetESP8266/gdisp_lld_uGFXnetESP8266.cpp | 38 +++++------ 108 files changed, 544 insertions(+), 544 deletions(-) (limited to 'drivers') diff --git a/drivers/gadc/AT91SAM7/gadc_lld_AT91SAM7.c b/drivers/gadc/AT91SAM7/gadc_lld_AT91SAM7.c index 94f48326..630ef5c7 100644 --- a/drivers/gadc/AT91SAM7/gadc_lld_AT91SAM7.c +++ b/drivers/gadc/AT91SAM7/gadc_lld_AT91SAM7.c @@ -16,7 +16,7 @@ #include "../../../src/gadc/gadc_driver.h" -static uint32_t nextfreq; +static gU32 nextfreq; // Forward references to ISR routines static void ISR_CompleteI(ADCDriver *adcp, adcsample_t *buffer, size_t n); @@ -50,8 +50,8 @@ void gadc_lld_init(void) { adcStart(&ADCD1, 0); } -size_t gadc_lld_samplesperconversion(uint32_t physdev) { - size_t samples; +gMemSize gadc_lld_samplesperconversion(gU32 physdev) { + gMemSize samples; for(samples = 0; physdev; physdev >>= 1) if (physdev & 0x01) @@ -59,7 +59,7 @@ size_t gadc_lld_samplesperconversion(uint32_t physdev) { return samples; } -void gadc_lld_start_timerI(uint32_t frequency) { +void gadc_lld_start_timerI(gU32 frequency) { // Nothing to do here - the AT91SAM7 adc driver uses an internal timer // which is set up when the job is started. We save this here just to // indicate the timer should be re-initialised on the next timer job diff --git a/drivers/gaudio/Win32/gaudio_play_Win32.c b/drivers/gaudio/Win32/gaudio_play_Win32.c index a59544fa..8cf024c6 100644 --- a/drivers/gaudio/Win32/gaudio_play_Win32.c +++ b/drivers/gaudio/Win32/gaudio_play_Win32.c @@ -122,7 +122,7 @@ static DWORD WINAPI waveProc(LPVOID arg) { /* External declarations. */ /*===========================================================================*/ -gBool gaudio_play_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat format) { +gBool gaudio_play_lld_init(gU16 channel, gU32 frequency, ArrayDataFormat format) { WAVEFORMATEX wfx; if (format != ARRAY_DATA_8BITUNSIGNED && format != ARRAY_DATA_16BITSIGNED) @@ -156,10 +156,10 @@ gBool gaudio_play_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat return gTrue; } -gBool gaudio_play_lld_set_volume(uint8_t vol) { +gBool gaudio_play_lld_set_volume(gU8 vol) { if (!ah) return gFalse; - return waveOutSetVolume(ah, (((uint16_t)vol)<<8)|vol) != 0; + return waveOutSetVolume(ah, (((gU16)vol)<<8)|vol) != 0; } void gaudio_play_lld_start(void) { diff --git a/drivers/gaudio/Win32/gaudio_record_Win32.c b/drivers/gaudio/Win32/gaudio_record_Win32.c index 13c9495e..e30fde1b 100644 --- a/drivers/gaudio/Win32/gaudio_record_Win32.c +++ b/drivers/gaudio/Win32/gaudio_record_Win32.c @@ -124,7 +124,7 @@ static DWORD WINAPI waveProc(LPVOID arg) { /* External declarations. */ /*===========================================================================*/ -gBool gaudio_record_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat format) { +gBool gaudio_record_lld_init(gU16 channel, gU32 frequency, ArrayDataFormat format) { WAVEFORMATEX wfx; if (format != ARRAY_DATA_8BITUNSIGNED && format != ARRAY_DATA_16BITSIGNED) diff --git a/drivers/gaudio/gadc/gaudio_record_board_template.h b/drivers/gaudio/gadc/gaudio_record_board_template.h index d42988ba..d8b8e6b3 100644 --- a/drivers/gaudio/gadc/gaudio_record_board_template.h +++ b/drivers/gaudio/gadc/gaudio_record_board_template.h @@ -19,7 +19,7 @@ #define GAUDIO_RECORD_MICROPHONE 0 #ifdef GAUDIO_RECORD_LLD_IMPLEMENTATION - static uint32_t gaudio_gadc_physdevs[GAUDIO_RECORD_NUM_CHANNELS] = { + static gU32 gaudio_gadc_physdevs[GAUDIO_RECORD_NUM_CHANNELS] = { GADC_PHYSDEV_MICROPHONE, }; #endif diff --git a/drivers/gaudio/gadc/gaudio_record_gadc.c b/drivers/gaudio/gadc/gaudio_record_gadc.c index 31b51ebe..b00da3cf 100644 --- a/drivers/gaudio/gadc/gaudio_record_gadc.c +++ b/drivers/gaudio/gadc/gaudio_record_gadc.c @@ -30,7 +30,7 @@ static void gadcCallbackI(void) { /* External declarations. */ /*===========================================================================*/ -gBool gaudio_record_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat format) { +gBool gaudio_record_lld_init(gU16 channel, gU32 frequency, ArrayDataFormat format) { /* Check the parameters */ if (channel >= GAUDIO_RECORD_NUM_CHANNELS || frequency > GAUDIO_RECORD_MAX_SAMPLE_FREQUENCY || format != GAUDIO_RECORD_FORMAT1) return gFalse; diff --git a/drivers/gaudio/pwm/gaudio_play_board_template.h b/drivers/gaudio/pwm/gaudio_play_board_template.h index 4e3e3bb1..86c4ea8a 100644 --- a/drivers/gaudio/pwm/gaudio_play_board_template.h +++ b/drivers/gaudio/pwm/gaudio_play_board_template.h @@ -15,7 +15,7 @@ * */ -static gBool gaudio_play_pwm_setup(uint32_t frequency, ArrayDataFormat format) { +static gBool gaudio_play_pwm_setup(gU32 frequency, ArrayDataFormat format) { /* Initialise the PWM - use a midpoint value for the initial PWM value */ /* Initialise the timer interrupt @ frequency */ /* Return gFalse if any parameter invalid */ @@ -31,7 +31,7 @@ static void gaudio_play_pwm_stop(void) { /* Stop the PWM */ } -static void gaudio_play_pwm_setI(uint16_t value) { +static void gaudio_play_pwm_setI(gU16 value) { /* Set the PWM value */ } diff --git a/drivers/gaudio/pwm/gaudio_play_pwm.c b/drivers/gaudio/pwm/gaudio_play_pwm.c index 57541470..899ea793 100644 --- a/drivers/gaudio/pwm/gaudio_play_pwm.c +++ b/drivers/gaudio/pwm/gaudio_play_pwm.c @@ -20,15 +20,15 @@ static void gaudio_play_pwm_timer_callbackI(void); static GDataBuffer *pplay; static ArrayDataFormat playfmt; -static size_t playlen; -static uint8_t *pdata; +static gMemSize playlen; +static gU8 *pdata; static void gaudio_play_pwm_timer_callbackI(void) { if (pplay) { // Get the next value from the current data buffer if (gfxSampleFormatBits(playfmt) > 8) { - gaudio_play_pwm_setI(*(uint16_t *)pdata); + gaudio_play_pwm_setI(*(gU16 *)pdata); pdata += 2; } else { gaudio_play_pwm_setI(*pdata); @@ -57,7 +57,7 @@ static void gaudio_play_pwm_timer_callbackI(void) { playlen = pplay->len; if (gfxSampleFormatBits(playfmt) > 8) playlen >>= 1; - pdata = (uint8_t *)(pplay+1); + pdata = (gU8 *)(pplay+1); } @@ -65,7 +65,7 @@ static void gaudio_play_pwm_timer_callbackI(void) { /* External declarations. */ /*===========================================================================*/ -gBool gaudio_play_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat format) { +gBool gaudio_play_lld_init(gU16 channel, gU32 frequency, ArrayDataFormat format) { (void) channel; if (format != ARRAY_DATA_8BITUNSIGNED && format != ARRAY_DATA_10BITUNSIGNED) @@ -75,7 +75,7 @@ gBool gaudio_play_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat return gaudio_play_pwm_setup(frequency, format); } -gBool gaudio_play_lld_set_volume(uint8_t vol) { +gBool gaudio_play_lld_set_volume(gU8 vol) { (void) vol; return gFalse; } @@ -93,7 +93,7 @@ void gaudio_play_lld_start(void) { playlen = pplay->len; if (gfxSampleFormatBits(playfmt) > 8) playlen >>= 1; - pdata = (uint8_t *)(pplay+1); + pdata = (gU8 *)(pplay+1); gfxSystemUnlock(); // Start the playing diff --git a/drivers/gaudio/vs1053/gaudio_play_board_template.h b/drivers/gaudio/vs1053/gaudio_play_board_template.h index 3c011254..0c06c4c9 100644 --- a/drivers/gaudio/vs1053/gaudio_play_board_template.h +++ b/drivers/gaudio/vs1053/gaudio_play_board_template.h @@ -59,12 +59,12 @@ static void board_enddatawrite(void) { } // Write data to the SPI port -static void board_spiwrite(const uint8_t *buf, unsigned len) { +static void board_spiwrite(const gU8 *buf, unsigned len) { } // Read data from the SPI port -static void board_spiread(uint8_t *buf, unsigned len) { +static void board_spiread(gU8 *buf, unsigned len) { } diff --git a/drivers/gaudio/vs1053/gaudio_play_vs1053.c b/drivers/gaudio/vs1053/gaudio_play_vs1053.c index 8cf0dcd7..1e88be4c 100644 --- a/drivers/gaudio/vs1053/gaudio_play_vs1053.c +++ b/drivers/gaudio/vs1053/gaudio_play_vs1053.c @@ -32,7 +32,7 @@ // Load the patch file if desired. New format patches only. #if VS1053_FIRMWARE_PATCH #define SKIP_PLUGIN_VARNAME - static const uint16_t plugin[] = { /* Compressed plugin */ + static const gU16 plugin[] = { /* Compressed plugin */ #include "vs1053_patch.plg" }; #endif @@ -67,7 +67,7 @@ static GTimer playTimer; // Some common macro's #define waitforready() while(!board_dreq()) gfxSleepMilliseconds(5) -static void cmd_write(uint16_t addr, uint16_t data) { +static void cmd_write(gU16 addr, gU16 data) { char buf[4]; buf[0] = 2; buf[1] = (char)addr; @@ -81,14 +81,14 @@ static void cmd_write(uint16_t addr, uint16_t data) { } #if VS1053_CLK > 12288000 - static GFXINLINE void cmd_writenodreq(uint16_t addr, uint16_t data) { - uint8_t buf[4]; + static GFXINLINE void cmd_writenodreq(gU16 addr, gU16 data) { + gU8 buf[4]; // This is the same as cmd_write() except for it doesn't wait for dreq first buf[0] = 2; - buf[1] = (uint8_t)addr; - buf[2] = (uint8_t)(data >> 8); - buf[3] = (uint8_t)data; + buf[1] = (gU8)addr; + buf[2] = (gU8)(data >> 8); + buf[3] = (gU8)data; board_startcmdwrite(); board_spiwrite(buf, 4); @@ -96,8 +96,8 @@ static void cmd_write(uint16_t addr, uint16_t data) { } #endif -static uint16_t cmd_read(uint16_t addr) { - uint8_t buf[2]; +static gU16 cmd_read(gU16 addr) { + gU8 buf[2]; buf[0] = 3; buf[1] = (char)addr; @@ -106,10 +106,10 @@ static uint16_t cmd_read(uint16_t addr) { board_spiwrite(buf, 2); board_spiread(buf, 2); board_endcmdread(); - return (((uint16_t)buf[0])<<8)|buf[1]; + return (((gU16)buf[0])<<8)|buf[1]; } -static void data_write(const uint8_t *data, unsigned len) { +static void data_write(const gU8 *data, unsigned len) { board_startdatawrite(); board_spiwrite(data, len); board_enddatawrite(); @@ -118,7 +118,7 @@ static void data_write(const uint8_t *data, unsigned len) { #if VS1053_FIRMWARE_PATCH static void LoadUserCode(void) { int i; - uint16_t addr, n, val; + gU16 addr, n, val; for(i=0; ilen; - pdata = (uint8_t *)(pplay+1); + pdata = (gU8 *)(pplay+1); gfxSystemUnlock(); } } @@ -228,11 +228,11 @@ static void FeedData(void *param) { /* External declarations. */ /*===========================================================================*/ -gBool gaudio_play_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat format) { - uint32_t brate; - uint32_t bps; - uint8_t buf[4]; - static const uint8_t hdr1[] = { +gBool gaudio_play_lld_init(gU16 channel, gU32 frequency, ArrayDataFormat format) { + gU32 brate; + gU32 bps; + gU8 buf[4]; + static const gU8 hdr1[] = { 'R', 'I', 'F', 'F', 0xFF, 0xFF, 0xFF, 0xFF, 'W', 'A', 'V', 'E', @@ -240,7 +240,7 @@ gBool gaudio_play_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat 16, 0, 0, 0, 0x01, 0x00, }; - static const uint8_t hdr2[] = { + static const gU8 hdr2[] = { 'd', 'a', 't', 'a', 0xFF, 0xFF, 0xFF, 0xFF, }; @@ -277,8 +277,8 @@ gBool gaudio_play_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat return gTrue; } -gBool gaudio_play_lld_set_volume(uint8_t vol) { - uint16_t tmp; +gBool gaudio_play_lld_set_volume(gU8 vol) { + gU16 tmp; // Volume is 0xFE -> 0x00. Adjust vol to match vol = ~vol; @@ -305,7 +305,7 @@ void gaudio_play_lld_start(void) { // Set up ready for the new buffer playlen = pplay->len; - pdata = (uint8_t *)(pplay+1); + pdata = (gU8 *)(pplay+1); gfxSystemUnlock(); // Start the playing by starting the timer and executing FeedData immediately just to get things started @@ -315,7 +315,7 @@ void gaudio_play_lld_start(void) { } void gaudio_play_lld_stop(void) { - uint8_t ch; + gU8 ch; unsigned i; // Stop the timer interrupt diff --git a/drivers/gdisp/AlteraFramereader/board_alteraframereader_template.h b/drivers/gdisp/AlteraFramereader/board_alteraframereader_template.h index c63e9083..e319ad85 100644 --- a/drivers/gdisp/AlteraFramereader/board_alteraframereader_template.h +++ b/drivers/gdisp/AlteraFramereader/board_alteraframereader_template.h @@ -10,13 +10,13 @@ #define FRAMEREADER_BASE ALT_VIP_VFR_0_BASE #if GDISP_NEED_CONTROL - static void board_backlight(GDisplay* g, uint8_t percent) + static void board_backlight(GDisplay* g, gU8 percent) { (void)g; (void)percent; } - static void board_contrast(GDisplay* g, uint8_t percent) + static void board_contrast(GDisplay* g, gU8 percent) { (void)g; (void)percent; diff --git a/drivers/gdisp/AlteraFramereader/gdisp_lld_alteraframereader.c b/drivers/gdisp/AlteraFramereader/gdisp_lld_alteraframereader.c index 848948c6..c510b1a9 100644 --- a/drivers/gdisp/AlteraFramereader/gdisp_lld_alteraframereader.c +++ b/drivers/gdisp/AlteraFramereader/gdisp_lld_alteraframereader.c @@ -73,7 +73,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) IOWR(ALT_VIP_VFR_0_BASE, 0x00, 0x00); // stop for config // Frame 0 - IOWR(ALT_VIP_VFR_0_BASE, 0x04, (uint32_t)PRIV(g)->frame0); + IOWR(ALT_VIP_VFR_0_BASE, 0x04, (gU32)PRIV(g)->frame0); IOWR(ALT_VIP_VFR_0_BASE, 0x05, SCREEN_WIDTH*SCREEN_HEIGHT/2); IOWR(ALT_VIP_VFR_0_BASE, 0x06, SCREEN_WIDTH*SCREEN_HEIGHT); IOWR(ALT_VIP_VFR_0_BASE, 0x08, SCREEN_WIDTH); @@ -81,7 +81,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) IOWR(ALT_VIP_VFR_0_BASE, 0x0a, 0x00); // Frame 1 - IOWR(ALT_VIP_VFR_0_BASE, 0x0b, (uint32_t)PRIV(g)->frame1); + IOWR(ALT_VIP_VFR_0_BASE, 0x0b, (gU32)PRIV(g)->frame1); IOWR(ALT_VIP_VFR_0_BASE, 0x0c, SCREEN_WIDTH*SCREEN_HEIGHT/2); IOWR(ALT_VIP_VFR_0_BASE, 0x0d, SCREEN_WIDTH*SCREEN_HEIGHT); IOWR(ALT_VIP_VFR_0_BASE, 0x0f, SCREEN_WIDTH); @@ -244,7 +244,7 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g) unsigned int addr; int bytes_per_line; int bytes_per_pixel; - uint8_t* line; + gU8* line; // Calculate some values required for further calculations bytes_per_pixel = ((fbPriv*)g->priv)->linelen/g->g.Width; // must be 4 diff --git a/drivers/gdisp/ED060SC4/board_ED060SC4_example.h b/drivers/gdisp/ED060SC4/board_ED060SC4_example.h index 96dd8be2..13311089 100644 --- a/drivers/gdisp/ED060SC4/board_ED060SC4_example.h +++ b/drivers/gdisp/ED060SC4/board_ED060SC4_example.h @@ -105,7 +105,7 @@ static GFXINLINE void setpin_sph(gBool on) { } /* Set the state of the D0-D7 (source driver Data) pins. */ -static GFXINLINE void setpins_data(uint8_t value) { +static GFXINLINE void setpins_data(gU8 value) { palWriteGroup(GPIOB, 0xFF, GPIOB_EINK_D0, value); } diff --git a/drivers/gdisp/ED060SC4/board_ED060SC4_template.h b/drivers/gdisp/ED060SC4/board_ED060SC4_template.h index 93e6d23b..65f77095 100644 --- a/drivers/gdisp/ED060SC4/board_ED060SC4_template.h +++ b/drivers/gdisp/ED060SC4/board_ED060SC4_template.h @@ -89,7 +89,7 @@ static GFXINLINE void setpin_sph(GDisplay *g, gBool on) { (void) on; } -static GFXINLINE void setpins_data(GDisplay *g, uint8_t value) { +static GFXINLINE void setpins_data(GDisplay *g, gU8 value) { (void) g; (void) value; } diff --git a/drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c b/drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c index ba1baee8..b5d1e08b 100644 --- a/drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c +++ b/drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c @@ -200,7 +200,7 @@ static void hscan_start(GDisplay *g) } /* Write data to the horizontal row. */ -static void hscan_write(GDisplay *g, const uint8_t *data, int count) +static void hscan_write(GDisplay *g, const gU8 *data, int count) { while (count--) { @@ -317,18 +317,18 @@ static void power_off(GDisplay *g) /* Buffers that store the data for a small area of the display. */ typedef struct { - uint8_t data[EINK_BLOCKHEIGHT][WIDTH_BYTES]; + gU8 data[EINK_BLOCKHEIGHT][WIDTH_BYTES]; } block_t; typedef struct drvPriv { - uint8_t g_next_block; /* Index of the next free block buffer. */ + gU8 g_next_block; /* Index of the next free block buffer. */ block_t g_blocks[EINK_NUMBUFFERS]; /* Map that stores the buffers associated to each area of the display. * Value of 0 means that the block is not allocated. * Other values are the index in g_blocks + 1. */ - uint8_t g_blockmap[BLOCKS_Y][BLOCKS_X]; + gU8 g_blockmap[BLOCKS_Y][BLOCKS_X]; } drvPriv; /* Check if the row contains any allocated blocks. */ @@ -358,7 +358,7 @@ static void write_block_row(GDisplay *g, unsigned by) { for (dx = 0; dx < WIDTH_BYTES; dx++) { - const uint8_t dummy = 0; + const gU8 dummy = 0; hscan_write(g, &dummy, 1); } } @@ -483,9 +483,9 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_DRAWPIXEL void gdisp_lld_draw_pixel(GDisplay *g) { block_t *block; - uint8_t byte; + gU8 byte; unsigned bx, by, dx, dy; - uint8_t bitpos; + gU8 bitpos; switch(g->g.Orientation) { default: @@ -583,7 +583,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_CLEARS static void subclear(GDisplay *g, gColor color) { unsigned x, y; - uint8_t byte; + gU8 byte; hscan_start(g); byte = color ? BYTE_WHITE : BYTE_BLACK; diff --git a/drivers/gdisp/Fb24bpp/board_fb24bpp_template.h b/drivers/gdisp/Fb24bpp/board_fb24bpp_template.h index 45029f5b..0d1d10dd 100644 --- a/drivers/gdisp/Fb24bpp/board_fb24bpp_template.h +++ b/drivers/gdisp/Fb24bpp/board_fb24bpp_template.h @@ -35,13 +35,13 @@ #endif #if GDISP_NEED_CONTROL - static void board_backlight(GDisplay *g, uint8_t percent) { + static void board_backlight(GDisplay *g, gU8 percent) { // TODO: Can be an empty function if your hardware doesn't support this (void) g; (void) percent; } - static void board_contrast(GDisplay *g, uint8_t percent) { + static void board_contrast(GDisplay *g, gU8 percent) { // TODO: Can be an empty function if your hardware doesn't support this (void) g; (void) percent; diff --git a/drivers/gdisp/Fb24bpp/gdisp_lld_fb24bpp.c b/drivers/gdisp/Fb24bpp/gdisp_lld_fb24bpp.c index 28ef8336..f16c2294 100644 --- a/drivers/gdisp/Fb24bpp/gdisp_lld_fb24bpp.c +++ b/drivers/gdisp/Fb24bpp/gdisp_lld_fb24bpp.c @@ -33,7 +33,7 @@ typedef struct fbPriv { /*===========================================================================*/ #define PIXIL_POS(g, x, y) ((y) * ((fbPriv *)(g)->priv)->fbi.linelen + (x) * 3) -#define PIXEL_ADDR(g, pos) (((uint8_t *)((fbPriv *)(g)->priv)->fbi.pixels)+pos) +#define PIXEL_ADDR(g, pos) (((gU8 *)((fbPriv *)(g)->priv)->fbi.pixels)+pos) /*===========================================================================*/ /* Driver exported functions. */ @@ -64,7 +64,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { unsigned pos; - uint8_t *p; + gU8 *p; #if GDISP_NEED_CONTROL switch(g->g.Orientation) { @@ -101,7 +101,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) { unsigned pos; - uint8_t *p; + gU8 *p; #if GDISP_NEED_CONTROL switch(g->g.Orientation) { diff --git a/drivers/gdisp/HX8347D/board_HX8347D_template.h b/drivers/gdisp/HX8347D/board_HX8347D_template.h index 9d21f8ba..23e1b23c 100644 --- a/drivers/gdisp/HX8347D/board_HX8347D_template.h +++ b/drivers/gdisp/HX8347D/board_HX8347D_template.h @@ -21,7 +21,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -42,17 +42,17 @@ static GFXINLINE void busmode8(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint8_t index) { +static GFXINLINE void write_index(GDisplay *g, gU8 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint8_t data) { +static GFXINLINE void write_data(GDisplay *g, gU8 data) { (void) g; (void) data; } -static GFXINLINE void write_ram16(GDisplay *g, uint16_t data) { +static GFXINLINE void write_ram16(GDisplay *g, gU16 data) { (void) g; (void) data; } diff --git a/drivers/gdisp/ILI9225/gdisp_lld_ili9225.c b/drivers/gdisp/ILI9225/gdisp_lld_ili9225.c index d1e71689..bf32280f 100644 --- a/drivers/gdisp/ILI9225/gdisp_lld_ili9225.c +++ b/drivers/gdisp/ILI9225/gdisp_lld_ili9225.c @@ -43,7 +43,7 @@ #include "drivers/gdisp/ILI9225/ili9225.h" // Some common routines and macros -#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } +#define dummy_read(g) { volatile gU16 dummy; dummy = read_data(g); (void) dummy; } #define write_reg(g, reg, data) { write_cmd(g, reg); write_data(g, data); } // Serial write data for fast fill. diff --git a/drivers/gdisp/ILI9320/board_ILI9320_template.h b/drivers/gdisp/ILI9320/board_ILI9320_template.h index 16d6ba68..45270de8 100644 --- a/drivers/gdisp/ILI9320/board_ILI9320_template.h +++ b/drivers/gdisp/ILI9320/board_ILI9320_template.h @@ -21,7 +21,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -34,12 +34,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; (void) data; } @@ -52,7 +52,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { (void) g; } -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return 0; } diff --git a/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c b/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c index b3a42c1a..1dc5ba17 100644 --- a/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c +++ b/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c @@ -51,7 +51,7 @@ /* Driver local functions. */ /*===========================================================================*/ -#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } +#define dummy_read(g) { volatile gU16 dummy; dummy = read_data(g); (void) dummy; } #define write_reg(g, reg, data) { write_index(g, reg); write_data(g, data); } static void set_cursor(GDisplay *g) { @@ -94,7 +94,7 @@ static void set_viewport(GDisplay *g) { } LLDSPEC gBool gdisp_lld_init(GDisplay *g) { - uint16_t cver; + gU16 cver; // No private area for this controller g->priv = 0; @@ -223,7 +223,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { dummy_read(g); } LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { - uint16_t data; + gU16 data; data = read_data(g); return gdispNative2Color(data); diff --git a/drivers/gdisp/ILI9325/board_ILI9325_template.h b/drivers/gdisp/ILI9325/board_ILI9325_template.h index 16d6ba68..45270de8 100644 --- a/drivers/gdisp/ILI9325/board_ILI9325_template.h +++ b/drivers/gdisp/ILI9325/board_ILI9325_template.h @@ -21,7 +21,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -34,12 +34,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; (void) data; } @@ -52,7 +52,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { (void) g; } -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return 0; } diff --git a/drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c b/drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c index 0bd3ec9f..73d79b47 100644 --- a/drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c +++ b/drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c @@ -52,7 +52,7 @@ /*===========================================================================*/ // Some common routines and macros -#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } +#define dummy_read(g) { volatile gU16 dummy; dummy = read_data(g); (void) dummy; } #define write_reg(g, reg, data) { write_index(g, reg); write_data(g, data); } static void set_cursor(GDisplay *g) { @@ -95,7 +95,7 @@ static void set_viewport(GDisplay* g) { } LLDSPEC gBool gdisp_lld_init(GDisplay *g) { - uint16_t cver; + gU16 cver; // No private area for this controller g->priv = 0; @@ -217,7 +217,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { dummy_read(g); } LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { - uint16_t data; + gU16 data; data = read_data(g); return gdispNative2Color(data); diff --git a/drivers/gdisp/ILI9341/board_ILI9341_template.h b/drivers/gdisp/ILI9341/board_ILI9341_template.h index a1b85c98..d4b8a8fd 100644 --- a/drivers/gdisp/ILI9341/board_ILI9341_template.h +++ b/drivers/gdisp/ILI9341/board_ILI9341_template.h @@ -21,7 +21,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -34,12 +34,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; (void) data; } @@ -52,7 +52,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { (void) g; } -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return 0; } diff --git a/drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c b/drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c index 464d663d..1c8e0956 100644 --- a/drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c +++ b/drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c @@ -49,24 +49,24 @@ /*===========================================================================*/ // Some common routines and macros -#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } +#define dummy_read(g) { volatile gU16 dummy; dummy = read_data(g); (void) dummy; } #define write_reg(g, reg, data) { write_index(g, reg); write_data(g, data); } -#define write_data16(g, data) { write_data(g, data >> 8); write_data(g, (uint8_t)data); } +#define write_data16(g, data) { write_data(g, data >> 8); write_data(g, (gU8)data); } #define delay(us) gfxSleepMicroseconds(us) #define delayms(ms) gfxSleepMilliseconds(ms) static void set_viewport(GDisplay *g) { write_index(g, 0x2A); write_data(g, (g->p.x >> 8)); - write_data(g, (uint8_t) g->p.x); + write_data(g, (gU8) g->p.x); write_data(g, (g->p.x + g->p.cx - 1) >> 8); - write_data(g, (uint8_t) (g->p.x + g->p.cx - 1)); + write_data(g, (gU8) (g->p.x + g->p.cx - 1)); write_index(g, 0x2B); write_data(g, (g->p.y >> 8)); - write_data(g, (uint8_t) g->p.y); + write_data(g, (gU8) g->p.y); write_data(g, (g->p.y + g->p.cy - 1) >> 8); - write_data(g, (uint8_t) (g->p.y + g->p.cy - 1)); + write_data(g, (gU8) (g->p.y + g->p.cy - 1)); } /*===========================================================================*/ @@ -257,7 +257,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { dummy_read(g); } LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { - uint16_t data; + gU16 data; data = read_data(g); return gdispNative2Color(data); diff --git a/drivers/gdisp/ILI9342/gdisp_lld_ILI9342.c b/drivers/gdisp/ILI9342/gdisp_lld_ILI9342.c index 8c98da1f..394a4b47 100644 --- a/drivers/gdisp/ILI9342/gdisp_lld_ILI9342.c +++ b/drivers/gdisp/ILI9342/gdisp_lld_ILI9342.c @@ -49,21 +49,21 @@ /*===========================================================================*/ // Some common routines and macros -#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } +#define dummy_read(g) { volatile gU16 dummy; dummy = read_data(g); (void) dummy; } #define write_reg(g, reg, data) { write_index(g, reg); write_data(g, data); } static void set_viewport(GDisplay *g) { write_index(g, 0x2A); write_data(g, (g->p.x >> 8)); - write_data(g, (uint8_t) g->p.x); + write_data(g, (gU8) g->p.x); write_data(g, (g->p.x + g->p.cx - 1) >> 8); - write_data(g, (uint8_t) (g->p.x + g->p.cx - 1)); + write_data(g, (gU8) (g->p.x + g->p.cx - 1)); write_index(g, 0x2B); write_data(g, (g->p.y >> 8)); - write_data(g, (uint8_t) g->p.y); + write_data(g, (gU8) g->p.y); write_data(g, (g->p.y + g->p.cy - 1) >> 8); - write_data(g, (uint8_t) (g->p.y + g->p.cy - 1)); + write_data(g, (gU8) (g->p.y + g->p.cy - 1)); } /*===========================================================================*/ @@ -261,7 +261,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { dummy_read(g); } LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { - uint16_t data; + gU16 data; data = read_data(g); return gdispNative2Color(data); diff --git a/drivers/gdisp/ILI93xx/board_ILI93xx_template.h b/drivers/gdisp/ILI93xx/board_ILI93xx_template.h index df2131bc..ab47b968 100644 --- a/drivers/gdisp/ILI93xx/board_ILI93xx_template.h +++ b/drivers/gdisp/ILI93xx/board_ILI93xx_template.h @@ -24,7 +24,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; @@ -40,13 +40,13 @@ static GFXINLINE void release_bus(GDisplay *g) (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; (void) data; @@ -62,7 +62,7 @@ static GFXINLINE void setwritemode(GDisplay *g) (void) g; } -static GFXINLINE uint16_t read_data(GDisplay *g) +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; diff --git a/drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c b/drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c index 8ea9b5b8..e35bf47a 100644 --- a/drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c +++ b/drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c @@ -52,10 +52,10 @@ /*===========================================================================*/ // Some common routines and macros -#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } +#define dummy_read(g) { volatile gU16 dummy; dummy = read_data(g); (void) dummy; } #define write_reg(g, reg, data) { write_index(g, reg); write_data(g, data); } -static GFXINLINE uint16_t read_reg(GDisplay *g, uint32_t reg) { +static GFXINLINE gU16 read_reg(GDisplay *g, gU32 reg) { write_index(g, reg); return read_data(g); } @@ -290,7 +290,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { dummy_read(g); } LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { - uint16_t data; + gU16 data; data = read_data(g); return gdispNative2Color(data); diff --git a/drivers/gdisp/ILI9481/board_ILI9481_template.h b/drivers/gdisp/ILI9481/board_ILI9481_template.h index a1b85c98..d4b8a8fd 100644 --- a/drivers/gdisp/ILI9481/board_ILI9481_template.h +++ b/drivers/gdisp/ILI9481/board_ILI9481_template.h @@ -21,7 +21,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -34,12 +34,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; (void) data; } @@ -52,7 +52,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { (void) g; } -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return 0; } diff --git a/drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c b/drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c index 357798b3..75c29ae7 100644 --- a/drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c +++ b/drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c @@ -47,9 +47,9 @@ /*===========================================================================*/ // Some common routines and macros -#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } +#define dummy_read(g) { volatile gU16 dummy; dummy = read_data(g); (void) dummy; } #define write_reg(g, reg, data) { write_index(g, reg); write_data(g, data); } -#define write_reg2x16(g, reg, data1, data2) { write_index(g, reg); write_data(g, (data1)>>8); write_data(g, (uint8_t)(data1)); write_data(g, (data2)>>8); write_data(g, (uint8_t)(data2));} +#define write_reg2x16(g, reg, data1, data2) { write_index(g, reg); write_data(g, (data1)>>8); write_data(g, (gU8)(data1)); write_data(g, (data2)>>8); write_data(g, (gU8)(data2));} static void set_viewport(GDisplay* g) { write_reg2x16(g, 0x2A, g->p.x, g->p.x + g->p.cx - 1); @@ -221,7 +221,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { dummy_read(g); } LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { - uint16_t data; + gU16 data; data = read_data(g); return gdispNative2Color(data); diff --git a/drivers/gdisp/ILI9488/board_ILI9488_template.h b/drivers/gdisp/ILI9488/board_ILI9488_template.h index a1b85c98..d4b8a8fd 100644 --- a/drivers/gdisp/ILI9488/board_ILI9488_template.h +++ b/drivers/gdisp/ILI9488/board_ILI9488_template.h @@ -21,7 +21,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -34,12 +34,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; (void) data; } @@ -52,7 +52,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { (void) g; } -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return 0; } diff --git a/drivers/gdisp/ILI9488/gdisp_lld_ILI9488.c b/drivers/gdisp/ILI9488/gdisp_lld_ILI9488.c index 61ff51ab..f0c2688d 100644 --- a/drivers/gdisp/ILI9488/gdisp_lld_ILI9488.c +++ b/drivers/gdisp/ILI9488/gdisp_lld_ILI9488.c @@ -46,7 +46,7 @@ /* Driver local functions. */ /*===========================================================================*/ static void dummy_read(GDisplay* g) { - volatile uint16_t dummy; + volatile gU16 dummy; dummy = read_data(g); (void)dummy; } @@ -221,7 +221,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { } LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { - uint16_t data; + gU16 data; data = read_data(g); return gdispNative2Color(data); diff --git a/drivers/gdisp/KS0108/board_KS0108_example.h b/drivers/gdisp/KS0108/board_KS0108_example.h index 23df5183..133955cd 100644 --- a/drivers/gdisp/KS0108/board_KS0108_example.h +++ b/drivers/gdisp/KS0108/board_KS0108_example.h @@ -170,7 +170,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { #endif } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -183,9 +183,9 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -void KS0108_delay(uint16_t microsec){ +void KS0108_delay(gU16 microsec){ #if KS0108_NOP_DLY - uint16_t cn; + gU16 cn; for (cn=0;cn< microsec;cn++){ asm("nop");asm("nop");asm("nop");asm("nop"); @@ -223,7 +223,7 @@ static GFXINLINE void KS0108_latch(void){ palSetLine(lcdpins.E); } -static GFXINLINE void KS0108_write(uint8_t value){ +static GFXINLINE void KS0108_write(gU8 value){ int ii; for(ii = 0; ii < 8; ii++){ @@ -235,8 +235,8 @@ static GFXINLINE void KS0108_write(uint8_t value){ KS0108_delay(1); } -static GFXINLINE void KS0108_select(uint8_t chip){ - uint8_t ii; +static GFXINLINE void KS0108_select(gU8 chip){ + gU8 ii; KS0108_delay(1); for (ii = 0; ii < CHIPS; ii++){ if (ii == chip) @@ -246,7 +246,7 @@ static GFXINLINE void KS0108_select(uint8_t chip){ } static GFXINLINE void KS0108_unselect(void){ - uint8_t ii; + gU8 ii; KS0108_delay(1); for (ii = 0; ii < CHIPS; ii++){ @@ -256,8 +256,8 @@ static GFXINLINE void KS0108_unselect(void){ /* #if KS0108_NEED_READ //Hardware Read ############## WORKS more or less -static GFXINLINE uint8_t read_KS0108(void) { - uint8_t ii, data=0; +static GFXINLINE gU8 read_KS0108(void) { + gU8 ii, data=0; for(ii = 0; ii < 8; ii++) palSetLineMode(lcdpins.D[ii], PAL_MODE_INPUT); //Set pads to input @@ -286,8 +286,8 @@ static GFXINLINE uint8_t read_KS0108(void) { #endif */ #if KS0108_NEED_READ //Hardware Read ########### needs more testing but my display is broken -static GFXINLINE uint8_t read_KS0108(void) { - uint8_t ii, data=0; +static GFXINLINE gU8 read_KS0108(void) { + gU8 ii, data=0; for(ii = 0; ii < 8; ii++) palSetLineMode(lcdpins.D[ii], PAL_MODE_INPUT); //Set pads to input @@ -336,15 +336,15 @@ static GFXINLINE uint8_t read_KS0108(void) { } #endif -static GFXINLINE void write_data(GDisplay* g, uint16_t data){ +static GFXINLINE void write_data(GDisplay* g, gU16 data){ (void)g; - uint8_t bit, displayData; + gU8 bit, displayData; #if !KS0108_NEED_READ - uint8_t *p; + gU8 *p; #endif palSetLine(lcdpins.DC); - KS0108_select((uint8_t)(data>>8)); + KS0108_select((gU8)(data>>8)); #if KS0108_NEED_READ displayData=read_KS0108(); #else @@ -353,7 +353,7 @@ static GFXINLINE void write_data(GDisplay* g, uint16_t data){ #endif bit = 1 << (g->p.y & 7); //Get Page bit - if ((uint8_t)data){ //set bit + if ((gU8)data){ //set bit KS0108_write(displayData | bit); #if !KS0108_NEED_READ *p = (displayData | bit); @@ -370,11 +370,11 @@ static GFXINLINE void write_data(GDisplay* g, uint16_t data){ KS0108_unselect(); //Important } -static GFXINLINE void write_cmd(GDisplay* g, uint16_t cmd){ +static GFXINLINE void write_cmd(GDisplay* g, gU16 cmd){ (void)g; palClearLine(lcdpins.DC); - KS0108_select((uint8_t)(cmd>>8)); - KS0108_write((uint8_t)cmd); + KS0108_select((gU8)(cmd>>8)); + KS0108_write((gU8)cmd); KS0108_latch(); KS0108_unselect(); //Important } @@ -387,7 +387,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { (void) g; } -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return 0; } diff --git a/drivers/gdisp/KS0108/gdisp_lld_KS0108.c b/drivers/gdisp/KS0108/gdisp_lld_KS0108.c index 94e81303..320896f5 100644 --- a/drivers/gdisp/KS0108/gdisp_lld_KS0108.c +++ b/drivers/gdisp/KS0108/gdisp_lld_KS0108.c @@ -64,7 +64,7 @@ #if !KS0108_NEED_READ #define BUFFSZ (GDISP_SCREEN_HEIGHT/8 * GDISP_SCREEN_WIDTH) - #define RAM(g) ((uint8_t *)g->priv) + #define RAM(g) ((gU8 *)g->priv) #endif #ifndef GDISP_INITIAL_CONTRAST #define GDISP_INITIAL_CONTRAST 50 @@ -146,8 +146,8 @@ GFXINLINE void KS0108_goto(GDisplay* g, ) { } static void set_viewport(GDisplay *g) { - uint16_t pg; - uint16_t chip; + gU16 pg; + gU16 chip; pg = g->p.y >> 3; chip = (g->p.x >> 6) << 8; @@ -156,7 +156,7 @@ static void set_viewport(GDisplay *g) { } LLDSPEC void gdisp_lld_write_color(GDisplay *g) { - uint16_t data; + gU16 data; data = (g->p.x >> 6) << 8; // Set the chip if (g->p.color != GFX_WHITE) @@ -189,7 +189,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { } LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { - uint16_t data; + gU16 data; data = read_data(g); return gdispNative2Color(data); @@ -203,7 +203,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { #if GDISP_HARDWARE_FILLS LLDSPEC void gdisp_lld_fill_area(GDisplay *g) { - uint8_t data, j; + gU8 data, j; set_viewport(g); if (g->p.color != GFX_WHITE) { diff --git a/drivers/gdisp/LGDP4532/board_LGDP4532_template.h b/drivers/gdisp/LGDP4532/board_LGDP4532_template.h index 600cf1fb..261d7758 100644 --- a/drivers/gdisp/LGDP4532/board_LGDP4532_template.h +++ b/drivers/gdisp/LGDP4532/board_LGDP4532_template.h @@ -24,7 +24,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; @@ -40,13 +40,13 @@ static GFXINLINE void release_bus(GDisplay *g) (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; (void) data; @@ -62,7 +62,7 @@ static GFXINLINE void setwritemode(GDisplay *g) (void) g; } -static GFXINLINE uint16_t read_data(GDisplay *g) +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return 0; diff --git a/drivers/gdisp/LGDP4532/gdisp_lld_LGDP4532.c b/drivers/gdisp/LGDP4532/gdisp_lld_LGDP4532.c index 87cc98a9..522e7821 100644 --- a/drivers/gdisp/LGDP4532/gdisp_lld_LGDP4532.c +++ b/drivers/gdisp/LGDP4532/gdisp_lld_LGDP4532.c @@ -52,7 +52,7 @@ /*===========================================================================*/ // Some common routines and macros -#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } +#define dummy_read(g) { volatile gU16 dummy; dummy = read_data(g); (void) dummy; } #define write_reg(g, reg, data) { write_index(g, reg); write_data(g, data); } static void set_cursor(GDisplay *g) { @@ -211,7 +211,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { dummy_read(g); } LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { - uint16_t data; + gU16 data; data = read_data(g); return gdispNative2Color(data); diff --git a/drivers/gdisp/Nokia6610GE12/board_Nokia6610GE12_template.h b/drivers/gdisp/Nokia6610GE12/board_Nokia6610GE12_template.h index de84b8aa..37fd6611 100644 --- a/drivers/gdisp/Nokia6610GE12/board_Nokia6610GE12_template.h +++ b/drivers/gdisp/Nokia6610GE12/board_Nokia6610GE12_template.h @@ -33,7 +33,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -46,12 +46,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; (void) data; } diff --git a/drivers/gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c b/drivers/gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c index aadfacff..53249f01 100644 --- a/drivers/gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c +++ b/drivers/gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c @@ -66,8 +66,8 @@ /*===========================================================================*/ // Use the priv pointer itself to save our color. This save allocating ram for it -// and works provided sizeof(uint16_t) <= sizeof(void *) -#define savecolor(g) (*(uint16_t *)&g->priv) +// and works provided sizeof(gU16) <= sizeof(void *) +#define savecolor(g) (*(gU16 *)&g->priv) #define GDISP_FLG_ODDBYTE (GDISP_FLG_DRIVER<<0) @@ -139,7 +139,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->flags &= ~GDISP_FLG_ODDBYTE; } LLDSPEC void gdisp_lld_write_color(GDisplay *g) { - uint16_t c; + gU16 c; c = gdispColor2Native(g->p.color); if ((g->flags & GDISP_FLG_ODDBYTE)) { diff --git a/drivers/gdisp/Nokia6610GE8/board_Nokia6610GE8_template.h b/drivers/gdisp/Nokia6610GE8/board_Nokia6610GE8_template.h index de84b8aa..37fd6611 100644 --- a/drivers/gdisp/Nokia6610GE8/board_Nokia6610GE8_template.h +++ b/drivers/gdisp/Nokia6610GE8/board_Nokia6610GE8_template.h @@ -33,7 +33,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -46,12 +46,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; (void) data; } diff --git a/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c b/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c index 7bc55aa1..cb3f4d17 100644 --- a/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c +++ b/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c @@ -104,9 +104,9 @@ #if GDISP_HARDWARE_STREAM_WRITE typedef struct dvrPriv { - uint16_t savecolor; + gU16 savecolor; #if GDISP_GE8_BROKEN_CONTROLLER - uint16_t firstcolor; + gU16 firstcolor; #endif } dvrPriv; #define PRIV ((dvrPriv *)g->priv) @@ -255,7 +255,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->flags &= ~(GDISP_FLG_ODDBYTE|GDISP_FLG_RUNBYTE); } LLDSPEC void gdisp_lld_write_color(GDisplay *g) { - uint16_t c; + gU16 c; c = gdispColor2Native(g->p.color); #if GDISP_GE8_BROKEN_CONTROLLER @@ -311,7 +311,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_DRAWPIXEL LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { - uint16_t c; + gU16 c; c = gdispColor2Native(g->p.color); acquire_bus(g); @@ -326,7 +326,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_FILLS LLDSPEC void gdisp_lld_fill_area(GDisplay *g) { unsigned tuples; - uint16_t c; + gU16 c; tuples = (g->p.cx*g->p.cy+1)>>1; // With an odd sized area we over-print by one pixel. // This extra pixel overwrites the first pixel (harmless as it is the same colour) @@ -343,12 +343,12 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_BITFILLS LLDSPEC void gdisp_lld_blit_area(GDisplay *g) { gCoord lg, x, y; - uint16_t c1, c2; + gU16 c1, c2; unsigned tuples; const gPixel *buffer; #if GDISP_PACKED_PIXELS unsigned pnum, pstart; - const uint8_t *p; + const gU8 *p; #else const gPixel *p; #endif @@ -428,10 +428,10 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { srccx = (g->p.x2 + 1) & ~1; #endif pstart = g->p.y1 * g->p.x2 + g->p.x1; // The starting pixel number - buffer = (const gPixel)(((const uint8_t *)buffer) + ((pstart>>1) * 3)); // The buffer start position + buffer = (const gPixel)(((const gU8 *)buffer) + ((pstart>>1) * 3)); // The buffer start position lg = ((g->p.x2-g->p.cx)>>1)*3; // The buffer gap between lines pnum = pstart + g->p.x2*y + x; // Adjustment for controller craziness - p = ((const uint8_t *)buffer) + (((g->p.x2*y + x)>>1)*3); // Adjustment for controller craziness + p = ((const gU8 *)buffer) + (((g->p.x2*y + x)>>1)*3); // Adjustment for controller craziness while (tuples--) { /* Get a pixel */ @@ -447,7 +447,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { pnum += g->p.x2 - g->p.cx; if (++y >= g->p.cy) { y = 0; - p = (const uint8_t *)buffer; + p = (const gU8 *)buffer; pnum = pstart; } } @@ -465,7 +465,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { pnum += g->p.x2 - g->p.cx; if (++y >= g->p.cy) { y = 0; - p = (const uint8_t *)buffer; + p = (const gU8 *)buffer; pnum = pstart; } } diff --git a/drivers/gdisp/PCD8544/board_PCD8544_template.h b/drivers/gdisp/PCD8544/board_PCD8544_template.h index 6b48d83b..0749f5a8 100644 --- a/drivers/gdisp/PCD8544/board_PCD8544_template.h +++ b/drivers/gdisp/PCD8544/board_PCD8544_template.h @@ -21,7 +21,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -34,12 +34,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) { +static GFXINLINE void write_cmd(GDisplay *g, gU8 cmd) { (void) g; (void) cmd; } -static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { +static GFXINLINE void write_data(GDisplay *g, gU8* data, gU16 length) { (void) g; (void) data; (void) length; diff --git a/drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c b/drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c index 0daf34b4..7e46e3ce 100644 --- a/drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c +++ b/drivers/gdisp/PCD8544/gdisp_lld_PCD8544.c @@ -33,7 +33,7 @@ /*===========================================================================*/ // Some common routines and macros -#define RAM(g) ((uint8_t *)g->priv) +#define RAM(g) ((gU8 *)g->priv) #define xyaddr(x, y) ((x) + ((y) >> 3) * GDISP_SCREEN_WIDTH) #define xybit(y) (1 << ((y) & 7)) diff --git a/drivers/gdisp/PCF8812/board_PCF8812_template.h b/drivers/gdisp/PCF8812/board_PCF8812_template.h index 88a7dfcf..36adc584 100644 --- a/drivers/gdisp/PCF8812/board_PCF8812_template.h +++ b/drivers/gdisp/PCF8812/board_PCF8812_template.h @@ -29,12 +29,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) { +static GFXINLINE void write_cmd(GDisplay *g, gU8 cmd) { (void) g; (void) cmd; } -static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { +static GFXINLINE void write_data(GDisplay *g, gU8* data, gU16 length) { (void) g; (void) data; (void) length; diff --git a/drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c b/drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c index 20486124..415f75e3 100644 --- a/drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c +++ b/drivers/gdisp/PCF8812/gdisp_lld_PCF8812.c @@ -36,7 +36,7 @@ /*===========================================================================*/ // Some common routines and macros -#define RAM(g) ((uint8_t *)g->priv) +#define RAM(g) ((gU8 *)g->priv) #define xyaddr(x, y) ((x) + ((y) >> 3) * GDISP_MATRIX_WIDTH) #define xybit(y) (1 << ((y) & 7)) diff --git a/drivers/gdisp/R61505U/board_R61505U_template.h b/drivers/gdisp/R61505U/board_R61505U_template.h index 16d6ba68..45270de8 100644 --- a/drivers/gdisp/R61505U/board_R61505U_template.h +++ b/drivers/gdisp/R61505U/board_R61505U_template.h @@ -21,7 +21,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -34,12 +34,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; (void) data; } @@ -52,7 +52,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { (void) g; } -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return 0; } diff --git a/drivers/gdisp/R61505U/gdisp_lld_R61505U.c b/drivers/gdisp/R61505U/gdisp_lld_R61505U.c index aa6c5b9e..f2edd3ca 100644 --- a/drivers/gdisp/R61505U/gdisp_lld_R61505U.c +++ b/drivers/gdisp/R61505U/gdisp_lld_R61505U.c @@ -51,7 +51,7 @@ /* Driver local functions. */ /*===========================================================================*/ -#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } +#define dummy_read(g) { volatile gU16 dummy; dummy = read_data(g); (void) dummy; } #define write_reg(g, reg, data) { write_index(g, reg); write_data(g, data); } static void set_cursor(GDisplay *g) { @@ -94,7 +94,7 @@ static void set_viewport(GDisplay *g) { } LLDSPEC gBool gdisp_lld_init(GDisplay *g) { - uint16_t cver; + gU16 cver; // No private area for this controller g->priv = 0; @@ -231,7 +231,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { dummy_read(g); } LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { - uint16_t data; + gU16 data; data = read_data(g); return gdispNative2Color(data); diff --git a/drivers/gdisp/RA6963/board_RA6963.h b/drivers/gdisp/RA6963/board_RA6963.h index ce2af186..bee22c30 100755 --- a/drivers/gdisp/RA6963/board_RA6963.h +++ b/drivers/gdisp/RA6963/board_RA6963.h @@ -177,7 +177,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { #endif } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; #if RA6963_NEED_BACKLIGHT @@ -199,9 +199,9 @@ static GFXINLINE void release_bus(GDisplay *g) { #if RA6963_NEED_READ -static GFXINLINE uint8_t RA6963_busy_wait(uint8_t pattern, gBool lh){ +static GFXINLINE gU8 RA6963_busy_wait(gU8 pattern, gBool lh){ - uint8_t data; + gU8 data; int ii; for(ii = 0; ii < 2; ii++) //Only interested in Bit 0 and 1 @@ -229,7 +229,7 @@ static GFXINLINE uint8_t RA6963_busy_wait(uint8_t pattern, gBool lh){ } #endif -static GFXINLINE void RA6963_write(uint8_t value){ +static GFXINLINE void RA6963_write(gU8 value){ int ii; for(ii = 0; ii < 8; ii++){ if(value & (1 << ii)) @@ -239,7 +239,7 @@ static GFXINLINE void RA6963_write(uint8_t value){ } } -static GFXINLINE void write_data(GDisplay* g, uint8_t data){ +static GFXINLINE void write_data(GDisplay* g, gU8 data){ (void)g; #if RA6963_NEED_READ RA6963_busy_wait(RA6963_STATUS_BUSY1 | RA6963_STATUS_BUSY2, ~(RA6963_STATUS_BUSY1 | RA6963_STATUS_BUSY2)); @@ -254,7 +254,7 @@ static GFXINLINE void write_data(GDisplay* g, uint8_t data){ palSetLine(lcdpins.CD); } -static GFXINLINE void write_cmd(GDisplay* g, uint8_t data){ +static GFXINLINE void write_cmd(GDisplay* g, gU8 data){ (void)g; #if RA6963_NEED_READ RA6963_busy_wait(RA6963_STATUS_BUSY1 | RA6963_STATUS_BUSY2, ~(RA6963_STATUS_BUSY1 | RA6963_STATUS_BUSY2)); @@ -275,11 +275,11 @@ static GFXINLINE void setwritemode(GDisplay *g) { (void) g; } -static GFXINLINE uint8_t read_data(GDisplay *g) { +static GFXINLINE gU8 read_data(GDisplay *g) { (void) g; #if RA6963_NEED_READ int ii; - uint8_t data; + gU8 data; write_cmd(g, RA6963_DATA_READ_AND_NONVARIABLE); //RA6963_busy_wait(RA6963_STATUS_BUSY1 | RA6963_STATUS_BUSY2, ~(RA6963_STATUS_BUSY1 | RA6963_STATUS_BUSY2)); diff --git a/drivers/gdisp/RA6963/gdisp_lld_RA6963.c b/drivers/gdisp/RA6963/gdisp_lld_RA6963.c index 3dfc13ef..ca7cf7e0 100755 --- a/drivers/gdisp/RA6963/gdisp_lld_RA6963.c +++ b/drivers/gdisp/RA6963/gdisp_lld_RA6963.c @@ -119,7 +119,7 @@ #if !RA6963_NEED_READ #define BUFFSZ (RA6963_GRAPHIC_SIZE) - #define RAM(g) ((uint8_t *)g->priv) + #define RAM(g) ((gU8 *)g->priv) #define POS (((g->p.x) / RA6963_FONT_WIDTH) + ((g->p.y) * RA6963_GRAPHIC_AREA)) #endif #ifndef GDISP_INITIAL_CONTRAST @@ -159,23 +159,23 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { gfxSleepMilliseconds(50); //RA6963 needs Data first THEN command! - write_data(g, (uint8_t)RA6963_GRAPHIC_HOME); //0 - write_data(g, (uint8_t)(RA6963_GRAPHIC_HOME>>8)); //0 + write_data(g, (gU8)RA6963_GRAPHIC_HOME); //0 + write_data(g, (gU8)(RA6963_GRAPHIC_HOME>>8)); //0 write_cmd(g, RA6963_SET_GRAPHIC_HOME_ADDRESS); //0x42 - write_data(g, (uint8_t)RA6963_GRAPHIC_AREA); //16 + write_data(g, (gU8)RA6963_GRAPHIC_AREA); //16 write_data(g, 0); //0 write_cmd(g, RA6963_SET_GRAPHIC_AREA); //0x43 - write_data(g, (uint8_t)RA6963_TEXT_HOME); //0x00 - write_data(g, (uint8_t)(RA6963_TEXT_HOME>>8)); //0x04 = 0x400 + write_data(g, (gU8)RA6963_TEXT_HOME); //0x00 + write_data(g, (gU8)(RA6963_TEXT_HOME>>8)); //0x04 = 0x400 write_cmd(g, RA6963_SET_TEXT_HOME_ADDRESS); //0x40 - write_data(g, (uint8_t)RA6963_TEXT_AREA); //16 - write_data(g, (uint8_t)(RA6963_TEXT_AREA>>8)); //0 + write_data(g, (gU8)RA6963_TEXT_AREA); //16 + write_data(g, (gU8)(RA6963_TEXT_AREA>>8)); //0 write_cmd(g, RA6963_SET_TEXT_AREA); //0x41 -/* write_data(g, (uint8_t)RA6963_OFFSET_REGISTER); +/* write_data(g, (gU8)RA6963_OFFSET_REGISTER); write_data(g, 0); write_cmd(g, RA6963_SET_OFFSET_REGISTER);*/ @@ -213,20 +213,20 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { static void set_viewport(GDisplay *g) { if ((g->p.x >= GDISP_SCREEN_WIDTH) || (g->p.y >= GDISP_SCREEN_HEIGHT)) return; // 0 + ( x / 8 ) + ( y * 16 ) - //uint16_t addr = (RA6963_GRAPHIC_HOME + ((g->p.x) / RA6963_FONT_WIDTH) + ((g->p.y) * RA6963_GRAPHIC_AREA)); - uint16_t addr = (RA6963_GRAPHIC_HOME + ((g->p.x >> 3) + (g->p.y << 4))); + //gU16 addr = (RA6963_GRAPHIC_HOME + ((g->p.x) / RA6963_FONT_WIDTH) + ((g->p.y) * RA6963_GRAPHIC_AREA)); + gU16 addr = (RA6963_GRAPHIC_HOME + ((g->p.x >> 3) + (g->p.y << 4))); #if GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_DIRECT #warning "check function set_viewport about the shift operations if you change the resolution!" #elif GFX_COMPILER_WARNING_TYPE == GFX_COMPILER_WARNING_MACRO COMPILER_WARNING("check function set_viewport about the shift operations if you change the resolution!") #endif - write_data(g, (uint8_t)addr); - write_data(g, (uint8_t)(addr>>8)); + write_data(g, (gU8)addr); + write_data(g, (gU8)(addr>>8)); write_cmd(g, RA6963_SET_ADDRESS_POINTER); } LLDSPEC void gdisp_lld_write_color(GDisplay *g) { - uint8_t temp; + gU8 temp; #if RA6963_NEED_READ temp = read_data(g); @@ -275,7 +275,7 @@ LLDSPEC void gdisp_lld_read_start(GDisplay *g) { } LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { - uint16_t data; + gU16 data; data = read_data(g); return gdispNative2Color(data); @@ -289,7 +289,7 @@ LLDSPEC void gdisp_lld_read_stop(GDisplay *g) { #if GDISP_HARDWARE_FILLS LLDSPEC void gdisp_lld_fill_area(GDisplay *g) { - uint8_t data, j; + gU8 data, j; set_viewport(g); if (g->p.color != GFX_WHITE) { diff --git a/drivers/gdisp/RA8875/board_RA8875_template.h b/drivers/gdisp/RA8875/board_RA8875_template.h index 01b5b65d..7ed5bf07 100644 --- a/drivers/gdisp/RA8875/board_RA8875_template.h +++ b/drivers/gdisp/RA8875/board_RA8875_template.h @@ -29,12 +29,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; (void) data; } @@ -47,7 +47,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { (void) g; } -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; } diff --git a/drivers/gdisp/RA8875/gdisp_lld_RA8875.c b/drivers/gdisp/RA8875/gdisp_lld_RA8875.c index d1d0a4d4..d9b2ba97 100644 --- a/drivers/gdisp/RA8875/gdisp_lld_RA8875.c +++ b/drivers/gdisp/RA8875/gdisp_lld_RA8875.c @@ -38,7 +38,7 @@ /*===========================================================================*/ // Some common routines and macros -#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } +#define dummy_read(g) { volatile gU16 dummy; dummy = read_data(g); (void) dummy; } #define write_reg8(g, reg, data) { write_index(g, reg); write_data(g, data); } #define write_reg16(g, reg, data) { write_index(g, reg); write_data(g, data); write_index(g, reg+1); write_data(g, (data)>>8); } #define write_reg8x2(g, reg, d1, d2) { write_index(g, reg); write_data(g, d1); write_data(g, d2); } @@ -58,8 +58,8 @@ static GFXINLINE void set_viewport(GDisplay* g) { // On this controller the back-light is controlled by the controllers internal PWM // which is why it is in this file rather than the board file. -static GFXINLINE void set_backlight(GDisplay* g, uint8_t percent) { - uint8_t temp; +static GFXINLINE void set_backlight(GDisplay* g, gU8 percent) { + gU8 temp; //Work in progress: the RA8875 has a built-in PWM, its output can //be used by a Dynamic Background Control or by a host (user) diff --git a/drivers/gdisp/S6D1121/board_S6D1121_template.h b/drivers/gdisp/S6D1121/board_S6D1121_template.h index a1b85c98..d4b8a8fd 100644 --- a/drivers/gdisp/S6D1121/board_S6D1121_template.h +++ b/drivers/gdisp/S6D1121/board_S6D1121_template.h @@ -21,7 +21,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -34,12 +34,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; (void) data; } @@ -52,7 +52,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { (void) g; } -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return 0; } diff --git a/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c b/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c index 4bbb6213..942f9a65 100644 --- a/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c +++ b/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c @@ -47,7 +47,7 @@ /*===========================================================================*/ /* Some common routines and macros */ -#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } +#define dummy_read(g) { volatile gU16 dummy; dummy = read_data(g); (void) dummy; } #define write_reg(g, reg, data) { write_index(g, reg); write_data(g, data); } #define delay(us) gfxSleepMicroseconds(us) #define delayms(ms) gfxSleepMilliseconds(ms) @@ -235,7 +235,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { dummy_read(g); } LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { - uint16_t data; + gU16 data; data = read_data(g); return gdispNative2Color(data); diff --git a/drivers/gdisp/SPFD54124B/board_SPFD54124B_template.h b/drivers/gdisp/SPFD54124B/board_SPFD54124B_template.h index 778d6fc5..ea6a92eb 100644 --- a/drivers/gdisp/SPFD54124B/board_SPFD54124B_template.h +++ b/drivers/gdisp/SPFD54124B/board_SPFD54124B_template.h @@ -24,7 +24,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; @@ -40,13 +40,13 @@ static GFXINLINE void release_bus(GDisplay *g) (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; (void) data; diff --git a/drivers/gdisp/SPFD54124B/gdisp_lld_SPFD54124B.c b/drivers/gdisp/SPFD54124B/gdisp_lld_SPFD54124B.c index 3c83273c..6dd867ee 100644 --- a/drivers/gdisp/SPFD54124B/gdisp_lld_SPFD54124B.c +++ b/drivers/gdisp/SPFD54124B/gdisp_lld_SPFD54124B.c @@ -68,8 +68,8 @@ /*===========================================================================*/ // Use the priv pointer itself to save our color. This save allocating ram for it -// and works provided sizeof(uint16_t) <= sizeof(void *) -#define savecolor(g) (*(uint16_t *)&g->priv) +// and works provided sizeof(gU16) <= sizeof(void *) +#define savecolor(g) (*(gU16 *)&g->priv) /*===========================================================================*/ /* Driver local functions. */ @@ -94,7 +94,7 @@ static GFXINLINE void set_viewport(GDisplay* g) /* Driver exported functions. */ /*===========================================================================*/ -const uint16_t lcd_init_list[] = { +const gU16 lcd_init_list[] = { SPFD54124B_CMD_SLPOUT, SPFD54124B_CMD_COLMOD, SPFD54124B_SEND_DATA | SPFD54124B_CMD_COLMOD_MCU16bit, SPFD54124B_CMD_DISPON, @@ -118,8 +118,8 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) acquire_bus(g); - const uint16_t *list = &lcd_init_list[0]; - uint8_t size = sizeof(lcd_init_list) / sizeof(lcd_init_list[0]); + const gU16 *list = &lcd_init_list[0]; + gU8 size = sizeof(lcd_init_list) / sizeof(lcd_init_list[0]); while(size--) { write_index(g, *list++); diff --git a/drivers/gdisp/SSD1289/board_SSD1289_template.h b/drivers/gdisp/SSD1289/board_SSD1289_template.h index 1cb21fb4..6cee8f1d 100644 --- a/drivers/gdisp/SSD1289/board_SSD1289_template.h +++ b/drivers/gdisp/SSD1289/board_SSD1289_template.h @@ -21,7 +21,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -34,12 +34,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; (void) data; } @@ -52,7 +52,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { (void) g; } -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return 0; } diff --git a/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c b/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c index 4c05f80f..8aff458c 100644 --- a/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c +++ b/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c @@ -43,7 +43,7 @@ /*===========================================================================*/ // Some common routines and macros -#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } +#define dummy_read(g) { volatile gU16 dummy; dummy = read_data(g); (void) dummy; } #define write_reg(g, reg, data) { write_index(g, reg); write_data(g, data); } static void set_cursor(GDisplay *g) { @@ -224,7 +224,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { dummy_read(g); } LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { - uint16_t data; + gU16 data; data = read_data(g); return gdispNative2Color(data); diff --git a/drivers/gdisp/SSD1306/board_SSD1306_template.h b/drivers/gdisp/SSD1306/board_SSD1306_template.h index 51b6e5f4..518f932a 100644 --- a/drivers/gdisp/SSD1306/board_SSD1306_template.h +++ b/drivers/gdisp/SSD1306/board_SSD1306_template.h @@ -31,12 +31,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) { +static GFXINLINE void write_cmd(GDisplay *g, gU8 cmd) { (void) g; (void) cmd; } -static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { +static GFXINLINE void write_data(GDisplay *g, gU8* data, gU16 length) { (void) g; (void) data; (void) length; diff --git a/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c b/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c index ed55f12a..ebe44447 100644 --- a/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c +++ b/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c @@ -49,7 +49,7 @@ /*===========================================================================*/ // Some common routines and macros -#define RAM(g) ((uint8_t *)g->priv) +#define RAM(g) ((gU8 *)g->priv) #define write_cmd2(g, cmd1, cmd2) { write_cmd(g, cmd1); write_cmd(g, cmd2); } #define write_cmd3(g, cmd1, cmd2, cmd3) { write_cmd(g, cmd1); write_cmd(g, cmd2); write_cmd(g, cmd3); } @@ -114,7 +114,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #else write_cmd2(g, SSD1306_SETCOMPINS, 0x22); #endif - write_cmd2(g, SSD1306_SETCONTRAST, (uint8_t)(GDISP_INITIAL_CONTRAST*256/101)); // Set initial contrast. + write_cmd2(g, SSD1306_SETCONTRAST, (gU8)(GDISP_INITIAL_CONTRAST*256/101)); // Set initial contrast. write_cmd2(g, SSD1306_SETVCOMDETECT, 0x10); write_cmd(g, SSD1306_DISPLAYON); write_cmd(g, SSD1306_NORMALDISPLAY); @@ -139,7 +139,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_FLUSH LLDSPEC void gdisp_lld_flush(GDisplay *g) { - uint8_t * ram; + gU8 * ram; unsigned pages; // Don't flush if we don't need it. @@ -173,8 +173,8 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { gCoord sx, ex; gCoord col; unsigned spage, zpages; - uint8_t * base; - uint8_t mask; + gU8 * base; + gU8 mask; switch(g->g.Orientation) { default: diff --git a/drivers/gdisp/SSD1322/board_SSD1322_template.h b/drivers/gdisp/SSD1322/board_SSD1322_template.h index 0fd6de8b..931c6e82 100644 --- a/drivers/gdisp/SSD1322/board_SSD1322_template.h +++ b/drivers/gdisp/SSD1322/board_SSD1322_template.h @@ -37,18 +37,18 @@ static GFXINLINE void release_bus(GDisplay *g) { } -static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) { +static GFXINLINE void write_cmd(GDisplay *g, gU8 cmd) { (void) g; (void) cmd; } -static GFXINLINE void write_data(GDisplay *g, uint8_t data) { +static GFXINLINE void write_data(GDisplay *g, gU8 data) { (void) g; (void) data; } #if SSD1322_USE_DMA - static GFXINLINE void write_data_DMA(GDisplay *g, uint8_t* data) { + static GFXINLINE void write_data_DMA(GDisplay *g, gU8* data) { (void) g; (void) data; } diff --git a/drivers/gdisp/SSD1322/gdisp_lld_SSD1322.c b/drivers/gdisp/SSD1322/gdisp_lld_SSD1322.c index 5f54cc47..054c1201 100644 --- a/drivers/gdisp/SSD1322/gdisp_lld_SSD1322.c +++ b/drivers/gdisp/SSD1322/gdisp_lld_SSD1322.c @@ -47,7 +47,7 @@ /*===========================================================================*/ // Some common routines and macros -#define RAM(g) ((uint8_t *)g->priv) +#define RAM(g) ((gU8 *)g->priv) // Some common routines and macros #define xyaddr(x, y) ((x) + (y)*SSD1322_ROW_WIDTH) @@ -157,7 +157,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_FLUSH LLDSPEC void gdisp_lld_flush(GDisplay *g) { - uint8_t * ram; + gU8 * ram; unsigned cols,rows; // Don't flush if we don't need it. @@ -190,7 +190,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_DRAWPIXEL LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { gCoord x, y; - uint8_t *ram; + gU8 *ram; switch(g->g.Orientation) { default: diff --git a/drivers/gdisp/SSD1331/board_SSD1331_template.h b/drivers/gdisp/SSD1331/board_SSD1331_template.h index 943a857d..daa5f4c0 100644 --- a/drivers/gdisp/SSD1331/board_SSD1331_template.h +++ b/drivers/gdisp/SSD1331/board_SSD1331_template.h @@ -29,12 +29,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_cmd(GDisplay *g, uint8_t index) { +static GFXINLINE void write_cmd(GDisplay *g, gU8 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint8_t data) { +static GFXINLINE void write_data(GDisplay *g, gU8 data) { (void) g; (void) data; } diff --git a/drivers/gdisp/SSD1331/gdisp_lld_SSD1331.c b/drivers/gdisp/SSD1331/gdisp_lld_SSD1331.c index c15c6370..76042c75 100644 --- a/drivers/gdisp/SSD1331/gdisp_lld_SSD1331.c +++ b/drivers/gdisp/SSD1331/gdisp_lld_SSD1331.c @@ -55,7 +55,7 @@ /* Driver exported functions. */ /*===========================================================================*/ -static const uint8_t initdata[] = { +static const gU8 initdata[] = { SSD1331_DISPLAY_OFF, SSD1331_START_LINE, 0x00, SSD1331_COM_OFFSET, 0x00, @@ -157,7 +157,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_FILLS LLDSPEC void gdisp_lld_fill_area(GDisplay *g) { - uint8_t a6, b6, c6; + gU8 a6, b6, c6; acquire_bus(g); diff --git a/drivers/gdisp/SSD1351/board_SSD1351_template.h b/drivers/gdisp/SSD1351/board_SSD1351_template.h index fc6fa7b4..b024520f 100644 --- a/drivers/gdisp/SSD1351/board_SSD1351_template.h +++ b/drivers/gdisp/SSD1351/board_SSD1351_template.h @@ -21,7 +21,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -34,12 +34,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_cmd(GDisplay *g, uint8_t index) { +static GFXINLINE void write_cmd(GDisplay *g, gU8 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint8_t data) { +static GFXINLINE void write_data(GDisplay *g, gU8 data) { (void) g; (void) data; } @@ -52,7 +52,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { (void) g; } -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return 0; } diff --git a/drivers/gdisp/SSD1351/gdisp_lld_SSD1351.c b/drivers/gdisp/SSD1351/gdisp_lld_SSD1351.c index 536f3a5e..854cbdce 100644 --- a/drivers/gdisp/SSD1351/gdisp_lld_SSD1351.c +++ b/drivers/gdisp/SSD1351/gdisp_lld_SSD1351.c @@ -49,7 +49,7 @@ /*===========================================================================*/ // Some common routines and macros -#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } +#define dummy_read(g) { volatile gU16 dummy; dummy = read_data(g); (void) dummy; } #define write_reg(g, reg, data) { write_cmd(g, reg); write_data(g, data); } /*===========================================================================*/ @@ -171,7 +171,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { //dummy_read(g); } LLDSPEC gColor gdisp_lld_read_color(GDisplay *g) { - uint16_t data; + gU16 data; data = read_data(g); return gdispNative2Color(data); diff --git a/drivers/gdisp/SSD1848/board_ssd1848_template.h b/drivers/gdisp/SSD1848/board_ssd1848_template.h index 294703e5..f3a3cb2f 100644 --- a/drivers/gdisp/SSD1848/board_ssd1848_template.h +++ b/drivers/gdisp/SSD1848/board_ssd1848_template.h @@ -21,7 +21,7 @@ static void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static void set_backlight(GDisplay *g, uint8_t percent) { +static void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -34,18 +34,18 @@ static void release_bus(GDisplay *g) { (void) g; } -static void spi_write_cmd(GDisplay *g, uint8_t cmd) { +static void spi_write_cmd(GDisplay *g, gU8 cmd) { (void) g; (void) cmd; } -static void spi_write_data_array(GDisplay *g, uint8_t* datas, size_t length) { +static void spi_write_data_array(GDisplay *g, gU8* datas, gMemSize length) { (void) g; (void) datas; (void) length; } -static void spi_write_data(GDisplay *g, uint8_t data) { +static void spi_write_data(GDisplay *g, gU8 data) { (void) g; (void) data; } diff --git a/drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c b/drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c index 8cefac96..1ae57273 100644 --- a/drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c +++ b/drivers/gdisp/SSD1848/gdisp_lld_SSD1848.c @@ -15,13 +15,13 @@ typedef struct LCD_Parameters { - uint8_t curXPtr; - uint8_t startXPtr; /* The area start bit position in the start column */ - uint8_t endXPtr; /* The area end bit position in the end column */ - uint8_t curCol; - uint8_t startCol; /* The area start column */ - uint8_t endCol; /* The area end column */ - uint8_t curYPtr; + gU8 curXPtr; + gU8 startXPtr; /* The area start bit position in the start column */ + gU8 endXPtr; /* The area end bit position in the end column */ + gU8 curCol; + gU8 startCol; /* The area start column */ + gU8 endCol; /* The area end column */ + gU8 curYPtr; } LCD_Parameters; #include "board_SSD1848.h" @@ -61,7 +61,7 @@ typedef struct LCD_Parameters /* Some common routines and macros */ #define PRM(g) ((LCD_Parameters *)g->priv) -#define RAM(g) ((uint8_t *)(PRM(g)+1)) +#define RAM(g) ((gU8 *)(PRM(g)+1)) #define write_cmd2(g, cmd1, cmd2) { spi_write_cmd (g, cmd1); spi_write_data (g, cmd2); } #define write_cmd3(g, cmd1, cmd2, cmd3) { spi_write_cmd (g, cmd1); spi_write_data2 (g, cmd2, cmd3); } @@ -76,7 +76,7 @@ static void set_viewport (GDisplay* g) default: case gOrientation0: spi_write_cmd (g, SSD1848_HV_COLUMN_ADDRESS); - spi_write_data2 (g, (uint8_t) (g->p.x / 8), (uint8_t) ((g->p.x + g->p.cx - 1) / 8)); + spi_write_data2 (g, (gU8) (g->p.x / 8), (gU8) ((g->p.x + g->p.cx - 1) / 8)); spi_write_cmd (g, SSD1848_HV_PAGE_ADDRESS); spi_write_data2 (g, g->p.y, g->p.y + g->p.cy - 1); spi_write_cmd (g, SSD1848_WRITE_DISP_DATA); @@ -118,7 +118,7 @@ static void set_viewport (GDisplay* g) LLDSPEC gBool gdisp_lld_init (GDisplay *g) { - uint8_t temp [5] = { 0 }; + gU8 temp [5] = { 0 }; /* The private area is the display surface. */ g->priv = gfxAlloc (sizeof(DisplayData) + GDISP_SCREEN_WIDTH / 8 * GDISP_SCREEN_HEIGHT); @@ -226,18 +226,18 @@ LLDSPEC void gdisp_lld_write_start (GDisplay *g) acquire_bus (g); set_viewport (g); - PRM(g)->curCol = PRM(g)->startCol = (uint8_t) (g->p.x / 8); - PRM(g)->endCol = (uint8_t) ((g->p.x + g->p.cx - 1) / 8); - PRM(g)->curXPtr = PRM(g)->startXPtr = (uint8_t) (g->p.x % 8); - PRM(g)->endXPtr = (uint8_t) ((g->p.x + g->p.cx - 1) % 8); + PRM(g)->curCol = PRM(g)->startCol = (gU8) (g->p.x / 8); + PRM(g)->endCol = (gU8) ((g->p.x + g->p.cx - 1) / 8); + PRM(g)->curXPtr = PRM(g)->startXPtr = (gU8) (g->p.x % 8); + PRM(g)->endXPtr = (gU8) ((g->p.x + g->p.cx - 1) % 8); PRM(g)->curYPtr = g->p.y; } LLDSPEC void gdisp_lld_write_color (GDisplay *g) { - uint8_t temp; - uint8_t a; - uint16_t y = PRM(g)->curYPtr; - uint16_t c = PRM(g)->curCol; + gU8 temp; + gU8 a; + gU16 y = PRM(g)->curYPtr; + gU16 c = PRM(g)->curCol; temp = RAM (g)[y * 16 + c]; if (gdispColor2Native (g->p.color)) @@ -286,7 +286,7 @@ LLDSPEC void gdisp_lld_write_stop (GDisplay *g) #if GDISP_HARDWARE_FLUSH LLDSPEC void gdisp_lld_flush (GDisplay *g) { - uint8_t * ram; + gU8 * ram; unsigned pages; /* Don't flush if we don't need it. */ @@ -312,7 +312,7 @@ LLDSPEC void gdisp_lld_flush (GDisplay *g) #if GDISP_HARDWARE_CLEARS LLDSPEC void gdisp_lld_clear (GDisplay *g) { - uint16_t area = GDISP_SCREEN_WIDTH / 8 * GDISP_SCREEN_HEIGHT; + gU16 area = GDISP_SCREEN_WIDTH / 8 * GDISP_SCREEN_HEIGHT; if (gdispColor2Native (g->p.color)) { @@ -343,13 +343,13 @@ LLDSPEC void gdisp_lld_fill_area (GDisplay *g) { gCoord scol, ecol, sx, ex; gCoord y, col, x; - uint16_t area = (uint16_t) g->p.cx * g->p.cy; - uint8_t temp; + gU16 area = (gU16) g->p.cx * g->p.cy; + gU8 temp; - col = scol = (uint8_t) (g->p.x / 8); - ecol = (uint8_t) ((g->p.x + g->p.cx - 1) / 8); - x = sx = (uint8_t) (g->p.x % 8); - ex = (uint8_t) ((g->p.x + g->p.cx - 1) % 8); + col = scol = (gU8) (g->p.x / 8); + ecol = (gU8) ((g->p.x + g->p.cx - 1) / 8); + x = sx = (gU8) (g->p.x % 8); + ex = (gU8) ((g->p.x + g->p.cx - 1) % 8); y = g->p.y; @@ -534,9 +534,9 @@ LLDSPEC void gdisp_lld_control (GDisplay *g) g->p.ptr = (void *) 100; acquire_bus (g); spi_write_cmd (g, SSD1848_SETCONTRAST); - spi_write_data (g, (((uint16_t) g->p.ptr) << 8) / 101); + spi_write_data (g, (((gU16) g->p.ptr) << 8) / 101); release_bus (g); - g->g.Contrast = (uint8_t) g->p.ptr; + g->g.Contrast = (gU8) g->p.ptr; return; /* Our own special controller code to inverse the display */ @@ -556,12 +556,12 @@ LLDSPEC void gdisp_lld_blit_area (GDisplay *g) { gCoord scol, ecol, sx; gCoord y, col; - uint16_t area; - uint8_t temp, temp2, i; + gU16 area; + gU8 temp, temp2, i; - col = scol = (uint8_t) (g->p.x / 8); - ecol = (uint8_t) ((g->p.x + g->p.cx - 1) / 8); - sx = (uint8_t) (g->p.x % 8); + col = scol = (gU8) (g->p.x / 8); + ecol = (gU8) ((g->p.x + g->p.cx - 1) / 8); + sx = (gU8) (g->p.x % 8); y = g->p.y; area = (ecol - scol + 1) * (g->p.cy); @@ -574,7 +574,7 @@ LLDSPEC void gdisp_lld_blit_area (GDisplay *g) { for (; area; area--) { - temp = RAM (g)[y * 16 + col] = *((uint8_t *) g->p.ptr)++; + temp = RAM (g)[y * 16 + col] = *((gU8 *) g->p.ptr)++; spi_write_data (g, temp); if (col == ecol) { @@ -595,13 +595,13 @@ LLDSPEC void gdisp_lld_blit_area (GDisplay *g) temp = RAM (g)[y * 16 + col]; if (col != ecol) { - temp |= (*((uint8_t *) g->p.ptr) >> sx); + temp |= (*((gU8 *) g->p.ptr) >> sx); RAM (g)[y * 16 + col] = temp; temp2 = RAM (g)[y * 16 + col + 1]; - temp2 |= (*((uint8_t *) g->p.ptr) << (8-sx)); + temp2 |= (*((gU8 *) g->p.ptr) << (8-sx)); RAM (g)[y * 16 + col + 1] = temp2; - ((uint8_t *) g->p.ptr)++; + ((gU8 *) g->p.ptr)++; } spi_write_data (g, temp); diff --git a/drivers/gdisp/SSD1963/board_SSD1963_template.h b/drivers/gdisp/SSD1963/board_SSD1963_template.h index 82010c3d..9fa5ad6b 100644 --- a/drivers/gdisp/SSD1963/board_SSD1963_template.h +++ b/drivers/gdisp/SSD1963/board_SSD1963_template.h @@ -43,12 +43,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; (void) data; } diff --git a/drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c b/drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c index 9c5ad960..145e9728 100644 --- a/drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c +++ b/drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c @@ -18,16 +18,16 @@ typedef struct LCD_Parameters { gCoord width, height; // Panel width and height - uint16_t hbporch; // Horizontal Back Porch - uint16_t hfporch; // Horizontal Front Porch - uint16_t hpulse; // Horizontal Pulse - uint16_t hperiod; // Horizontal Period (Total) - uint16_t vbporch; // Vertical Back Porch - uint16_t vfporch; // Vertical Front Porch - uint16_t vpulse; // Vertical Pulse - uint16_t vperiod; // Vertical Period (Total) - uint32_t fpr; // Calculated FPR - uint16_t mode; // For command "SSD1963_SET_LCD_MODE" + gU16 hbporch; // Horizontal Back Porch + gU16 hfporch; // Horizontal Front Porch + gU16 hpulse; // Horizontal Pulse + gU16 hperiod; // Horizontal Period (Total) + gU16 vbporch; // Vertical Back Porch + gU16 vfporch; // Vertical Front Porch + gU16 vpulse; // Vertical Pulse + gU16 vperiod; // Vertical Period (Total) + gU32 fpr; // Calculated FPR + gU16 mode; // For command "SSD1963_SET_LCD_MODE" /* Set the pannel data width */ #define LCD_PANEL_DATA_WIDTH_24BIT (1<<5) // 18bit default /* Set the color deeph enhancement */ @@ -71,7 +71,7 @@ typedef struct LCD_Parameters { #include "ssd1963.h" -#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } +#define dummy_read(g) { volatile gU16 dummy; dummy = read_data(g); (void) dummy; } #define write_reg(g, reg, data) { write_index(g, reg); write_data(g, data); } #define write_data16(g, data) { write_data(g, (data)>>8); write_data(g, (data) & 0xFF); } #define read_reg(g, reg) { write_index(g, reg); read_data(g); } @@ -124,7 +124,7 @@ static GFXINLINE void set_viewport(GDisplay* g) { * * Backlight appears to be forced off (by chip) when display blanked */ -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { // The SSD1963 has a built-in PWM (duty_cycle 00..FF). // Its output can be used by a Dynamic Background Control or by a host (user) // Check your LCD's hardware, the PWM connection is default left open and instead diff --git a/drivers/gdisp/SSD2119/board_SSD2119_template.h b/drivers/gdisp/SSD2119/board_SSD2119_template.h index 1cb21fb4..6cee8f1d 100644 --- a/drivers/gdisp/SSD2119/board_SSD2119_template.h +++ b/drivers/gdisp/SSD2119/board_SSD2119_template.h @@ -21,7 +21,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -34,12 +34,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_index(GDisplay *g, uint16_t index) { +static GFXINLINE void write_index(GDisplay *g, gU16 index) { (void) g; (void) index; } -static GFXINLINE void write_data(GDisplay *g, uint16_t data) { +static GFXINLINE void write_data(GDisplay *g, gU16 data) { (void) g; (void) data; } @@ -52,7 +52,7 @@ static GFXINLINE void setwritemode(GDisplay *g) { (void) g; } -static GFXINLINE uint16_t read_data(GDisplay *g) { +static GFXINLINE gU16 read_data(GDisplay *g) { (void) g; return 0; } diff --git a/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c b/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c index 82b8edaa..cea3319a 100644 --- a/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c +++ b/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c @@ -45,7 +45,7 @@ /*===========================================================================*/ // Some common routines and macros -#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } +#define dummy_read(g) { volatile gU16 dummy; dummy = read_data(g); (void) dummy; } #define write_reg(g, reg, data) { write_index(g, reg); write_data(g, data); } static void set_cursor(GDisplay* g) { @@ -260,7 +260,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) { dummy_read(g); } LLDSPEC gColor gdisp_lld_read_color(GDisplay* g) { - uint16_t data; + gU16 data; data = read_data(g); return gdispNative2Color(data); diff --git a/drivers/gdisp/ST7565/board_ST7565_template.h b/drivers/gdisp/ST7565/board_ST7565_template.h index 6835c187..44dfab39 100644 --- a/drivers/gdisp/ST7565/board_ST7565_template.h +++ b/drivers/gdisp/ST7565/board_ST7565_template.h @@ -38,12 +38,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) { +static GFXINLINE void write_cmd(GDisplay *g, gU8 cmd) { (void) g; (void) cmd; } -static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { +static GFXINLINE void write_data(GDisplay *g, gU8* data, gU16 length) { (void) g; (void) data; (void) length; diff --git a/drivers/gdisp/ST7565/gdisp_lld_ST7565.c b/drivers/gdisp/ST7565/gdisp_lld_ST7565.c index a651b6b7..2998eb3b 100644 --- a/drivers/gdisp/ST7565/gdisp_lld_ST7565.c +++ b/drivers/gdisp/ST7565/gdisp_lld_ST7565.c @@ -57,7 +57,7 @@ /*===========================================================================*/ // Some common routines and macros -#define RAM(g) ((uint8_t *)g->priv) +#define RAM(g) ((gU8 *)g->priv) #define write_cmd2(g, cmd1, cmd2) { write_cmd(g, cmd1); write_cmd(g, cmd2); } #define write_cmd3(g, cmd1, cmd2, cmd3) { write_cmd(g, cmd1); write_cmd(g, cmd2); write_cmd(g, cmd3); } @@ -150,7 +150,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return; acquire_bus(g); - uint8_t pagemap[8]={ST7565_PAGE_ORDER}; + gU8 pagemap[8]={ST7565_PAGE_ORDER}; for (p = 0; p < 8; p++) { write_cmd(g, ST7565_PAGE | pagemap[p]); write_cmd(g, ST7565_COLUMN_MSB | 0); diff --git a/drivers/gdisp/ST7735/gdisp_lld_ST7735.c b/drivers/gdisp/ST7735/gdisp_lld_ST7735.c index bc6b8084..3095dbbf 100644 --- a/drivers/gdisp/ST7735/gdisp_lld_ST7735.c +++ b/drivers/gdisp/ST7735/gdisp_lld_ST7735.c @@ -94,7 +94,7 @@ #include "drivers/gdisp/ST7735/st7735.h" // Some common routines and macros -#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } +#define dummy_read(g) { volatile gU16 dummy; dummy = read_data(g); (void) dummy; } #define write_reg(g, reg, data) { write_cmd(g, reg); write_data(g, data); } // Serial write data for fast fill. @@ -215,7 +215,7 @@ static const unsigned char #endif -static void execute_cmds(GDisplay *g, const uint8_t *addr) { +static void execute_cmds(GDisplay *g, const gU8 *addr) { unsigned int cmds = *addr++; while (cmds--) { diff --git a/drivers/gdisp/STM32LTDC/board_STM32LTDC_template.h b/drivers/gdisp/STM32LTDC/board_STM32LTDC_template.h index a3658680..20e47b5e 100644 --- a/drivers/gdisp/STM32LTDC/board_STM32LTDC_template.h +++ b/drivers/gdisp/STM32LTDC/board_STM32LTDC_template.h @@ -69,7 +69,7 @@ static GFXINLINE void post_init_board(GDisplay* g) (void)g; } -static GFXINLINE void set_backlight(GDisplay* g, uint8_t percent) +static GFXINLINE void set_backlight(GDisplay* g, gU8 percent) { // This is function may be called with the display for either the foreground // or the background layer. diff --git a/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c b/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c index 54ecf0cc..7cb8e8a0 100644 --- a/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c +++ b/drivers/gdisp/STM32LTDC/gdisp_lld_STM32LTDC.c @@ -50,19 +50,19 @@ typedef struct ltdcLayerConfig { LLDCOLOR_TYPE* frame; // Frame buffer address gCoord width, height; // Frame size in pixels gCoord pitch; // Line pitch, in bytes - uint16_t fmt; // Pixel format in LTDC format + gU16 fmt; // Pixel format in LTDC format // Window gCoord x, y; // Start pixel position of the virtual layer gCoord cx, cy; // Size of the virtual layer - uint32_t defcolor; // Default color, ARGB8888 - uint32_t keycolor; // Color key, RGB888 - uint32_t blending; // Blending factors - const uint32_t* palette; // The palette, RGB888 (can be NULL) - uint16_t palettelen; // Palette length - uint8_t alpha; // Constant alpha factor - uint8_t layerflags; // Layer configuration + gU32 defcolor; // Default color, ARGB8888 + gU32 keycolor; // Color key, RGB888 + gU32 blending; // Blending factors + const gU32* palette; // The palette, RGB888 (can be NULL) + gU16 palettelen; // Palette length + gU8 alpha; // Constant alpha factor + gU8 layerflags; // Layer configuration } ltdcLayerConfig; typedef struct ltdcConfig { @@ -70,8 +70,8 @@ typedef struct ltdcConfig { gCoord hsync, vsync; // Horizontal and Vertical sync pixels gCoord hbackporch, vbackporch; // Horizontal and Vertical back porch pixels gCoord hfrontporch, vfrontporch; // Horizontal and Vertical front porch pixels - uint32_t syncflags; // Sync flags - uint32_t bgcolor; // Clear screen color RGB888 + gU32 syncflags; // Sync flags + gU32 bgcolor; // Clear screen color RGB888 ltdcLayerConfig bglayer; // Background layer config ltdcLayerConfig fglayer; // Foreground layer config @@ -109,7 +109,7 @@ typedef struct ltdcConfig { /*===========================================================================*/ #define PIXIL_POS(g, x, y) ((y) * ((ltdcLayerConfig *)g->priv)->pitch + (x) * LTDC_PIXELBYTES) -#define PIXEL_ADDR(g, pos) ((LLDCOLOR_TYPE *)((uint8_t *)((ltdcLayerConfig *)g->priv)->frame+pos)) +#define PIXEL_ADDR(g, pos) ((LLDCOLOR_TYPE *)((gU8 *)((ltdcLayerConfig *)g->priv)->frame+pos)) /*===========================================================================*/ /* Driver exported functions. */ @@ -124,7 +124,7 @@ static void _ltdc_reload(void) { } static void _ltdc_layer_init(LTDC_Layer_TypeDef* pLayReg, const ltdcLayerConfig* pCfg) { - static const uint8_t fmt2Bpp[] = { + static const gU8 fmt2Bpp[] = { 4, /* LTDC_FMT_ARGB8888 */ 3, /* LTDC_FMT_RGB888 */ 2, /* LTDC_FMT_RGB565 */ @@ -134,37 +134,37 @@ static void _ltdc_layer_init(LTDC_Layer_TypeDef* pLayReg, const ltdcLayerConfig* 1, /* LTDC_FMT_AL44 */ 2 /* LTDC_FMT_AL88 */ }; - uint32_t start, stop; + gU32 start, stop; // Set the framebuffer dimensions and format - pLayReg->PFCR = (pLayReg->PFCR & ~LTDC_LxPFCR_PF) | ((uint32_t)pCfg->fmt & LTDC_LxPFCR_PF); - pLayReg->CFBAR = (uint32_t)pCfg->frame & LTDC_LxCFBAR_CFBADD; - pLayReg->CFBLR = ((((uint32_t)pCfg->pitch << 16) & LTDC_LxCFBLR_CFBP) | (((uint32_t)fmt2Bpp[pCfg->fmt] * pCfg->width + 3) & LTDC_LxCFBLR_CFBLL)); - pLayReg->CFBLNR = (uint32_t)pCfg->height & LTDC_LxCFBLNR_CFBLNBR; + pLayReg->PFCR = (pLayReg->PFCR & ~LTDC_LxPFCR_PF) | ((gU32)pCfg->fmt & LTDC_LxPFCR_PF); + pLayReg->CFBAR = (gU32)pCfg->frame & LTDC_LxCFBAR_CFBADD; + pLayReg->CFBLR = ((((gU32)pCfg->pitch << 16) & LTDC_LxCFBLR_CFBP) | (((gU32)fmt2Bpp[pCfg->fmt] * pCfg->width + 3) & LTDC_LxCFBLR_CFBLL)); + pLayReg->CFBLNR = (gU32)pCfg->height & LTDC_LxCFBLNR_CFBLNBR; // Set the display window boundaries - start = (uint32_t)pCfg->x + driverCfg.hsync + driverCfg.hbackporch; + start = (gU32)pCfg->x + driverCfg.hsync + driverCfg.hbackporch; stop = start + pCfg->cx - 1; pLayReg->WHPCR = ((start << 0) & LTDC_LxWHPCR_WHSTPOS) | ((stop << 16) & LTDC_LxWHPCR_WHSPPOS); - start = (uint32_t)pCfg->y + driverCfg.vsync + driverCfg.vbackporch; + start = (gU32)pCfg->y + driverCfg.vsync + driverCfg.vbackporch; stop = start + pCfg->cy - 1; pLayReg->WVPCR = ((start << 0) & LTDC_LxWVPCR_WVSTPOS) | ((stop << 16) & LTDC_LxWVPCR_WVSPPOS); // Set colors pLayReg->DCCR = pCfg->defcolor; pLayReg->CKCR = (pLayReg->CKCR & ~0x00FFFFFF) | (pCfg->keycolor & 0x00FFFFFF); - pLayReg->CACR = (pLayReg->CACR & ~LTDC_LxCACR_CONSTA) | ((uint32_t)pCfg->alpha & LTDC_LxCACR_CONSTA); - pLayReg->BFCR = (pLayReg->BFCR & ~(LTDC_LxBFCR_BF1 | LTDC_LxBFCR_BF2)) | ((uint32_t)pCfg->blending & (LTDC_LxBFCR_BF1 | LTDC_LxBFCR_BF2)); + pLayReg->CACR = (pLayReg->CACR & ~LTDC_LxCACR_CONSTA) | ((gU32)pCfg->alpha & LTDC_LxCACR_CONSTA); + pLayReg->BFCR = (pLayReg->BFCR & ~(LTDC_LxBFCR_BF1 | LTDC_LxBFCR_BF2)) | ((gU32)pCfg->blending & (LTDC_LxBFCR_BF1 | LTDC_LxBFCR_BF2)); for (start = 0; start < pCfg->palettelen; start++) - pLayReg->CLUTWR = ((uint32_t)start << 24) | (pCfg->palette[start] & 0x00FFFFFF); + pLayReg->CLUTWR = ((gU32)start << 24) | (pCfg->palette[start] & 0x00FFFFFF); // Final flags - pLayReg->CR = (pLayReg->CR & ~LTDC_LEF_MASK) | ((uint32_t)pCfg->layerflags & LTDC_LEF_MASK); + pLayReg->CR = (pLayReg->CR & ~LTDC_LEF_MASK) | ((gU32)pCfg->layerflags & LTDC_LEF_MASK); } static void _ltdc_init(void) { // Set up the display scanning - uint32_t hacc, vacc; + gU32 hacc, vacc; // Reset the LTDC peripheral RCC->APB2RSTR |= RCC_APB2RSTR_LTDCRST; @@ -446,9 +446,9 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g) { // Uses p.x,p.y p.cx,p.cy p.color LLDSPEC void gdisp_lld_fill_area(GDisplay* g) { - uint32_t pos; - uint32_t lineadd; - uint32_t shape; + gU32 pos; + gU32 lineadd; + gU32 shape; #if GDISP_NEED_CONTROL switch(g->g.Orientation) { @@ -484,13 +484,13 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g) { { // This is slightly less than optimal as we flush the whole line in the source and destination image // instead of just the cx portion but this saves us having to iterate over each line. - uint32_t f, e; + gU32 f, e; // Data memory barrier __ugfxDSB(); // Flush then invalidate the destination area - e = pos + (g->p.cy > 1 ? ((uint32_t)((ltdcLayerConfig *)g->priv)->pitch*(shape & 0xFFFF)) : ((shape>>16)*LTDC_PIXELBYTES)); + e = pos + (g->p.cy > 1 ? ((gU32)((ltdcLayerConfig *)g->priv)->pitch*(shape & 0xFFFF)) : ((shape>>16)*LTDC_PIXELBYTES)); for(f=(pos & ~31); f < e; f += 32) { SCB->DCCIMVAC = f; SCB->DCIMVAC = f; @@ -505,16 +505,16 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g) { while(DMA2D->CR & DMA2D_CR_START); // Start the DMA2D - DMA2D->OMAR = (uint32_t)PIXEL_ADDR(g, pos); + DMA2D->OMAR = (gU32)PIXEL_ADDR(g, pos); DMA2D->OOR = lineadd; DMA2D->NLR = shape; #if GDISP_LLD_PIXELFORMAT == GDISP_PIXELFORMAT_RGB888 // As we don't support ARGB pixel types in uGFX yet we will // use RGB with an inverted alpha value for compatibility // ie. 0x00FFFFFF is fully opaque white, 0xFFFFFFFF is fully transparent white - DMA2D->OCOLR = (uint32_t)(gdispColor2Native(g->p.color)) ^ 0xFF000000; + DMA2D->OCOLR = (gU32)(gdispColor2Native(g->p.color)) ^ 0xFF000000; #else - DMA2D->OCOLR = (uint32_t)(gdispColor2Native(g->p.color)); + DMA2D->OCOLR = (gU32)(gdispColor2Native(g->p.color)); #endif ; DMA2D->CR = DMA2D_CR_MODE_R2M | DMA2D_CR_START; @@ -540,27 +540,27 @@ LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay* g) { #if GDISP_HARDWARE_BITFILLS // Uses p.x,p.y p.cx,p.cy p.x1,p.y1 (=srcx,srcy) p.x2 (=srccx), p.ptr (=buffer) LLDSPEC void gdisp_lld_blit_area(GDisplay* g) { - uint32_t srcstart, dststart; + gU32 srcstart, dststart; - srcstart = LTDC_PIXELBYTES * ((uint32_t)g->p.x2 * g->p.y1 * + g->p.x1) + (uint32_t)g->p.ptr; - dststart = (uint32_t)PIXEL_ADDR(g, PIXIL_POS(g, g->p.x, g->p.y)); + srcstart = LTDC_PIXELBYTES * ((gU32)g->p.x2 * g->p.y1 * + g->p.x1) + (gU32)g->p.ptr; + dststart = (gU32)PIXEL_ADDR(g, PIXIL_POS(g, g->p.x, g->p.y)); #if LTDC_DMA_CACHE_FLUSH { // This is slightly less than optimal as we flush the whole line in the source and destination image // instead of just the cx portion but this saves us having to iterate over each line. - uint32_t f, e; + gU32 f, e; // Data memory barrier __ugfxDSB(); // Flush the source area - e = srcstart + (g->p.cy > 1 ? ((uint32_t)g->p.x2*g->p.cy) : (uint32_t)g->p.cx)*LTDC_PIXELBYTES; + e = srcstart + (g->p.cy > 1 ? ((gU32)g->p.x2*g->p.cy) : (gU32)g->p.cx)*LTDC_PIXELBYTES; for(f=(srcstart & ~31); f < e; f += 32) SCB->DCCIMVAC = f; // Flush then invalidate the destination area - e = dststart + (g->p.cy > 1 ? ((uint32_t)((ltdcLayerConfig *)g->priv)->pitch*g->p.cy) : ((uint32_t)g->p.cx*LTDC_PIXELBYTES)); + e = dststart + (g->p.cy > 1 ? ((gU32)((ltdcLayerConfig *)g->priv)->pitch*g->p.cy) : ((gU32)g->p.cx*LTDC_PIXELBYTES)); for(f=(dststart & ~31); f < e; f += 32) { SCB->DCCIMVAC = f; SCB->DCIMVAC = f; diff --git a/drivers/gdisp/STM32LTDC/stm32_dma2d.h b/drivers/gdisp/STM32LTDC/stm32_dma2d.h index 1b3478c9..38995479 100644 --- a/drivers/gdisp/STM32LTDC/stm32_dma2d.h +++ b/drivers/gdisp/STM32LTDC/stm32_dma2d.h @@ -11,8 +11,8 @@ #define FGPFCCR_CM_RGB888 0x01 #define FGPFCCR_CM_RGB565 0x02 -#define DMA2D_CR_MODE_R2M ((uint32_t)0x00030000) /* Register-to-memory mode */ -#define DMA2D_CR_MODE_M2M ((uint32_t)0x00000000) /* Register-to-memory mode */ +#define DMA2D_CR_MODE_R2M ((gU32)0x00030000) /* Register-to-memory mode */ +#define DMA2D_CR_MODE_M2M ((gU32)0x00000000) /* Register-to-memory mode */ static void dma2d_init(void); diff --git a/drivers/gdisp/TLS8204/board_TLS8204_template.h b/drivers/gdisp/TLS8204/board_TLS8204_template.h index 6b48d83b..0749f5a8 100644 --- a/drivers/gdisp/TLS8204/board_TLS8204_template.h +++ b/drivers/gdisp/TLS8204/board_TLS8204_template.h @@ -21,7 +21,7 @@ static GFXINLINE void setpin_reset(GDisplay *g, gBool state) { (void) state; } -static GFXINLINE void set_backlight(GDisplay *g, uint8_t percent) { +static GFXINLINE void set_backlight(GDisplay *g, gU8 percent) { (void) g; (void) percent; } @@ -34,12 +34,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) { +static GFXINLINE void write_cmd(GDisplay *g, gU8 cmd) { (void) g; (void) cmd; } -static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { +static GFXINLINE void write_data(GDisplay *g, gU8* data, gU16 length) { (void) g; (void) data; (void) length; diff --git a/drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c b/drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c index c7ec75a8..8cfdb862 100644 --- a/drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c +++ b/drivers/gdisp/TLS8204/gdisp_lld_TLS8204.c @@ -33,7 +33,7 @@ /*===========================================================================*/ // Some common routines and macros -#define RAM(g) ((uint8_t *)g->priv) +#define RAM(g) ((gU8 *)g->priv) #define xyaddr(x, y) ((x) + ((y) >> 3) * GDISP_TLS8204_WIDTH) #define xybit(y) (1 << ((y) & 7)) @@ -261,7 +261,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { case GDISP_CONTROL_CONTRAST: if ((unsigned)g->p.ptr > 100) g->p.ptr = (void *)100; { - uint8_t cval; + gU8 cval; cval = (unsigned)g->p.ptr * 2 + 22; acquire_bus(g); diff --git a/drivers/gdisp/UC1601s/board_UC1601s_template.h b/drivers/gdisp/UC1601s/board_UC1601s_template.h index 51b6e5f4..518f932a 100644 --- a/drivers/gdisp/UC1601s/board_UC1601s_template.h +++ b/drivers/gdisp/UC1601s/board_UC1601s_template.h @@ -31,12 +31,12 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) { +static GFXINLINE void write_cmd(GDisplay *g, gU8 cmd) { (void) g; (void) cmd; } -static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { +static GFXINLINE void write_data(GDisplay *g, gU8* data, gU16 length) { (void) g; (void) data; (void) length; diff --git a/drivers/gdisp/UC1601s/gdisp_lld_UC1601s.c b/drivers/gdisp/UC1601s/gdisp_lld_UC1601s.c index 9b801ea5..c5c78cad 100644 --- a/drivers/gdisp/UC1601s/gdisp_lld_UC1601s.c +++ b/drivers/gdisp/UC1601s/gdisp_lld_UC1601s.c @@ -53,7 +53,7 @@ /*===========================================================================*/ // Some common routines and macros -#define RAM(g) ((uint8_t *)g->priv) +#define RAM(g) ((gU8 *)g->priv) #define xyaddr(x, y) ((x) + ((y) >> 3) * GDISP_SCREEN_WIDTH) #define xybit(y) (1 << ((y) & 7)) @@ -94,7 +94,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { write_cmd(g, UC1601s_RESET); gfxSleepMilliseconds(10); - write_cmd2(g, UC1601s_SET_BIAS, (uint8_t)(((GDISP_INITIAL_CONTRAST << 8) - 1) / 100)); + write_cmd2(g, UC1601s_SET_BIAS, (gU8)(((GDISP_INITIAL_CONTRAST << 8) - 1) / 100)); write_cmd(g, UC1601s_SET_EN | UC1601s_ENABLE); @@ -266,7 +266,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { case GDISP_CONTROL_CONTRAST: if ((unsigned)g->p.ptr > 100) g->p.ptr = (void *)100; acquire_bus(g); - write_cmd2(g, UC1601s_SET_BIAS, (uint8_t)(((((unsigned)g->p.ptr) << 8) - 1) / 100)); + write_cmd2(g, UC1601s_SET_BIAS, (gU8)(((((unsigned)g->p.ptr) << 8) - 1) / 100)); release_bus(g); g->g.Contrast = (unsigned)g->p.ptr; return; diff --git a/drivers/gdisp/UC1610/board_UC1610_template.h b/drivers/gdisp/UC1610/board_UC1610_template.h index bc5d3a88..ee27a6e3 100644 --- a/drivers/gdisp/UC1610/board_UC1610_template.h +++ b/drivers/gdisp/UC1610/board_UC1610_template.h @@ -30,13 +30,13 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_cmd(GDisplay *g, uint8_t * cmd, uint8_t length) { +static GFXINLINE void write_cmd(GDisplay *g, gU8 * cmd, gU8 length) { (void) g; (void) cmd; (void) length; } -static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) { +static GFXINLINE void write_data(GDisplay *g, gU8* data, gU16 length) { (void) g; (void) data; (void) length; diff --git a/drivers/gdisp/UC1610/gdisp_lld_UC1610.c b/drivers/gdisp/UC1610/gdisp_lld_UC1610.c index 10e1e2f3..001a87a6 100644 --- a/drivers/gdisp/UC1610/gdisp_lld_UC1610.c +++ b/drivers/gdisp/UC1610/gdisp_lld_UC1610.c @@ -39,7 +39,7 @@ // Some common routines and macros #define PRIV(g) ((UC1610_Window *)g->priv) -#define RAM(g) ((uint8_t *)(PRIV(g) + 1)) +#define RAM(g) ((gU8 *)(PRIV(g) + 1)) #define xyaddr(x, y) ((x) + GDISP_SCREEN_WIDTH * ((y) >> 2)) #define xybit(y, c) ((c) << (((y) & 3) << 1)) #define GDISP_FLG_NEEDFLUSH (GDISP_FLG_DRIVER << 0) @@ -55,7 +55,7 @@ typedef struct UC1610_Window { /* Driver local varriables. */ /*===========================================================================*/ -static uint8_t cmdBuffer[11]; +static gU8 cmdBuffer[11]; /*===========================================================================*/ /* Driver local functions. */ @@ -70,7 +70,7 @@ static void GFXINLINE power_on_sequence(GDisplay* g) { cmdBuffer[2] = UC1610_SET_PANEL_LOADING; cmdBuffer[3] = UC1610_SET_LCD_BIAS_RATIO; cmdBuffer[4] = UC1610_SET_VBIAS_POT; // set contrast - cmdBuffer[5] = (uint8_t) (GDISP_INITIAL_CONTRAST * 254 / 100); + cmdBuffer[5] = (gU8) (GDISP_INITIAL_CONTRAST * 254 / 100); cmdBuffer[6] = UC1610_SET_MAPPING_CONTROL; // bottom view cmdBuffer[7] = UC1610_SET_SCROLL_LINES_LSB | 0; cmdBuffer[8] = UC1610_SET_SCROLL_LINES_MSB | 0; // set scroll line on line 0 @@ -134,7 +134,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_DRAWPIXEL LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { gCoord x, y; - uint8_t *c; + gU8 *c; // handle orientation switch (g->g.Orientation) { @@ -171,7 +171,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { LLDSPEC void gdisp_lld_flush(GDisplay* g) { gCoord x1, y1, x2, y2, cx; - uint8_t *c; + gU8 *c; // Don't flush unless we really need to if (!(g->flags & GDISP_FLG_NEEDFLUSH)) @@ -307,7 +307,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { if ((unsigned)g->p.ptr > 100) { g->p.ptr = (void *)100; } acquire_bus(g); cmdBuffer[0] = UC1610_SET_VBIAS_POT; - cmdBuffer[1] = (uint8_t)((unsigned)g->p.ptr * 254 / 100); + cmdBuffer[1] = (gU8)((unsigned)g->p.ptr * 254 / 100); write_cmd(g, cmdBuffer, 2); release_bus(g); g->g.Contrast = (unsigned)g->p.ptr; diff --git a/drivers/gdisp/UC8173/UC8173_waveform_examples.h b/drivers/gdisp/UC8173/UC8173_waveform_examples.h index e8ac919b..8bfaf93f 100644 --- a/drivers/gdisp/UC8173/UC8173_waveform_examples.h +++ b/drivers/gdisp/UC8173/UC8173_waveform_examples.h @@ -1,4 +1,4 @@ -static uint8_t const _lut_ft[] = { +static gU8 const _lut_ft[] = { 0x55,0x55,0x55,0x55,0x55,0xAA,0xAA,0xAA,0xAA,0xAA,0x55,0x55,0x55,0x55,0x55,0x55, 0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x5A,0x5A, 0x5A,0x5A,0x5A,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0x5A,0x5A, @@ -9,11 +9,11 @@ static uint8_t const _lut_ft[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; -static uint8_t const _lut_KWvcom_DC_GU[] = { +static gU8 const _lut_KWvcom_DC_GU[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0C, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; -static uint8_t const _lut_kw_GU[] = { +static gU8 const _lut_kw_GU[] = { 0x01,0x00,0x00,0x80,0x01,0x00,0x00,0x80,0x01,0x00,0x00,0x80,0x01,0x00,0x00,0x80, 0x01,0x00,0x00,0x80,0x01,0x00,0x00,0x80,0x01,0x00,0x00,0x80,0x01,0x00,0x00,0x80, 0x01,0x00,0x00,0x80,0x01,0x00,0x00,0x80,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40, @@ -48,11 +48,11 @@ static uint8_t const _lut_kw_GU[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; -static uint8_t const _lut_KWvcom_GC[] = { +static gU8 const _lut_KWvcom_GC[] = { 0x55,0x6A,0xA5,0x55,0x55,0x55,0x55,0x55,0x56,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0x0C, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; -static uint8_t const _lut_kw_GC[] = { +static gU8 const _lut_kw_GC[] = { 0x41,0x00,0x00,0x81,0x41,0x00,0x00,0x81,0x41,0x00,0x00,0x81,0x41,0x00,0x00,0x81, 0x41,0x00,0x00,0x81,0x81,0x00,0x00,0x82,0x81,0x00,0x00,0x82,0x81,0x00,0x00,0x82, 0x81,0x00,0x00,0x82,0x81,0x00,0x00,0x82,0x42,0x00,0x00,0x41,0x42,0x00,0x00,0x41, @@ -87,11 +87,11 @@ static uint8_t const _lut_kw_GC[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; -static uint8_t const _lut_KWvcom_DC_A2_240ms[] = { +static gU8 const _lut_KWvcom_DC_A2_240ms[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; -static uint8_t const _lut_kw_A2_240ms[] = { +static gU8 const _lut_kw_A2_240ms[] = { 0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40, 0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40, 0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40, @@ -126,11 +126,11 @@ static uint8_t const _lut_kw_A2_240ms[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; -static uint8_t const _lut_KWvcom_DC_A2_120ms[] = { +static gU8 const _lut_KWvcom_DC_A2_120ms[] = { 0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; -static uint8_t const _lut_kw_A2_120ms[] = { +static gU8 const _lut_kw_A2_120ms[] = { 0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40, 0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40, 0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40,0x02,0x00,0x00,0x40, diff --git a/drivers/gdisp/UC8173/board_UC8173_template.h b/drivers/gdisp/UC8173/board_UC8173_template.h index 94677979..5321afe7 100644 --- a/drivers/gdisp/UC8173/board_UC8173_template.h +++ b/drivers/gdisp/UC8173/board_UC8173_template.h @@ -61,19 +61,19 @@ static GFXINLINE void release_bus(GDisplay* g) (void) g; } -static GFXINLINE void write_cmd(GDisplay* g, uint8_t cmd) +static GFXINLINE void write_cmd(GDisplay* g, gU8 cmd) { (void) g; (void) cmd; } -static GFXINLINE void write_data(GDisplay* g, uint8_t data) +static GFXINLINE void write_data(GDisplay* g, gU8 data) { (void) g; (void) data; } -static GFXINLINE void write_data_burst(GDisplay* g, uint8_t* data, unsigned length) +static GFXINLINE void write_data_burst(GDisplay* g, gU8* data, unsigned length) { (void) g; (void) data; @@ -81,7 +81,7 @@ static GFXINLINE void write_data_burst(GDisplay* g, uint8_t* data, unsigned leng } #if UC8173_CAN_READ - static GFXINLINE uint8_t read_data(GDisplay* g) + static GFXINLINE gU8 read_data(GDisplay* g) { (void)g; return 0; diff --git a/drivers/gdisp/UC8173/gdisp_lld_UC8173.c b/drivers/gdisp/UC8173/gdisp_lld_UC8173.c index 05fcf557..fdd9fd23 100644 --- a/drivers/gdisp/UC8173/gdisp_lld_UC8173.c +++ b/drivers/gdisp/UC8173/gdisp_lld_UC8173.c @@ -25,9 +25,9 @@ /*------------------ Load the board file ------------------*/ typedef struct UC8173Lut { - uint8_t const *lutVCOM; // 32 bytes - uint8_t const *lutFW; // 512 bytes - uint8_t const *lutFT; // 128 bytes + gU8 const *lutVCOM; // 32 bytes + gU8 const *lutFW; // 512 bytes + gU8 const *lutFT; // 128 bytes gBool regal; } UC8173Lut; @@ -115,7 +115,7 @@ typedef struct UC8173_Private { } UC8173_Private; #if !UC8173_INIT_REAL_LUT - static uint8_t const UC8173_LUT_None[] = { + static gU8 const UC8173_LUT_None[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, @@ -234,7 +234,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) write_data(g, UC8173_VCOM_VOLTAGEBYTE); // was 0x12 in example code = -1.0V #elif UC8173_CAN_READ { - uint8_t vc; + gU8 vc; write_cmd(g, VV); vc = read_data(g); @@ -340,12 +340,12 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) // Setup the window // Datasheet says x,y,w,h but in practice it needs to be x,y,w-1,h-1 write_cmd(g, DTMW); - write_data(g, (uint8_t)((priv->fb.fa0.x >> 0) & 0xFF)); - write_data(g, (uint8_t)((priv->fb.fa0.y >> 8) & 0x03)); - write_data(g, (uint8_t)((priv->fb.fa0.y >> 0) & 0xFF)); - write_data(g, (uint8_t)(((cx-1) >> 0) & 0xFF)); - write_data(g, (uint8_t)(((cy-1) >> 8) & 0x03)); - write_data(g, (uint8_t)(((cy-1) >> 0) & 0xFF)); + write_data(g, (gU8)((priv->fb.fa0.x >> 0) & 0xFF)); + write_data(g, (gU8)((priv->fb.fa0.y >> 8) & 0x03)); + write_data(g, (gU8)((priv->fb.fa0.y >> 0) & 0xFF)); + write_data(g, (gU8)(((cx-1) >> 0) & 0xFF)); + write_data(g, (gU8)(((cy-1) >> 8) & 0x03)); + write_data(g, (gU8)(((cy-1) >> 0) & 0xFF)); // Transfer the buffer #if GDISP_LLD_PIXELFORMAT == GDISP_PIXELFORMAT_MONO @@ -357,7 +357,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) #endif dx = (cx+FB_TYPE_PIXELS-1)/FB_TYPE_PIXELS * (LLDCOLOR_TYPE_BITS/8); for (fb = FB_ADDR(&priv->fb, 0, priv->fb.fa0.x, priv->fb.fa0.y), dy = cy; dy; dy--, fb += FB_LINE_TYPES) - write_data_burst(g, (uint8_t *)fb, dx); + write_data_burst(g, (gU8 *)fb, dx); // Power-up the DC/DC converter to update the display panel write_cmd(g, PON); @@ -367,12 +367,12 @@ LLDSPEC gBool gdisp_lld_init(GDisplay* g) // Datasheet says x,y,w,h but in practice it needs to be x,y,w-1,h-1 write_cmd(g, DRF); // data: Partial Scan = 0x10, REGAL = 0x08, VCOM_DoNothing = 0x04 (GC4/A2 = 0x00, GU4 = 0x08) write_data(g, (priv->lut->regal ? 0x08 : 0x00)); - write_data(g, (uint8_t)((priv->fb.fa0.x >> 0) & 0xFF)); - write_data(g, (uint8_t)((priv->fb.fa0.y >> 8) & 0x03)); - write_data(g, (uint8_t)((priv->fb.fa0.y >> 0) & 0xFF)); - write_data(g, (uint8_t)(((cx-1) >> 0) & 0xFF)); - write_data(g, (uint8_t)(((cy-1) >> 8) & 0x03)); - write_data(g, (uint8_t)(((cy-1) >> 0) & 0xFF)); + write_data(g, (gU8)((priv->fb.fa0.x >> 0) & 0xFF)); + write_data(g, (gU8)((priv->fb.fa0.y >> 8) & 0x03)); + write_data(g, (gU8)((priv->fb.fa0.y >> 0) & 0xFF)); + write_data(g, (gU8)(((cx-1) >> 0) & 0xFF)); + write_data(g, (gU8)(((cy-1) >> 8) & 0x03)); + write_data(g, (gU8)(((cy-1) >> 0) & 0xFF)); while (!getpin_busy(g)); // Power-down the DC/DC converter diff --git a/drivers/gdisp/WS29EPD/board_WS29EPD_template.h b/drivers/gdisp/WS29EPD/board_WS29EPD_template.h index 8d8b1077..1682ebf6 100644 --- a/drivers/gdisp/WS29EPD/board_WS29EPD_template.h +++ b/drivers/gdisp/WS29EPD/board_WS29EPD_template.h @@ -31,23 +31,23 @@ static GFXINLINE void release_bus(GDisplay *g) { (void) g; } -static GFXINLINE void write_data(GDisplay *g, uint8_t data) { +static GFXINLINE void write_data(GDisplay *g, gU8 data) { (void) g; (void) data; } -static GFXINLINE void write_reg(GDisplay *g, uint8_t reg, uint8_t data){ +static GFXINLINE void write_reg(GDisplay *g, gU8 reg, gU8 data){ (void) g; (void) reg; (void) data; } -static GFXINLINE void write_cmd(GDisplay *g, uint8_t reg){ +static GFXINLINE void write_cmd(GDisplay *g, gU8 reg){ (void) g; (void) reg; } -static GFXINLINE void write_reg_data(GDisplay *g, uint8_t reg, uint8_t *data, uint8_t len) { +static GFXINLINE void write_reg_data(GDisplay *g, gU8 reg, gU8 *data, gU8 len) { (void) g; (void) reg; (void) data; diff --git a/drivers/gdisp/WS29EPD/gdisp_lld_WS29EPD.c b/drivers/gdisp/WS29EPD/gdisp_lld_WS29EPD.c index 5073ed61..07bf8e8f 100644 --- a/drivers/gdisp/WS29EPD/gdisp_lld_WS29EPD.c +++ b/drivers/gdisp/WS29EPD/gdisp_lld_WS29EPD.c @@ -37,9 +37,9 @@ /*===========================================================================*/ /* initialization variables according to WaveShare. */ -uint8_t GDOControl[] = {(GDISP_SCREEN_HEIGHT-1)%256,(GDISP_SCREEN_HEIGHT-1)/256,0x00}; -uint8_t softstart[] = {0xd7,0xd6,0x9d}; -uint8_t LUTDefault_full[] = {0x02,0x02,0x01,0x11,0x12,0x12,0x22,0x22,0x66,0x69,0x69,0x59,0x58,0x99,0x99,0x88,0x00,0x00,0x00,0x00,0xF8,0xB4,0x13,0x51,0x35,0x51,0x51,0x19,0x01,0x00}; // Initialize the full display +gU8 GDOControl[] = {(GDISP_SCREEN_HEIGHT-1)%256,(GDISP_SCREEN_HEIGHT-1)/256,0x00}; +gU8 softstart[] = {0xd7,0xd6,0x9d}; +gU8 LUTDefault_full[] = {0x02,0x02,0x01,0x11,0x12,0x12,0x22,0x22,0x66,0x69,0x69,0x59,0x58,0x99,0x99,0x88,0x00,0x00,0x00,0x00,0xF8,0xB4,0x13,0x51,0x35,0x51,0x51,0x19,0x01,0x00}; // Initialize the full display /*===========================================================================*/ /* Driver local functions. */ @@ -55,7 +55,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { * [y=0; y=1; y=2; y=3; ...; y=GDISP_SCREEN_HEIGHT][y=0; y=1; y=2; y=3; ...; y=GDISP_SCREEN_HEIGHT]... * */ - g->priv = gfxAlloc((GDISP_SCREEN_WIDTH / WS29EPD_PPB) * GDISP_SCREEN_HEIGHT * sizeof(uint8_t)); + g->priv = gfxAlloc((GDISP_SCREEN_WIDTH / WS29EPD_PPB) * GDISP_SCREEN_HEIGHT * sizeof(gU8)); if (!g->priv) return gFalse; @@ -85,12 +85,12 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { write_cmd(g, MASTER_ACTIVATION); write_reg(g, DEEP_SLEEP_MODE, 0x00); - uint8_t zeros[2] = { 0, 0 }; + gU8 zeros[2] = { 0, 0 }; write_reg(g, SET_RAM_X_CNT, 0x00); // Set cursor at origin write_reg_data(g, SET_RAM_Y_CNT, zeros, 2); - uint8_t dataX[2] = { 0, (GDISP_SCREEN_WIDTH-1)/8 }; - uint8_t dataY[4] = { 0, 0, (GDISP_SCREEN_HEIGHT-1)%256, (GDISP_SCREEN_HEIGHT-1)/256 }; + gU8 dataX[2] = { 0, (GDISP_SCREEN_WIDTH-1)/8 }; + gU8 dataY[4] = { 0, 0, (GDISP_SCREEN_HEIGHT-1)%256, (GDISP_SCREEN_HEIGHT-1)/256 }; write_reg_data(g, SET_RAM_X_ADR, dataX, 2); // Set viewport for the whole screen write_reg_data(g, SET_RAM_Y_ADR, dataY, 4); @@ -111,7 +111,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if 0 // Not needed yet static void set_cursor(GDisplay *g) { - uint8_t dataY[2]; + gU8 dataY[2]; dataY[0] = g->p.y % 256; // Y-data is send in two bytes dataY[1] = g->p.y / 256; @@ -133,8 +133,8 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { } static void set_viewport(GDisplay *g) { - uint8_t dataX[2]; - uint8_t dataY[4]; + gU8 dataX[2]; + gU8 dataY[4]; // Fill up the X and Y position buffers. dataX[0] = g->p.x / WS29EPD_PPB; @@ -186,9 +186,9 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { } /* There is only black and no black (white). */ if (gdispColor2Native(g->p.color) != Black) // Indexing in the array is done as described in the init routine - ((uint8_t *)g->priv)[(GDISP_SCREEN_HEIGHT*(x/WS29EPD_PPB)) + y] |= (1 << (WS29EPD_PPB-1 - (x % WS29EPD_PPB))); + ((gU8 *)g->priv)[(GDISP_SCREEN_HEIGHT*(x/WS29EPD_PPB)) + y] |= (1 << (WS29EPD_PPB-1 - (x % WS29EPD_PPB))); else - ((uint8_t *)g->priv)[(GDISP_SCREEN_HEIGHT*(x/WS29EPD_PPB)) + y] &= ~(1 << (WS29EPD_PPB-1 - (x % WS29EPD_PPB))); + ((gU8 *)g->priv)[(GDISP_SCREEN_HEIGHT*(x/WS29EPD_PPB)) + y] &= ~(1 << (WS29EPD_PPB-1 - (x % WS29EPD_PPB))); } #endif @@ -201,7 +201,7 @@ LLDSPEC void gdisp_lld_flush(GDisplay *g) { for(int i=0; ipriv)[(GDISP_SCREEN_HEIGHT*j) + i]); + write_data(g, ((gU8 *)g->priv)[(GDISP_SCREEN_HEIGHT*j) + i]); /* Update the screen. */ write_reg(g, DISPLAY_UPDATE_CTRL2, 0xc7); // Full update (partial hasn't been implemented yet) diff --git a/drivers/gdisp/framebuffer/board_framebuffer_template.h b/drivers/gdisp/framebuffer/board_framebuffer_template.h index 594f4340..9b01f075 100644 --- a/drivers/gdisp/framebuffer/board_framebuffer_template.h +++ b/drivers/gdisp/framebuffer/board_framebuffer_template.h @@ -35,13 +35,13 @@ #endif #if GDISP_NEED_CONTROL - static void board_backlight(GDisplay *g, uint8_t percent) { + static void board_backlight(GDisplay *g, gU8 percent) { // TODO: Can be an empty function if your hardware doesn't support this (void) g; (void) percent; } - static void board_contrast(GDisplay *g, uint8_t percent) { + static void board_contrast(GDisplay *g, gU8 percent) { // TODO: Can be an empty function if your hardware doesn't support this (void) g; (void) percent; diff --git a/drivers/ginput/dial/GADC/ginput_lld_dial_GADC.c b/drivers/ginput/dial/GADC/ginput_lld_dial_GADC.c index 99dfe8fd..d6674d80 100644 --- a/drivers/ginput/dial/GADC/ginput_lld_dial_GADC.c +++ b/drivers/ginput/dial/GADC/ginput_lld_dial_GADC.c @@ -18,7 +18,7 @@ static adcsample_t samplebuf[GINPUT_DIAL_NUM_PORTS]; #if GINPUT_DIAL_CYCLE_POLL - static uint16_t cycle; + static gU16 cycle; #endif static void GADCCallback(adcsample_t *buffer, void *param) { diff --git a/drivers/ginput/touch/ADS7843/gmouse_lld_ADS7843_board_template.h b/drivers/ginput/touch/ADS7843/gmouse_lld_ADS7843_board_template.h index 7b4bcb58..59a78a53 100644 --- a/drivers/ginput/touch/ADS7843/gmouse_lld_ADS7843_board_template.h +++ b/drivers/ginput/touch/ADS7843/gmouse_lld_ADS7843_board_template.h @@ -35,7 +35,7 @@ static GFXINLINE void release_bus(GMouse* m) { } -static GFXINLINE uint16_t read_value(GMouse* m, uint16_t port) { +static GFXINLINE gU16 read_value(GMouse* m, gU16 port) { } diff --git a/drivers/ginput/touch/EXC7200/gmouse_lld_EXC7200.c b/drivers/ginput/touch/EXC7200/gmouse_lld_EXC7200.c index c7afd0d7..e4d6247a 100644 --- a/drivers/ginput/touch/EXC7200/gmouse_lld_EXC7200.c +++ b/drivers/ginput/touch/EXC7200/gmouse_lld_EXC7200.c @@ -28,7 +28,7 @@ static gBool MouseInit(GMouse* m, unsigned driverinstance) static gBool read_xyz(GMouse* m, GMouseReading* pdr) { - uint8_t rxbuf[10]; + gU8 rxbuf[10]; // We don't support buttons. This is a regular touchscreen pdr->buttons = 0; diff --git a/drivers/ginput/touch/EXC7200/gmouse_lld_EXC7200_board_template.h b/drivers/ginput/touch/EXC7200/gmouse_lld_EXC7200_board_template.h index 9cd8eb7d..d4a8365b 100644 --- a/drivers/ginput/touch/EXC7200/gmouse_lld_EXC7200_board_template.h +++ b/drivers/ginput/touch/EXC7200/gmouse_lld_EXC7200_board_template.h @@ -31,15 +31,15 @@ static GFXINLINE void release_bus(GMouse* m) { } -static void write_reg(GMouse* m, uint8_t reg, uint8_t val) +static void write_reg(GMouse* m, gU8 reg, gU8 val) { } -static uint8_t read_byte(GMouse* m, uint8_t reg) +static gU8 read_byte(GMouse* m, gU8 reg) { } -static uint16_t read_word(GMouse* m, uint8_t reg) +static gU16 read_word(GMouse* m, gU8 reg) { } diff --git a/drivers/ginput/touch/FT5336/gmouse_lld_FT5336_board_template.h b/drivers/ginput/touch/FT5336/gmouse_lld_FT5336_board_template.h index 5cbbbd1a..5e835f37 100644 --- a/drivers/ginput/touch/FT5336/gmouse_lld_FT5336_board_template.h +++ b/drivers/ginput/touch/FT5336/gmouse_lld_FT5336_board_template.h @@ -33,27 +33,27 @@ static gBool init_board(GMouse* m, unsigned instance) return gTrue; } -static void write_reg(GMouse* m, uint8_t reg, uint8_t val) +static void write_reg(GMouse* m, gU8 reg, gU8 val) { (void)m; (void)reg; (void)val; } -static uint8_t read_byte(GMouse* m, uint8_t reg) +static gU8 read_byte(GMouse* m, gU8 reg) { (void)m; (void)reg; - return (uint16_t)0x00; + return (gU16)0x00; } -static uint16_t read_word(GMouse* m, uint8_t reg) +static gU16 read_word(GMouse* m, gU8 reg) { (void)m; (void)reg; - return (uint16_t)0x0000; + return (gU16)0x0000; } #endif /* _GINPUT_LLD_MOUSE_BOARD_H */ diff --git a/drivers/ginput/touch/FT5x06/gmouse_lld_FT5x06_board_template.h b/drivers/ginput/touch/FT5x06/gmouse_lld_FT5x06_board_template.h index 45f0a66e..4a36c297 100644 --- a/drivers/ginput/touch/FT5x06/gmouse_lld_FT5x06_board_template.h +++ b/drivers/ginput/touch/FT5x06/gmouse_lld_FT5x06_board_template.h @@ -34,13 +34,13 @@ static GFXINLINE void aquire_bus(GMouse* m) { static GFXINLINE void release_bus(GMouse* m) { } -static void write_reg(GMouse* m, uint8_t reg, uint8_t val) { +static void write_reg(GMouse* m, gU8 reg, gU8 val) { } -static uint8_t read_byte(GMouse* m, uint8_t reg) { +static gU8 read_byte(GMouse* m, gU8 reg) { } -static uint16_t read_word(GMouse* m, uint8_t reg) { +static gU16 read_word(GMouse* m, gU8 reg) { } #endif /* _GINPUT_LLD_MOUSE_BOARD_H */ diff --git a/drivers/ginput/touch/FT6x06/gmouse_lld_FT6x06_board_template.h b/drivers/ginput/touch/FT6x06/gmouse_lld_FT6x06_board_template.h index d81f55f0..17fa35a9 100644 --- a/drivers/ginput/touch/FT6x06/gmouse_lld_FT6x06_board_template.h +++ b/drivers/ginput/touch/FT6x06/gmouse_lld_FT6x06_board_template.h @@ -34,13 +34,13 @@ static GFXINLINE void aquire_bus(GMouse* m) { static GFXINLINE void release_bus(GMouse* m) { } -static void write_reg(GMouse* m, uint8_t reg, uint8_t val) { +static void write_reg(GMouse* m, gU8 reg, gU8 val) { } -static uint8_t read_byte(GMouse* m, uint8_t reg) { +static gU8 read_byte(GMouse* m, gU8 reg) { } -static uint16_t read_word(GMouse* m, uint8_t reg) { +static gU16 read_word(GMouse* m, gU8 reg) { } #endif /* _GINPUT_LLD_MOUSE_BOARD_H */ diff --git a/drivers/ginput/touch/MAX11802/gmouse_lld_MAX11802.c b/drivers/ginput/touch/MAX11802/gmouse_lld_MAX11802.c index acfe2142..4fca15d9 100644 --- a/drivers/ginput/touch/MAX11802/gmouse_lld_MAX11802.c +++ b/drivers/ginput/touch/MAX11802/gmouse_lld_MAX11802.c @@ -29,9 +29,9 @@ static gBool MouseInit(GMouse* m, unsigned driverinstance) { - const uint8_t *p; + const gU8 *p; - static const uint8_t commandList[] = { + static const gU8 commandList[] = { MAX11802_CMD_GEN_WR, 0xf0, // General config - leave TIRQ enabled, even though we ignore it ATM MAX11802_CMD_RES_WR, 0x00, // A-D resolution, hardware config - rewriting default; all 12-bit resolution MAX11802_CMD_AVG_WR, MAX11802_AVG, // A-D averaging - 8 samples, average four median samples @@ -70,8 +70,8 @@ static gBool MouseInit(GMouse* m, unsigned driverinstance) static gBool read_xyz(GMouse* m, GMouseReading* pdr) { - uint8_t readyCount; - uint8_t notReadyCount; + gU8 readyCount; + gU8 notReadyCount; // Assume not touched. pdr->buttons = 0; @@ -153,8 +153,8 @@ static gBool read_xyz(GMouse* m, GMouseReading* pdr) } // Strip the tags (we need to take care because gCoord is signed - and sign bit gets extended on shift!) - pdr->x = (uint16_t)(pdr->x) >> 4; - pdr->y = (uint16_t)(pdr->y) >> 4; + pdr->x = (gU16)(pdr->x) >> 4; + pdr->y = (gU16)(pdr->y) >> 4; pdr->z = Z_MAX; return gTrue; diff --git a/drivers/ginput/touch/MAX11802/gmouse_lld_MAX11802_board_template.h b/drivers/ginput/touch/MAX11802/gmouse_lld_MAX11802_board_template.h index ec5d6982..f0461db6 100644 --- a/drivers/ginput/touch/MAX11802/gmouse_lld_MAX11802_board_template.h +++ b/drivers/ginput/touch/MAX11802/gmouse_lld_MAX11802_board_template.h @@ -47,7 +47,7 @@ static GFXINLINE void release_bus(GMouse* m) { * * Return the second byte read in case of interest */ -static GFXINLINE uint8_t write_command(GMouse* m, uint8_t command, uint8_t value) { +static GFXINLINE gU8 write_command(GMouse* m, gU8 command, gU8 value) { } /** @@ -55,14 +55,14 @@ static GFXINLINE uint8_t write_command(GMouse* m, uint8_t command, uint8_t value * * Return the byte read in case of interest */ -static GFXINLINE uint8_t gfintWriteCommand(GMouse* m, uint8_t command) { +static GFXINLINE gU8 gfintWriteCommand(GMouse* m, gU8 command) { } /* * Read 2 bytes as 16-bit value (command to read must have been sent previously) * Note: Analog value is in bits 15..4, tags (reading status) in bits 3..0 */ -static GFXINLINE uint16_t read_value(GMouse* m) { +static GFXINLINE gU16 read_value(GMouse* m) { } diff --git a/drivers/ginput/touch/QWidget/example/mywidget.cpp b/drivers/ginput/touch/QWidget/example/mywidget.cpp index c4599193..0a7ca29e 100644 --- a/drivers/ginput/touch/QWidget/example/mywidget.cpp +++ b/drivers/ginput/touch/QWidget/example/mywidget.cpp @@ -5,7 +5,7 @@ extern GMouse* qwidgetMouse; extern gCoord qwidgetMouseX; extern gCoord qwidgetMouseY; extern gCoord qwidgetMouseZ; -extern uint16_t qwidgetMouseButtons; +extern gU16 qwidgetMouseButtons; MyWidget::MyWidget(QWidget* parent) : QWidget(parent) { diff --git a/drivers/ginput/touch/QWidget/gmouse_lld_QWidget.c b/drivers/ginput/touch/QWidget/gmouse_lld_QWidget.c index acbc0406..42b1f2b9 100644 --- a/drivers/ginput/touch/QWidget/gmouse_lld_QWidget.c +++ b/drivers/ginput/touch/QWidget/gmouse_lld_QWidget.c @@ -17,7 +17,7 @@ GMouse* qwidgetMouse; gCoord qwidgetMouseX; gCoord qwidgetMouseY; gCoord qwidgetMouseZ; -uint16_t qwidgetMouseButtons; +gU16 qwidgetMouseButtons; static gBool _init(GMouse* m, unsigned driverinstance) { diff --git a/drivers/ginput/touch/STMPE610/gmouse_lld_STMPE610.c b/drivers/ginput/touch/STMPE610/gmouse_lld_STMPE610.c index 21581077..c44289c6 100644 --- a/drivers/ginput/touch/STMPE610/gmouse_lld_STMPE610.c +++ b/drivers/ginput/touch/STMPE610/gmouse_lld_STMPE610.c @@ -103,7 +103,7 @@ static gBool read_xyz(GMouse* m, GMouseReading* pdr) #if GMOUSE_STMPE610_TEST_MODE static GMouseReading n; #endif - uint8_t status; + gU8 status; // Button information will be regenerated pdr->buttons = 0; diff --git a/drivers/ginput/touch/STMPE610/gmouse_lld_STMPE610_board_template.h b/drivers/ginput/touch/STMPE610/gmouse_lld_STMPE610_board_template.h index d68a0be3..e4d4527c 100644 --- a/drivers/ginput/touch/STMPE610/gmouse_lld_STMPE610_board_template.h +++ b/drivers/ginput/touch/STMPE610/gmouse_lld_STMPE610_board_template.h @@ -48,13 +48,13 @@ static GFXINLINE void aquire_bus(GMouse* m) { static GFXINLINE void release_bus(GMouse* m) { } -static void write_reg(GMouse* m, uint8_t reg, uint8_t val) { +static void write_reg(GMouse* m, gU8 reg, gU8 val) { } -static uint8_t read_byte(GMouse* m, uint8_t reg) { +static gU8 read_byte(GMouse* m, gU8 reg) { } -static uint16_t read_word(GMouse* m, uint8_t reg) { +static gU16 read_word(GMouse* m, gU8 reg) { } #endif /* _GINPUT_LLD_MOUSE_BOARD_H */ diff --git a/drivers/ginput/touch/STMPE811/gmouse_lld_STMPE811.c b/drivers/ginput/touch/STMPE811/gmouse_lld_STMPE811.c index ab2c87b4..90ea953f 100644 --- a/drivers/ginput/touch/STMPE811/gmouse_lld_STMPE811.c +++ b/drivers/ginput/touch/STMPE811/gmouse_lld_STMPE811.c @@ -103,7 +103,7 @@ static gBool read_xyz(GMouse* m, GMouseReading* pdr) #if GMOUSE_STMPE811_TEST_MODE static GMouseReading n; #endif - uint8_t status; + gU8 status; // Button information will be regenerated pdr->buttons = 0; diff --git a/drivers/ginput/touch/STMPE811/gmouse_lld_STMPE811_board_template.h b/drivers/ginput/touch/STMPE811/gmouse_lld_STMPE811_board_template.h index bcc9ab57..9d38b797 100644 --- a/drivers/ginput/touch/STMPE811/gmouse_lld_STMPE811_board_template.h +++ b/drivers/ginput/touch/STMPE811/gmouse_lld_STMPE811_board_template.h @@ -48,13 +48,13 @@ static GFXINLINE void aquire_bus(GMouse* m) { static GFXINLINE void release_bus(GMouse* m) { } -static void write_reg(GMouse* m, uint8_t reg, uint8_t val) { +static void write_reg(GMouse* m, gU8 reg, gU8 val) { } -static uint8_t read_byte(GMouse* m, uint8_t reg) { +static gU8 read_byte(GMouse* m, gU8 reg) { } -static uint16_t read_word(GMouse* m, uint8_t reg) { +static gU16 read_word(GMouse* m, gU8 reg) { } #endif /* _GINPUT_LLD_MOUSE_BOARD_H */ diff --git a/drivers/multiple/SDL/gdisp_lld_SDL.c b/drivers/multiple/SDL/gdisp_lld_SDL.c index e594e649..e306dd7f 100644 --- a/drivers/multiple/SDL/gdisp_lld_SDL.c +++ b/drivers/multiple/SDL/gdisp_lld_SDL.c @@ -79,7 +79,7 @@ // Forward definitions static gBool SDL_KeyboardInit(GKeyboard *k, unsigned driverinstance); - static int SDL_KeyboardGetData(GKeyboard *k, uint8_t *pch, int sz); + static int SDL_KeyboardGetData(GKeyboard *k, gU8 *pch, int sz); const GKeyboardVMT GKEYBOARD_DRIVER_VMT[1] = {{ { @@ -97,7 +97,7 @@ static struct KeyMap { SDL_Keycode k_sdl; - uint16_t k_ugfx; + gU16 k_ugfx; } SDL_keymap[] = { {SDLK_UP, GKEY_UP}, @@ -136,7 +136,7 @@ }; static struct ModMap { SDL_Keycode s_sdl; - uint32_t s_ugfx; + gU32 s_ugfx; } SDL_modmap[] = { {KMOD_LSHIFT, GKEYSTATE_SHIFT_L}, {KMOD_RSHIFT, GKEYSTATE_SHIFT_R}, @@ -149,23 +149,23 @@ {0,0} }; struct SDL_keymsg { - uint32_t key; - uint32_t keystate; + gU32 key; + gU32 keystate; }; static GKeyboard *keyboard = 0; #endif // shared IPC context struct SDL_UGFXContext { - uint32_t framebuf[GDISP_SCREEN_WIDTH*GDISP_SCREEN_HEIGHT]; - int16_t need_redraw; + gU32 framebuf[GDISP_SCREEN_WIDTH*GDISP_SCREEN_HEIGHT]; + gI16 need_redraw; int minx,miny,maxx,maxy; #if GINPUT_NEED_MOUSE gCoord mousex, mousey; - uint16_t buttons; + gU16 buttons; #endif #if GINPUT_NEED_KEYBOARD - uint16_t keypos; + gU16 keypos; struct SDL_keymsg keybuffer[8]; #endif }; @@ -198,7 +198,7 @@ static int SDL_loop (void) { context->maxx = 0; context->maxy = 0; - SDL_UpdateTexture(texture, &r, context->framebuf+r.y*GDISP_SCREEN_WIDTH+r.x, GDISP_SCREEN_WIDTH*sizeof(uint32_t)); + SDL_UpdateTexture(texture, &r, context->framebuf+r.y*GDISP_SCREEN_WIDTH+r.x, GDISP_SCREEN_WIDTH*sizeof(gU32)); SDL_RenderCopy(render, texture, 0, 0); SDL_RenderPresent(render); } @@ -249,8 +249,8 @@ static int SDL_loop (void) { case SDL_KEYDOWN: case SDL_KEYUP: { SDL_Keycode k_sdl = event.key.keysym.sym; - uint8_t k_ugfx = 0; - uint32_t s_ugfx = (event.type==SDL_KEYDOWN)?0:GKEYSTATE_KEYUP; + gU8 k_ugfx = 0; + gU32 s_ugfx = (event.type==SDL_KEYDOWN)?0:GKEYSTATE_KEYUP; int i; if (!(k_sdl & ~0x7f) && (k_sdl <32 || k_sdl == 127)) { k_ugfx = k_sdl; @@ -409,7 +409,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) LLDCOLOR_TYPE c = gdispColor2Native(g->p.color); if (context) { int x,y; - uint32_t *pbuf = context->framebuf + g->p.y*GDISP_SCREEN_WIDTH + g->p.x; + gU32 *pbuf = context->framebuf + g->p.y*GDISP_SCREEN_WIDTH + g->p.x; int dy = GDISP_SCREEN_WIDTH - g->p.cx; for (y = 0; y < g->p.cy; ++y) { for (x = 0; x < g->p.cx; ++x) @@ -458,7 +458,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) return gTrue; } - static int SDL_KeyboardGetData(GKeyboard *k, uint8_t *pch, int sz) { + static int SDL_KeyboardGetData(GKeyboard *k, gU8 *pch, int sz) { int i = 0; if (!context || !context->keypos || !sz) return 0; diff --git a/drivers/multiple/Win32/gdisp_lld_Win32.c b/drivers/multiple/Win32/gdisp_lld_Win32.c index cd8eb512..1ec52a37 100644 --- a/drivers/multiple/Win32/gdisp_lld_Win32.c +++ b/drivers/multiple/Win32/gdisp_lld_Win32.c @@ -144,11 +144,11 @@ #include "../../../src/ginput/ginput_keyboard_microcode.h" // Forward definitions - extern uint8_t GKEYBOARD_WIN32_DEFAULT_LAYOUT[]; + extern gU8 GKEYBOARD_WIN32_DEFAULT_LAYOUT[]; // This is the layout code for the English US keyboard. // We make it public so that a user can switch to a different layout if required. - uint8_t KeyboardLayout_Win32_US[] = { + gU8 KeyboardLayout_Win32_US[] = { KMC_HEADERSTART, KMC_HEADER_ID1, KMC_HEADER_ID2, KMC_HEADER_VER_1, // Transient Shifters: SHIFT, CTRL, ALT, WINKEY @@ -391,7 +391,7 @@ // Forward definitions static gBool Win32KeyboardInit(GKeyboard *k, unsigned driverinstance); - static int Win32KeyboardGetData(GKeyboard *k, uint8_t *pch, int sz); + static int Win32KeyboardGetData(GKeyboard *k, gU8 *pch, int sz); const GKeyboardVMT const GKEYBOARD_DRIVER_VMT[1] = {{ { @@ -415,7 +415,7 @@ }}; static int keypos; - static uint8_t keybuffer[8]; + static gU8 keybuffer[8]; static GKeyboard *keyboard; #endif @@ -443,13 +443,13 @@ typedef struct winPriv { HBITMAP dcOldBitmap; #if GFX_USE_GINPUT && GINPUT_NEED_MOUSE gCoord mousex, mousey; - uint16_t mousebuttons; + gU16 mousebuttons; GMouse *mouse; gBool mouseenabled; - void (*capfn)(void * hWnd, GDisplay *g, uint16_t buttons, gCoord x, gCoord y); + void (*capfn)(void * hWnd, GDisplay *g, gU16 buttons, gCoord x, gCoord y); #endif #if GFX_USE_GINPUT && GINPUT_NEED_TOGGLE - uint8_t toggles; + gU8 toggles; #endif #if GDISP_HARDWARE_STREAM_WRITE || GDISP_HARDWARE_STREAM_READ gCoord x0, y0, x1, y1; @@ -462,7 +462,7 @@ void gfxEmulatorSetParentWindow(void *hwnd) { } #if GFX_USE_GINPUT && GINPUT_NEED_MOUSE - void gfxEmulatorMouseInject(GDisplay *g, uint16_t buttons, gCoord x, gCoord y) { + void gfxEmulatorMouseInject(GDisplay *g, gU16 buttons, gCoord x, gCoord y) { winPriv * priv; priv = (winPriv *)g->priv; @@ -475,7 +475,7 @@ void gfxEmulatorSetParentWindow(void *hwnd) { void gfxEmulatorMouseEnable(GDisplay *g, gBool enabled) { ((winPriv *)g->priv)->mouseenabled = enabled; } - void gfxEmulatorMouseCapture(GDisplay *g, void (*capfn)(void * hWnd, GDisplay *g, uint16_t buttons, gCoord x, gCoord y)) { + void gfxEmulatorMouseCapture(GDisplay *g, void (*capfn)(void * hWnd, GDisplay *g, gU16 buttons, gCoord x, gCoord y)) { ((winPriv *)g->priv)->capfn = capfn; } #endif @@ -487,7 +487,7 @@ static LRESULT myWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) GDisplay * g; winPriv * priv; #if GFX_USE_GINPUT && GINPUT_NEED_MOUSE - uint16_t btns; + gU16 btns; #endif #if GFX_USE_GINPUT && GINPUT_NEED_TOGGLE HBRUSH hbrOn, hbrOff; @@ -496,7 +496,7 @@ static LRESULT myWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) HGDIOBJ old; POINT p; gCoord pos; - uint8_t bit; + gU8 bit; #endif switch (Msg) { @@ -1611,7 +1611,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return gTrue; } - static int Win32KeyboardGetData(GKeyboard *k, uint8_t *pch, int sz) { + static int Win32KeyboardGetData(GKeyboard *k, gU8 *pch, int sz) { int i, j; (void) k; diff --git a/drivers/multiple/Win32/gdisp_lld_config.h b/drivers/multiple/Win32/gdisp_lld_config.h index 0eefe49a..9f6f38fe 100644 --- a/drivers/multiple/Win32/gdisp_lld_config.h +++ b/drivers/multiple/Win32/gdisp_lld_config.h @@ -55,14 +55,14 @@ void gfxEmulatorSetParentWindow(void *hwnd); #if GINPUT_NEED_MOUSE // This function allows you to inject mouse events into the ugfx mouse driver - void gfxEmulatorMouseInject(GDisplay *g, uint16_t buttons, gCoord x, gCoord y); + void gfxEmulatorMouseInject(GDisplay *g, gU16 buttons, gCoord x, gCoord y); // This function enables you to turn on/off normal mouse functions on a ugfx Win32 display window. void gfxEmulatorMouseEnable(GDisplay *g, gBool enabled); // This function enables you to capture mouse events on a ugfx Win32 display window. // Passing NULL turns off the capture - void gfxEmulatorMouseCapture(GDisplay *g, void (*capfn)(void * hWnd, GDisplay *g, uint16_t buttons, gCoord x, gCoord y)); + void gfxEmulatorMouseCapture(GDisplay *g, void (*capfn)(void * hWnd, GDisplay *g, gU16 buttons, gCoord x, gCoord y)); #endif #endif /* GFX_USE_GDISP */ diff --git a/drivers/multiple/X/gdisp_lld_X.c b/drivers/multiple/X/gdisp_lld_X.c index d4f7f3da..ace906a7 100644 --- a/drivers/multiple/X/gdisp_lld_X.c +++ b/drivers/multiple/X/gdisp_lld_X.c @@ -106,14 +106,14 @@ #endif // Forward definitions - extern uint8_t GKEYBOARD_X_DEFAULT_LAYOUT[]; + extern gU8 GKEYBOARD_X_DEFAULT_LAYOUT[]; #include "../../../src/ginput/ginput_keyboard_microcode.h" #include // This is the layout code for the English US keyboard. // We make it public so that a user can switch to a different layout if required. - uint8_t KeyboardLayout_X_US[] = { + gU8 KeyboardLayout_X_US[] = { KMC_HEADERSTART, KMC_HEADER_ID1, KMC_HEADER_ID2, KMC_HEADER_VER_1, // TODO @@ -141,7 +141,7 @@ // Forward definitions static gBool XKeyboardInit(GKeyboard *k, unsigned driverinstance); - static int XKeyboardGetData(GKeyboard *k, uint8_t *pch, int sz); + static int XKeyboardGetData(GKeyboard *k, gU8 *pch, int sz); const GKeyboardVMT const GKEYBOARD_DRIVER_VMT[1] = {{ { @@ -163,7 +163,7 @@ }}; static int keypos; - static uint8_t keybuffer[8]; + static gU8 keybuffer[8]; static GKeyboard *keyboard; #endif @@ -182,7 +182,7 @@ typedef struct xPriv { Window win; #if GINPUT_NEED_MOUSE gCoord mousex, mousey; - uint16_t buttons; + gU16 buttons; GMouse * mouse; #endif } xPriv; @@ -509,7 +509,7 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) return gTrue; } - static int XKeyboardGetData(GKeyboard *k, uint8_t *pch, int sz) { + static int XKeyboardGetData(GKeyboard *k, gU8 *pch, int sz) { int i, j; (void) k; diff --git a/drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c b/drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c index ffd3b1f9..a5bfbd97 100644 --- a/drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c +++ b/drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c @@ -157,10 +157,10 @@ typedef struct netPriv { SOCKET_TYPE netfd; // The current socket unsigned databytes; // How many bytes have been read - uint16_t data[2]; // Buffer for storing data read. + gU16 data[2]; // Buffer for storing data read. #if GINPUT_NEED_MOUSE gCoord mousex, mousey; - uint16_t mousebuttons; + gU16 mousebuttons; GMouse * mouse; #endif } netPriv; @@ -180,19 +180,19 @@ static gThread hThread; /** * Send a whole packet of data. - * Len is specified in the number of uint16_t's we want to send as our protocol only talks uint16_t's. + * Len is specified in the number of gU16's we want to send as our protocol only talks gU16's. * Note that contents of the packet are modified to ensure it will cross the wire in the correct format. * If the connection closes before we send all the data - the call returns gFalse. */ -static gBool sendpkt(SOCKET_TYPE netfd, uint16_t *pkt, int len) { +static gBool sendpkt(SOCKET_TYPE netfd, gU16 *pkt, int len) { int i; - // Convert each uint16_t to network order + // Convert each gU16 to network order for(i = 0; i < len; i++) pkt[i] = htons(pkt[i]); // Send it - len *= sizeof(uint16_t); + len *= sizeof(gU16); return send(netfd, (const char *)pkt, len, 0) == len; } @@ -465,7 +465,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_FLUSH LLDSPEC void gdisp_lld_flush(GDisplay *g) { netPriv * priv; - uint16_t buf[1]; + gU16 buf[1]; #if GDISP_DONT_WAIT_FOR_NET_DISPLAY if (!(g->flags & GDISP_FLG_CONNECTED)) @@ -486,7 +486,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_DRAWPIXEL LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { netPriv * priv; - uint16_t buf[4]; + gU16 buf[4]; #if GDISP_DONT_WAIT_FOR_NET_DISPLAY if (!(g->flags & GDISP_FLG_CONNECTED)) @@ -512,7 +512,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_FILLS LLDSPEC void gdisp_lld_fill_area(GDisplay *g) { netPriv * priv; - uint16_t buf[6]; + gU16 buf[6]; #if GDISP_DONT_WAIT_FOR_NET_DISPLAY if (!(g->flags & GDISP_FLG_CONNECTED)) @@ -539,7 +539,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { LLDSPEC void gdisp_lld_blit_area(GDisplay *g) { netPriv * priv; gPixel * buffer; - uint16_t buf[5]; + gU16 buf[5]; gCoord x, y; #if GDISP_DONT_WAIT_FOR_NET_DISPLAY @@ -576,7 +576,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_PIXELREAD LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) { netPriv * priv; - uint16_t buf[3]; + gU16 buf[3]; gColor data; #if GDISP_DONT_WAIT_FOR_NET_DISPLAY @@ -609,7 +609,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_NEED_SCROLL && GDISP_HARDWARE_SCROLL LLDSPEC void gdisp_lld_vertical_scroll(GDisplay *g) { netPriv * priv; - uint16_t buf[6]; + gU16 buf[6]; #if GDISP_DONT_WAIT_FOR_NET_DISPLAY if (!(g->flags & GDISP_FLG_CONNECTED)) @@ -635,7 +635,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL LLDSPEC void gdisp_lld_control(GDisplay *g) { netPriv * priv; - uint16_t buf[3]; + gU16 buf[3]; gBool allgood; #if GDISP_DONT_WAIT_FOR_NET_DISPLAY @@ -657,9 +657,9 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return; break; case GDISP_CONTROL_BACKLIGHT: - if (g->g.Backlight == (uint16_t)(int)g->p.ptr) + if (g->g.Backlight == (gU16)(int)g->p.ptr) return; - if ((uint16_t)(int)g->p.ptr > 100) + if ((gU16)(int)g->p.ptr > 100) g->p.ptr = (void *)100; break; default: @@ -670,7 +670,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { priv = g->priv; buf[0] = GNETCODE_CONTROL; buf[1] = g->p.x; - buf[2] = (uint16_t)(int)g->p.ptr; + buf[2] = (gU16)(int)g->p.ptr; MUTEX_ENTER; sendpkt(priv->netfd, buf, 3); MUTEX_EXIT; @@ -709,7 +709,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Powermode = (gPowermode)g->p.ptr; break; case GDISP_CONTROL_BACKLIGHT: - g->g.Backlight = (uint16_t)(int)g->p.ptr; + g->g.Backlight = (gU16)(int)g->p.ptr; break; } } diff --git a/drivers/multiple/uGFXnetESP8266/gdisp_lld_uGFXnetESP8266.cpp b/drivers/multiple/uGFXnetESP8266/gdisp_lld_uGFXnetESP8266.cpp index 11b4b144..0e5381e5 100644 --- a/drivers/multiple/uGFXnetESP8266/gdisp_lld_uGFXnetESP8266.cpp +++ b/drivers/multiple/uGFXnetESP8266/gdisp_lld_uGFXnetESP8266.cpp @@ -117,10 +117,10 @@ static gBool uGFXInitDone; typedef struct netPriv { CLIENTFD netfd; // The current client unsigned databytes; // How many bytes have been read - uint16_t data[2]; // Buffer for storing data read. + gU16 data[2]; // Buffer for storing data read. #if GINPUT_NEED_MOUSE gCoord mousex, mousey; - uint16_t mousebuttons; + gU16 mousebuttons; GMouse * mouse; #endif } netPriv; @@ -148,12 +148,12 @@ static void endcon(GDisplay *g) { /** * Send a whole packet of data. - * Len is specified in the number of uint16_t's we want to send as our protocol only talks uint16_t's. + * Len is specified in the number of gU16's we want to send as our protocol only talks gU16's. * Note that contents of the packet are modified to ensure it will cross the wire in the correct format. * If the connection closes before we send all the data - the call returns gFalse. */ -static gBool sendpkt(CLIENTFD fd, uint16_t *pkt, int len) { - // Convert each uint16_t to network order +static gBool sendpkt(CLIENTFD fd, gU16 *pkt, int len) { + // Convert each gU16 to network order #if GFX_CPU_ENDIAN == GFX_CPU_ENDIAN_LITTLE { int i; @@ -164,8 +164,8 @@ static gBool sendpkt(CLIENTFD fd, uint16_t *pkt, int len) { #endif // Send it - len *= sizeof(uint16_t); - return fd->write((uint8_t *)pkt, len) == len; + len *= sizeof(gU16); + return fd->write((gU8 *)pkt, len) == len; } static void rxdata(GDisplay *g) { @@ -197,7 +197,7 @@ static void rxdata(GDisplay *g) { } // Get the data - if ((len = fd->read(((uint8_t *)priv->data)+priv->databytes, sizeof(priv->data)-priv->databytes, 0)) <= 0) { + if ((len = fd->read(((gU8 *)priv->data)+priv->databytes, sizeof(priv->data)-priv->databytes, 0)) <= 0) { // Socket closed or in error state MUTEX_EXIT; endcon(g); @@ -348,7 +348,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_FLUSH LLDSPEC void gdisp_lld_flush(GDisplay *g) { netPriv * priv; - uint16_t buf[1]; + gU16 buf[1]; #if GDISP_DONT_WAIT_FOR_NET_DISPLAY if (!(g->flags & GDISP_FLG_CONNECTED)) @@ -369,7 +369,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_DRAWPIXEL LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) { netPriv * priv; - uint16_t buf[4]; + gU16 buf[4]; #if GDISP_DONT_WAIT_FOR_NET_DISPLAY if (!(g->flags & GDISP_FLG_CONNECTED)) @@ -395,7 +395,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_FILLS LLDSPEC void gdisp_lld_fill_area(GDisplay *g) { netPriv * priv; - uint16_t buf[6]; + gU16 buf[6]; #if GDISP_DONT_WAIT_FOR_NET_DISPLAY if (!(g->flags & GDISP_FLG_CONNECTED)) @@ -422,7 +422,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { LLDSPEC void gdisp_lld_blit_area(GDisplay *g) { netPriv * priv; gPixel * buffer; - uint16_t buf[5]; + gU16 buf[5]; gCoord x, y; #if GDISP_DONT_WAIT_FOR_NET_DISPLAY @@ -459,7 +459,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_HARDWARE_PIXELREAD LLDSPEC gColor gdisp_lld_get_pixel_color(GDisplay *g) { netPriv * priv; - uint16_t buf[3]; + gU16 buf[3]; gColor data; #if GDISP_DONT_WAIT_FOR_NET_DISPLAY @@ -492,7 +492,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_NEED_SCROLL && GDISP_HARDWARE_SCROLL LLDSPEC void gdisp_lld_vertical_scroll(GDisplay *g) { netPriv * priv; - uint16_t buf[6]; + gU16 buf[6]; #if GDISP_DONT_WAIT_FOR_NET_DISPLAY if (!(g->flags & GDISP_FLG_CONNECTED)) @@ -518,7 +518,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { #if GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL LLDSPEC void gdisp_lld_control(GDisplay *g) { netPriv * priv; - uint16_t buf[3]; + gU16 buf[3]; gBool allgood; #if GDISP_DONT_WAIT_FOR_NET_DISPLAY @@ -540,9 +540,9 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { return; break; case GDISP_CONTROL_BACKLIGHT: - if (g->g.Backlight == (uint16_t)(int)g->p.ptr) + if (g->g.Backlight == (gU16)(int)g->p.ptr) return; - if ((uint16_t)(int)g->p.ptr > 100) + if ((gU16)(int)g->p.ptr > 100) g->p.ptr = (void *)100; break; default: @@ -553,7 +553,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { priv = g->priv; buf[0] = GNETCODE_CONTROL; buf[1] = g->p.x; - buf[2] = (uint16_t)(int)g->p.ptr; + buf[2] = (gU16)(int)g->p.ptr; MUTEX_ENTER; sendpkt(priv->netfd, buf, 3); MUTEX_EXIT; @@ -592,7 +592,7 @@ LLDSPEC gBool gdisp_lld_init(GDisplay *g) { g->g.Powermode = (gPowermode)g->p.ptr; break; case GDISP_CONTROL_BACKLIGHT: - g->g.Backlight = (uint16_t)(int)g->p.ptr; + g->g.Backlight = (gU16)(int)g->p.ptr; break; } } -- cgit v1.2.3