From d506a3c49d55480e22bbecec7e2b45346ae66222 Mon Sep 17 00:00:00 2001 From: Bodmer Date: Thu, 7 Dec 2023 20:35:59 +0000 Subject: [PATCH] Update for spelling etc. in comments! --- Extensions/Smooth_font.cpp | 26 ++-- Extensions/Sprite.cpp | 12 +- Extensions/Sprite.h | 24 +-- Fonts/Font32rle.c | 2 +- Fonts/Font64rle.c | 2 +- Fonts/Font72rle.c | 2 +- Fonts/Font72x53rle.c | 2 +- Fonts/Font7srle.c | 2 +- Kconfig | 2 +- Processors/TFT_eSPI_ESP32.c | 10 +- Processors/TFT_eSPI_ESP32.h | 34 ++--- Processors/TFT_eSPI_ESP32_C3.c | 8 +- Processors/TFT_eSPI_ESP32_C3.h | 34 ++--- Processors/TFT_eSPI_ESP32_S3.c | 14 +- Processors/TFT_eSPI_ESP32_S3.h | 30 ++-- Processors/TFT_eSPI_ESP8266.c | 4 +- Processors/TFT_eSPI_ESP8266.h | 8 +- Processors/TFT_eSPI_Generic.c | 4 +- Processors/TFT_eSPI_Generic.h | 12 +- Processors/TFT_eSPI_RP2040.c | 6 +- Processors/TFT_eSPI_RP2040.h | 42 +++--- Processors/TFT_eSPI_STM32.c | 10 +- Processors/TFT_eSPI_STM32.h | 40 ++--- Processors/pio_16bit_parallel.pio.h | 2 +- Processors/pio_8bit_parallel.pio.h | 2 +- Processors/pio_SPI.pio.h | 2 +- Processors/pio_SPI_18bit.pio.h | 2 +- README.md | 30 ++-- README.txt | 4 +- TFT_Drivers/HX8357B_Init.h | 2 +- TFT_Drivers/HX8357C_Init.h | 2 +- TFT_Drivers/HX8357D_Init.h | 4 +- TFT_Drivers/ILI9341_Init.h | 2 +- TFT_Drivers/ILI9481_Init.h | 34 ++--- TFT_Drivers/ILI9486_Init.h | 6 +- TFT_Drivers/ILI9488_Init.h | 6 +- TFT_Drivers/R61581_Init.h | 2 +- TFT_Drivers/RM68140_Init.h | 2 +- TFT_Drivers/SSD1963_Init.h | 8 +- TFT_Drivers/ST7789_Init.h | 7 +- TFT_Drivers/ST7796_Init.h | 2 +- TFT_eSPI.cpp | 126 ++++++++-------- TFT_eSPI.h | 52 +++---- .../Create_font/Create_font.pde | 6 +- Tools/Screenshot_client/Screenshot_client.pde | 2 +- User_Setup.h | 18 +-- User_Setup_Select.h | 20 +-- User_Setups/Setup0_Sprite.h | 47 ++++++ .../Setup100_RP2040_ILI9488_parallel.h | 2 +- .../Setup101_RP2040_ILI9481_parallel.h | 2 +- .../Setup102_RP2040_ILI9341_parallel.h | 2 +- .../Setup103_RP2040_ILI9486_parallel.h | 2 +- User_Setups/Setup104_RP2040_ST7796_parallel.h | 2 +- .../Setup105_RP2040_ST7796_16bit_parallel.h | 2 +- .../Setup106_RP2040_ILI9481_16bit_parallel.h | 4 +- .../Setup107_RP2040_ILI9341_16bit_parallel.h | 2 +- User_Setups/Setup201_WT32_SC01.h | 2 +- User_Setups/Setup27_RPi_ST7796_ESP32.h | 2 +- User_Setups/Setup28_RPi_ST7796_ESP8266.h | 2 +- User_Setups/Setup29_ILI9341_STM32.h | 2 +- User_Setups/Setup29b_ILI9341_STM32.h | 141 ++++++++++++++++++ User_Setups/Setup30_ILI9341_Parallel_STM32.h | 4 +- User_Setups/Setup31_ST7796_Parallel_STM32.h | 4 +- User_Setups/Setup33_RPi_ILI9486_STM32.h | 2 +- User_Setups/Setup34_ILI9481_Parallel_STM32.h | 4 +- User_Setups/Setup35_ILI9341_STM32_Port_Bus.h | 4 +- User_Setups/Setup50_SSD1963_Parallel.h | 2 +- User_Setups/Setup60_RP2040_ILI9341.h | 4 +- User_Setups/Setup60_RP2040_RPI_MHS.h | 29 ++++ .../Setup62_RP2040_Nano_Connect_ILI9341.h | 4 +- User_Setups/Setup70h_ESP32_S3_GC9A01.h | 31 ++++ User_Setups/SetupX_Template.h | 14 +- User_Setups/User_Custom_Fonts.h | 4 +- docs/ESP-IDF/Using ESP-IDF.txt | 2 +- docs/PlatformIO/Configuring options.txt | 2 +- docs/PlatformIO/rp2040.txt | 2 +- .../160 x 128/Arduino_Life/Arduino_Life.ino | 8 +- .../TFT_Clock_Digital/TFT_Clock_Digital.ino | 2 +- .../160 x 128/TFT_Ellipse/TFT_Ellipse.ino | 4 +- .../160 x 128/TFT_Meter_5/TFT_Meter_5.ino | 2 +- .../TFT_Print_Test/TFT_Print_Test.ino | 4 +- .../160 x 128/TFT_Rainbow/TFT_Rainbow.ino | 6 +- .../160 x 128/TFT_flash_jpg/TFT_flash_jpg.ino | 8 +- .../TFT_graphicstest_PDQ3.ino | 6 +- .../TFT_graphicstest_small.ino | 6 +- .../All_Free_Fonts_Demo.ino | 2 +- .../Cellular_Automata/Cellular_Automata.ino | 8 +- .../Free_Font_Demo/Free_Font_Demo.ino | 4 +- .../Keypad_240x320/Keypad_240x320.ino | 12 +- .../Read_ID_bitbash/Read_ID_bitbash.ino | 4 +- .../320 x 240/TFT_ArcFill/TFT_ArcFill.ino | 10 +- .../TFT_Custom_Fonts/TFT_Custom_Fonts.ino | 2 +- .../TFT_FillArcSpiral/TFT_FillArcSpiral.ino | 8 +- .../TFT_Mandlebrot/TFT_Mandlebrot.ino | 2 +- .../TFT_Meter_linear/TFT_Meter_linear.ino | 6 +- examples/320 x 240/TFT_Meters/TFT_Meters.ino | 4 +- .../320 x 240/TFT_Pie_Chart/TFT_Pie_Chart.ino | 6 +- .../TFT_Print_Test/TFT_Print_Test.ino | 4 +- .../TFT_Rainbow_one_lib.ino | 14 +- .../320 x 240/TFT_Read_Reg/TFT_Read_Reg.ino | 8 +- examples/320 x 240/TFT_Spiro/TFT_Spiro.ino | 4 +- .../320 x 240/TFT_Starfield/TFT_Starfield.ino | 4 +- .../320 x 240/TFT_Terminal/TFT_Terminal.ino | 2 +- .../TFT_graphicstest_PDQ.ino | 8 +- .../TFT_graphicstest_one_lib.ino | 2 +- .../Cellular_Automata/Cellular_Automata.ino | 8 +- .../Free_Font_Demo/Free_Font_Demo.ino | 4 +- .../Keypad_480x320/Keypad_480x320.ino | 12 +- .../480 x 320/TFT_Meter_4/TFT_Meter_4.ino | 6 +- examples/480 x 320/TFT_Meters/TFT_Meters.ino | 4 +- .../TFT_Print_Test/TFT_Print_Test.ino | 4 +- .../TFT_Rainbow480/TFT_Rainbow480.ino | 14 +- .../480 x 320/TFT_flash_jpg/TFT_flash_jpg.ino | 10 +- .../TFT_graphicstest_one_lib.ino | 2 +- .../TFT_ring_meter/TFT_ring_meter.ino | 10 +- .../Touch_Controller_Demo.ino | 8 +- .../Bouncy_Circles/Bouncy_Circles.ino | 4 +- .../DMA test/Flash_Jpg_DMA/Flash_Jpg_DMA.ino | 2 +- .../SpriteRotatingCube/SpriteRotatingCube.ino | 8 +- examples/DMA test/boing_ball/boing_ball.ino | 2 +- .../Buttons/Button_demo/Button_demo.ino | 4 +- .../Graphs/Graph_demo_1/Graph_demo_1.ino | 2 +- .../Graphs/Graph_demo_2/Graph_demo_2.ino | 2 +- .../Sliders/Slider_demo/Slider_demo.ino | 4 +- examples/Generic/Animated_Eyes_1/config.h | 2 +- .../Generic/Animated_Eyes_1/eye_functions.ino | 4 +- examples/Generic/Animated_Eyes_2/config.h | 2 +- .../Generic/Animated_Eyes_2/eye_functions.ino | 4 +- .../ESP32_SDcard_jpeg/ESP32_SDcard_jpeg.ino | 4 +- .../ESP8266_uncannyEyes.ino | 4 +- .../screenshotToConsole.ino | 2 +- .../Generic/Gradient_Fill/Gradient_Fill.ino | 4 +- examples/Generic/Julia_Set/Julia_Set.ino | 6 +- .../Local_Custom_Fonts/Local_Custom_Fonts.ino | 2 +- .../Generic/On_Off_Button/On_Off_Button.ino | 2 +- .../TFT_Button_Label_Datum.ino | 2 +- .../TFT_Flash_Bitmap/TFT_Flash_Bitmap.ino | 2 +- .../Generic/TFT_SPIFFS_BMP/BMP_functions.ino | 2 +- .../TFT_Screen_Capture/TFT_Screen_Capture.ino | 2 +- .../TFT_Screen_Capture/processing_sketch.ino | 2 +- .../TFT_Screen_Capture/screenServer.ino | 12 +- .../Touch_calibrate/Touch_calibrate.ino | 2 +- .../Generic/Viewport_Demo/Viewport_Demo.ino | 2 +- .../Viewport_graphicstest.ino | 2 +- .../alphaBlend_Test/alphaBlend_Test.ino | 16 +- examples/PNG Images/Flash_PNG/Flash_PNG.ino | 4 +- .../Font_Demo_1_Array/Font_Demo_1_Array.ino | 12 +- .../Font_Demo_3_Array/Font_Demo_3_Array.ino | 10 +- .../Font_Demo_4_Array/Font_Demo_4_Array.ino | 8 +- .../Print_Smooth_Font/Print_Smooth_Font.ino | 4 +- .../Smooth_font_gradient.ino | 8 +- .../Smooth_font_reading_TFT.ino | 10 +- .../FLASH_Array/Unicode_test/Unicode_test.ino | 12 +- .../LittleFS/Font_Demo_1/Font_Demo_1.ino | 12 +- .../LittleFS/Font_Demo_3/Font_Demo_3.ino | 8 +- .../LittleFS/Font_Demo_4/Font_Demo_4.ino | 8 +- .../Print_Smooth_Font/Print_Smooth_Font.ino | 4 +- .../Smooth_font_gradient.ino | 8 +- .../Smooth_font_reading_TFT.ino | 8 +- .../LittleFS/Unicode_test/Unicode_test.ino | 8 +- .../ESP32_Smooth_Font_SD.ino | 4 +- .../SPIFFS/Font_Demo_1/Font_Demo_1.ino | 12 +- .../SPIFFS/Font_Demo_3/Font_Demo_3.ino | 8 +- .../SPIFFS/Font_Demo_4/Font_Demo_4.ino | 8 +- .../Print_Smooth_Font/Print_Smooth_Font.ino | 4 +- .../Smooth_font_gradient.ino | 8 +- .../Smooth_font_reading_TFT.ino | 8 +- .../SPIFFS/Unicode_test/Unicode_test.ino | 8 +- .../Anti-aliased_Clock/Anti-aliased_Clock.ino | 12 +- .../Anti-aliased_Clock/NTP_Time.h | 6 +- .../Arc_meter_demo/Arc_meter_demo.ino | 18 +-- .../Draw_Smooth_Circles.ino | 4 +- .../Smooth_Graphics_Demo.ino | 18 +-- .../Smooth_Rounded_Rectangles.ino | 4 +- .../Sprite/Animated_dial/Animated_dial.ino | 4 +- .../One_bit_Sprite_Demo.ino | 4 +- .../One_bit_Yin_Yang/One_bit_Yin_Yang.ino | 10 +- examples/Sprite/Orrery/Orrery.ino | 8 +- .../Rotated_Sprite_1/Rotated_Sprite_1.ino | 8 +- .../Rotated_Sprite_2/Rotated_Sprite_2.ino | 6 +- .../Rotated_Sprite_3/Rotated_Sprite_3.ino | 4 +- .../Sprite_RLE_Font_test.ino | 4 +- examples/Sprite/Sprite_draw/Sprite_draw.ino | 8 +- .../Sprite_draw_4bit/Sprite_draw_4bit.ino | 10 +- .../Sprite_image_4bit/Sprite_image_4bit.ino | 12 +- .../Sprite/Sprite_scroll/Sprite_scroll.ino | 10 +- .../Sprite_scroll_16bit.ino | 6 +- .../Sprite_scroll_1bit/Sprite_scroll_1bit.ino | 4 +- .../Sprite_scroll_4bit/Sprite_scroll_4bit.ino | 4 +- .../Sprite_scroll_8bit/Sprite_scroll_8bit.ino | 16 +- .../Sprite_scroll_wrap_1bit.ino | 2 +- .../Transparent_Sprite_Demo.ino | 10 +- .../Transparent_Sprite_Demo_4bit.ino | 14 +- .../Floyd_Steinberg/Floyd_Steinberg.ino | 4 +- .../Floyd_Steinberg/Floyd_Steinberg_BMP.ino | 12 +- library.properties | 2 +- license.txt | 6 +- 197 files changed, 1006 insertions(+), 757 deletions(-) create mode 100644 User_Setups/Setup0_Sprite.h create mode 100644 User_Setups/Setup29b_ILI9341_STM32.h create mode 100644 User_Setups/Setup60_RP2040_RPI_MHS.h create mode 100644 User_Setups/Setup70h_ESP32_S3_GC9A01.h diff --git a/Extensions/Smooth_font.cpp b/Extensions/Smooth_font.cpp index d1915a4..c67204a 100644 --- a/Extensions/Smooth_font.cpp +++ b/Extensions/Smooth_font.cpp @@ -48,7 +48,7 @@ void TFT_eSPI::loadFont(String fontName, bool flash) 6. Descent in pixels from baseline to bottom of "p" Next are gCount sets of values for each glyph, each set comprises 7 int32t parameters (28 bytes): - 1. Glyph Unicode stored as a 32 bit value + 1. Glyph Unicode stored as a 32-bit value 2. Height of bitmap bounding box 3. Width of bitmap bounding box 4. gxAdvance for cursor (setWidth in Processing) @@ -57,7 +57,7 @@ void TFT_eSPI::loadFont(String fontName, bool flash) 7. padding value, typically 0 The bitmaps start next at 24 + (28 * gCount) bytes from the start of the file. - Each pixel is 1 byte, an 8 bit Alpha value which represents the transparency from + Each pixel is 1 byte, an 8-bit Alpha value which represents the transparency from 0xFF foreground colour, 0x00 background. The library uses a linear interpolation between the foreground and background RGB component colours. e.g. pixelRed = ((fgRed * alpha) + (bgRed * (255 - alpha))/255 @@ -158,7 +158,7 @@ void TFT_eSPI::loadMetrics(void) #if defined (ESP32) && defined (CONFIG_SPIRAM_SUPPORT) if ( psramFound() ) { - gUnicode = (uint16_t*)ps_malloc( gFont.gCount * 2); // Unicode 16 bit Basic Multilingual Plane (0-FFFF) + gUnicode = (uint16_t*)ps_malloc( gFont.gCount * 2); // Unicode 16-bit Basic Multilingual Plane (0-FFFF) gHeight = (uint8_t*)ps_malloc( gFont.gCount ); // Height of glyph gWidth = (uint8_t*)ps_malloc( gFont.gCount ); // Width of glyph gxAdvance = (uint8_t*)ps_malloc( gFont.gCount ); // xAdvance - to move x cursor @@ -169,7 +169,7 @@ void TFT_eSPI::loadMetrics(void) else #endif { - gUnicode = (uint16_t*)malloc( gFont.gCount * 2); // Unicode 16 bit Basic Multilingual Plane (0-FFFF) + gUnicode = (uint16_t*)malloc( gFont.gCount * 2); // Unicode 16-bit Basic Multilingual Plane (0-FFFF) gHeight = (uint8_t*)malloc( gFont.gCount ); // Height of glyph gWidth = (uint8_t*)malloc( gFont.gCount ); // Width of glyph gxAdvance = (uint8_t*)malloc( gFont.gCount ); // xAdvance - to move x cursor @@ -308,7 +308,7 @@ void TFT_eSPI::unloadFont( void ) /*************************************************************************************** ** Function name: readInt32 -** Description: Get a 32 bit integer from the font file +** Description: Get a 32-bit integer from the font file *************************************************************************************x*/ uint32_t TFT_eSPI::readInt32(void) { @@ -316,18 +316,18 @@ uint32_t TFT_eSPI::readInt32(void) #ifdef FONT_FS_AVAILABLE if (fs_font) { - val = fontFile.read() << 24; - val |= fontFile.read() << 16; - val |= fontFile.read() << 8; - val |= fontFile.read(); + val = (uint32_t)fontFile.read() << 24; + val |= (uint32_t)fontFile.read() << 16; + val |= (uint32_t)fontFile.read() << 8; + val |= (uint32_t)fontFile.read(); } else #endif { - val = pgm_read_byte(fontPtr++) << 24; - val |= pgm_read_byte(fontPtr++) << 16; - val |= pgm_read_byte(fontPtr++) << 8; - val |= pgm_read_byte(fontPtr++); + val = (uint32_t)pgm_read_byte(fontPtr++) << 24; + val |= (uint32_t)pgm_read_byte(fontPtr++) << 16; + val |= (uint32_t)pgm_read_byte(fontPtr++) << 8; + val |= (uint32_t)pgm_read_byte(fontPtr++); } return val; diff --git a/Extensions/Sprite.cpp b/Extensions/Sprite.cpp index 5343c08..a02ab9b 100644 --- a/Extensions/Sprite.cpp +++ b/Extensions/Sprite.cpp @@ -47,7 +47,7 @@ TFT_eSprite::TFT_eSprite(TFT_eSPI *tft) ** Function name: createSprite ** Description: Create a sprite (bitmap) of defined width and height ***************************************************************************************/ -// cast returned value to (uint8_t*) for 8 bit or (uint16_t*) for 16 bit colours +// cast returned value to (uint8_t*) for 8-bit or (uint16_t*) for 16-bit colours void* TFT_eSprite::createSprite(int16_t w, int16_t h, uint8_t frames) { @@ -1104,7 +1104,7 @@ void TFT_eSprite::pushImage(int32_t x, int32_t y, int32_t w, int32_t h, uint16_ } else if (_bpp == 4) { - // The image is assumed to be 4 bit, where each byte corresponds to two pixels. + // The image is assumed to be 4-bit, where each byte corresponds to two pixels. // much faster when aligned to a byte boundary, because the alternative is slower, requiring // tedious bit operations. @@ -1355,10 +1355,10 @@ void TFT_eSprite::writeColor(uint16_t color) { if (!_created ) return; - // Write 16 bit RGB 565 encoded colour to RAM + // Write 16-bit RGB 565 encoded colour to RAM if (_bpp == 16) _img [_xptr + _yptr * _iwidth] = color; - // Write 8 bit RGB 332 encoded colour to RAM + // Write 8-bit RGB 332 encoded colour to RAM else if (_bpp == 8) _img8[_xptr + _yptr * _iwidth] = (uint8_t) color; else if (_bpp == 4) @@ -2138,7 +2138,7 @@ void TFT_eSprite::drawChar(int32_t x, int32_t y, uint16_t c, uint32_t color, uin /*************************************************************************************** ** Function name: drawChar -** Description: draw a unicode glyph into the sprite +** Description: draw a Unicode glyph into the sprite ***************************************************************************************/ // TODO: Rationalise with TFT_eSPI // Any UTF-8 decoding must be done before calling drawChar() @@ -2290,7 +2290,7 @@ int16_t TFT_eSprite::drawChar(uint16_t uniCode, int32_t x, int32_t y, uint8_t fo uint8_t tnp = 0; // Temporary copy of np for while loop uint8_t ts = textsize - 1; // Temporary copy of textsize - // 16 bit pixel count so maximum font size is equivalent to 180x180 pixels in area + // 16-bit pixel count so maximum font size is equivalent to 180x180 pixels in area // w is total number of pixels to plot to fill character block while (pc < w) { line = pgm_read_byte((uint8_t *)flash_address); diff --git a/Extensions/Sprite.h b/Extensions/Sprite.h index 5f3e59e..67e29de 100644 --- a/Extensions/Sprite.h +++ b/Extensions/Sprite.h @@ -13,12 +13,12 @@ class TFT_eSprite : public TFT_eSPI { ~TFT_eSprite(void); // Create a sprite of width x height pixels, return a pointer to the RAM area - // Sketch can cast returned value to (uint16_t*) for 16 bit depth if needed + // Sketch can cast returned value to (uint16_t*) for 16-bit depth if needed // RAM required is: // - 1 bit per pixel for 1 bit colour depth - // - 1 nibble per pixel for 4 bit colour (with palette table) - // - 1 byte per pixel for 8 bit colour (332 RGB format) - // - 2 bytes per pixel for 16 bit color depth (565 RGB format) + // - 1 nibble per pixel for 4-bit colour (with palette table) + // - 1 byte per pixel for 8-bit colour (332 RGB format) + // - 2 bytes per pixel for 16-bit color depth (565 RGB format) void* createSprite(int16_t width, int16_t height, uint8_t frames = 1); // Returns a pointer to the sprite or nullptr if not created, user must cast to pointer type @@ -39,7 +39,7 @@ class TFT_eSprite : public TFT_eSPI { void* setColorDepth(int8_t b); int8_t getColorDepth(void); - // Set the palette for a 4 bit depth sprite. Only the first 16 colours in the map are used. + // Set the palette for a 4-bit depth sprite. Only the first 16 colours in the map are used. void createPalette(uint16_t *palette = nullptr, uint8_t colors = 16); // Palette in RAM void createPalette(const uint16_t *palette = nullptr, uint8_t colors = 16); // Palette in FLASH @@ -61,14 +61,14 @@ class TFT_eSprite : public TFT_eSPI { // Fill Sprite with a colour fillSprite(uint32_t color), - // Define a window to push 16 bit colour pixels into in a raster order + // Define a window to push 16-bit colour pixels into in a raster order // Colours are converted to the set Sprite colour bit depth setWindow(int32_t x0, int32_t y0, int32_t x1, int32_t y1), // Push a color (aka singe pixel) to the sprite's set window area pushColor(uint16_t color), // Push len colors (pixels) to the sprite's set window area pushColor(uint16_t color, uint32_t len), - // Push a pixel pre-formatted as a 1, 4, 8 or 16 bit colour (avoids conversion overhead) + // Push a pixel pre-formatted as a 1, 4, 8 or 16-bit colour (avoids conversion overhead) writeColor(uint16_t color), // Set the scroll zone, top left corner at x,y with defined width and height @@ -139,7 +139,7 @@ class TFT_eSprite : public TFT_eSPI { height(void); // Functions associated with anti-aliased fonts - // Draw a single unicode character using the loaded font + // Draw a single Unicode character using the loaded font void drawGlyph(uint16_t code); // Print string to sprite using loaded font at cursor position void printToSprite(String string); @@ -162,13 +162,13 @@ class TFT_eSprite : public TFT_eSPI { protected: uint8_t _bpp; // bits per pixel (1, 4, 8 or 16) - uint16_t *_img; // pointer to 16 bit sprite - uint8_t *_img8; // pointer to 1 and 8 bit sprite frame 1 or frame 2 - uint8_t *_img4; // pointer to 4 bit sprite (uses color map) + uint16_t *_img; // pointer to 16-bit sprite + uint8_t *_img8; // pointer to 1 and 8-bit sprite frame 1 or frame 2 + uint8_t *_img4; // pointer to 4-bit sprite (uses color map) uint8_t *_img8_1; // pointer to frame 1 uint8_t *_img8_2; // pointer to frame 2 - uint16_t *_colorMap; // color map pointer: 16 entries, used with 4 bit color map. + uint16_t *_colorMap; // color map pointer: 16 entries, used with 4-bit color map. int32_t _sinra; // Sine of rotation angle in fixed point int32_t _cosra; // Cosine of rotation angle in fixed point diff --git a/Fonts/Font32rle.c b/Fonts/Font32rle.c index f163986..7a8119b 100644 --- a/Fonts/Font32rle.c +++ b/Fonts/Font32rle.c @@ -1,6 +1,6 @@ // Font 4 // -// This font has been 8 bit Run Length Encoded to save FLASH space +// This font has been 8-bit Run Length Encoded to save FLASH space // // This font contains 96 ASCII characters diff --git a/Fonts/Font64rle.c b/Fonts/Font64rle.c index 9d1415b..a80e6ea 100644 --- a/Fonts/Font64rle.c +++ b/Fonts/Font64rle.c @@ -1,6 +1,6 @@ // Font 6 is intended to display numbers and time // -// This font has been 8 bit Run Length Encoded to save FLASH space +// This font has been 8-bit Run Length Encoded to save FLASH space // // This font only contains characters [space] 0 1 2 3 4 5 6 7 8 9 : - . a p m // The Pipe character | is a narrow space to aid formatting diff --git a/Fonts/Font72rle.c b/Fonts/Font72rle.c index 7f5da5d..478411a 100644 --- a/Fonts/Font72rle.c +++ b/Fonts/Font72rle.c @@ -1,6 +1,6 @@ // Font 8 // -// This font has been 8 bit Run Length Encoded to save FLASH space +// This font has been 8-bit Run Length Encoded to save FLASH space // // It is a Arial 75 pixel height font intended to display large numbers // This font only contains characters [space] 0 1 2 3 4 5 6 7 8 9 0 : - . diff --git a/Fonts/Font72x53rle.c b/Fonts/Font72x53rle.c index 71c2c4f..ae8d00c 100644 --- a/Fonts/Font72x53rle.c +++ b/Fonts/Font72x53rle.c @@ -1,6 +1,6 @@ // Font 8 // -// This font has been 8 bit Run Length Encoded to save FLASH space +// This font has been 8-bit Run Length Encoded to save FLASH space // // It is a Arial 75 pixel height font intended to display large numbers // Width for numerals reduced from 55 to 53 (to fit in 160 pixel screens) diff --git a/Fonts/Font7srle.c b/Fonts/Font7srle.c index 7c6f929..7d54a6f 100644 --- a/Fonts/Font7srle.c +++ b/Fonts/Font7srle.c @@ -1,6 +1,6 @@ // Font 7 // -// This font has been 8 bit Run Length Encoded to save FLASH space +// This font has been 8-bit Run Length Encoded to save FLASH space // // This is a 7 segment font intended to display numbers and time // This font only contains characters [space] 0 1 2 3 4 5 6 7 8 9 : . - diff --git a/Kconfig b/Kconfig index 1433ee5..2e21c90 100644 --- a/Kconfig +++ b/Kconfig @@ -158,7 +158,7 @@ menu "TFT_eSPI" config TFT_SPI bool "SPI" config TFT_PARALLEL_8_BIT - bool "Parallel (8 bit)" + bool "Parallel (8-bit)" endchoice menu "Display Data pins" diff --git a/Processors/TFT_eSPI_ESP32.c b/Processors/TFT_eSPI_ESP32.c index 1b0435f..faf3034 100644 --- a/Processors/TFT_eSPI_ESP32.c +++ b/Processors/TFT_eSPI_ESP32.c @@ -100,7 +100,7 @@ void TFT_eSPI::end_SDA_Read(void) /*************************************************************************************** ** Function name: read byte - supports class functions -** Description: Read a byte from ESP32 8 bit data port +** Description: Read a byte from ESP32 8-bit data port ***************************************************************************************/ // Parallel bus MUST be set to input before calling this function! uint8_t TFT_eSPI::readByte(void) @@ -415,7 +415,7 @@ void TFT_eSPI::pushPixels(const void* data_in, uint32_t len){ } //////////////////////////////////////////////////////////////////////////////////////// -#elif defined (SPI_18BIT_DRIVER) // SPI 18 bit colour +#elif defined (SPI_18BIT_DRIVER) // SPI 18-bit colour //////////////////////////////////////////////////////////////////////////////////////// /*************************************************************************************** @@ -428,7 +428,7 @@ void TFT_eSPI::pushBlock(uint16_t color, uint32_t len) uint32_t r = (color & 0xF800)>>8; uint32_t g = (color & 0x07E0)<<5; uint32_t b = (color & 0x001F)<<19; - // Concatenate 4 pixels into three 32 bit blocks + // Concatenate 4 pixels into three 32-bit blocks uint32_t r0 = r<<24 | b | g | r; uint32_t r1 = r0>>8 | g<<16; uint32_t r2 = r1>>8 | b<<8; @@ -512,7 +512,7 @@ void TFT_eSPI::pushSwapBytePixels(const void* data_in, uint32_t len){ } //////////////////////////////////////////////////////////////////////////////////////// -#elif defined (TFT_PARALLEL_8_BIT) // Now the code for ESP32 8 bit parallel +#elif defined (TFT_PARALLEL_8_BIT) // Now the code for ESP32 8-bit parallel //////////////////////////////////////////////////////////////////////////////////////// /*************************************************************************************** @@ -793,7 +793,7 @@ bool TFT_eSPI::initDMA(bool ctrl_cs) .sclk_io_num = TFT_SCLK, .quadwp_io_num = -1, .quadhd_io_num = -1, - #ifdef CONFIG_IDF_TARGET_ESP32S2 + #ifdef xCONFIG_IDF_TARGET_ESP32S2 .data4_io_num = -1, .data5_io_num = -1, .data6_io_num = -1, diff --git a/Processors/TFT_eSPI_ESP32.h b/Processors/TFT_eSPI_ESP32.h index 7385dd5..ad60e3d 100644 --- a/Processors/TFT_eSPI_ESP32.h +++ b/Processors/TFT_eSPI_ESP32.h @@ -87,14 +87,14 @@ SPI3_HOST = 2 // Initialise processor specific SPI functions, used by init() #define INIT_TFT_DATA_BUS // Not used -// Define a generic flag for 8 bit parallel +// Define a generic flag for 8-bit parallel #if defined (ESP32_PARALLEL) // Specific to ESP32 for backwards compatibility #if !defined (TFT_PARALLEL_8_BIT) #define TFT_PARALLEL_8_BIT // Generic parallel flag #endif #endif -// Ensure ESP32 specific flag is defined for 8 bit parallel +// Ensure ESP32 specific flag is defined for 8-bit parallel #if defined (TFT_PARALLEL_8_BIT) #if !defined (ESP32_PARALLEL) #define ESP32_PARALLEL @@ -380,12 +380,12 @@ SPI3_HOST = 2 #if defined (SSD1963_DRIVER) - // Write 18 bit color to TFT + // Write 18-bit color to TFT #define tft_Write_16(C) GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) (((C) & 0xF800)>> 8)); WR_H; \ GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) (((C) & 0x07E0)>> 3)); WR_H; \ GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) (((C) & 0x001F)<< 3)); WR_H - // 18 bit color write with swapped bytes + // 18-bit color write with swapped bytes #define tft_Write_16S(C) Cswap = ((C) >>8 | (C) << 8); tft_Write_16(Cswap) #else @@ -399,7 +399,7 @@ SPI3_HOST = 2 #define tft_Write_16(C) GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) ((C) >> 8)); WR_H; \ GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) ((C) >> 0)); WR_H - // 16 bit write with swapped bytes + // 16-bit write with swapped bytes #define tft_Write_16S(C) GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) ((C) >> 0)); WR_H; \ GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) ((C) >> 8)); WR_H #endif @@ -412,13 +412,13 @@ SPI3_HOST = 2 GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) ((C) >> 8)); WR_H; \ GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) ((C) >> 0)); WR_H - // Write two concatenated 16 bit values to TFT + // Write two concatenated 16-bit values to TFT #define tft_Write_32C(C,D) GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) ((C) >> 8)); WR_H; \ GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) ((C) >> 0)); WR_H; \ GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) ((D) >> 8)); WR_H; \ GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) ((D) >> 0)); WR_H - // Write 16 bit value twice to TFT - used by drawPixel() + // Write 16-bit value twice to TFT - used by drawPixel() #define tft_Write_32D(C) GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) ((C) >> 8)); WR_H; \ GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) ((C) >> 0)); WR_H; \ GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) ((C) >> 8)); WR_H; \ @@ -447,12 +447,12 @@ SPI3_HOST = 2 //////////////////////////////////////////////////////////////////////////////////////// // Macros to write commands/pixel colour data to a SPI ILI948x TFT //////////////////////////////////////////////////////////////////////////////////////// -#elif defined (SPI_18BIT_DRIVER) // SPI 18 bit colour +#elif defined (SPI_18BIT_DRIVER) // SPI 18-bit colour // Write 8 bits to TFT #define tft_Write_8(C) spi.transfer(C) - // Convert 16 bit colour to 18 bit and write in 3 bytes + // Convert 16-bit colour to 18-bit and write in 3 bytes #define tft_Write_16(C) spi.transfer(((C) & 0xF800)>>8); \ spi.transfer(((C) & 0x07E0)>>3); \ spi.transfer(((C) & 0x001F)<<3) @@ -460,7 +460,7 @@ SPI3_HOST = 2 // Future option for transfer without wait #define tft_Write_16N(C) tft_Write_16(C) - // Convert swapped byte 16 bit colour to 18 bit and write in 3 bytes + // Convert swapped byte 16-bit colour to 18-bit and write in 3 bytes #define tft_Write_16S(C) spi.transfer((C) & 0xF8); \ spi.transfer(((C) & 0xE000)>>11 | ((C) & 0x07)<<5); \ spi.transfer(((C) & 0x1F00)>>5) @@ -468,10 +468,10 @@ SPI3_HOST = 2 // Write 32 bits to TFT #define tft_Write_32(C) spi.write32(C) - // Write two concatenated 16 bit values to TFT + // Write two concatenated 16-bit values to TFT #define tft_Write_32C(C,D) spi.write32((C)<<16 | (D)) - // Write 16 bit value twice to TFT + // Write 16-bit value twice to TFT #define tft_Write_32D(C) spi.write32((C)<<16 | (C)) //////////////////////////////////////////////////////////////////////////////////////// @@ -479,7 +479,7 @@ SPI3_HOST = 2 //////////////////////////////////////////////////////////////////////////////////////// #elif defined (RPI_DISPLAY_TYPE) - // ESP32 low level SPI writes for 8, 16 and 32 bit values + // ESP32 low level SPI writes for 8, 16 and 32-bit values // to avoid the function call overhead #define TFT_WRITE_BITS(D, B) \ WRITE_PERI_REG(SPI_MOSI_DLEN_REG(SPI_PORT), B-1); \ @@ -490,7 +490,7 @@ SPI3_HOST = 2 // Write 8 bits #define tft_Write_8(C) TFT_WRITE_BITS((C)<<8, 16) - // Write 16 bits with corrected endianness for 16 bit colours + // Write 16 bits with corrected endianness for 16-bit colours #define tft_Write_16(C) TFT_WRITE_BITS((C)<<8 | (C)>>8, 16) // Future option for transfer without wait @@ -514,7 +514,7 @@ SPI3_HOST = 2 //////////////////////////////////////////////////////////////////////////////////////// #else /* Old macros - // ESP32 low level SPI writes for 8, 16 and 32 bit values + // ESP32 low level SPI writes for 8, 16 and 32-bit values // to avoid the function call overhead #define TFT_WRITE_BITS(D, B) \ WRITE_PERI_REG(SPI_MOSI_DLEN_REG(SPI_PORT), B-1); \ @@ -525,7 +525,7 @@ SPI3_HOST = 2 // Write 8 bits #define tft_Write_8(C) TFT_WRITE_BITS(C, 8) - // Write 16 bits with corrected endianness for 16 bit colours + // Write 16 bits with corrected endianness for 16-bit colours #define tft_Write_16(C) TFT_WRITE_BITS((C)<<8 | (C)>>8, 16) // Write 16 bits @@ -549,7 +549,7 @@ SPI3_HOST = 2 // Write 8 bits #define tft_Write_8(C) TFT_WRITE_BITS(C, 8) - // Write 16 bits with corrected endianness for 16 bit colours + // Write 16 bits with corrected endianness for 16-bit colours #define tft_Write_16(C) TFT_WRITE_BITS((C)<<8 | (C)>>8, 16) // Future option for transfer without wait diff --git a/Processors/TFT_eSPI_ESP32_C3.c b/Processors/TFT_eSPI_ESP32_C3.c index e33a5ac..a28cf4f 100644 --- a/Processors/TFT_eSPI_ESP32_C3.c +++ b/Processors/TFT_eSPI_ESP32_C3.c @@ -93,7 +93,7 @@ void TFT_eSPI::end_SDA_Read(void) /*************************************************************************************** ** Function name: read byte - supports class functions -** Description: Read a byte from ESP32 8 bit data port +** Description: Read a byte from ESP32 8-bit data port ***************************************************************************************/ // Parallel bus MUST be set to input before calling this function! uint8_t TFT_eSPI::readByte(void) @@ -436,7 +436,7 @@ void TFT_eSPI::pushPixels(const void* data_in, uint32_t len){ } //////////////////////////////////////////////////////////////////////////////////////// -#elif defined (SPI_18BIT_DRIVER) // SPI 18 bit colour +#elif defined (SPI_18BIT_DRIVER) // SPI 18-bit colour //////////////////////////////////////////////////////////////////////////////////////// /*************************************************************************************** @@ -449,7 +449,7 @@ void TFT_eSPI::pushBlock(uint16_t color, uint32_t len) uint32_t r = (color & 0xF800)>>8; uint32_t g = (color & 0x07E0)<<5; uint32_t b = (color & 0x001F)<<19; - // Concatenate 4 pixels into three 32 bit blocks + // Concatenate 4 pixels into three 32-bit blocks uint32_t r0 = r<<24 | b | g | r; uint32_t r1 = r0>>8 | g<<16; uint32_t r2 = r1>>8 | b<<8; @@ -540,7 +540,7 @@ void TFT_eSPI::pushSwapBytePixels(const void* data_in, uint32_t len){ } //////////////////////////////////////////////////////////////////////////////////////// -#elif defined (TFT_PARALLEL_8_BIT) // Now the code for ESP32 8 bit parallel +#elif defined (TFT_PARALLEL_8_BIT) // Now the code for ESP32 8-bit parallel //////////////////////////////////////////////////////////////////////////////////////// /*************************************************************************************** diff --git a/Processors/TFT_eSPI_ESP32_C3.h b/Processors/TFT_eSPI_ESP32_C3.h index e9f81d1..6fa1858 100644 --- a/Processors/TFT_eSPI_ESP32_C3.h +++ b/Processors/TFT_eSPI_ESP32_C3.h @@ -79,14 +79,14 @@ SPI3_HOST = 2 // Initialise processor specific SPI functions, used by init() #define INIT_TFT_DATA_BUS // Not used -// Define a generic flag for 8 bit parallel +// Define a generic flag for 8-bit parallel #if defined (ESP32_PARALLEL) // Specific to ESP32 for backwards compatibility #if !defined (TFT_PARALLEL_8_BIT) #define TFT_PARALLEL_8_BIT // Generic parallel flag #endif #endif -// Ensure ESP32 specific flag is defined for 8 bit parallel +// Ensure ESP32 specific flag is defined for 8-bit parallel #if defined (TFT_PARALLEL_8_BIT) #if !defined (ESP32_PARALLEL) #define ESP32_PARALLEL @@ -371,12 +371,12 @@ SPI3_HOST = 2 #if defined (SSD1963_DRIVER) - // Write 18 bit color to TFT + // Write 18-bit color to TFT #define tft_Write_16(C) GPIO.out_w1tc.val = GPIO_OUT_CLR_MASK; GPIO.out_w1ts.val = set_mask((uint8_t) (((C) & 0xF800)>> 8)); WR_H; \ GPIO.out_w1tc.val = GPIO_OUT_CLR_MASK; GPIO.out_w1ts.val = set_mask((uint8_t) (((C) & 0x07E0)>> 3)); WR_H; \ GPIO.out_w1tc.val = GPIO_OUT_CLR_MASK; GPIO.out_w1ts.val = set_mask((uint8_t) (((C) & 0x001F)<< 3)); WR_H - // 18 bit color write with swapped bytes + // 18-bit color write with swapped bytes #define tft_Write_16S(C) Cswap = ((C) >>8 | (C) << 8); tft_Write_16(Cswap) #else @@ -390,7 +390,7 @@ SPI3_HOST = 2 #define tft_Write_16(C) GPIO.out_w1tc.val = GPIO_OUT_CLR_MASK; GPIO.out_w1ts.val = set_mask((uint8_t) ((C) >> 8)); WR_H; \ GPIO.out_w1tc.val = GPIO_OUT_CLR_MASK; GPIO.out_w1ts.val = set_mask((uint8_t) ((C) >> 0)); WR_H - // 16 bit write with swapped bytes + // 16-bit write with swapped bytes #define tft_Write_16S(C) GPIO.out_w1tc.val = GPIO_OUT_CLR_MASK; GPIO.out_w1ts.val = set_mask((uint8_t) ((C) >> 0)); WR_H; \ GPIO.out_w1tc.val = GPIO_OUT_CLR_MASK; GPIO.out_w1ts.val = set_mask((uint8_t) ((C) >> 8)); WR_H #endif @@ -403,13 +403,13 @@ SPI3_HOST = 2 GPIO.out_w1tc.val = GPIO_OUT_CLR_MASK; GPIO.out_w1ts.val = set_mask((uint8_t) ((C) >> 8)); WR_H; \ GPIO.out_w1tc.val = GPIO_OUT_CLR_MASK; GPIO.out_w1ts.val = set_mask((uint8_t) ((C) >> 0)); WR_H - // Write two concatenated 16 bit values to TFT + // Write two concatenated 16-bit values to TFT #define tft_Write_32C(C,D) GPIO.out_w1tc.val = GPIO_OUT_CLR_MASK; GPIO.out_w1ts.val = set_mask((uint8_t) ((C) >> 8)); WR_H; \ GPIO.out_w1tc.val = GPIO_OUT_CLR_MASK; GPIO.out_w1ts.val = set_mask((uint8_t) ((C) >> 0)); WR_H; \ GPIO.out_w1tc.val = GPIO_OUT_CLR_MASK; GPIO.out_w1ts.val = set_mask((uint8_t) ((D) >> 8)); WR_H; \ GPIO.out_w1tc.val = GPIO_OUT_CLR_MASK; GPIO.out_w1ts.val = set_mask((uint8_t) ((D) >> 0)); WR_H - // Write 16 bit value twice to TFT - used by drawPixel() + // Write 16-bit value twice to TFT - used by drawPixel() #define tft_Write_32D(C) GPIO.out_w1tc.val = GPIO_OUT_CLR_MASK; GPIO.out_w1ts.val = set_mask((uint8_t) ((C) >> 8)); WR_H; \ GPIO.out_w1tc.val = GPIO_OUT_CLR_MASK; GPIO.out_w1ts.val = set_mask((uint8_t) ((C) >> 0)); WR_H; \ GPIO.out_w1tc.val = GPIO_OUT_CLR_MASK; GPIO.out_w1ts.val = set_mask((uint8_t) ((C) >> 8)); WR_H; \ @@ -438,12 +438,12 @@ SPI3_HOST = 2 //////////////////////////////////////////////////////////////////////////////////////// // Macros to write commands/pixel colour data to a SPI ILI948x TFT //////////////////////////////////////////////////////////////////////////////////////// -#elif defined (SPI_18BIT_DRIVER) // SPI 18 bit colour +#elif defined (SPI_18BIT_DRIVER) // SPI 18-bit colour // Write 8 bits to TFT #define tft_Write_8(C) spi.transfer(C) - // Convert 16 bit colour to 18 bit and write in 3 bytes + // Convert 16-bit colour to 18-bit and write in 3 bytes #define tft_Write_16(C) spi.transfer(((C) & 0xF800)>>8); \ spi.transfer(((C) & 0x07E0)>>3); \ spi.transfer(((C) & 0x001F)<<3) @@ -451,7 +451,7 @@ SPI3_HOST = 2 // Future option for transfer without wait #define tft_Write_16N(C) tft_Write_16(C) - // Convert swapped byte 16 bit colour to 18 bit and write in 3 bytes + // Convert swapped byte 16-bit colour to 18-bit and write in 3 bytes #define tft_Write_16S(C) spi.transfer((C) & 0xF8); \ spi.transfer(((C) & 0xE000)>>11 | ((C) & 0x07)<<5); \ spi.transfer(((C) & 0x1F00)>>5) @@ -459,10 +459,10 @@ SPI3_HOST = 2 // Write 32 bits to TFT #define tft_Write_32(C) spi.write32(C) - // Write two concatenated 16 bit values to TFT + // Write two concatenated 16-bit values to TFT #define tft_Write_32C(C,D) spi.write32((C)<<16 | (D)) - // Write 16 bit value twice to TFT + // Write 16-bit value twice to TFT #define tft_Write_32D(C) spi.write32((C)<<16 | (C)) //////////////////////////////////////////////////////////////////////////////////////// @@ -470,7 +470,7 @@ SPI3_HOST = 2 //////////////////////////////////////////////////////////////////////////////////////// #elif defined (RPI_DISPLAY_TYPE) - // ESP32 low level SPI writes for 8, 16 and 32 bit values + // ESP32 low level SPI writes for 8, 16 and 32-bit values // to avoid the function call overhead #define TFT_WRITE_BITS(D, B) \ WRITE_PERI_REG(SPI_MOSI_DLEN_REG(SPI_PORT), B-1); \ @@ -481,7 +481,7 @@ SPI3_HOST = 2 // Write 8 bits #define tft_Write_8(C) TFT_WRITE_BITS((C)<<8, 16) - // Write 16 bits with corrected endianness for 16 bit colours + // Write 16 bits with corrected endianness for 16-bit colours #define tft_Write_16(C) TFT_WRITE_BITS((C)<<8 | (C)>>8, 16) // Future option for transfer without wait @@ -505,7 +505,7 @@ SPI3_HOST = 2 //////////////////////////////////////////////////////////////////////////////////////// #else /* Old macros - // ESP32 low level SPI writes for 8, 16 and 32 bit values + // ESP32 low level SPI writes for 8, 16 and 32-bit values // to avoid the function call overhead #define TFT_WRITE_BITS(D, B) \ WRITE_PERI_REG(SPI_MOSI_DLEN_REG(SPI_PORT), B-1); \ @@ -516,7 +516,7 @@ SPI3_HOST = 2 // Write 8 bits #define tft_Write_8(C) TFT_WRITE_BITS(C, 8) - // Write 16 bits with corrected endianness for 16 bit colours + // Write 16 bits with corrected endianness for 16-bit colours #define tft_Write_16(C) TFT_WRITE_BITS((C)<<8 | (C)>>8, 16) // Write 16 bits @@ -548,7 +548,7 @@ SPI3_HOST = 2 // Write 8 bits #define tft_Write_8(C) TFT_WRITE_BITS(C, 8) - // Write 16 bits with corrected endianness for 16 bit colours + // Write 16 bits with corrected endianness for 16-bit colours #define tft_Write_16(C) TFT_WRITE_BITS((C)<<8 | (C)>>8, 16) // Future option for transfer without wait diff --git a/Processors/TFT_eSPI_ESP32_S3.c b/Processors/TFT_eSPI_ESP32_S3.c index 8483bf7..b6cbd6d 100644 --- a/Processors/TFT_eSPI_ESP32_S3.c +++ b/Processors/TFT_eSPI_ESP32_S3.c @@ -84,7 +84,7 @@ void TFT_eSPI::end_SDA_Read(void) /*************************************************************************************** ** Function name: read byte - supports class functions -** Description: Read a byte from ESP32 8 bit data port +** Description: Read a byte from ESP32 8-bit data port ***************************************************************************************/ // Parallel bus MUST be set to input before calling this function! uint8_t TFT_eSPI::readByte(void) @@ -426,7 +426,7 @@ void TFT_eSPI::pushPixels(const void* data_in, uint32_t len){ } //////////////////////////////////////////////////////////////////////////////////////// -#elif defined (SPI_18BIT_DRIVER) // SPI 18 bit colour +#elif defined (SPI_18BIT_DRIVER) // SPI 18-bit colour //////////////////////////////////////////////////////////////////////////////////////// /*************************************************************************************** @@ -439,7 +439,7 @@ void TFT_eSPI::pushBlock(uint16_t color, uint32_t len) uint32_t r = (color & 0xF800)>>8; uint32_t g = (color & 0x07E0)<<5; uint32_t b = (color & 0x001F)<<19; - // Concatenate 4 pixels into three 32 bit blocks + // Concatenate 4 pixels into three 32-bit blocks uint32_t r0 = r<<24 | b | g | r; uint32_t r1 = r0>>8 | g<<16; uint32_t r2 = r1>>8 | b<<8; @@ -530,7 +530,7 @@ void TFT_eSPI::pushSwapBytePixels(const void* data_in, uint32_t len){ } //////////////////////////////////////////////////////////////////////////////////////// -#elif defined (TFT_PARALLEL_8_BIT) // Now the code for ESP32 8 bit parallel +#elif defined (TFT_PARALLEL_8_BIT) // Now the code for ESP32 8-bit parallel //////////////////////////////////////////////////////////////////////////////////////// /*************************************************************************************** @@ -646,7 +646,7 @@ void TFT_eSPI::pushPixelsDMA(uint16_t* image, uint32_t len) // of 32768 pixels maximum. (equivalent to an area of ~320 x 100 pixels) bool temp = _swapBytes; _swapBytes = false; - while(len>0x4000) { // Transfer 16 bit pixels in blocks if len*2 over 65536 bytes + while(len>0x4000) { // Transfer 16-bit pixels in blocks if len*2 over 65536 bytes pushPixels(image, 0x400); len -= 0x400; image+= 0x400; // Arbitrarily send 1K pixel blocks (2Kbytes) } @@ -690,7 +690,7 @@ void TFT_eSPI::pushImageDMA(int32_t x, int32_t y, int32_t w, int32_t h, uint16_t // of 32768 pixels maximum. (equivalent to an area of ~320 x 100 pixels) bool temp = _swapBytes; _swapBytes = false; - while(len>0x4000) { // Transfer 16 bit pixels in blocks if len*2 over 65536 bytes + while(len>0x4000) { // Transfer 16-bit pixels in blocks if len*2 over 65536 bytes pushPixels(buffer, 0x400); len -= 0x400; buffer+= 0x400; // Arbitrarily send 1K pixel blocks (2Kbytes) } @@ -778,7 +778,7 @@ void TFT_eSPI::pushImageDMA(int32_t x, int32_t y, int32_t w, int32_t h, uint16_t // of 32768 pixels maximum. (equivalent to an area of ~320 x 100 pixels) bool temp = _swapBytes; _swapBytes = false; - while(len>0x4000) { // Transfer 16 bit pixels in blocks if len*2 over 65536 bytes + while(len>0x4000) { // Transfer 16-bit pixels in blocks if len*2 over 65536 bytes pushPixels(buffer, 0x400); len -= 0x400; buffer+= 0x400; // Arbitrarily send 1K pixel blocks (2Kbytes) } diff --git a/Processors/TFT_eSPI_ESP32_S3.h b/Processors/TFT_eSPI_ESP32_S3.h index 97d0fc5..c1a9e10 100644 --- a/Processors/TFT_eSPI_ESP32_S3.h +++ b/Processors/TFT_eSPI_ESP32_S3.h @@ -93,14 +93,14 @@ SPI3_HOST = 2 // Initialise processor specific SPI functions, used by init() #define INIT_TFT_DATA_BUS // Not used -// Define a generic flag for 8 bit parallel +// Define a generic flag for 8-bit parallel #if defined (ESP32_PARALLEL) // Specific to ESP32 for backwards compatibility #if !defined (TFT_PARALLEL_8_BIT) #define TFT_PARALLEL_8_BIT // Generic parallel flag #endif #endif -// Ensure ESP32 specific flag is defined for 8 bit parallel +// Ensure ESP32 specific flag is defined for 8-bit parallel #if defined (TFT_PARALLEL_8_BIT) #if !defined (ESP32_PARALLEL) #define ESP32_PARALLEL @@ -414,12 +414,12 @@ SPI3_HOST = 2 #if defined (SSD1963_DRIVER) - // Write 18 bit color to TFT + // Write 18-bit color to TFT #define tft_Write_16(C) GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) (((C) & 0xF800)>> 8)); WR_H; \ GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) (((C) & 0x07E0)>> 3)); WR_H; \ GPIO.out_w1tc = GPIO_OUT_CLR_MASK; GPIO.out_w1ts = set_mask((uint8_t) (((C) & 0x001F)<< 3)); WR_H - // 18 bit color write with swapped bytes + // 18-bit color write with swapped bytes #define tft_Write_16S(C) Cswap = ((C) >>8 | (C) << 8); tft_Write_16(Cswap) #else @@ -433,7 +433,7 @@ SPI3_HOST = 2 #define tft_Write_16(C) GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 8)); WR_H; \ GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 0)); WR_H - // 16 bit write with swapped bytes + // 16-bit write with swapped bytes #define tft_Write_16S(C) GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 0)); WR_H; \ GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 8)); WR_H #endif @@ -446,13 +446,13 @@ SPI3_HOST = 2 GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 8)); WR_H; \ GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 0)); WR_H - // Write two concatenated 16 bit values to TFT + // Write two concatenated 16-bit values to TFT #define tft_Write_32C(C,D) GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 8)); WR_H; \ GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 0)); WR_H; \ GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((D) >> 8)); WR_H; \ GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((D) >> 0)); WR_H - // Write 16 bit value twice to TFT - used by drawPixel() + // Write 16-bit value twice to TFT - used by drawPixel() #define tft_Write_32D(C) GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 8)); WR_H; \ GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 0)); WR_H; \ GPIO_CLR_REG = GPIO_OUT_CLR_MASK; GPIO_SET_REG = set_mask((uint8_t) ((C) >> 8)); WR_H; \ @@ -481,12 +481,12 @@ SPI3_HOST = 2 //////////////////////////////////////////////////////////////////////////////////////// // Macros to write commands/pixel colour data to a SPI ILI948x TFT //////////////////////////////////////////////////////////////////////////////////////// -#elif defined (SPI_18BIT_DRIVER) // SPI 18 bit colour +#elif defined (SPI_18BIT_DRIVER) // SPI 18-bit colour // Write 8 bits to TFT #define tft_Write_8(C) spi.transfer(C) - // Convert 16 bit colour to 18 bit and write in 3 bytes + // Convert 16-bit colour to 18-bit and write in 3 bytes #define tft_Write_16(C) spi.transfer(((C) & 0xF800)>>8); \ spi.transfer(((C) & 0x07E0)>>3); \ spi.transfer(((C) & 0x001F)<<3) @@ -494,7 +494,7 @@ SPI3_HOST = 2 // Future option for transfer without wait #define tft_Write_16N(C) tft_Write_16(C) - // Convert swapped byte 16 bit colour to 18 bit and write in 3 bytes + // Convert swapped byte 16-bit colour to 18-bit and write in 3 bytes #define tft_Write_16S(C) spi.transfer((C) & 0xF8); \ spi.transfer(((C) & 0xE000)>>11 | ((C) & 0x07)<<5); \ spi.transfer(((C) & 0x1F00)>>5) @@ -502,17 +502,17 @@ SPI3_HOST = 2 // Write 32 bits to TFT #define tft_Write_32(C) spi.write32(C) - // Write two concatenated 16 bit values to TFT + // Write two concatenated 16-bit values to TFT #define tft_Write_32C(C,D) spi.write32((C)<<16 | (D)) - // Write 16 bit value twice to TFT + // Write 16-bit value twice to TFT #define tft_Write_32D(C) spi.write32((C)<<16 | (C)) //////////////////////////////////////////////////////////////////////////////////////// // Macros to write commands/pixel colour data to an Raspberry Pi TFT //////////////////////////////////////////////////////////////////////////////////////// #elif defined (RPI_DISPLAY_TYPE) - // ESP32-S3 low level SPI writes for 8, 16 and 32 bit values + // ESP32-S3 low level SPI writes for 8, 16 and 32-bit values // to avoid the function call overhead #define TFT_WRITE_BITS(D, B) *_spi_mosi_dlen = B-1; \ *_spi_w = D; \ @@ -524,7 +524,7 @@ SPI3_HOST = 2 // Write 8 bits #define tft_Write_8(C) TFT_WRITE_BITS((C)<<8, 16) - // Write 16 bits with corrected endianness for 16 bit colours + // Write 16 bits with corrected endianness for 16-bit colours #define tft_Write_16(C) TFT_WRITE_BITS((C)<<8 | (C)>>8, 16) // Future option for transfer without wait @@ -563,7 +563,7 @@ SPI3_HOST = 2 // Write 8 bits #define tft_Write_8(C) TFT_WRITE_BITS(C, 8) - // Write 16 bits with corrected endianness for 16 bit colours + // Write 16 bits with corrected endianness for 16-bit colours #define tft_Write_16(C) TFT_WRITE_BITS((C)<<8 | (C)>>8, 16) // Future option for transfer without wait diff --git a/Processors/TFT_eSPI_ESP8266.c b/Processors/TFT_eSPI_ESP8266.c index 83939f9..b49380a 100644 --- a/Processors/TFT_eSPI_ESP8266.c +++ b/Processors/TFT_eSPI_ESP8266.c @@ -109,7 +109,7 @@ void TFT_eSPI::pushSwapBytePixels(const void* data_in, uint32_t len){ } //////////////////////////////////////////////////////////////////////////////////////// -#elif defined (SPI_18BIT_DRIVER) // SPI 18 bit colour +#elif defined (SPI_18BIT_DRIVER) // SPI 18-bit colour //////////////////////////////////////////////////////////////////////////////////////// /*************************************************************************************** @@ -122,7 +122,7 @@ void TFT_eSPI::pushBlock(uint16_t color, uint32_t len) uint8_t r = (color & 0xF800)>>8; uint8_t g = (color & 0x07E0)>>3; uint8_t b = (color & 0x001F)<<3; - // Concatenate 4 pixels into three 32 bit blocks + // Concatenate 4 pixels into three 32-bit blocks uint32_t r0 = r<<24 | b<<16 | g<<8 | r; uint32_t r1 = g<<24 | r<<16 | b<<8 | g; uint32_t r2 = b<<24 | g<<16 | r<<8 | b; diff --git a/Processors/TFT_eSPI_ESP8266.h b/Processors/TFT_eSPI_ESP8266.h index c05d136..1aacc1e 100644 --- a/Processors/TFT_eSPI_ESP8266.h +++ b/Processors/TFT_eSPI_ESP8266.h @@ -117,17 +117,17 @@ //////////////////////////////////////////////////////////////////////////////////////// // Macros to write commands/pixel colour data to a SPI ILI948x TFT //////////////////////////////////////////////////////////////////////////////////////// -#if defined (SPI_18BIT_DRIVER) // SPI 18 bit colour +#if defined (SPI_18BIT_DRIVER) // SPI 18-bit colour // Write 8 bits to TFT #define tft_Write_8(C) spi.transfer(C) - // Convert 16 bit colour to 18 bit and write in 3 bytes + // Convert 16-bit colour to 18-bit and write in 3 bytes #define tft_Write_16(C) spi.transfer(((C) & 0xF800)>>8); \ spi.transfer(((C) & 0x07E0)>>3); \ spi.transfer(((C) & 0x001F)<<3) - // Convert swapped byte 16 bit colour to 18 bit and write in 3 bytes + // Convert swapped byte 16-bit colour to 18-bit and write in 3 bytes #define tft_Write_16S(C) spi.transfer((C) & 0xF8); \ spi.transfer(((C) & 0xE000)>>11 | ((C) & 0x07)<<5); \ spi.transfer(((C) & 0x1F00)>>5) @@ -148,7 +148,7 @@ // Command is 16 bits #define CMD_BITS 16 - // ESP8266 low level SPI writes for 8, 16 and 32 bit values + // ESP8266 low level SPI writes for 8, 16 and 32-bit values // to avoid the function call overhead #define TFT_WRITE_BITS(D, B) \ SPI1U1 = ((B-1) << SPILMOSI); \ diff --git a/Processors/TFT_eSPI_Generic.c b/Processors/TFT_eSPI_Generic.c index 14eda10..1c2287b 100644 --- a/Processors/TFT_eSPI_Generic.c +++ b/Processors/TFT_eSPI_Generic.c @@ -172,7 +172,7 @@ void TFT_eSPI::pushPixels(const void* data_in, uint32_t len) } //////////////////////////////////////////////////////////////////////////////////////// -#elif defined (SPI_18BIT_DRIVER) // SPI 18 bit colour +#elif defined (SPI_18BIT_DRIVER) // SPI 18-bit colour //////////////////////////////////////////////////////////////////////////////////////// /*************************************************************************************** @@ -216,7 +216,7 @@ void TFT_eSPI::pushPixels(const void* data_in, uint32_t len){ } //////////////////////////////////////////////////////////////////////////////////////// -#else // Standard SPI 16 bit colour TFT +#else // Standard SPI 16-bit colour TFT //////////////////////////////////////////////////////////////////////////////////////// /*************************************************************************************** diff --git a/Processors/TFT_eSPI_Generic.h b/Processors/TFT_eSPI_Generic.h index 8b31655..df7981d 100644 --- a/Processors/TFT_eSPI_Generic.h +++ b/Processors/TFT_eSPI_Generic.h @@ -3,7 +3,7 @@ //////////////////////////////////////////////////// // This is a generic driver for Arduino boards, it supports SPI interface displays -// 8 bit parallel interface to TFT is not supported for generic processors +// 8-bit parallel interface to TFT is not supported for generic processors #ifndef _TFT_eSPI_GENERICH_ #define _TFT_eSPI_GENERICH_ @@ -94,17 +94,17 @@ //////////////////////////////////////////////////////////////////////////////////////// // Macros to write commands/pixel colour data to a SPI ILI948x TFT //////////////////////////////////////////////////////////////////////////////////////// -#if defined (SPI_18BIT_DRIVER) // SPI 18 bit colour +#if defined (SPI_18BIT_DRIVER) // SPI 18-bit colour // Write 8 bits to TFT #define tft_Write_8(C) spi.transfer(C) - // Convert 16 bit colour to 18 bit and write in 3 bytes + // Convert 16-bit colour to 18-bit and write in 3 bytes #define tft_Write_16(C) spi.transfer(((C) & 0xF800)>>8); \ spi.transfer(((C) & 0x07E0)>>3); \ spi.transfer(((C) & 0x001F)<<3) - // Convert swapped byte 16 bit colour to 18 bit and write in 3 bytes + // Convert swapped byte 16-bit colour to 18-bit and write in 3 bytes #define tft_Write_16S(C) spi.transfer((C) & 0xF8); \ spi.transfer(((C) & 0xE000)>>11 | ((C) & 0x07)<<5); \ spi.transfer(((C) & 0x1F00)>>5) @@ -121,7 +121,7 @@ // Macros to write commands/pixel colour data to other displays //////////////////////////////////////////////////////////////////////////////////////// #else - #if defined (RPI_DISPLAY_TYPE) // RPi TFT type always needs 16 bit transfers + #if defined (RPI_DISPLAY_TYPE) // RPi TFT type always needs 16-bit transfers #define tft_Write_8(C) spi.transfer(C); spi.transfer(C) #define tft_Write_16(C) spi.transfer((uint8_t)((C)>>8));spi.transfer((uint8_t)((C)>>0)) #define tft_Write_16S(C) spi.transfer((uint8_t)((C)>>0));spi.transfer((uint8_t)((C)>>8)) @@ -143,7 +143,7 @@ spi.transfer(0); spi.transfer((C)>>0) #else - #ifdef __AVR__ // AVR processors do not have 16 bit transfer + #ifdef __AVR__ // AVR processors do not have 16-bit transfer #define tft_Write_8(C) {SPDR=(C); while (!(SPSR&_BV(SPIF)));} #define tft_Write_16(C) tft_Write_8((uint8_t)((C)>>8));tft_Write_8((uint8_t)((C)>>0)) #define tft_Write_16S(C) tft_Write_8((uint8_t)((C)>>0));tft_Write_8((uint8_t)((C)>>8)) diff --git a/Processors/TFT_eSPI_RP2040.c b/Processors/TFT_eSPI_RP2040.c index d557c9e..e046c7a 100644 --- a/Processors/TFT_eSPI_RP2040.c +++ b/Processors/TFT_eSPI_RP2040.c @@ -22,7 +22,7 @@ #ifdef RP2040_PIO_SPI #if defined (SPI_18BIT_DRIVER) - // SPI PIO code for 18 bit colour transmit + // SPI PIO code for 18-bit colour transmit #include "pio_SPI_18bit.pio.h" #else // SPI PIO code for 16-bit colour transmit @@ -30,7 +30,7 @@ #endif #elif defined (TFT_PARALLEL_8_BIT) #if defined (SSD1963_DRIVER) - // PIO code for 8-bit parallel interface (18 bit colour) + // PIO code for 8-bit parallel interface (18-bit colour) #include "pio_8bit_parallel_18bpp.pio.h" #else // PIO code for 8-bit parallel interface (16-bit colour) @@ -458,7 +458,7 @@ void TFT_eSPI::pushPixels(const void* data_in, uint32_t len) } //////////////////////////////////////////////////////////////////////////////////////// -#elif defined (SPI_18BIT_DRIVER) // SPI 18 bit colour +#elif defined (SPI_18BIT_DRIVER) // SPI 18-bit colour //////////////////////////////////////////////////////////////////////////////////////// /*************************************************************************************** diff --git a/Processors/TFT_eSPI_RP2040.h b/Processors/TFT_eSPI_RP2040.h index 47c3c2d..f10058f 100644 --- a/Processors/TFT_eSPI_RP2040.h +++ b/Processors/TFT_eSPI_RP2040.h @@ -3,7 +3,7 @@ //////////////////////////////////////////////////// // This is a generic driver for Arduino boards, it supports SPI interface displays -// 8 bit parallel interface to TFT is not supported for generic processors +// 8-bit parallel interface to TFT is not supported for generic processors #ifndef _TFT_eSPI_RP2040H_ #define _TFT_eSPI_RP2040H_ @@ -72,8 +72,8 @@ #if !defined (RP2040_PIO_INTERFACE) // SPI - #if defined (MHS_DISPLAY_TYPE) // High speed RPi TFT type always needs 16 bit transfers - // This swaps to 16 bit mode, used for commands so wait avoids clash with DC timing + #if defined (MHS_DISPLAY_TYPE) // High speed RPi TFT type always needs 16-bit transfers + // This swaps to 16-bit mode, used for commands so wait avoids clash with DC timing #define INIT_TFT_DATA_BUS hw_write_masked(&spi_get_hw(SPI_X)->cr0, (16 - 1) << SPI_SSPCR0_DSS_LSB, SPI_SSPCR0_DSS_BITS) #else // Initialise processor specific SPI functions, used by init() @@ -114,7 +114,7 @@ #define DIV_UNITS 3 // 96ns write cycle time #endif #define DIV_FRACT 0 - #else // 8 bit parallel mode default 64ns write cycle time + #else // 8-bit parallel mode default 64ns write cycle time #define DIV_UNITS 2 #define DIV_FRACT 0 // Note: Fractional values done with clock period dithering #endif @@ -166,10 +166,10 @@ tft_pio->sm[pio_sm].instr = pio_instr_clr_dc #ifndef RM68120_DRIVER - // Flush has happened before this and mode changed back to 16 bit + // Flush has happened before this and mode changed back to 16-bit #define DC_D tft_pio->sm[pio_sm].instr = pio_instr_set_dc #else - // Need to wait for stall since RM68120 commands are 16 bit + // Need to wait for stall since RM68120 commands are 16-bit #define DC_D WAIT_FOR_STALL; tft_pio->sm[pio_sm].instr = pio_instr_set_dc #endif #endif @@ -257,7 +257,7 @@ //////////////////////////////////////////////////////////////////////////////////////// #if !defined (RP2040_PIO_INTERFACE) // SPI - #if defined (SPI_18BIT_DRIVER) // SPI 18 bit colour + #if defined (SPI_18BIT_DRIVER) // SPI 18-bit colour // Write 8 bits to TFT #define tft_Write_8(C) spi_get_hw(SPI_X)->dr = (uint32_t)(C); \ @@ -267,17 +267,17 @@ #define tft_Write_8N(B) while (!spi_is_writable(SPI_X)){}; \ spi_get_hw(SPI_X)->dr = (uint8_t)(B) - // Convert 16 bit colour to 18 bit and write in 3 bytes + // Convert 16-bit colour to 18-bit and write in 3 bytes #define tft_Write_16(C) tft_Write_8N(((C) & 0xF800)>>8); \ tft_Write_8N(((C) & 0x07E0)>>3); \ tft_Write_8N(((C) & 0x001F)<<3) - // Convert 16 bit colour to 18 bit and write in 3 bytes + // Convert 16-bit colour to 18-bit and write in 3 bytes #define tft_Write_16N(C) tft_Write_8N(((C) & 0xF800)>>8); \ tft_Write_8N(((C) & 0x07E0)>>3); \ tft_Write_8N(((C) & 0x001F)<<3) - // Convert swapped byte 16 bit colour to 18 bit and write in 3 bytes + // Convert swapped byte 16-bit colour to 18-bit and write in 3 bytes #define tft_Write_16S(C) tft_Write_8N((C) & 0xF8); \ tft_Write_8N(((C) & 0xE000)>>11 | ((C) & 0x07)<<5); \ tft_Write_8N(((C) & 0x1F00)>>5) @@ -303,8 +303,8 @@ // Macros to write commands/pixel colour data to other displays //////////////////////////////////////////////////////////////////////////////////////// #else - #if defined (MHS_DISPLAY_TYPE) // High speed RPi TFT type always needs 16 bit transfers - // This swaps to 16 bit mode, used for commands so wait avoids clash with DC timing + #if defined (MHS_DISPLAY_TYPE) // High speed RPi TFT type always needs 16-bit transfers + // This swaps to 16-bit mode, used for commands so wait avoids clash with DC timing #define tft_Write_8(C) while (spi_get_hw(SPI_X)->sr & SPI_SSPSR_BSY_BITS) {}; \ hw_write_masked(&spi_get_hw(SPI_X)->cr0, (16 - 1) << SPI_SSPCR0_DSS_LSB, SPI_SSPCR0_DSS_BITS); \ spi_get_hw(SPI_X)->dr = (uint32_t)((C) | ((C)<<8)); \ @@ -324,7 +324,7 @@ #define tft_Write_32D(C) spi_get_hw(SPI_X)->dr = (uint32_t)(C); spi_get_hw(SPI_X)->dr = (uint32_t)(C) - #elif defined (RPI_DISPLAY_TYPE) // RPi TFT type always needs 16 bit transfers + #elif defined (RPI_DISPLAY_TYPE) // RPi TFT type always needs 16-bit transfers #define tft_Write_8(C) spi.transfer(C); spi.transfer(C) #define tft_Write_16(C) spi.transfer((uint8_t)((C)>>8));spi.transfer((uint8_t)((C)>>0)) #define tft_Write_16N(C) spi.transfer((uint8_t)((C)>>8));spi.transfer((uint8_t)((C)>>0)) @@ -348,7 +348,7 @@ #elif defined (ILI9225_DRIVER) // Needs gaps between commands + data bytes, so use slower transfer functions - // Warning: these all end in 8 bit SPI mode! + // Warning: these all end in 8-bit SPI mode! #define tft_Write_8(C) spi.transfer(C); #define tft_Write_16(C) spi.transfer16(C) @@ -365,7 +365,7 @@ #else - // This swaps to 8 bit mode, then back to 16 bit mode + // This swaps to 8-bit mode, then back to 16-bit mode #define tft_Write_8(C) while (spi_get_hw(SPI_X)->sr & SPI_SSPSR_BSY_BITS) {}; \ hw_write_masked(&spi_get_hw(SPI_X)->cr0, (8 - 1) << SPI_SSPCR0_DSS_LSB, SPI_SSPCR0_DSS_BITS); \ spi_get_hw(SPI_X)->dr = (uint32_t)(C); \ @@ -389,7 +389,7 @@ #endif // RPI_DISPLAY_TYPE #endif -#else // Parallel 8 bit or PIO SPI +#else // Parallel 8-bit or PIO SPI // Wait for the PIO to stall (SM pull request finds no data in TX FIFO) // This is used to detect when the SM is idle and hence ready for a jump instruction @@ -413,15 +413,15 @@ // Temporary - to be deleted #define GPIO_DIR_MASK 0 - #if defined (SPI_18BIT_DRIVER) || defined (SSD1963_DRIVER) // 18 bit colour (3 bytes) - // This writes 8 bits, then switches back to 16 bit mode automatically + #if defined (SPI_18BIT_DRIVER) || defined (SSD1963_DRIVER) // 18-bit colour (3 bytes) + // This writes 8 bits, then switches back to 16-bit mode automatically // Have already waited for pio stalled (last data write complete) when DC switched to command mode // The wait for stall allows DC to be changed immediately afterwards #define tft_Write_8(C) tft_pio->sm[pio_sm].instr = pio_instr_jmp8; \ TX_FIFO = (C); \ WAIT_FOR_STALL - // Used to send last byte for 32 bit macros below since PIO sends 24 bits + // Used to send last byte for 32-bit macros below since PIO sends 24 bits #define tft_Write_8L(C) WAIT_FOR_STALL; \ tft_pio->sm[pio_sm].instr = pio_instr_jmp8; \ TX_FIFO = (C) @@ -441,14 +441,14 @@ #define tft_Write_32D(C) WAIT_FOR_FIFO_FREE(2); TX_FIFO = (((C)<<8) | ((C)>>8)); tft_Write_8L(C) #else // PIO interface, SPI or parallel - // This writes 8 bits, then switches back to 16 bit mode automatically + // This writes 8 bits, then switches back to 16-bit mode automatically // Have already waited for pio stalled (last data write complete) when DC switched to command mode // The wait for stall allows DC to be changed immediately afterwards #if defined (TFT_PARALLEL_8_BIT) || defined (RP2040_PIO_SPI) #define tft_Write_8(C) tft_pio->sm[pio_sm].instr = pio_instr_jmp8; \ TX_FIFO = (C); \ WAIT_FOR_STALL - #else // For 16 bit parallel 16 bits are always sent + #else // For 16-bit parallel 16 bits are always sent #define tft_Write_8(C) TX_FIFO = (C); \ WAIT_FOR_STALL #endif diff --git a/Processors/TFT_eSPI_STM32.c b/Processors/TFT_eSPI_STM32.c index 950677c..776cc84 100644 --- a/Processors/TFT_eSPI_STM32.c +++ b/Processors/TFT_eSPI_STM32.c @@ -76,7 +76,7 @@ void TFT_eSPI::end_SDA_Read(void) //////////////////////////////////////////////////////////////////////////////////////// -#if defined (TFT_PARALLEL_8_BIT) // Code for STM32 8 bit parallel +#if defined (TFT_PARALLEL_8_BIT) // Code for STM32 8-bit parallel //////////////////////////////////////////////////////////////////////////////////////// /*************************************************************************************** @@ -286,7 +286,7 @@ void TFT_eSPI::pushPixels(const void* data_in, uint32_t len) } //////////////////////////////////////////////////////////////////////////////////////// -#elif defined (SPI_18BIT_DRIVER) // SPI 18 bit colour +#elif defined (SPI_18BIT_DRIVER) // SPI 18-bit colour //////////////////////////////////////////////////////////////////////////////////////// /*************************************************************************************** @@ -356,7 +356,7 @@ void TFT_eSPI::pushPixels(const void* data_in, uint32_t len) } //////////////////////////////////////////////////////////////////////////////////////// -#else // Standard SPI 16 bit colour TFT All Tested +#else // Standard SPI 16-bit colour TFT All Tested //////////////////////////////////////////////////////////////////////////////////////// /*************************************************************************************** @@ -405,7 +405,7 @@ void TFT_eSPI::pushPixels(const void* data_in, uint32_t len) else { // HAL byte count for transmit is only 16 bits maximum so to avoid this constraint // transfers of small blocks are performed until HAL capacity is reached. - while(len>0x7FFF) { // Transfer 16 bit pixels in blocks if len*2 over 65534 bytes + while(len>0x7FFF) { // Transfer 16-bit pixels in blocks if len*2 over 65534 bytes HAL_SPI_Transmit(&spiHal, (uint8_t*)data, 0x800<<1, HAL_MAX_DELAY); len -= 0x800; data+= 0x800; // Arbitrarily use 2KByte blocks } @@ -527,7 +527,7 @@ void TFT_eSPI::pushImageDMA(int32_t x, int32_t y, int32_t w, int32_t h, uint16_t // small transfers are performed using a blocking call until DMA capacity is reached. // User sketch can prevent blocking by managing pixel count and splitting into blocks // of 32767 pixels maximum. (equivalent to an area of ~320 x 100 pixels) - while(len>0x7FFF) { // Transfer 16 bit pixels in blocks if len*2 over 65534 bytes + while(len>0x7FFF) { // Transfer 16-bit pixels in blocks if len*2 over 65534 bytes HAL_SPI_Transmit(&spiHal, (uint8_t*)buffer, 0x800<<1, HAL_MAX_DELAY); len -= 0x800; buffer+= 0x800; // Arbitrarily send 1K pixel blocks (2Kbytes) } diff --git a/Processors/TFT_eSPI_STM32.h b/Processors/TFT_eSPI_STM32.h index 1091582..65e710d 100644 --- a/Processors/TFT_eSPI_STM32.h +++ b/Processors/TFT_eSPI_STM32.h @@ -401,7 +401,7 @@ #define D5_BSR_MASK(B) ((D5_PIN_MASK<<16)>>(((B)>> 1)&0x10)) #define D6_BSR_MASK(B) ((D6_PIN_MASK<<16)>>(((B)>> 2)&0x10)) #define D7_BSR_MASK(B) ((D7_PIN_MASK<<16)>>(((B)>> 3)&0x10)) - // Create bit set/reset mask for top byte of 16 bit value B + // Create bit set/reset mask for top byte of 16-bit value B #define D8_BSR_MASK(B) ((D0_PIN_MASK<<16)>>(((B)>> 4)&0x10)) #define D9_BSR_MASK(B) ((D1_PIN_MASK<<16)>>(((B)>> 5)&0x10)) #define D10_BSR_MASK(B) ((D2_PIN_MASK<<16)>>(((B)>> 6)&0x10)) @@ -420,7 +420,7 @@ #if defined (SSD1963_DRIVER) - // Write 18 bit color to TFT (untested) + // Write 18-bit color to TFT (untested) #define tft_Write_16(C) r6 = (((C) & 0xF800)>> 8); g6 = (((C) & 0x07E0)>> 3); b6 = (((C) & 0x001F)<< 3); \ GPIOA->BSRR = D0_BSR_MASK(r6) | D2_BSR_MASK(r6) | D7_BSR_MASK(r6); \ WR_L; \ @@ -438,7 +438,7 @@ GPIOB->BSRR = D3_BSR_MASK(b6) | D4_BSR_MASK(b6) | D5_BSR_MASK(b6) | D6_BSR_MASK(b6); \ WR_STB // Need to slow down strobe - // 18 bit color write with swapped bytes + // 18-bit color write with swapped bytes #define tft_Write_16S(C) Cswap = ((C) >>8 | (C) << 8); tft_Write_16(Cswap) #else @@ -454,7 +454,7 @@ GPIOB->BSRR = D3_BSR_MASK(C) | D4_BSR_MASK(C) | D5_BSR_MASK(C) | D6_BSR_MASK(C); \ WR_STB // Need to slow down strobe - // 16 bit write with swapped bytes + // 16-bit write with swapped bytes #define tft_Write_16S(C) GPIOA->BSRR = D0_BSR_MASK(C) | D2_BSR_MASK(C) | D7_BSR_MASK(C); \ WR_L; \ GPIOC->BSRR = D1_BSR_MASK(C); \ @@ -541,7 +541,7 @@ #define D5_BSR_MASK(B) ((D5_PIN_MASK<<16)>>(((B)>> 1)&0x10)) #define D6_BSR_MASK(B) ((D6_PIN_MASK<<16)>>(((B)>> 2)&0x10)) #define D7_BSR_MASK(B) ((D7_PIN_MASK<<16)>>(((B)>> 3)&0x10)) - // Create bit set/reset mask for top byte of 16 bit value B + // Create bit set/reset mask for top byte of 16-bit value B #define D8_BSR_MASK(B) ((D0_PIN_MASK<<16)>>(((B)>> 4)&0x10)) #define D9_BSR_MASK(B) ((D1_PIN_MASK<<16)>>(((B)>> 5)&0x10)) #define D10_BSR_MASK(B) ((D2_PIN_MASK<<16)>>(((B)>> 6)&0x10)) @@ -561,7 +561,7 @@ #if defined (SSD1963_DRIVER) - // Write 18 bit color to TFT (untested) + // Write 18-bit color to TFT (untested) #define tft_Write_16(C) r6 = (((C) & 0xF800)>> 8); g6 = (((C) & 0x07E0)>> 3); b6 = (((C) & 0x001F)<< 3); \ GPIOF->BSRR = D0_BSR_MASK(r6) | D2_BSR_MASK(r6) | D4_BSR_MASK(r6) | D7_BSR_MASK(r6); \ WR_L; \ @@ -579,7 +579,7 @@ GPIOE->BSRR = D3_BSR_MASK(b6) | D5_BSR_MASK(b6) | D6_BSR_MASK(b6); \ WR_STB // Need to slow down strobe - // 18 bit color write with swapped bytes + // 18-bit color write with swapped bytes #define tft_Write_16S(C) Cswap = ((C) >>8 | (C) << 8); tft_Write_16(Cswap) #else @@ -596,7 +596,7 @@ GPIOE->BSRR = D3_BSR_MASK(C) | D5_BSR_MASK(C) | D6_BSR_MASK(C); \ WR_STB - // 16 bit write with swapped bytes + // 16-bit write with swapped bytes #define tft_Write_16S(C) GPIOF->BSRR = D0_BSR_MASK(C) | D2_BSR_MASK(C) | D4_BSR_MASK(C) | D7_BSR_MASK(C); \ WR_L; \ GPIOD->BSRR = D1_BSR_MASK(C); \ @@ -659,7 +659,7 @@ #define D5_BSR_MASK(B) ((D5_PIN_MASK<<16)>>(((B)>> 1)&0x10)) #define D6_BSR_MASK(B) ((D6_PIN_MASK<<16)>>(((B)>> 2)&0x10)) #define D7_BSR_MASK(B) ((D7_PIN_MASK<<16)>>(((B)>> 3)&0x10)) - // Create bit set/reset mask for top byte of 16 bit value B + // Create bit set/reset mask for top byte of 16-bit value B #define D8_BSR_MASK(B) ((D0_PIN_MASK<<16)>>(((B)>> 4)&0x10)) #define D9_BSR_MASK(B) ((D1_PIN_MASK<<16)>>(((B)>> 5)&0x10)) #define D10_BSR_MASK(B) ((D2_PIN_MASK<<16)>>(((B)>> 6)&0x10)) @@ -692,7 +692,7 @@ GPIOE->BSRR = D3_BSR_MASK(C) | D4_BSR_MASK(C) | D5_BSR_MASK(C) | D6_BSR_MASK(C); \ WR_STB - // 16 bit write with swapped bytes + // 16-bit write with swapped bytes #define tft_Write_16S(C) GPIOF->BSRR = D0_BSR_MASK(C); \ GPIOG->BSRR = D2_BSR_MASK(C) | D7_BSR_MASK(C); \ WR_L; \ @@ -743,14 +743,14 @@ #if defined (SSD1963_DRIVER) - // Write 18 bit color to TFT (untested) + // Write 18-bit color to TFT (untested) #define tft_Write_16(C) r6 = (((C) & 0xF800)>> 8); g6 = (((C) & 0x07E0)>> 3); b6 = (((C) & 0x001F)<< 3); \ GPIOX->BSRR = (0x00FF0000 | (uint8_t)(r6)); WR_L; WR_STB; \ GPIOX->BSRR = (0x00FF0000 | (uint8_t)(g6)); WR_L; WR_STB; \ GPIOX->BSRR = (0x00FF0000 | (uint8_t)(b6)); WR_L; WR_STB - // 18 bit color write with swapped bytes + // 18-bit color write with swapped bytes #define tft_Write_16S(C) Cswap = ((C) >>8 | (C) << 8); tft_Write_16(Cswap) #else @@ -759,7 +759,7 @@ #define tft_Write_16(C) GPIOX->BSRR = (0x00FF0000 | (uint8_t)(C>>8)); WR_L; WR_STB; \ GPIOX->BSRR = (0x00FF0000 | (uint8_t)(C>>0)); WR_L; WR_STB - // 16 bit write with swapped bytes + // 16-bit write with swapped bytes #define tft_Write_16S(C) GPIOX->BSRR = (0x00FF0000 | (uint8_t)(C>>0)); WR_L; WR_STB; \ GPIOX->BSRR = (0x00FF0000 | (uint8_t)(C>>8)); WR_L; WR_STB #endif @@ -832,7 +832,7 @@ #define D5_BSR_MASK(B) ((D5_PIN_MASK<<16)>>(((B)>> 1)&0x10)) #define D6_BSR_MASK(B) ((D6_PIN_MASK<<16)>>(((B)>> 2)&0x10)) #define D7_BSR_MASK(B) ((D7_PIN_MASK<<16)>>(((B)>> 3)&0x10)) - // Create bit set/reset mask for top byte of 16 bit value B + // Create bit set/reset mask for top byte of 16-bit value B #define D8_BSR_MASK(B) ((D0_PIN_MASK<<16)>>(((B)>> 4)&0x10)) #define D9_BSR_MASK(B) ((D1_PIN_MASK<<16)>>(((B)>> 5)&0x10)) #define D10_BSR_MASK(B) ((D2_PIN_MASK<<16)>>(((B)>> 6)&0x10)) @@ -857,7 +857,7 @@ #if defined (SSD1963_DRIVER) - // Write 18 bit color to TFT (untested) + // Write 18-bit color to TFT (untested) #define tft_Write_16(C) r6 = (((C) & 0xF800)>> 8); g6 = (((C) & 0x07E0)>> 3); b6 = (((C) & 0x001F)<< 3); \ D0_PIN_PORT->BSRR = D8_BSR_MASK(r6); \ D1_PIN_PORT->BSRR = D9_BSR_MASK(r6); \ @@ -890,7 +890,7 @@ D7_PIN_PORT->BSRR = D7_BSR_MASK(b6); \ WR_STB - // 18 bit color write with swapped bytes + // 18-bit color write with swapped bytes #define tft_Write_16S(C) Cswap = ((C) >>8 | (C) << 8); tft_Write_16(Cswap) #else @@ -917,7 +917,7 @@ D7_PIN_PORT->BSRR = D7_BSR_MASK(C); \ WR_STB - // 16 bit write with swapped bytes + // 16-bit write with swapped bytes #define tft_Write_16S(C) D0_PIN_PORT->BSRR = D0_BSR_MASK(C); \ D1_PIN_PORT->BSRR = D1_BSR_MASK(C); \ D2_PIN_PORT->BSRR = D2_BSR_MASK(C); \ @@ -960,19 +960,19 @@ //////////////////////////////////////////////////////////////////////////////////////// // Macros to write commands/pixel colour data to a SPI ILI948x TFT //////////////////////////////////////////////////////////////////////////////////////// -#elif defined (SPI_18BIT_DRIVER) // SPI 18 bit colour +#elif defined (SPI_18BIT_DRIVER) // SPI 18-bit colour // Write 8 bits to TFT #define tft_Write_8(C) \ { spiBuffer[0] = C; \ HAL_SPI_Transmit(&spiHal, spiBuffer, 1, 10); } - // Convert 16 bit colour to 18 bit and write in 3 bytes + // Convert 16-bit colour to 18-bit and write in 3 bytes #define tft_Write_16(C) \ { spiBuffer[0] = ((C) & 0xF800)>>8; spiBuffer[1] = ((C) & 0x07E0)>>3; spiBuffer[2] = ((C) & 0x001F)<<3; \ HAL_SPI_Transmit(&spiHal, spiBuffer, 3, 10); } - // Convert swapped byte 16 bit colour to 18 bit and write in 3 bytes + // Convert swapped byte 16-bit colour to 18-bit and write in 3 bytes #define tft_Write_16S(C) \ { spiBuffer[0] = (C) & 0xF8; spiBuffer[1] = ((C) & 0xE000)>>11 | ((C) & 0x07)<<5; spiBuffer[2] = ((C) & 0x1F00)>>5; \ HAL_SPI_Transmit(&spiHal, spiBuffer, 3, 10); } diff --git a/Processors/pio_16bit_parallel.pio.h b/Processors/pio_16bit_parallel.pio.h index c972add..655c1b1 100644 --- a/Processors/pio_16bit_parallel.pio.h +++ b/Processors/pio_16bit_parallel.pio.h @@ -1,6 +1,6 @@ // -------------------------------------------------- // // This file is autogenerated by pioasm; do not edit! // -// 16 bit parallel // +// 16-bit parallel // // -------------------------------------------------- // #pragma once diff --git a/Processors/pio_8bit_parallel.pio.h b/Processors/pio_8bit_parallel.pio.h index aab04e8..b5d6a8c 100644 --- a/Processors/pio_8bit_parallel.pio.h +++ b/Processors/pio_8bit_parallel.pio.h @@ -1,6 +1,6 @@ // -------------------------------------------------- // // This file is autogenerated by pioasm; do not edit! // -// 8 bit parallel // +// 8-bit parallel // // -------------------------------------------------- // #pragma once diff --git a/Processors/pio_SPI.pio.h b/Processors/pio_SPI.pio.h index 277eeef..0848529 100644 --- a/Processors/pio_SPI.pio.h +++ b/Processors/pio_SPI.pio.h @@ -1,6 +1,6 @@ // -------------------------------------------------- // // This file is autogenerated by pioasm; do not edit! // -// 8 + 16 bit SPI - no auto colour conversion // +// 8 + 16-bit SPI - no auto colour conversion // // -------------------------------------------------- // #pragma once diff --git a/Processors/pio_SPI_18bit.pio.h b/Processors/pio_SPI_18bit.pio.h index e769073..09bbfeb 100644 --- a/Processors/pio_SPI_18bit.pio.h +++ b/Processors/pio_SPI_18bit.pio.h @@ -1,6 +1,6 @@ // -------------------------------------------------- // // This file is autogenerated by pioasm; do not edit! // -// 8 + 18 bit SPI - no auto colour conversion // +// 8 + 18-bit SPI - no auto colour conversion // // -------------------------------------------------- // #pragma once diff --git a/README.md b/README.md index 02e9ea2..0c0c15b 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ A ["Discussions"](https://github.com/Bodmer/TFT_eSPI/discussions) facility has b [TFT_eWidget](https://github.com/Bodmer/TFT_eWidget) -6. Support has been added in v2.4.70 for the RP2040 with 16 bit parallel displays. This has been tested and the screen update performance is very good (4ms to clear 320 x 480 screen with HC8357C). The use of the RP2040 PIO makes it easy to change the write cycle timing for different displays. DMA with 16 bit transfers is also supported. +6. Support has been added in v2.4.70 for the RP2040 with 16-bit parallel displays. This has been tested and the screen update performance is very good (4ms to clear 320 x 480 screen with HC8357C). The use of the RP2040 PIO makes it easy to change the write cycle timing for different displays. DMA with 16-bit transfers is also supported. 7. Support for the ESP32-S2, ESP32-S3 and ESP32-C3 has been added (DMA only on ESP32 S3 at the moment). Tested with v2.0.3 RC1 of the ESP32 board package. Example setups: @@ -51,14 +51,14 @@ Note: background rendering for Smooth fonts is also now available when using the ![Gradient](https://i.imgur.com/atR0DmP.png) -12. The RP2040 8 bit parallel interface uses the PIO. The PIO now manages the "setWindow" and "block fill" actions, releasing the processor for other tasks when areas of the screen are being filled with a colour. The PIO can optionally be used for SPI interface displays if #define RP2040_PIO_SPI is put in the setup file. Touch screens and pixel read operations are not supported when the PIO interface is used. +12. The RP2040 8-bit parallel interface uses the PIO. The PIO now manages the "setWindow" and "block fill" actions, releasing the processor for other tasks when areas of the screen are being filled with a colour. The PIO can optionally be used for SPI interface displays if #define RP2040_PIO_SPI is put in the setup file. Touch screens and pixel read operations are not supported when the PIO interface is used. The RP2040 PIO features only work with [Earle Philhower's board package](https://github.com/earlephilhower/arduino-pico), NOT the Arduino Mbed version. The use of PIO for SPI allows the RP2040 to be over-clocked (up to 250MHz works on my boards) in Earle's board package whilst still maintaining high SPI clock rates. # TFT_eSPI -A feature rich Arduino IDE compatible graphics and fonts library for 32 bit processors. The library is targeted at 32 bit processors, it has been performance optimised for RP2040, STM32, ESP8266 and ESP32 types, other 32 bit processors may be used but will use the slower generic Arduino interface calls. The library can be loaded using the Arduino IDE's Library Manager. Direct Memory Access (DMA) can be used with the ESP32, RP2040 and STM32 processors with SPI interface displays to improve rendering performance. DMA with a parallel interface (8 and 16 bit) is only supported with the RP2040. +A feature rich Arduino IDE compatible graphics and fonts library for 32-bit processors. The library is targeted at 32-bit processors, it has been performance optimised for RP2040, STM32, ESP8266 and ESP32 types, other 32-bit processors may be used but will use the slower generic Arduino interface calls. The library can be loaded using the Arduino IDE's Library Manager. Direct Memory Access (DMA) can be used with the ESP32, RP2040 and STM32 processors with SPI interface displays to improve rendering performance. DMA with a parallel interface (8 and 16-bit) is only supported with the RP2040. The updates for the ESP32 S2/C3/S3 means that the library requires the ESP32 Arduino board package 2.x.x or later. @@ -75,7 +75,7 @@ Optimised drivers have been tested with the following processors: The library supports the following interface types for these processors: -| Processor | 4 wire SPI | 8 bit parallel | 16 bit parallel | DMA support | +| Processor | 4 wire SPI | 8-bit parallel | 16-bit parallel | DMA support | |-----------| :---: | :---: | :---: | :---: | | RP2040 | Yes | Yes | Yes | Yes (all) | | ESP32 | Yes | Yes | No | Yes (SPI only) | @@ -90,7 +90,7 @@ For other (generic) processors only SPI interface displays are supported and the 4 wire SPI means the display must have SPI interface comaptible signals and a "Data/Command" control signal, this signal line is sometimes labelled DC, RS or A0. -Due to lack of GPIO pins the 8 bit parallel interface is NOT supported on the ESP8266. 8 bit parallel interface TFTs (e.g. UNO format mcufriend shields) can used with the STM32Fxxx Nucleo 64/144 range or the UNO format ESP32 (see below for ESP32). +Due to lack of GPIO pins the 8-bit parallel interface is NOT supported on the ESP8266. 8-bit parallel interface TFTs (e.g. UNO format mcufriend shields) can used with the STM32Fxxx Nucleo 64/144 range or the UNO format ESP32 (see below for ESP32). Support for the XPT2046 touch screen controller is built into the library and can be used with SPI interface displays. Third party touch support libraries are also available when using a display parallel interface. @@ -104,8 +104,8 @@ Displays using the following controllers are supported: * ILI9481 (DMA not supported with SPI) * ILI9486 (DMA not supported with SPI) * ILI9488 (DMA not supported with SPI) -* HX8357B (16 bit parallel tested with RP2040) -* HX8357C (16 bit parallel tested with RP2040) +* HX8357B (16-bit parallel tested with RP2040) +* HX8357C (16-bit parallel tested with RP2040) * HX8357D * R61581 * RM68120 (support files added but untested) @@ -119,7 +119,7 @@ Displays using the following controllers are supported: ILI9341 and ST7796 SPI based displays are recommended as starting point for experimenting with this library. -The library supports some TFT displays designed for the Raspberry Pi (RPi) that are based on a ILI9486 or ST7796 driver chip with a 480 x 320 pixel screen. The ILI9486 RPi display must be of the Waveshare design and use a 16 bit serial interface based on the 74HC04, 74HC4040 and 2 x 74HC4094 logic chips. Note that due to design variations between these displays not all RPi displays will work with this library, so purchasing a RPi display of these types solely for use with this library is NOT recommended. +The library supports some TFT displays designed for the Raspberry Pi (RPi) that are based on a ILI9486 or ST7796 driver chip with a 480 x 320 pixel screen. The ILI9486 RPi display must be of the Waveshare design and use a 16-bit serial interface based on the 74HC04, 74HC4040 and 2 x 74HC4094 logic chips. Note that due to design variations between these displays not all RPi displays will work with this library, so purchasing a RPi display of these types solely for use with this library is NOT recommended. A "good" RPi display is the [MHS-4.0 inch Display-B type ST7796](http://www.lcdwiki.com/MHS-4.0inch_Display-B) which provides good performance. This has a dedicated controller and can be clocked at up to 80MHz with the ESP32 (125MHz with overclocked RP2040, 55MHz with STM32 and 40MHz with ESP8266). The [MHS-3.5 inch RPi ILI9486](http://www.lcdwiki.com/MHS-3.5inch_RPi_Display) based display is also supported, however the MHS ILI9341 based display of the same type does NOT work with this library. @@ -129,15 +129,15 @@ The library includes a "Sprite" class, this enables flicker free updates of comp # Sprites -A Sprite is notionally an invisible graphics screen that is kept in the processors RAM. Graphics can be drawn into the Sprite just as they can be drawn directly to the screen. Once the Sprite is completed it can be plotted onto the screen in any position. If there is sufficient RAM then the Sprite can be the same size as the screen and used as a frame buffer. Sprites by default use 16 bit colours, the bit depth can be set to 8 bits (256 colours) , or 1 bit (any 2 colours) to reduce the RAM needed. On an ESP8266 the largest 16 bit colour Sprite that can be created is about 160x128 pixels, this consumes 40Kbytes of RAM. On an ESP32 the workspace RAM is more limited than the datasheet implies so a 16 bit colour Sprite is limited to about 200x200 pixels (~80Kbytes), an 8 bit sprite to 320x240 pixels (~76kbytes). A 1 bit per pixel Sprite requires only 9600 bytes for a full 320 x 240 screen buffer, this is ideal for supporting use with 2 colour bitmap fonts. +A Sprite is notionally an invisible graphics screen that is kept in the processors RAM. Graphics can be drawn into the Sprite just as they can be drawn directly to the screen. Once the Sprite is completed it can be plotted onto the screen in any position. If there is sufficient RAM then the Sprite can be the same size as the screen and used as a frame buffer. Sprites by default use 16-bit colours, the bit depth can be set to 8 bits (256 colours) , or 1 bit (any 2 colours) to reduce the RAM needed. On an ESP8266 the largest 16-bit colour Sprite that can be created is about 160x128 pixels, this consumes 40Kbytes of RAM. On an ESP32 the workspace RAM is more limited than the datasheet implies so a 16-bit colour Sprite is limited to about 200x200 pixels (~80Kbytes), an 8-bit sprite to 320x240 pixels (~76kbytes). A 1 bit per pixel Sprite requires only 9600 bytes for a full 320 x 240 screen buffer, this is ideal for supporting use with 2 colour bitmap fonts. -One or more sprites can be created, a sprite can be any pixel width and height, limited only by available RAM. The RAM needed for a 16 bit colour depth Sprite is (2 x width x height) bytes, for a Sprite with 8 bit colour depth the RAM needed is (width x height) bytes. Sprites can be created and deleted dynamically as needed in the sketch, this means RAM can be freed up after the Sprite has been plotted on the screen, more RAM intensive WiFi based code can then be run and normal graphics operations still work. +One or more sprites can be created, a sprite can be any pixel width and height, limited only by available RAM. The RAM needed for a 16-bit colour depth Sprite is (2 x width x height) bytes, for a Sprite with 8-bit colour depth the RAM needed is (width x height) bytes. Sprites can be created and deleted dynamically as needed in the sketch, this means RAM can be freed up after the Sprite has been plotted on the screen, more RAM intensive WiFi based code can then be run and normal graphics operations still work. Drawing graphics into a sprite is very fast, for those familiar with the Adafruit "graphicstest" example, this whole test completes in 18ms in a 160x128 sprite. Examples of sprite use can be found in the "examples/Sprite" folder. Sprites can be plotted to the TFT with one colour being specified as "transparent", see Transparent_Sprite_Demo example. -If an ESP32 board has SPIRAM (i.e. PSRAM) fitted then Sprites will use the PSRAM memory and large full screen buffer Sprites can be created. Full screen Sprites take longer to render (~45ms for a 320 x 240 16 bit Sprite), so bear that in mind. +If an ESP32 board has SPIRAM (i.e. PSRAM) fitted then Sprites will use the PSRAM memory and large full screen buffer Sprites can be created. Full screen Sprites take longer to render (~45ms for a 320 x 240 16-bit Sprite), so bear that in mind. The "Animated_dial" example shows how dials can be created using a rotated Sprite for the needle. To run this example the TFT interface must support reading from the screen RAM (not all do). The dial rim and scale is a jpeg image, created using a paint program. @@ -157,7 +157,7 @@ The library supports SPI overlap on the ESP8266 so the TFT screen can share MOSI # Fonts -The library contains proportional fonts, different sizes can be enabled/disabled at compile time to optimise the use of FLASH memory. Anti-aliased (smooth) font files in vlw format stored in SPIFFS are supported. Any 16 bit Unicode character can be included and rendered, this means many language specific characters can be rendered to the screen. +The library contains proportional fonts, different sizes can be enabled/disabled at compile time to optimise the use of FLASH memory. Anti-aliased (smooth) font files in vlw format stored in SPIFFS are supported. Any 16-bit Unicode character can be included and rendered, this means many language specific characters can be rendered to the screen. The library is based on the Adafruit GFX and Adafruit driver libraries and the aim is to retain compatibility. Significant additions have been made to the library to boost the speed for the different processors (it is typically 3 to 10 times faster) and to add new features. The new graphics functions include different size proportional fonts and formatting features. There are lots of example sketches to demonstrate the different features and included functions. @@ -166,7 +166,7 @@ Configuration of the library font selections, pins used to interface with the TF # Anti-aliased Fonts -Anti-aliased (smooth) font files in "vlw" format are generated by the free [Processing IDE](https://processing.org/) using a sketch included in the library Tools folder. This sketch with the Processing IDE can be used to generate font files from your computer's font set or any TrueType (.ttf) font, the font file can include **any** combination of 16 bit Unicode characters. This means Greek, Japanese and any other UCS-2 glyphs can be used. Character arrays and Strings in UTF-8 format are supported. +Anti-aliased (smooth) font files in "vlw" format are generated by the free [Processing IDE](https://processing.org/) using a sketch included in the library Tools folder. This sketch with the Processing IDE can be used to generate font files from your computer's font set or any TrueType (.ttf) font, the font file can include **any** combination of 16-bit Unicode characters. This means Greek, Japanese and any other UCS-2 glyphs can be used. Character arrays and Strings in UTF-8 format are supported. The .vlw files must be uploaded to the processors FLASH filing system (SPIFFS, LittleFS or SD card) for use. Alternatively the .vlw files can be converted to C arrays (see "Smooth Font -> FLASH_Array" examples) and stored directly in FLASH as part of the compile process. The array based approach is convenient, provides performance improvements and is suitable where: either use of a filing system is undesirable, or the processor type (e.g. STM32) does not support a FLASH based filing system. @@ -188,9 +188,9 @@ Anti-aliased fonts can also be drawn over a gradient background with a callback Anti-aliased fonts cannot be scaled with setTextSize so you need to create a font for each size you need. See examples. -# 8 bit parallel support +# 8-bit parallel support -The common 8 bit "Mcufriend" shields are supported for the STM Nucleo 64/144 boards and ESP32 UNO style board. The STM32 "Blue/Black Pill" boards can also be used with 8 bit parallel displays. +The common 8-bit "Mcufriend" shields are supported for the STM Nucleo 64/144 boards and ESP32 UNO style board. The STM32 "Blue/Black Pill" boards can also be used with 8-bit parallel displays. The ESP32 board I have been using for testing has the following pinout: diff --git a/README.txt b/README.txt index 0b738e6..45eb4fb 100644 --- a/README.txt +++ b/README.txt @@ -3,5 +3,5 @@ and the TFT chip driver library. It supports the ESP8266, ESP32, STM32 and RP2040 processors with performance optimised code. Other Arduino IDE compatible boards are also supported but the library then uses generic functions which will be slower. The library uses -32 bit variables extensively so this will affect performance on 8 -and 16 bit processors. +32-bit variables extensively so this will affect performance on 8 +and 16-bit processors. diff --git a/TFT_Drivers/HX8357B_Init.h b/TFT_Drivers/HX8357B_Init.h index b5f8c2e..7ca937c 100644 --- a/TFT_Drivers/HX8357B_Init.h +++ b/TFT_Drivers/HX8357B_Init.h @@ -1,7 +1,7 @@ // This is the command sequence that initialises the HX8357B driver // -// This setup information uses simple 8 bit SPI writecommand() and writedata() functions +// This setup information uses simple 8-bit SPI writecommand() and writedata() functions // // See ST7735_Setup.h file for an alternative format diff --git a/TFT_Drivers/HX8357C_Init.h b/TFT_Drivers/HX8357C_Init.h index 35cde5c..807cadb 100644 --- a/TFT_Drivers/HX8357C_Init.h +++ b/TFT_Drivers/HX8357C_Init.h @@ -1,7 +1,7 @@ // This is the command sequence that initialises the HX8357C driver // -// This setup information uses simple 8 bit SPI writecommand() and writedata() functions +// This setup information uses simple 8-bit SPI writecommand() and writedata() functions // // See ST7735_Setup.h file for an alternative format diff --git a/TFT_Drivers/HX8357D_Init.h b/TFT_Drivers/HX8357D_Init.h index 9b5f05a..0e49d3f 100644 --- a/TFT_Drivers/HX8357D_Init.h +++ b/TFT_Drivers/HX8357D_Init.h @@ -1,7 +1,7 @@ // This is the command sequence that initialises the HX8357D driver // -// This setup information uses simple 8 bit SPI writecommand() and writedata() functions +// This setup information uses simple 8-bit SPI writecommand() and writedata() functions // // See ST7735_Setup.h file for an alternative format @@ -94,7 +94,7 @@ writedata(0x01); writecommand(HX8357_COLMOD); - writedata(0x55); // 16 bit + writedata(0x55); // 16-bit writecommand(HX8357_MADCTL); writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_COLOR_ORDER); diff --git a/TFT_Drivers/ILI9341_Init.h b/TFT_Drivers/ILI9341_Init.h index 05a703e..05a5dda 100644 --- a/TFT_Drivers/ILI9341_Init.h +++ b/TFT_Drivers/ILI9341_Init.h @@ -1,7 +1,7 @@ // This is the command sequence that initialises the ILI9341 driver // -// This setup information uses simple 8 bit SPI writecommand() and writedata() functions +// This setup information uses simple 8-bit SPI writecommand() and writedata() functions // // See ST7735_Setup.h file for an alternative format diff --git a/TFT_Drivers/ILI9481_Init.h b/TFT_Drivers/ILI9481_Init.h index 3ac9965..a5f19b8 100644 --- a/TFT_Drivers/ILI9481_Init.h +++ b/TFT_Drivers/ILI9481_Init.h @@ -1,7 +1,7 @@ // This is the command sequence that initialises the ILI9481 driver // -// This setup information uses simple 8 bit SPI writecommand() and writedata() functions +// This setup information uses simple 8-bit SPI writecommand() and writedata() functions // // See ST7735_Setup.h file for an alternative format @@ -64,9 +64,9 @@ writecommand(0x3A); #if defined (TFT_PARALLEL_8_BIT) || defined (TFT_PARALLEL_16_BIT) || defined (RPI_DISPLAY_TYPE) - writedata(0x55); // 16 bit colour interface + writedata(0x55); // 16-bit colour interface #else - writedata(0x66); // 18 bit colour interface + writedata(0x66); // 18-bit colour interface #endif #if !defined (TFT_PARALLEL_8_BIT) && !defined (TFT_PARALLEL_16_BIT) @@ -153,9 +153,9 @@ writecommand(0x3A); #if defined (TFT_PARALLEL_8_BIT) || defined (TFT_PARALLEL_16_BIT) || defined (RPI_DISPLAY_TYPE) - writedata(0x55); // 16 bit colour interface + writedata(0x55); // 16-bit colour interface #else - writedata(0x66); // 18 bit colour interface + writedata(0x66); // 18-bit colour interface #endif #if !defined (TFT_PARALLEL_8_BIT) && !defined (TFT_PARALLEL_16_BIT) @@ -242,9 +242,9 @@ writecommand(0x3A); #if defined (TFT_PARALLEL_8_BIT) || defined (TFT_PARALLEL_16_BIT) || defined (RPI_DISPLAY_TYPE) - writedata(0x55); // 16 bit colour interface + writedata(0x55); // 16-bit colour interface #else - writedata(0x66); // 18 bit colour interface + writedata(0x66); // 18-bit colour interface #endif #if !defined (TFT_PARALLEL_8_BIT) && !defined (TFT_PARALLEL_16_BIT) @@ -327,9 +327,9 @@ writecommand(0x3A); #if defined (TFT_PARALLEL_8_BIT) || defined (TFT_PARALLEL_16_BIT) || defined (RPI_DISPLAY_TYPE) - writedata(0x55); // 16 bit colour interface + writedata(0x55); // 16-bit colour interface #else - writedata(0x66); // 18 bit colour interface + writedata(0x66); // 18-bit colour interface #endif #if !defined (TFT_PARALLEL_8_BIT) && !defined (TFT_PARALLEL_16_BIT) @@ -415,9 +415,9 @@ writecommand(0x3A); #if defined (TFT_PARALLEL_8_BIT) || defined (TFT_PARALLEL_16_BIT) || defined (RPI_DISPLAY_TYPE) - writedata(0x55); // 16 bit colour interface + writedata(0x55); // 16-bit colour interface #else - writedata(0x66); // 18 bit colour interface + writedata(0x66); // 18-bit colour interface #endif #if !defined (TFT_PARALLEL_8_BIT) && !defined (TFT_PARALLEL_16_BIT) @@ -527,9 +527,9 @@ writecommand(0x3A); #if defined (TFT_PARALLEL_8_BIT) || defined (TFT_PARALLEL_16_BIT) || defined (RPI_DISPLAY_TYPE) - writedata(0x55); // 16 bit colour interface + writedata(0x55); // 16-bit colour interface #else - writedata(0x66); // 18 bit colour interface + writedata(0x66); // 18-bit colour interface #endif #if !defined (TFT_PARALLEL_8_BIT) && !defined (TFT_PARALLEL_16_BIT) @@ -605,9 +605,9 @@ writecommand(0x3A); #if defined (TFT_PARALLEL_8_BIT) || defined (TFT_PARALLEL_16_BIT) || defined (RPI_DISPLAY_TYPE) - writedata(0x55); // 16 bit colour interface + writedata(0x55); // 16-bit colour interface #else - writedata(0x66); // 18 bit colour interface + writedata(0x66); // 18-bit colour interface #endif #if !defined (TFT_PARALLEL_8_BIT) && !defined (TFT_PARALLEL_16_BIT) @@ -700,9 +700,9 @@ writecommand(0x3a); #if defined (TFT_PARALLEL_8_BIT) || defined (TFT_PARALLEL_16_BIT) || defined (RPI_DISPLAY_TYPE) - writedata(0x55); // 16 bit colour interface + writedata(0x55); // 16-bit colour interface #else - writedata(0x66); // 18 bit colour interface + writedata(0x66); // 18-bit colour interface #endif #if defined (TFT_PARALLEL_8_BIT) || defined (TFT_PARALLEL_16_BIT) diff --git a/TFT_Drivers/ILI9486_Init.h b/TFT_Drivers/ILI9486_Init.h index e96c4e4..db0f7aa 100644 --- a/TFT_Drivers/ILI9486_Init.h +++ b/TFT_Drivers/ILI9486_Init.h @@ -1,7 +1,7 @@ // This is the command sequence that initialises the ILI9486 driver // -// This setup information uses simple 8 bit SPI writecommand() and writedata() functions +// This setup information uses simple 8-bit SPI writecommand() and writedata() functions // // See ST7735_Setup.h file for an alternative format @@ -16,9 +16,9 @@ writecommand(0x3A); #if defined (TFT_PARALLEL_8_BIT) || defined (TFT_PARALLEL_16_BIT) || defined (RPI_DISPLAY_TYPE) - writedata(0x55); // 16 bit colour interface + writedata(0x55); // 16-bit colour interface #else - writedata(0x66); // 18 bit colour interface + writedata(0x66); // 18-bit colour interface #endif writecommand(0xC0); // 1100.0000 Power Control 1 diff --git a/TFT_Drivers/ILI9488_Init.h b/TFT_Drivers/ILI9488_Init.h index d487187..c1b20b6 100644 --- a/TFT_Drivers/ILI9488_Init.h +++ b/TFT_Drivers/ILI9488_Init.h @@ -1,7 +1,7 @@ // This is the command sequence that initialises the ILI9488 driver // -// This setup information uses simple 8 bit SPI writecommand() and writedata() functions +// This setup information uses simple 8-bit SPI writecommand() and writedata() functions // // See ST7735_Setup.h file for an alternative format @@ -59,9 +59,9 @@ writecommand(0x3A); // Pixel Interface Format #if defined (TFT_PARALLEL_8_BIT) || defined (TFT_PARALLEL_16_BIT) || defined (RPI_DISPLAY_TYPE) - writedata(0x55); // 16 bit colour for parallel + writedata(0x55); // 16-bit colour for parallel #else - writedata(0x66); // 18 bit colour for SPI + writedata(0x66); // 18-bit colour for SPI #endif writecommand(0xB0); // Interface Mode Control diff --git a/TFT_Drivers/R61581_Init.h b/TFT_Drivers/R61581_Init.h index 929d680..1e9adee 100644 --- a/TFT_Drivers/R61581_Init.h +++ b/TFT_Drivers/R61581_Init.h @@ -1,7 +1,7 @@ // This is the command sequence that initialises the R61581 driver // -// This setup information uses simple 8 bit SPI writecommand() and writedata() functions +// This setup information uses simple 8-bit SPI writecommand() and writedata() functions // // See ST7735_Setup.h file for an alternative format diff --git a/TFT_Drivers/RM68140_Init.h b/TFT_Drivers/RM68140_Init.h index e5df339..cc44719 100644 --- a/TFT_Drivers/RM68140_Init.h +++ b/TFT_Drivers/RM68140_Init.h @@ -1,7 +1,7 @@ // This is the command sequence that initialises the RM68140 driver // -// This setup information uses simple 8 bit SPI writecommand() and writedata() functions +// This setup information uses simple 8-bit SPI writecommand() and writedata() functions // // See ST7735_Setup.h file for an alternative format diff --git a/TFT_Drivers/SSD1963_Init.h b/TFT_Drivers/SSD1963_Init.h index f785961..87d4ee6 100644 --- a/TFT_Drivers/SSD1963_Init.h +++ b/TFT_Drivers/SSD1963_Init.h @@ -62,7 +62,7 @@ writedata(0x21 | TFT_MAD_COLOR_ORDER); writecommand(0xF0); //pixel data interface - writedata(0x00); //8 bit bus + writedata(0x00); //8-bit bus delay(1); @@ -166,7 +166,7 @@ writedata(0x21 | TFT_MAD_COLOR_ORDER); writecommand(0xF0); //pixel data interface - writedata(0x00); //8 bit bus + writedata(0x00); //8-bit bus delay(1); @@ -270,7 +270,7 @@ writedata(0x21 | TFT_MAD_COLOR_ORDER); // -- Set rotation writecommand(0xF0); //pixel data interface - writedata(0x00); //8 bit bus + writedata(0x00); //8-bit bus delay(10); @@ -371,7 +371,7 @@ //writedata(0x0050); //16-bit/pixel writecommand(0xF0); //pixel data interface - writedata(0x00); //000 = 8 bit bus, 011 = 16 bit, 110 = 9 bit + writedata(0x00); //000 = 8-bit bus, 011 = 16-bit, 110 = 9-bit writecommand(0xBC); writedata(0x40); //contrast value diff --git a/TFT_Drivers/ST7789_Init.h b/TFT_Drivers/ST7789_Init.h index 9fa2918..b2ed7eb 100644 --- a/TFT_Drivers/ST7789_Init.h +++ b/TFT_Drivers/ST7789_Init.h @@ -1,12 +1,13 @@ // This is the command sequence that initialises the ST7789 driver // -// This setup information uses simple 8 bit SPI writecommand() and writedata() functions +// This setup information uses simple 8-bit SPI writecommand() and writedata() functions // // See ST7735_Setup.h file for an alternative format #ifndef INIT_SEQUENCE_3 { + fillScreen(TFT_RED); writecommand(ST7789_SLPOUT); // Sleep out delay(120); @@ -24,7 +25,7 @@ writecommand(ST7789_RAMCTRL); writedata(0x00); - writedata(0xE0); // 5 to 6 bit conversion: r0 = r5, b0 = b5 + writedata(0xE0); // 5 to 6-bit conversion: r0 = r5, b0 = b5 writecommand(ST7789_COLMOD); writedata(0x55); @@ -143,7 +144,7 @@ // writecommand(ST7789_RAMCTRL); // writedata(0x00); - // writedata(0xE0); // 5 to 6 bit conversion: r0 = r5, b0 = b5 + // writedata(0xE0); // 5 to 6-bit conversion: r0 = r5, b0 = b5 writecommand(ST7789_COLMOD); writedata(0x55); diff --git a/TFT_Drivers/ST7796_Init.h b/TFT_Drivers/ST7796_Init.h index a112815..c1d8421 100644 --- a/TFT_Drivers/ST7796_Init.h +++ b/TFT_Drivers/ST7796_Init.h @@ -1,7 +1,7 @@ // This is the command sequence that initialises the ST7796 driver // -// This setup information uses simple 8 bit SPI writecommand() and writedata() functions +// This setup information uses simple 8-bit SPI writecommand() and writedata() functions // // See ST7735_Setup.h file for an alternative format diff --git a/TFT_eSPI.cpp b/TFT_eSPI.cpp index afd72e4..1798704 100644 --- a/TFT_eSPI.cpp +++ b/TFT_eSPI.cpp @@ -1,5 +1,5 @@ /*************************************************** - Arduino TFT graphics library targeted at 32 bit + Arduino TFT graphics library targeted at 32-bit processors such as ESP32, ESP8266 and STM32. This is a stand-alone library that contains the @@ -17,9 +17,9 @@ #if defined (ESP32) #if defined(CONFIG_IDF_TARGET_ESP32S3) - #include "Processors/TFT_eSPI_ESP32_S3.c" // Tested with SPI and 8 bit parallel + #include "Processors/TFT_eSPI_ESP32_S3.c" // Tested with SPI and 8-bit parallel #elif defined(CONFIG_IDF_TARGET_ESP32C3) - #include "Processors/TFT_eSPI_ESP32_C3.c" // Tested with SPI (8 bit parallel will probably work too!) + #include "Processors/TFT_eSPI_ESP32_C3.c" // Tested with SPI (8-bit parallel will probably work too!) #else #include "Processors/TFT_eSPI_ESP32.c" #endif @@ -942,7 +942,7 @@ void TFT_eSPI::commandList (const uint8_t *addr) { writecommand(pgm_read_byte(addr++)); // Read, issue command numArgs = pgm_read_byte(addr++); // Number of args to follow - ms = numArgs & TFT_INIT_DELAY; // If hibit set, delay follows args + ms = numArgs & TFT_INIT_DELAY; // If high bit set, delay follows args numArgs &= ~TFT_INIT_DELAY; // Mask out delay bit while (numArgs--) // For each argument... @@ -974,7 +974,7 @@ void TFT_eSPI::spiwrite(uint8_t c) /*************************************************************************************** ** Function name: writecommand -** Description: Send an 8 bit command to the TFT +** Description: Send an 8-bit command to the TFT ***************************************************************************************/ #ifndef RM68120_DRIVER void TFT_eSPI::writecommand(uint8_t c) @@ -1038,7 +1038,7 @@ void TFT_eSPI::writeRegister16(uint16_t c, uint16_t d) /*************************************************************************************** ** Function name: writedata -** Description: Send a 8 bit data value to the TFT +** Description: Send a 8-bit data value to the TFT ***************************************************************************************/ void TFT_eSPI::writedata(uint8_t d) { @@ -1056,7 +1056,7 @@ void TFT_eSPI::writedata(uint8_t d) /*************************************************************************************** ** Function name: readcommand8 -** Description: Read a 8 bit data value from an indexed command register +** Description: Read a 8-bit data value from an indexed command register ***************************************************************************************/ uint8_t TFT_eSPI::readcommand8(uint8_t cmd_function, uint8_t index) { @@ -1099,7 +1099,7 @@ uint8_t TFT_eSPI::readcommand8(uint8_t cmd_function, uint8_t index) /*************************************************************************************** ** Function name: readcommand16 -** Description: Read a 16 bit data value from an indexed command register +** Description: Read a 16-bit data value from an indexed command register ***************************************************************************************/ uint16_t TFT_eSPI::readcommand16(uint8_t cmd_function, uint8_t index) { @@ -1114,7 +1114,7 @@ uint16_t TFT_eSPI::readcommand16(uint8_t cmd_function, uint8_t index) /*************************************************************************************** ** Function name: readcommand32 -** Description: Read a 32 bit data value from an indexed command register +** Description: Read a 32-bit data value from an indexed command register ***************************************************************************************/ uint32_t TFT_eSPI::readcommand32(uint8_t cmd_function, uint8_t index) { @@ -1157,12 +1157,12 @@ uint16_t TFT_eSPI::readPixel(int32_t x0, int32_t y0) readByte(); #endif - // Fetch the 16 bit BRG pixel + // Fetch the 16-bit BRG pixel //uint16_t rgb = (readByte() << 8) | readByte(); #if defined (ILI9341_DRIVER) || defined(ILI9341_2_DRIVER) || defined (ILI9488_DRIVER) || defined (SSD1963_DRIVER)// Read 3 bytes - // Read window pixel 24 bit RGB values and fill in LS bits + // Read window pixel 24-bit RGB values and fill in LS bits uint16_t rgb = ((readByte() & 0xF8) << 8) | ((readByte() & 0xFC) << 3) | (readByte() >> 3); if (!inTransaction) { CS_H; } // CS_H can be multi-statement @@ -1172,9 +1172,9 @@ uint16_t TFT_eSPI::readPixel(int32_t x0, int32_t y0) return rgb; - #else // ILI9481 or ILI9486 16 bit read + #else // ILI9481 or ILI9486 16-bit read - // Fetch the 16 bit BRG pixel + // Fetch the 16-bit BRG pixel uint16_t bgr = (readByte() << 8) | readByte(); if (!inTransaction) { CS_H; } // CS_H can be multi-statement @@ -1289,12 +1289,12 @@ void TFT_eSPI::readRect(int32_t x, int32_t y, int32_t w, int32_t h, uint16_t *da // Dummy read to throw away don't care value readByte(); - // Fetch the 24 bit RGB value + // Fetch the 24-bit RGB value while (dh--) { int32_t lw = dw; uint16_t* line = data; while (lw--) { - // Assemble the RGB 16 bit colour + // Assemble the RGB 16-bit colour uint16_t rgb = ((readByte() & 0xF8) << 8) | ((readByte() & 0xFC) << 3) | (readByte() >> 3); // Swapped byte order for compatibility with pushRect() @@ -1304,7 +1304,7 @@ void TFT_eSPI::readRect(int32_t x, int32_t y, int32_t w, int32_t h, uint16_t *da } #elif defined (SSD1963_DRIVER) - // Fetch the 18 bit BRG pixels + // Fetch the 18-bit BRG pixels while (dh--) { int32_t lw = dw; uint16_t* line = data; @@ -1324,16 +1324,16 @@ void TFT_eSPI::readRect(int32_t x, int32_t y, int32_t w, int32_t h, uint16_t *da // Dummy read to throw away don't care value readByte(); - // Fetch the 16 bit BRG pixels + // Fetch the 16-bit BRG pixels while (dh--) { int32_t lw = dw; uint16_t* line = data; while (lw--) { #if defined (ILI9486_DRIVER) || defined (ST7796_DRIVER) - // Read the RGB 16 bit colour + // Read the RGB 16-bit colour *line++ = readByte() | (readByte() << 8); #else - // Read the BRG 16 bit colour + // Read the BRG 16-bit colour uint16_t bgr = (readByte() << 8) | readByte(); // Swap Red and Blue (could check MADCTL setting to see if this is needed) uint16_t rgb = (bgr>>11) | (bgr<<11) | (bgr & 0x7E0); @@ -1372,7 +1372,7 @@ void TFT_eSPI::readRect(int32_t x, int32_t y, int32_t w, int32_t h, uint16_t *da // Dummy read to throw away don't care value tft_Read_8(); - // Read window pixel 24 bit RGB values + // Read window pixel 24-bit RGB values while (dh--) { int32_t lw = dw; uint16_t* line = data; @@ -1443,7 +1443,7 @@ void TFT_eSPI::pushRect(int32_t x, int32_t y, int32_t w, int32_t h, uint16_t *da /*************************************************************************************** ** Function name: pushImage -** Description: plot 16 bit colour sprite or image onto TFT +** Description: plot 16-bit colour sprite or image onto TFT ***************************************************************************************/ void TFT_eSPI::pushImage(int32_t x, int32_t y, int32_t w, int32_t h, uint16_t *data) { @@ -1473,7 +1473,7 @@ void TFT_eSPI::pushImage(int32_t x, int32_t y, int32_t w, int32_t h, uint16_t *d /*************************************************************************************** ** Function name: pushImage -** Description: plot 16 bit sprite or image with 1 colour being transparent +** Description: plot 16-bit sprite or image with 1 colour being transparent ***************************************************************************************/ void TFT_eSPI::pushImage(int32_t x, int32_t y, int32_t w, int32_t h, uint16_t *data, uint16_t transp) { @@ -1532,11 +1532,11 @@ void TFT_eSPI::pushImage(int32_t x, int32_t y, int32_t w, int32_t h, uint16_t *d /*************************************************************************************** ** Function name: pushImage - for FLASH (PROGMEM) stored images -** Description: plot 16 bit image +** Description: plot 16-bit image ***************************************************************************************/ void TFT_eSPI::pushImage(int32_t x, int32_t y, int32_t w, int32_t h, const uint16_t *data) { - // Requires 32 bit aligned access, so use PROGMEM 16 bit word functions + // Requires 32-bit aligned access, so use PROGMEM 16-bit word functions PI_CLIP; begin_tft_write(); @@ -1562,11 +1562,11 @@ void TFT_eSPI::pushImage(int32_t x, int32_t y, int32_t w, int32_t h, const uint1 /*************************************************************************************** ** Function name: pushImage - for FLASH (PROGMEM) stored images -** Description: plot 16 bit image with 1 colour being transparent +** Description: plot 16-bit image with 1 colour being transparent ***************************************************************************************/ void TFT_eSPI::pushImage(int32_t x, int32_t y, int32_t w, int32_t h, const uint16_t *data, uint16_t transp) { - // Requires 32 bit aligned access, so use PROGMEM 16 bit word functions + // Requires 32-bit aligned access, so use PROGMEM 16-bit word functions PI_CLIP; begin_tft_write(); @@ -1618,7 +1618,7 @@ void TFT_eSPI::pushImage(int32_t x, int32_t y, int32_t w, int32_t h, const uint1 /*************************************************************************************** ** Function name: pushImage -** Description: plot 8 bit or 4 bit or 1 bit image or sprite using a line buffer +** Description: plot 8-bit or 4-bit or 1 bit image or sprite using a line buffer ***************************************************************************************/ void TFT_eSPI::pushImage(int32_t x, int32_t y, int32_t w, int32_t h, const uint8_t *data, bool bpp8, uint16_t *cmap) { @@ -1637,7 +1637,7 @@ void TFT_eSPI::pushImage(int32_t x, int32_t y, int32_t w, int32_t h, const uint8 { _swapBytes = false; - uint8_t blue[] = {0, 11, 21, 31}; // blue 2 to 5 bit colour lookup table + uint8_t blue[] = {0, 11, 21, 31}; // blue 2 to 5-bit colour lookup table _lastColor = -1; // Set to illegal value @@ -1751,7 +1751,7 @@ void TFT_eSPI::pushImage(int32_t x, int32_t y, int32_t w, int32_t h, const uint8 /*************************************************************************************** ** Function name: pushImage -** Description: plot 8 bit or 4 bit or 1 bit image or sprite using a line buffer +** Description: plot 8-bit or 4-bit or 1 bit image or sprite using a line buffer ***************************************************************************************/ void TFT_eSPI::pushImage(int32_t x, int32_t y, int32_t w, int32_t h, uint8_t *data, bool bpp8, uint16_t *cmap) { @@ -1770,7 +1770,7 @@ void TFT_eSPI::pushImage(int32_t x, int32_t y, int32_t w, int32_t h, uint8_t *da { _swapBytes = false; - uint8_t blue[] = {0, 11, 21, 31}; // blue 2 to 5 bit colour lookup table + uint8_t blue[] = {0, 11, 21, 31}; // blue 2 to 5-bit colour lookup table _lastColor = -1; // Set to illegal value @@ -1903,7 +1903,7 @@ void TFT_eSPI::pushImage(int32_t x, int32_t y, int32_t w, int32_t h, uint8_t *da data += dx + dy * w; - uint8_t blue[] = {0, 11, 21, 31}; // blue 2 to 5 bit colour lookup table + uint8_t blue[] = {0, 11, 21, 31}; // blue 2 to 5-bit colour lookup table _lastColor = -1; // Set to illegal value @@ -2089,7 +2089,7 @@ void TFT_eSPI::pushImage(int32_t x, int32_t y, int32_t w, int32_t h, uint8_t *da /*************************************************************************************** ** Function name: pushMaskedImage -** Description: Render a 16 bit colour image to TFT with a 1bpp mask +** Description: Render a 16-bit colour image to TFT with a 1bpp mask ***************************************************************************************/ // Can be used with a 16bpp sprite and a 1bpp sprite for the mask void TFT_eSPI::pushMaskedImage(int32_t x, int32_t y, int32_t w, int32_t h, uint16_t *img, uint8_t *mask) @@ -2175,7 +2175,7 @@ void TFT_eSPI::pushMaskedImage(int32_t x, int32_t y, int32_t w, int32_t h, uint1 /*************************************************************************************** ** Function name: setSwapBytes -** Description: Used by 16 bit pushImage() to swap byte order in colours +** Description: Used by 16-bit pushImage() to swap byte order in colours ***************************************************************************************/ void TFT_eSPI::setSwapBytes(bool swap) { @@ -2231,7 +2231,7 @@ void TFT_eSPI::readRectRGB(int32_t x0, int32_t y0, int32_t w, int32_t h, uint8_ // Dummy read to throw away don't care value tft_Read_8(); - // Read window pixel 24 bit RGB values, buffer must be set in sketch to 3 * w * h + // Read window pixel 24-bit RGB values, buffer must be set in sketch to 3 * w * h uint32_t len = w * h; while (len--) { @@ -3140,7 +3140,7 @@ int16_t TFT_eSPI::textWidth(const char *string, uint8_t font) /*************************************************************************************** ** Function name: fontsLoaded -** Description: return an encoded 16 bit value showing the fonts loaded +** Description: return an encoded 16-bit value showing the fonts loaded ***************************************************************************************/ // Returns a value showing which fonts are loaded (bit N set = Font N loaded) uint16_t TFT_eSPI::fontsLoaded(void) @@ -3384,7 +3384,7 @@ void TFT_eSPI::setWindow(int32_t x0, int32_t y0, int32_t x1, int32_t y1) DC_D; // Temporary solution is to include the RP2040 code here #if (defined(ARDUINO_ARCH_RP2040) || defined (ARDUINO_ARCH_MBED)) && !defined(RP2040_PIO_INTERFACE) - // For ILI9225 and RP2040 the slower Arduino SPI transfer calls were used, so need to swap back to 16 bit mode + // For ILI9225 and RP2040 the slower Arduino SPI transfer calls were used, so need to swap back to 16-bit mode while (spi_get_hw(SPI_X)->sr & SPI_SSPSR_BSY_BITS) {}; hw_write_masked(&spi_get_hw(SPI_X)->cr0, (16 - 1) << SPI_SSPCR0_DSS_LSB, SPI_SSPCR0_DSS_BITS); #endif @@ -3415,12 +3415,12 @@ void TFT_eSPI::setWindow(int32_t x0, int32_t y0, int32_t x1, int32_t y1) // Temporary solution is to include the RP2040 optimised code here #if (defined(ARDUINO_ARCH_RP2040) || defined (ARDUINO_ARCH_MBED)) #if !defined(RP2040_PIO_INTERFACE) - // Use hardware SPI port, this code does not swap from 8 to 16 bit + // Use hardware SPI port, this code does not swap from 8 to 16-bit // to avoid the spi_set_format() call overhead while (spi_get_hw(SPI_X)->sr & SPI_SSPSR_BSY_BITS) {}; DC_C; #if !defined (SPI_18BIT_DRIVER) - #if defined (RPI_DISPLAY_TYPE) // RPi TFT type always needs 16 bit transfers + #if defined (RPI_DISPLAY_TYPE) // RPi TFT type always needs 16-bit transfers hw_write_masked(&spi_get_hw(SPI_X)->cr0, (16 - 1) << SPI_SSPCR0_DSS_LSB, SPI_SSPCR0_DSS_BITS); #else hw_write_masked(&spi_get_hw(SPI_X)->cr0, (8 - 1) << SPI_SSPCR0_DSS_LSB, SPI_SSPCR0_DSS_BITS); @@ -3518,7 +3518,7 @@ void TFT_eSPI::readAddrWindow(int32_t xs, int32_t ys, int32_t w, int32_t h) // Temporary solution is to include the RP2040 optimised code here #if (defined(ARDUINO_ARCH_RP2040) || defined (ARDUINO_ARCH_MBED)) && !defined(RP2040_PIO_INTERFACE) - // Use hardware SPI port, this code does not swap from 8 to 16 bit + // Use hardware SPI port, this code does not swap from 8 to 16-bit // to avoid the spi_set_format() call overhead while (spi_get_hw(SPI_X)->sr & SPI_SSPSR_BSY_BITS) {}; DC_C; @@ -3641,7 +3641,7 @@ void TFT_eSPI::drawPixel(int32_t x, int32_t y, uint32_t color) #if !defined(RP2040_PIO_INTERFACE) while (spi_get_hw(SPI_X)->sr & SPI_SSPSR_BSY_BITS) {}; - #if defined (RPI_DISPLAY_TYPE) // RPi TFT type always needs 16 bit transfers + #if defined (RPI_DISPLAY_TYPE) // RPi TFT type always needs 16-bit transfers hw_write_masked(&spi_get_hw(SPI_X)->cr0, (16 - 1) << SPI_SSPCR0_DSS_LSB, SPI_SSPCR0_DSS_BITS); #else hw_write_masked(&spi_get_hw(SPI_X)->cr0, (8 - 1) << SPI_SSPCR0_DSS_LSB, SPI_SSPCR0_DSS_BITS); @@ -3676,7 +3676,7 @@ void TFT_eSPI::drawPixel(int32_t x, int32_t y, uint32_t color) DC_C; spi_get_hw(SPI_X)->dr = (uint32_t)TFT_RAMWR; - #if defined (SPI_18BIT_DRIVER) // SPI 18 bit colour + #if defined (SPI_18BIT_DRIVER) // SPI 18-bit colour uint8_t r = (color & 0xF800)>>8; uint8_t g = (color & 0x07E0)>>3; uint8_t b = (color & 0x001F)<<3; @@ -3686,7 +3686,7 @@ void TFT_eSPI::drawPixel(int32_t x, int32_t y, uint32_t color) #else while (spi_get_hw(SPI_X)->sr & SPI_SSPSR_BSY_BITS) {}; DC_D; - #if defined (RPI_DISPLAY_TYPE) // RPi TFT type always needs 16 bit transfers + #if defined (RPI_DISPLAY_TYPE) // RPi TFT type always needs 16-bit transfers spi_get_hw(SPI_X)->dr = (uint32_t)color; #else spi_get_hw(SPI_X)->dr = (uint32_t)color>>8; @@ -3843,7 +3843,7 @@ void TFT_eSPI::writeColor(uint16_t color, uint32_t len) /*************************************************************************************** ** Function name: pushColors -** Description: push an array of pixels for 16 bit raw image drawing +** Description: push an array of pixels for 16-bit raw image drawing ***************************************************************************************/ // Assumed that setAddrWindow() has previously been called // len is number of bytes, not pixels @@ -3877,7 +3877,7 @@ void TFT_eSPI::pushColors(uint16_t *data, uint32_t len, bool swap) ** Function name: drawLine ** Description: draw a line between 2 arbitrary points ***************************************************************************************/ -// Bresenham's algorithm - thx wikipedia - speed enhanced by Bodmer to use +// Bresenham's algorithm - thx Wikipedia - speed enhanced by Bodmer to use // an efficient FastH/V Line draw routine for line segments of 2 pixels or more void TFT_eSPI::drawLine(int32_t x0, int32_t y0, int32_t x1, int32_t y1, uint32_t color) { @@ -4106,7 +4106,7 @@ void TFT_eSPI::drawArc(int32_t x, int32_t y, int32_t r, int32_t ir, float fabssin = fabsf(sinf(startAngle * deg2rad)); // U16.16 slope of arc start - uint32_t slope = (fabscos/(fabssin + minDivisor)) * (float)(1<<16); + uint32_t slope = (fabscos/(fabssin + minDivisor)) * (float)(1UL<<16); // Update slope table, add slope for arc start if (startAngle <= 90) { @@ -4130,7 +4130,7 @@ void TFT_eSPI::drawArc(int32_t x, int32_t y, int32_t r, int32_t ir, fabssin = fabsf(sinf(endAngle * deg2rad)); // U16.16 slope of arc end - slope = (uint32_t)((fabscos/(fabssin + minDivisor)) * (float)(1<<16)); + slope = (uint32_t)((fabscos/(fabssin + minDivisor)) * (float)(1UL<<16)); // Work out which quadrants will need to be drawn and add slope for arc end if (endAngle <= 90) { @@ -4769,7 +4769,7 @@ void TFT_eSPI::fillRectHGradient(int16_t x, int16_t y, int16_t w, int16_t h, uin /*************************************************************************************** ** Function name: color565 -** Description: convert three 8 bit RGB levels to a 16 bit colour value +** Description: convert three 8-bit RGB levels to a 16-bit colour value ***************************************************************************************/ uint16_t TFT_eSPI::color565(uint8_t r, uint8_t g, uint8_t b) { @@ -4779,7 +4779,7 @@ uint16_t TFT_eSPI::color565(uint8_t r, uint8_t g, uint8_t b) /*************************************************************************************** ** Function name: color16to8 -** Description: convert 16 bit colour to an 8 bit 332 RGB colour value +** Description: convert 16-bit colour to an 8-bit 332 RGB colour value ***************************************************************************************/ uint8_t TFT_eSPI::color16to8(uint16_t c) { @@ -4789,11 +4789,11 @@ uint8_t TFT_eSPI::color16to8(uint16_t c) /*************************************************************************************** ** Function name: color8to16 -** Description: convert 8 bit colour to a 16 bit 565 colour value +** Description: convert 8-bit colour to a 16-bit 565 colour value ***************************************************************************************/ uint16_t TFT_eSPI::color8to16(uint8_t color) { - uint8_t blue[] = {0, 11, 21, 31}; // blue 2 to 5 bit colour lookup table + uint8_t blue[] = {0, 11, 21, 31}; // blue 2 to 5-bit colour lookup table uint16_t color16 = 0; // =====Green===== ===============Red============== @@ -4806,7 +4806,7 @@ uint16_t TFT_eSPI::color8to16(uint8_t color) /*************************************************************************************** ** Function name: color16to24 -** Description: convert 16 bit colour to a 24 bit 888 colour value +** Description: convert 16-bit colour to a 24-bit 888 colour value ***************************************************************************************/ uint32_t TFT_eSPI::color16to24(uint16_t color565) { @@ -4819,7 +4819,7 @@ uint32_t TFT_eSPI::color16to24(uint16_t color565) /*************************************************************************************** ** Function name: color24to16 -** Description: convert 24 bit colour to a 16 bit 565 colour value +** Description: convert 24-bit colour to a 16-bit 565 colour value ***************************************************************************************/ uint32_t TFT_eSPI::color24to16(uint32_t color888) { @@ -4900,26 +4900,26 @@ uint16_t TFT_eSPI::decodeUTF8(uint8_t c) { if (!_utf8) return c; - // 7 bit Unicode Code Point + // 7-bit Unicode Code Point if ((c & 0x80) == 0x00) { decoderState = 0; return c; } if (decoderState == 0) { - // 11 bit Unicode Code Point + // 11-bit Unicode Code Point if ((c & 0xE0) == 0xC0) { decoderBuffer = ((c & 0x1F)<<6); decoderState = 1; return 0; } - // 16 bit Unicode Code Point + // 16-bit Unicode Code Point if ((c & 0xF0) == 0xE0) { decoderBuffer = ((c & 0x0F)<<12); decoderState = 2; return 0; } - // 21 bit Unicode Code Point not supported so fall-back to extended ASCII + // 21-bit Unicode Code Point not supported so fall-back to extended ASCII // if ((c & 0xF8) == 0xF0) return c; } else { @@ -4952,20 +4952,20 @@ uint16_t TFT_eSPI::decodeUTF8(uint8_t *buf, uint16_t *index, uint16_t remaining) if (!_utf8) return c; - // 7 bit Unicode + // 7-bit Unicode if ((c & 0x80) == 0x00) return c; - // 11 bit Unicode + // 11-bit Unicode if (((c & 0xE0) == 0xC0) && (remaining > 1)) return ((c & 0x1F)<<6) | (buf[(*index)++]&0x3F); - // 16 bit Unicode + // 16-bit Unicode if (((c & 0xF0) == 0xE0) && (remaining > 2)) { c = ((c & 0x0F)<<12) | ((buf[(*index)++]&0x3F)<<6); return c | ((buf[(*index)++]&0x3F)); } - // 21 bit Unicode not supported so fall-back to extended ASCII + // 21-bit Unicode not supported so fall-back to extended ASCII // if ((c & 0xF8) == 0xF0) return c; return c; // fall-back to extended ASCII @@ -4978,10 +4978,10 @@ uint16_t TFT_eSPI::decodeUTF8(uint8_t *buf, uint16_t *index, uint16_t remaining) *************************************************************************************x*/ uint16_t TFT_eSPI::alphaBlend(uint8_t alpha, uint16_t fgc, uint16_t bgc) { - // Split out and blend 5 bit red and blue channels + // Split out and blend 5-bit red and blue channels uint32_t rxb = bgc & 0xF81F; rxb += ((fgc & 0xF81F) - rxb) * (alpha >> 2) >> 6; - // Split out and blend 6 bit green channel + // Split out and blend 6-bit green channel uint32_t xgx = bgc & 0x07E0; xgx += ((fgc & 0x07E0) - xgx) * alpha >> 8; // Recombine channels @@ -5352,7 +5352,7 @@ int16_t TFT_eSPI::drawChar(uint16_t uniCode, int32_t x, int32_t y, uint8_t font) uint8_t tnp = 0; // Temporary copy of np for while loop uint8_t ts = textsize - 1; // Temporary copy of textsize - // 16 bit pixel count so maximum font size is equivalent to 180x180 pixels in area + // 16-bit pixel count so maximum font size is equivalent to 180x180 pixels in area // w is total number of pixels to plot to fill character block while (pc < w) { line = pgm_read_byte((uint8_t *)flash_address); diff --git a/TFT_eSPI.h b/TFT_eSPI.h index f892203..41f8c07 100644 --- a/TFT_eSPI.h +++ b/TFT_eSPI.h @@ -12,7 +12,7 @@ Last review/edit by Bodmer: 04/02/22 ****************************************************/ -// Stop fonts etc being loaded multiple times +// Stop fonts etc. being loaded multiple times #ifndef _TFT_eSPIH_ #define _TFT_eSPIH_ @@ -36,7 +36,7 @@ ** Section 2: Load library and processor specific header files ***************************************************************************************/ // Include header file that defines the fonts loaded, the TFT drivers -// available and the pins to be used, etc, etc +// available and the pins to be used, etc. etc. #ifdef CONFIG_TFT_eSPI_ESPIDF #include "TFT_config.h" #endif @@ -327,12 +327,12 @@ const PROGMEM fontinfo fontdata [] = { #define TFT_SKYBLUE 0x867D /* 135, 206, 235 */ #define TFT_VIOLET 0x915C /* 180, 46, 226 */ -// Next is a special 16 bit colour value that encodes to 8 bits -// and will then decode back to the same 16 bit value. -// Convenient for 8 bit and 16 bit transparent sprites. +// Next is a special 16-bit colour value that encodes to 8 bits +// and will then decode back to the same 16-bit value. +// Convenient for 8-bit and 16-bit transparent sprites. #define TFT_TRANSPARENT 0x0120 // This is actually a dark green -// Default palette for 4 bit colour sprites +// Default palette for 4-bit colour sprites static const uint16_t default_4bit_palette[] PROGMEM = { TFT_BLACK, // 0 ^ TFT_BROWN, // 1 | @@ -505,7 +505,7 @@ class TFT_eSPI : public Print { friend class TFT_eSprite; // Sprite class has ac // Support for half duplex (bi-directional SDA) SPI bus where MOSI must be switched to input #ifdef TFT_SDA_READ #if defined (TFT_eSPI_ENABLE_8_BIT_READ) - uint8_t tft_Read_8(void); // Read 8 bit value from TFT command register + uint8_t tft_Read_8(void); // Read 8-bit value from TFT command register #endif void begin_SDA_Read(void); // Begin a read on a half duplex (bi-directional SDA) SPI bus - sets MOSI to input void end_SDA_Read(void); // Restore MOSI to output @@ -598,7 +598,7 @@ class TFT_eSPI : public Print { friend class TFT_eSprite; // Sprite class has ac getPivotY(void); // Get pivot y // The next functions can be used as a pair to copy screen blocks (or horizontal/vertical lines) to another location - // Read a block of pixels to a data buffer, buffer is 16 bit and the size must be at least w * h + // Read a block of pixels to a data buffer, buffer is 16-bit and the size must be at least w * h void readRect(int32_t x, int32_t y, int32_t w, int32_t h, uint16_t *data); // Write a block of pixels to the screen which have been read by readRect() void pushRect(int32_t x, int32_t y, int32_t w, int32_t h, uint16_t *data); @@ -619,11 +619,11 @@ class TFT_eSPI : public Print { friend class TFT_eSprite; // Sprite class has ac // FLASH version void pushImage(int32_t x, int32_t y, int32_t w, int32_t h, const uint8_t *data, bool bpp8, uint16_t *cmap = nullptr); - // Render a 16 bit colour image with a 1bpp mask + // Render a 16-bit colour image with a 1bpp mask void pushMaskedImage(int32_t x, int32_t y, int32_t w, int32_t h, uint16_t *img, uint8_t *mask); // This next function has been used successfully to dump the TFT screen to a PC for documentation purposes - // It reads a screen area and returns the 3 RGB 8 bit colour values of each pixel in the buffer + // It reads a screen area and returns the 3 RGB 8-bit colour values of each pixel in the buffer // Set w and h to 1 to read 1 pixel's colour. The data buffer must be at least w * h * 3 bytes void readRectRGB(int32_t x, int32_t y, int32_t w, int32_t h, uint8_t *data); @@ -650,7 +650,7 @@ class TFT_eSPI : public Print { friend class TFT_eSprite; // Sprite class has ac drawRightString(const String& string, int32_t x, int32_t y, uint8_t font); // Deprecated, use setTextDatum() and drawString() - // Text rendering and font handling support funtions + // Text rendering and font handling support functions void setCursor(int16_t x, int16_t y), // Set cursor for tft.print() setCursor(int16_t x, int16_t y, uint8_t font); // Set cursor and font number for tft.print() @@ -663,7 +663,7 @@ class TFT_eSPI : public Print { friend class TFT_eSprite; // Sprite class has ac void setTextWrap(bool wrapX, bool wrapY = false); // Turn on/off wrapping of text in TFT width and/or height - void setTextDatum(uint8_t datum); // Set text datum position (default is top left), see Section 6 above + void setTextDatum(uint8_t datum); // Set text datum position (default is top left), see Section 5 above uint8_t getTextDatum(void); void setTextPadding(uint16_t x_width); // Set text padding (background blanking/over-write) width in pixels @@ -701,11 +701,11 @@ class TFT_eSPI : public Print { friend class TFT_eSprite; // Sprite class has ac // Low level read/write void spiwrite(uint8_t); // legacy support only #ifdef RM68120_DRIVER - void writecommand(uint16_t c); // Send a 16 bit command, function resets DC/RS high ready for data - void writeRegister8(uint16_t c, uint8_t d); // Write 8 bit data data to 16 bit command register - void writeRegister16(uint16_t c, uint16_t d); // Write 16 bit data data to 16 bit command register + void writecommand(uint16_t c); // Send a 16-bit command, function resets DC/RS high ready for data + void writeRegister8(uint16_t c, uint8_t d); // Write 8-bit data data to 16-bit command register + void writeRegister16(uint16_t c, uint16_t d); // Write 16-bit data data to 16-bit command register #else - void writecommand(uint8_t c); // Send an 8 bit command, function resets DC/RS high ready for data + void writecommand(uint8_t c); // Send an 8-bit command, function resets DC/RS high ready for data #endif void writedata(uint8_t d); // Send data with DC/RS set high @@ -717,15 +717,15 @@ class TFT_eSPI : public Print { friend class TFT_eSprite; // Sprite class has ac // Colour conversion - // Convert 8 bit red, green and blue to 16 bits + // Convert 8-bit red, green and blue to 16 bits uint16_t color565(uint8_t red, uint8_t green, uint8_t blue); - // Convert 8 bit colour to 16 bits + // Convert 8-bit colour to 16 bits uint16_t color8to16(uint8_t color332); - // Convert 16 bit colour to 8 bits + // Convert 16-bit colour to 8 bits uint8_t color16to8(uint16_t color565); - // Convert 16 bit colour to/from 24 bit, R+G+B concatenated into LS 24 bits + // Convert 16-bit colour to/from 24-bit, R+G+B concatenated into LS 24 bits uint32_t color16to24(uint16_t color565); uint32_t color24to16(uint32_t color888); @@ -734,14 +734,14 @@ class TFT_eSPI : public Print { friend class TFT_eSprite; // Sprite class has ac // alpha = 255 = 100% foreground colour uint16_t alphaBlend(uint8_t alpha, uint16_t fgc, uint16_t bgc); - // 16 bit colour alphaBlend with alpha dither (dither reduces colour banding) + // 16-bit colour alphaBlend with alpha dither (dither reduces colour banding) uint16_t alphaBlend(uint8_t alpha, uint16_t fgc, uint16_t bgc, uint8_t dither); - // 24 bit colour alphaBlend with optional alpha dither + // 24-bit colour alphaBlend with optional alpha dither uint32_t alphaBlend24(uint8_t alpha, uint32_t fgc, uint32_t bgc, uint8_t dither = 0); // Direct Memory Access (DMA) support functions // These can be used for SPI writes when using the ESP32 (original) or STM32 processors. - // DMA also works on a RP2040 processor with PIO based SPI and parallel (8 and 16 bit) interfaces + // DMA also works on a RP2040 processor with PIO based SPI and parallel (8 and 16-bit) interfaces // Bear in mind DMA will only be of benefit in particular circumstances and can be tricky // to manage by noobs. The functions have however been designed to be noob friendly and // avoid a few DMA behaviour "gotchas". @@ -963,7 +963,7 @@ class TFT_eSPI : public Print { friend class TFT_eSprite; // Sprite class has ac #ifdef TOUCH_CS #if defined (TFT_PARALLEL_8_BIT) || defined (RP2040_PIO_INTERFACE) #if !defined(DISABLE_ALL_LIBRARY_WARNINGS) - #error >>>>------>> Touch functions not supported in 8/16 bit parallel mode or with RP2040 PIO. + #error >>>>------>> Touch functions not supported in 8/16-bit parallel mode or with RP2040 PIO. #endif #else #include "Extensions/Touch.h" // Loaded if TOUCH_CS is defined by user @@ -989,10 +989,10 @@ transpose(T& a, T& b) { T t = a; a = b; b = t; } template static inline uint16_t fastBlend(A alpha, F fgc, B bgc) { - // Split out and blend 5 bit red and blue channels + // Split out and blend 5-bit red and blue channels uint32_t rxb = bgc & 0xF81F; rxb += ((fgc & 0xF81F) - rxb) * (alpha >> 2) >> 6; - // Split out and blend 6 bit green channel + // Split out and blend 6-bit green channel uint32_t xgx = bgc & 0x07E0; xgx += ((fgc & 0x07E0) - xgx) * alpha >> 8; // Recombine channels diff --git a/Tools/Create_Smooth_Font/Create_font/Create_font.pde b/Tools/Create_Smooth_Font/Create_font/Create_font.pde index 9771bfb..1a07c5c 100644 --- a/Tools/Create_Smooth_Font/Create_font/Create_font.pde +++ b/Tools/Create_Smooth_Font/Create_font/Create_font.pde @@ -48,13 +48,13 @@ Software License Agreement (FreeBSD License) // >>>>>>>>>>>>>>>>>>>> INSTRUCTIONS <<<<<<<<<<<<<<<<<<<< // See comments below in code for specifying the font parameters (point size, -// unicode blocks to include etc). Ranges of characters (glyphs) and specific +// unicode blocks to include etc.). Ranges of characters (glyphs) and specific // individual glyphs can be included in the created "*.vlw" font file. // Created fonts are saved in the sketches "FontFiles" folder. Press Ctrl+K to // see that folder location. -// 16 bit Unicode point codes in the range 0x0000 - 0xFFFF are supported. +// 16-bit Unicode point codes in the range 0x0000 - 0xFFFF are supported. // Codes 0-31 are control codes such as "tab" and "carraige return" etc. // and 32 is a "space", these should NOT be included. @@ -369,7 +369,7 @@ static final int[] specificUnicodes = { //////////////////////////////////////////////////////////////////////////////////////////////// -// Variable to hold the inclusive Unicode range (16 bit values only for this sketch) +// Variable to hold the inclusive Unicode range (16-bit values only for this sketch) int firstUnicode = 0; int lastUnicode = 0; diff --git a/Tools/Screenshot_client/Screenshot_client.pde b/Tools/Screenshot_client/Screenshot_client.pde index 537b108..03c9eef 100644 --- a/Tools/Screenshot_client/Screenshot_client.pde +++ b/Tools/Screenshot_client/Screenshot_client.pde @@ -55,7 +55,7 @@ int max_allowed = 1000; // Maximum number of save images allowed before a resta // These are default values, this sketch obtains the actual values from the Arduino board int tft_width = 480; // default TFT width (automatic - sent by Arduino) int tft_height = 480; // default TFT height (automatic - sent by Arduino) -int color_bytes = 2; // 2 for 16 bit, 3 for three RGB bytes (automatic - sent by Arduino) +int color_bytes = 2; // 2 for 16-bit, 3 for three RGB bytes (automatic - sent by Arduino) import processing.serial.*; diff --git a/User_Setup.h b/User_Setup.h index cc03d24..a012331 100644 --- a/User_Setup.h +++ b/User_Setup.h @@ -1,5 +1,5 @@ // USER DEFINED SETTINGS -// Set driver type, fonts to be loaded, pins used and SPI control method etc +// Set driver type, fonts to be loaded, pins used and SPI control method etc. // // See the User_Setup_Select.h file if you wish to be able to define multiple // setups and then easily select which setup file is used by the compiler. @@ -28,15 +28,15 @@ //#define NUCLEO_64_TFT //#define NUCLEO_144_TFT -// STM32 8 bit parallel only: -// If STN32 Port A or B pins 0-7 are used for 8 bit parallel data bus bits 0-7 +// STM32 8-bit parallel only: +// If STN32 Port A or B pins 0-7 are used for 8-bit parallel data bus bits 0-7 // then this will improve rendering performance by a factor of ~8x //#define STM_PORTA_DATA_BUS //#define STM_PORTB_DATA_BUS // Tell the library to use parallel mode (otherwise SPI is assumed) //#define TFT_PARALLEL_8_BIT -//#defined TFT_PARALLEL_16_BIT // **** 16 bit parallel ONLY for RP2040 processor **** +//#defined TFT_PARALLEL_16_BIT // **** 16-bit parallel ONLY for RP2040 processor **** // Display type - only define if RPi display //#define RPI_DISPLAY_TYPE // 20MHz maximum SPI @@ -105,7 +105,7 @@ // #define ST7735_GREENTAB3 // #define ST7735_GREENTAB128 // For 128 x 128 display // #define ST7735_GREENTAB160x80 // For 160 x 80 display (BGR, inverted, 26 offset) -// #define ST7735_ROBOTLCD // For some RobotLCD arduino shields (128x160, BGR, https://docs.arduino.cc/retired/getting-started-guides/TFT) +// #define ST7735_ROBOTLCD // For some RobotLCD Arduino shields (128x160, BGR, https://docs.arduino.cc/retired/getting-started-guides/TFT) // #define ST7735_REDTAB // #define ST7735_BLACKTAB // #define ST7735_REDTAB160x80 // For 160 x 80 display with 24 pixel offset @@ -242,7 +242,7 @@ // ###### EDIT THE PINs BELOW TO SUIT YOUR ESP32 PARALLEL TFT SETUP ###### -// The library supports 8 bit parallel TFTs with the ESP32, the pin +// The library supports 8-bit parallel TFTs with the ESP32, the pin // selection below is compatible with ESP32 boards in UNO format. // Wemos D32 boards need to be modified, see diagram in Tools folder. // Only ILI9481 and ILI9341 based displays have been tested! @@ -250,7 +250,7 @@ // Parallel bus is only supported for the STM32 and ESP32 // Example below is for ESP32 Parallel interface with UNO displays -// Tell the library to use 8 bit parallel mode (otherwise SPI is assumed) +// Tell the library to use 8-bit parallel mode (otherwise SPI is assumed) //#define TFT_PARALLEL_8_BIT // The ESP32 and TFT the pins used for testing are: @@ -330,11 +330,11 @@ // For RP2040 processor and SPI displays, uncomment the following line to use the PIO interface. //#define RP2040_PIO_SPI // Leave commented out to use standard RP2040 SPI port interface -// For RP2040 processor and 8 or 16 bit parallel displays: +// For RP2040 processor and 8 or 16-bit parallel displays: // The parallel interface write cycle period is derived from a division of the CPU clock // speed so scales with the processor clock. This means that the divider ratio may need // to be increased when overclocking. It may also need to be adjusted dependant on the -// display controller type (ILI94341, HX8357C etc). If RP2040_PIO_CLK_DIV is not defined +// display controller type (ILI94341, HX8357C etc.). If RP2040_PIO_CLK_DIV is not defined // the library will set default values which may not suit your display. // The display controller data sheet will specify the minimum write cycle period. The // controllers often work reliably for shorter periods, however if the period is too short diff --git a/User_Setup_Select.h b/User_Setup_Select.h index 6e1b625..bead30d 100644 --- a/User_Setup_Select.h +++ b/User_Setup_Select.h @@ -100,15 +100,15 @@ //#include // Setup file for ESP32 S2 with ST7789 //#include // Setup file for ESP32 with ST7789 1.47" 172x320 -//#include // Setup file for Pico/RP2040 with 8 bit parallel ILI9488 -//#include // Setup file for Pico/RP2040 with 8 bit parallel ILI9481 -//#include // Setup file for Pico/RP2040 with 8 bit parallel ILI9341 -//#include // Setup file for Pico/RP2040 with 8 bit parallel ILI9486 -//#include // Setup file for Pico/RP2040 with 8 bit parallel ST7796 +//#include // Setup file for Pico/RP2040 with 8-bit parallel ILI9488 +//#include // Setup file for Pico/RP2040 with 8-bit parallel ILI9481 +//#include // Setup file for Pico/RP2040 with 8-bit parallel ILI9341 +//#include // Setup file for Pico/RP2040 with 8-bit parallel ILI9486 +//#include // Setup file for Pico/RP2040 with 8-bit parallel ST7796 -//#include // Setup file for RP2040 16 bit parallel display -//#include // Setup file for RP2040 16 bit parallel display -//#include // Setup file for RP2040 16 bit parallel display +//#include // Setup file for RP2040 16-bit parallel display +//#include // Setup file for RP2040 16-bit parallel display +//#include // Setup file for RP2040 16-bit parallel display //#include // Setup file for Waveshare RP2040 board with onboard ST7735 0.96" 160x80 display //#include // Setup file for ESP8266 and ST7789 135 x 240 TFT @@ -168,7 +168,7 @@ ///////////////////////////////////////////////////////////////////////////////////// -// Identical looking TFT displays may have a different colour ordering in the 16 bit colour +// Identical looking TFT displays may have a different colour ordering in the 16-bit colour #define TFT_BGR 0 // Colour order Blue-Green-Red #define TFT_RGB 1 // Colour order Red-Green-Blue @@ -190,7 +190,7 @@ #endif #endif -// Invoke 18 bit colour for selected displays +// Invoke 18-bit colour for selected displays #if !defined (RPI_DISPLAY_TYPE) && !defined (TFT_PARALLEL_8_BIT) && !defined (TFT_PARALLEL_16_BIT) && !defined (ESP32_PARALLEL) #if defined (ILI9481_DRIVER) || defined (ILI9486_DRIVER) || defined (ILI9488_DRIVER) #define SPI_18BIT_DRIVER diff --git a/User_Setups/Setup0_Sprite.h b/User_Setups/Setup0_Sprite.h new file mode 100644 index 0000000..a769291 --- /dev/null +++ b/User_Setups/Setup0_Sprite.h @@ -0,0 +1,47 @@ +// For sprite only functionality (untested) +#define USER_SETUP_ID 0 + +#define TFT_WIDTH 1000 +#define TFT_HEIGHT 1000 + +#define TFT_INIT_DELAY 0 + +#define TFT_NOP 0x00 +#define TFT_SWRST 0x00 + +#define TFT_CASET 0x00 +#define TFT_PASET 0x00 +#define TFT_RAMWR 0x00 + +#define TFT_RAMRD 0x00 +#define TFT_IDXRD 0x00 + +/* +#define TFT_MADCTL 0x00 +#define TFT_MAD_MY 0x00 +#define TFT_MAD_MX 0x00 +#define TFT_MAD_MV 0x00 +#define TFT_MAD_ML 0x00 +#define TFT_MAD_BGR 0x00 +#define TFT_MAD_MH 0x00 +#define TFT_MAD_RGB 0x00 +*/ +#define TFT_INVOFF 0x00 +#define TFT_INVON 0x00 + + +#define TFT_MISO -1 +#define TFT_MOSI -1 +#define TFT_SCLK -1 + + +#define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH +#define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters +#define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters +#define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm +#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:-. +#define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. +//#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT +#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts + +#define SMOOTH_FONT diff --git a/User_Setups/Setup100_RP2040_ILI9488_parallel.h b/User_Setups/Setup100_RP2040_ILI9488_parallel.h index 2a3aeda..dcec30e 100644 --- a/User_Setups/Setup100_RP2040_ILI9488_parallel.h +++ b/User_Setups/Setup100_RP2040_ILI9488_parallel.h @@ -1,4 +1,4 @@ -// This setup is for the RP2040 processor only when used with 8 bit parallel displays +// This setup is for the RP2040 processor only when used with 8-bit parallel displays // See SetupX_Template.h for all options available #define USER_SETUP_ID 100 diff --git a/User_Setups/Setup101_RP2040_ILI9481_parallel.h b/User_Setups/Setup101_RP2040_ILI9481_parallel.h index 4b3e507..714e5e1 100644 --- a/User_Setups/Setup101_RP2040_ILI9481_parallel.h +++ b/User_Setups/Setup101_RP2040_ILI9481_parallel.h @@ -1,4 +1,4 @@ -// This setup is for the RP2040 processor only when used with 8 bit parallel displays +// This setup is for the RP2040 processor only when used with 8-bit parallel displays // See SetupX_Template.h for all options available #define USER_SETUP_ID 101 diff --git a/User_Setups/Setup102_RP2040_ILI9341_parallel.h b/User_Setups/Setup102_RP2040_ILI9341_parallel.h index 8cb1778..ce133c8 100644 --- a/User_Setups/Setup102_RP2040_ILI9341_parallel.h +++ b/User_Setups/Setup102_RP2040_ILI9341_parallel.h @@ -1,4 +1,4 @@ -// This setup is for the RP2040 processor only when used with 8 bit parallel displays +// This setup is for the RP2040 processor only when used with 8-bit parallel displays // See SetupX_Template.h for all options available #define USER_SETUP_ID 102 diff --git a/User_Setups/Setup103_RP2040_ILI9486_parallel.h b/User_Setups/Setup103_RP2040_ILI9486_parallel.h index c50b93d..34bb702 100644 --- a/User_Setups/Setup103_RP2040_ILI9486_parallel.h +++ b/User_Setups/Setup103_RP2040_ILI9486_parallel.h @@ -1,4 +1,4 @@ -// This setup is for the RP2040 processor only when used with 8 bit parallel displays +// This setup is for the RP2040 processor only when used with 8-bit parallel displays // See SetupX_Template.h for all options available #define USER_SETUP_ID 103 diff --git a/User_Setups/Setup104_RP2040_ST7796_parallel.h b/User_Setups/Setup104_RP2040_ST7796_parallel.h index c42fa0b..a76e4fc 100644 --- a/User_Setups/Setup104_RP2040_ST7796_parallel.h +++ b/User_Setups/Setup104_RP2040_ST7796_parallel.h @@ -1,4 +1,4 @@ -// This setup is for the RP2040 processor only when used with 8 bit parallel displays +// This setup is for the RP2040 processor only when used with 8-bit parallel displays // See SetupX_Template.h for all options available #define USER_SETUP_ID 104 diff --git a/User_Setups/Setup105_RP2040_ST7796_16bit_parallel.h b/User_Setups/Setup105_RP2040_ST7796_16bit_parallel.h index e53afa6..82b506c 100644 --- a/User_Setups/Setup105_RP2040_ST7796_16bit_parallel.h +++ b/User_Setups/Setup105_RP2040_ST7796_16bit_parallel.h @@ -1,4 +1,4 @@ -// This setup is for the RP2040 processor only when used with 8 bit parallel displays +// This setup is for the RP2040 processor only when used with 8-bit parallel displays // See SetupX_Template.h for all options available #define USER_SETUP_ID 105 diff --git a/User_Setups/Setup106_RP2040_ILI9481_16bit_parallel.h b/User_Setups/Setup106_RP2040_ILI9481_16bit_parallel.h index 0a1d75c..7273ba3 100644 --- a/User_Setups/Setup106_RP2040_ILI9481_16bit_parallel.h +++ b/User_Setups/Setup106_RP2040_ILI9481_16bit_parallel.h @@ -1,4 +1,4 @@ -// This setup is for the RP2040 processor when used with 8 bit parallel displays +// This setup is for the RP2040 processor when used with 8-bit parallel displays // See SetupX_Template.h for all options available #define USER_SETUP_ID 106 @@ -11,7 +11,7 @@ // The parallel interface write cycle period is derived from a division of the CPU clock // speed so scales with the processor clock. This means that the divider ratio may need // to be increased when overclocking. I may also need to be adjusted dependant on the -// display controller type (ILI94341, HX8357C etc). If RP2040_PIO_CLK_DIV is not defined +// display controller type (ILI94341, HX8357C etc.). If RP2040_PIO_CLK_DIV is not defined // the library will set default values which may not suit your display. // The display controller data sheet will specify the minimum write cycle period. The // controllers often work reliably for shorter periods, however if the period is too short diff --git a/User_Setups/Setup107_RP2040_ILI9341_16bit_parallel.h b/User_Setups/Setup107_RP2040_ILI9341_16bit_parallel.h index 6b0d0f9..384dc1c 100644 --- a/User_Setups/Setup107_RP2040_ILI9341_16bit_parallel.h +++ b/User_Setups/Setup107_RP2040_ILI9341_16bit_parallel.h @@ -1,4 +1,4 @@ -// This setup is for the RP2040 processor only when used with 8 bit parallel displays +// This setup is for the RP2040 processor only when used with 8-bit parallel displays // See SetupX_Template.h for all options available #define USER_SETUP_ID 107 diff --git a/User_Setups/Setup201_WT32_SC01.h b/User_Setups/Setup201_WT32_SC01.h index 7f03497..08f5953 100644 --- a/User_Setups/Setup201_WT32_SC01.h +++ b/User_Setups/Setup201_WT32_SC01.h @@ -1,5 +1,5 @@ // USER DEFINED SETTINGS -// Set driver type, fonts to be loaded, pins used and SPI control method etc +// Set driver type, fonts to be loaded, pins used and SPI control method etc. // // See the User_Setup_Select.h file if you wish to be able to define multiple // setups and then easily select which setup file is used by the compiler. diff --git a/User_Setups/Setup27_RPi_ST7796_ESP32.h b/User_Setups/Setup27_RPi_ST7796_ESP32.h index 8d2f54b..ed053a4 100644 --- a/User_Setups/Setup27_RPi_ST7796_ESP32.h +++ b/User_Setups/Setup27_RPi_ST7796_ESP32.h @@ -1,5 +1,5 @@ // USER DEFINED SETTINGS -// Set driver type, fonts to be loaded, pins used and SPI control method etc +// Set driver type, fonts to be loaded, pins used and SPI control method etc. // // See the User_Setup_Select.h file if you wish to be able to define multiple // setups and then easily select which setup file is used by the compiler. diff --git a/User_Setups/Setup28_RPi_ST7796_ESP8266.h b/User_Setups/Setup28_RPi_ST7796_ESP8266.h index 4be8274..e4ba57c 100644 --- a/User_Setups/Setup28_RPi_ST7796_ESP8266.h +++ b/User_Setups/Setup28_RPi_ST7796_ESP8266.h @@ -1,5 +1,5 @@ // USER DEFINED SETTINGS -// Set driver type, fonts to be loaded, pins used and SPI control method etc +// Set driver type, fonts to be loaded, pins used and SPI control method etc. // // See the User_Setup_Select.h file if you wish to be able to define multiple // setups and then easily select which setup file is used by the compiler. diff --git a/User_Setups/Setup29_ILI9341_STM32.h b/User_Setups/Setup29_ILI9341_STM32.h index bb78e8e..61043a9 100644 --- a/User_Setups/Setup29_ILI9341_STM32.h +++ b/User_Setups/Setup29_ILI9341_STM32.h @@ -83,7 +83,7 @@ #define SMOOTH_FONT -// Nucleo-F767ZI has a ~216MHZ CPU clock, this is divided by 4, 8, 16 etc +// Nucleo-F767ZI has a ~216MHZ CPU clock, this is divided by 4, 8, 16 etc. #define SPI_FREQUENCY 27000000 // 27MHz SPI clock //#define SPI_FREQUENCY 55000000 // 55MHz is over-clocking ILI9341 but seems to work reliably! diff --git a/User_Setups/Setup29b_ILI9341_STM32.h b/User_Setups/Setup29b_ILI9341_STM32.h new file mode 100644 index 0000000..fac3846 --- /dev/null +++ b/User_Setups/Setup29b_ILI9341_STM32.h @@ -0,0 +1,141 @@ + +#define STM32 + +#define NUCLEO_64_TFT +//#define TFT_INVERSION_OFF + +#define TFT_WIDTH 240 +#define TFT_HEIGHT 320 + +#define ST7789_DRIVER +#define TFT_RGB_ORDER TFT_BGR + +#define TFT_SPI_PORT 1 // SPI 1 maximum clock rate is 55MHz +#define TFT_MOSI D11 +#define TFT_MISO D12 +#define TFT_SCLK D13 + + +// Can use Ardiuno pin references, arbitrary allocation, TFT_eSPI controls chip select +#define TFT_CS D5 // Chip select control pin to TFT CS +#define TFT_DC D6 // Data Command control pin to TFT DC (may be labelled RS = Register Select) +#define TFT_RST D7 // Reset pin to TFT RST (or RESET) + +#define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH +#define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters +#define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters +#define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm +#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:-. +#define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. +#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts + +// STM32 support for smooth fonts via program memory (FLASH) arrays +#define SMOOTH_FONT + +#define SPI_FREQUENCY 55000000 // 27MHz SPI clock +//#define SPI_FREQUENCY 55000000 // 55MHz is over-clocking ILI9341 but seems to work reliably! + +#define SPI_READ_FREQUENCY 15000000 // Reads need a slower SPI clock, probably ends up at 13.75MHz (CPU clock/16) + +// This has no effect, transactions for STM32 are automatically enabled +#define SUPPORT_TRANSACTIONS + +/* + /////////////////////////////////////////////////// + // Setup for STM32 Nucleo and ILI9341 display // + /////////////////////////////////////////////////// +#define USER_SETUP_ID 29 + +// Last update by Bodmer: 28/11/19 + +// STM32 optimised functions are not yet compatible with STM32H743 processor. +// The STM32H743 does work with the slower generic processor drivers +// +// REMINDER - Nucleo-F743ZI and Nucleo-F743ZI2 have different pin port allocations +// and require appropriate selection in IDE. ^---- Note the extra 2 in part number! + + +// Define STM32 to invoke STM32 optimised driver +#define STM32 + +// Define the TFT display driver +//#define ILI9341_DRIVER +//#define ILI9481_DRIVER +#define ST7789_DRIVER +#define TFT_RGB_ORDER TFT_BGR +// MOSI and SCK do not need to be defined, connect: +// - Arduino SCK to TFT SCK +// - Arduino MOSI to TFT SDI(may be marked SDA or MOSI) +// Typical Arduino SPI port 1 pins are (SCK=D13, MISO=D12, MOSI=D11) this is port pins PA5, PA6 and PA7 on Nucleo-F767ZI +// SPI port 2 pins are (SCK=D18, MISO=A7, MOSI=D17) this is port pins PB13, PC2 and PB15 on Nucleo-F767ZI + +//* +#define TFT_SPI_PORT 1 // SPI 1 maximum clock rate is 55MHz +#define TFT_MOSI PA7 +#define TFT_MISO PA6 +#define TFT_SCLK PA5 +//*/ + +/* +#define TFT_SPI_PORT 2 // SPI 2 maximum clock rate is 27MHz +#define TFT_MOSI D17 +#define TFT_MISO A7 +#define TFT_SCLK D18 +//*/ + +/* +#define TFT_SPI_PORT 2 // SPI 2 maximum clock rate is 27MHz +#define TFT_MOSI PB15 +#define TFT_MISO PC2 +#define TFT_SCLK PB13 +//*/ + +/* +#define TFT_SPI_PORT 2 // SPI 2 maximum clock rate is 27MHz +#define TFT_MOSI PB15 +#define TFT_MISO PB14 +#define TFT_SCLK PB13 +//*/ + +/* +// Can use Ardiuno pin references, arbitrary allocation, TFT_eSPI controls chip select +#define TFT_CS D5 // Chip select control pin to TFT CS +#define TFT_DC D6 // Data Command control pin to TFT DC (may be labelled RS = Register Select) +#define TFT_RST D7 // Reset pin to TFT RST (or RESET) + +// Alternatively, we can use STM32 port reference names PXnn +//#define TFT_CS PE11 // Nucleo-F767ZI equivalent of D5 +//#define TFT_DC PE9 // Nucleo-F767ZI equivalent of D6 +//#define TFT_RST PF13 // Nucleo-F767ZI equivalent of D7 + +//#define TFT_RST -1 // Set TFT_RST to -1 if the display RESET is connected to processor reset + // Use an Arduino pin for initial testing as connecting to processor reset + // may not work (pulse too short at power up?) + +// Chip select for XPT2046 touch controller +#define TOUCH_CS D4 + +#define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH +#define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters +#define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters +#define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm +#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:-. +#define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. +#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts + +// STM32 support for smooth fonts via program memory (FLASH) arrays +#define SMOOTH_FONT + + +// Nucleo-F767ZI has a ~216MHZ CPU clock, this is divided by 4, 8, 16 etc. + +#define SPI_FREQUENCY 27000000 // 27MHz SPI clock +//#define SPI_FREQUENCY 55000000 // 55MHz is over-clocking ILI9341 but seems to work reliably! + +#define SPI_READ_FREQUENCY 15000000 // Reads need a slower SPI clock, probably ends up at 13.75MHz (CPU clock/16) + +#define SPI_TOUCH_FREQUENCY 2500000 // Must be very slow + +// This has no effect, transactions for STM32 are automatically enabled +#define SUPPORT_TRANSACTIONS +*/ \ No newline at end of file diff --git a/User_Setups/Setup30_ILI9341_Parallel_STM32.h b/User_Setups/Setup30_ILI9341_Parallel_STM32.h index e9a4221..5b1b26d 100644 --- a/User_Setups/Setup30_ILI9341_Parallel_STM32.h +++ b/User_Setups/Setup30_ILI9341_Parallel_STM32.h @@ -14,7 +14,7 @@ #define NUCLEO_64_TFT //#define NUCLEO_144_TFT -// Tell the library to use 8 bit parallel mode (otherwise SPI is assumed) +// Tell the library to use 8-bit parallel mode (otherwise SPI is assumed) #define TFT_PARALLEL_8_BIT // Define the display driver chip type @@ -31,7 +31,7 @@ #define TFT_WR A1 // Write strobe control pin #define TFT_RD A0 // Read pin -#define TFT_D0 D8 // 8 bit parallel bus to TFT +#define TFT_D0 D8 // 8-bit parallel bus to TFT #define TFT_D1 D9 #define TFT_D2 D2 #define TFT_D3 D3 diff --git a/User_Setups/Setup31_ST7796_Parallel_STM32.h b/User_Setups/Setup31_ST7796_Parallel_STM32.h index 0063e76..0e26eaa 100644 --- a/User_Setups/Setup31_ST7796_Parallel_STM32.h +++ b/User_Setups/Setup31_ST7796_Parallel_STM32.h @@ -13,7 +13,7 @@ #define NUCLEO_64_TFT //#define NUCLEO_144_TFT -// Tell the library to use 8 bit parallel mode(otherwise SPI is assumed) +// Tell the library to use 8-bit parallel mode(otherwise SPI is assumed) #define TFT_PARALLEL_8_BIT // Define the display driver chip type @@ -30,7 +30,7 @@ #define TFT_WR A1 // Write strobe control pin #define TFT_RD A0 // Read pin -#define TFT_D0 D8 // 8 bit parallel bus to TFT +#define TFT_D0 D8 // 8-bit parallel bus to TFT #define TFT_D1 D9 #define TFT_D2 D2 #define TFT_D3 D3 diff --git a/User_Setups/Setup33_RPi_ILI9486_STM32.h b/User_Setups/Setup33_RPi_ILI9486_STM32.h index 6def91d..5a1a8c8 100644 --- a/User_Setups/Setup33_RPi_ILI9486_STM32.h +++ b/User_Setups/Setup33_RPi_ILI9486_STM32.h @@ -54,7 +54,7 @@ #define SMOOTH_FONT -// Nucleo-F767ZI has a ~216MHZ CPU clock, this is divided by 4, 8, 16 etc +// Nucleo-F767ZI has a ~216MHZ CPU clock, this is divided by 4, 8, 16 etc. #define SPI_FREQUENCY 20000000 // 27MHz SPI clock //#define SPI_FREQUENCY 55000000 // 55MHz is over-clocking ILI9341 but seems to work reliably! diff --git a/User_Setups/Setup34_ILI9481_Parallel_STM32.h b/User_Setups/Setup34_ILI9481_Parallel_STM32.h index 9585a4f..467a001 100644 --- a/User_Setups/Setup34_ILI9481_Parallel_STM32.h +++ b/User_Setups/Setup34_ILI9481_Parallel_STM32.h @@ -12,7 +12,7 @@ #define NUCLEO_64_TFT //#define NUCLEO_144_TFT -// Tell the library to use 8 bit parallel mode (otherwise SPI is assumed) +// Tell the library to use 8-bit parallel mode (otherwise SPI is assumed) #define TFT_PARALLEL_8_BIT // Define the display driver chip type @@ -29,7 +29,7 @@ #define TFT_WR A1 // Write strobe control pin #define TFT_RD A0 // Read pin -#define TFT_D0 D8 // 8 bit parallel bus to TFT +#define TFT_D0 D8 // 8-bit parallel bus to TFT #define TFT_D1 D9 #define TFT_D2 D2 #define TFT_D3 D3 diff --git a/User_Setups/Setup35_ILI9341_STM32_Port_Bus.h b/User_Setups/Setup35_ILI9341_STM32_Port_Bus.h index eadec6e..894948c 100644 --- a/User_Setups/Setup35_ILI9341_STM32_Port_Bus.h +++ b/User_Setups/Setup35_ILI9341_STM32_Port_Bus.h @@ -14,7 +14,7 @@ //#define STM_PORTC_DATA_BUS // Pins below must re re-allocated to use this option //#define STM_PORTD_DATA_BUS // Pins below must re re-allocated to use this option -// Tell the library to use 8 bit parallel mode (otherwise SPI is assumed) +// Tell the library to use 8-bit parallel mode (otherwise SPI is assumed) #define TFT_PARALLEL_8_BIT // Define ONE of the the TFT display drivers @@ -30,7 +30,7 @@ #define TFT_WR PB9 // Write strobe control pin #define TFT_RD PB1 // Read pin -#define TFT_D0 PA0 // 8 bit Port A parallel bus to TFT +#define TFT_D0 PA0 // 8-bit Port A parallel bus to TFT #define TFT_D1 PA1 #define TFT_D2 PA2 #define TFT_D3 PA3 diff --git a/User_Setups/Setup50_SSD1963_Parallel.h b/User_Setups/Setup50_SSD1963_Parallel.h index 011fbd1..d7265d7 100644 --- a/User_Setups/Setup50_SSD1963_Parallel.h +++ b/User_Setups/Setup50_SSD1963_Parallel.h @@ -1,5 +1,5 @@ // USER DEFINED SETTINGS -// Set driver type, fonts to be loaded, pins used and SPI control method etc +// Set driver type, fonts to be loaded, pins used and SPI control method etc. // // See the User_Setup_Select.h file if you wish to be able to define multiple // setups and then easily select which setup file is used by the compiler. diff --git a/User_Setups/Setup60_RP2040_ILI9341.h b/User_Setups/Setup60_RP2040_ILI9341.h index 49522e1..c795e0e 100644 --- a/User_Setups/Setup60_RP2040_ILI9341.h +++ b/User_Setups/Setup60_RP2040_ILI9341.h @@ -1,5 +1,5 @@ // USER DEFINED SETTINGS -// Set driver type, fonts to be loaded, pins used and SPI control method etc +// Set driver type, fonts to be loaded, pins used and SPI control method etc. // // See the User_Setup_Select.h file if you wish to be able to define multiple // setups and then easily select which setup file is used by the compiler. @@ -15,7 +15,7 @@ // // ################################################################################## -// Tell the library to use 8 bit parallel mode (otherwise SPI is assumed) +// Tell the library to use 8-bit parallel mode (otherwise SPI is assumed) //#define TFT_PARALLEL_8_BIT // Display type - only define if RPi display diff --git a/User_Setups/Setup60_RP2040_RPI_MHS.h b/User_Setups/Setup60_RP2040_RPI_MHS.h new file mode 100644 index 0000000..804541c --- /dev/null +++ b/User_Setups/Setup60_RP2040_RPI_MHS.h @@ -0,0 +1,29 @@ +#define USER_SETUP_ID 162 +#define ST7796_DRIVER + +#define MHS_DISPLAY_TYPE +//#define RP2040_PIO_SPI +#define TFT_MISO 16 +#define TFT_MOSI 19 +#define TFT_SCLK 18 +#define TFT_CS 17 // Chip select control pin +#define TFT_DC 20 // Data Command control pin +#define TFT_RST 21 // Reset pin (could connect to Arduino RESET pin) +//#define TFT_BL // LED back-light + +#define TOUCH_CS 22 // Chip select pin (T_CS) of touch screen + +#define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH +#define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters +#define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters +#define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm +#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:-. +#define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-. +//#define LOAD_FONT8N // Font 8. Alternative to Font 8 above, slightly narrower, so 3 digits fit a 160 pixel TFT +#define LOAD_GFXFF // FreeFonts. Include access to the 48 Adafruit_GFX free fonts FF1 to FF48 and custom fonts + +#define SMOOTH_FONT + +#define SPI_FREQUENCY 125000000 +#define SPI_READ_FREQUENCY 20000000 +#define SPI_TOUCH_FREQUENCY 2500000 \ No newline at end of file diff --git a/User_Setups/Setup62_RP2040_Nano_Connect_ILI9341.h b/User_Setups/Setup62_RP2040_Nano_Connect_ILI9341.h index 6548062..0e8a4a9 100644 --- a/User_Setups/Setup62_RP2040_Nano_Connect_ILI9341.h +++ b/User_Setups/Setup62_RP2040_Nano_Connect_ILI9341.h @@ -1,5 +1,5 @@ // USER DEFINED SETTINGS -// Set driver type, fonts to be loaded, pins used and SPI control method etc +// Set driver type, fonts to be loaded, pins used and SPI control method etc. // // See the User_Setup_Select.h file if you wish to be able to define multiple // setups and then easily select which setup file is used by the compiler. @@ -15,7 +15,7 @@ // // ################################################################################## -// Tell the library to use 8 bit parallel mode (otherwise SPI is assumed) +// Tell the library to use 8-bit parallel mode (otherwise SPI is assumed) //#define TFT_PARALLEL_8_BIT // Display type - only define if RPi display diff --git a/User_Setups/Setup70h_ESP32_S3_GC9A01.h b/User_Setups/Setup70h_ESP32_S3_GC9A01.h new file mode 100644 index 0000000..847a2ee --- /dev/null +++ b/User_Setups/Setup70h_ESP32_S3_GC9A01.h @@ -0,0 +1,31 @@ +// Setup for the ESP32 S3 with GC9A01 display +#define USER_SETUP_ID 70 + +#define GC9A01_DRIVER + +#define TFT_WIDTH 240 +#define TFT_HEIGHT 240 + // Typical board default pins - change to match your board +#define TFT_CS 10 //34 // 10 or 34 (FSPI CS0) +#define TFT_MOSI 11 //35 // 11 or 35 (FSPI D) +#define TFT_SCLK 12 //36 // 12 or 36 (FSPI CLK) +#define TFT_MISO 13 //37 // 13 or 37 (FSPI Q) + +// Use pins in range 0-31 +#define TFT_DC 7 +#define TFT_RST 6 + +#define LOAD_GLCD +#define LOAD_FONT2 +#define LOAD_FONT4 +#define LOAD_FONT6 +#define LOAD_FONT7 +#define LOAD_FONT8 +#define LOAD_GFXFF + +#define SMOOTH_FONT + +// FSPI port (SPI2) used unless following defined +#define USE_HSPI_PORT + +#define SPI_FREQUENCY 80000000 // Maximum for ILI9341 diff --git a/User_Setups/SetupX_Template.h b/User_Setups/SetupX_Template.h index 4a42c84..00bf9a5 100644 --- a/User_Setups/SetupX_Template.h +++ b/User_Setups/SetupX_Template.h @@ -1,5 +1,5 @@ // USER DEFINED SETTINGS -// Set driver type, fonts to be loaded, pins used and SPI control method etc +// Set driver type, fonts to be loaded, pins used and SPI control method etc. // // See the User_Setup_Select.h file if you wish to be able to define multiple // setups and then easily select which setup file is used by the compiler. @@ -27,15 +27,15 @@ //#define NUCLEO_64_TFT //#define NUCLEO_144_TFT -// STM32 8 bit parallel only: -// If STN32 Port A or B pins 0-7 are used for 8 bit parallel data bus bits 0-7 +// STM32 8-bit parallel only: +// If STN32 Port A or B pins 0-7 are used for 8-bit parallel data bus bits 0-7 // then this will improve rendering performance by a factor of ~8x //#define STM_PORTA_DATA_BUS //#define STM_PORTB_DATA_BUS -// Tell the library to use 8 bit parallel mode (otherwise SPI is assumed) +// Tell the library to use 8-bit parallel mode (otherwise SPI is assumed) //#define TFT_PARALLEL_8_BIT -//#define TFT_PARALLEL_16_BIT // **** 16 bit parallel ONLY with RP2040 processor **** +//#define TFT_PARALLEL_16_BIT // **** 16-bit parallel ONLY with RP2040 processor **** // Display type - only define if RPi display //#define RPI_DISPLAY_TYPE // 20MHz maximum SPI @@ -236,7 +236,7 @@ // ###### EDIT THE PINs BELOW TO SUIT YOUR ESP32 PARALLEL TFT SETUP ###### -// The library supports 8 bit parallel TFTs with the ESP32, the pin +// The library supports 8-bit parallel TFTs with the ESP32, the pin // selection below is compatible with ESP32 boards in UNO format. // Wemos D32 boards need to be modified, see diagram in Tools folder. // Only ILI9481 and ILI9341 based displays have been tested! @@ -244,7 +244,7 @@ // Parallel bus is only supported for the STM32 and ESP32 // Example below is for ESP32 Parallel interface with UNO displays -// Tell the library to use 8 bit parallel mode (otherwise SPI is assumed) +// Tell the library to use 8-bit parallel mode (otherwise SPI is assumed) //#define TFT_PARALLEL_8_BIT // The ESP32 and TFT the pins used for testing are: diff --git a/User_Setups/User_Custom_Fonts.h b/User_Setups/User_Custom_Fonts.h index f2dc3d3..004ac54 100644 --- a/User_Setups/User_Custom_Fonts.h +++ b/User_Setups/User_Custom_Fonts.h @@ -6,7 +6,7 @@ */ // Note: At the time of writing there is a last character code definition bug in the -// Squix font file format so do NOT try and print the tilda (~) symbol (ASCII 0x7E) +// Squix font file format so do NOT try and print the tilde (~) symbol (ASCII 0x7E) // Alternatively look at the end of the font header file and edit: 0x7E to read 0x7D /* e.g. vvvv (uint8_t *)Orbitron_Light_32Bitmaps,(GFXglyph *)Orbitron_Light_32Glyphs,0x20, 0x7D, 32}; @@ -16,7 +16,7 @@ // When font files are placed in the Custom folder (TFT_eSPI\Fonts\Custom) then they must // also be #included here: -// The CF_OL24 etc are a shorthand reference, but this is not essential to use the fonts +// The CF_OL24 etc. are a shorthand reference, but this is not essential to use the fonts #ifdef LOAD_GFXFF diff --git a/docs/ESP-IDF/Using ESP-IDF.txt b/docs/ESP-IDF/Using ESP-IDF.txt index 18af838..a23a651 100644 --- a/docs/ESP-IDF/Using ESP-IDF.txt +++ b/docs/ESP-IDF/Using ESP-IDF.txt @@ -30,7 +30,7 @@ Steps to use: If your board is connected choose serial port. Leave ESP-IDF component directory blank and press Choose Template. - 4. In the dropdown choose Extension and select Arduino-as-component. (This is not mandatory. + 4. In the drop-down choose Extension and select Arduino-as-component. (This is not mandatory. You can try other templates if you want). This will create a blank project with a simple main source file in the "main" folder. diff --git a/docs/PlatformIO/Configuring options.txt b/docs/PlatformIO/Configuring options.txt index c80259f..26caeac 100644 --- a/docs/PlatformIO/Configuring options.txt +++ b/docs/PlatformIO/Configuring options.txt @@ -29,7 +29,7 @@ build_flags = -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG -DUSER_SETUP_LOADED=1 - ; Define the TFT driver, pins etc here: + ; Define the TFT driver, pins etc. here: -DST7789_DRIVER=1 -DTFT_WIDTH=128 -DTFT_HEIGHT=160 diff --git a/docs/PlatformIO/rp2040.txt b/docs/PlatformIO/rp2040.txt index fc6ef3e..f4208bd 100644 --- a/docs/PlatformIO/rp2040.txt +++ b/docs/PlatformIO/rp2040.txt @@ -33,7 +33,7 @@ board_build.f_cpu = 133000000L build_flags = -Os -DUSER_SETUP_LOADED=1 - ; Define the TFT driver, pins etc here: + ; Define the TFT driver, pins etc. here: -DTFT_PARALLEL_8_BIT=1 -DRM68120_DRIVER=1 -DRP2040_PIO_CLK_DIV=1 diff --git a/examples/160 x 128/Arduino_Life/Arduino_Life.ino b/examples/160 x 128/Arduino_Life/Arduino_Life.ino index d2f52cf..e242ac9 100644 --- a/examples/160 x 128/Arduino_Life/Arduino_Life.ino +++ b/examples/160 x 128/Arduino_Life/Arduino_Life.ino @@ -44,7 +44,7 @@ void setup() { tft.fillScreen(TFT_BLACK); tft.setTextSize(1); tft.setTextColor(TFT_WHITE); - tft.setCursor(0, 0); + tft.setcursor(0, 0); } @@ -54,11 +54,11 @@ void loop() { tft.fillScreen(TFT_BLACK); tft.setTextSize(2); tft.setTextColor(TFT_WHITE); - tft.setCursor(40, 5); + tft.setcursor(40, 5); tft.println(F("Arduino")); - tft.setCursor(35, 25); + tft.setcursor(35, 25); tft.println(F("Cellular")); - tft.setCursor(35, 45); + tft.setcursor(35, 45); tft.println(F("Automata")); delay(1000); diff --git a/examples/160 x 128/TFT_Clock_Digital/TFT_Clock_Digital.ino b/examples/160 x 128/TFT_Clock_Digital/TFT_Clock_Digital.ino index 3fc35b8..522c909 100644 --- a/examples/160 x 128/TFT_Clock_Digital/TFT_Clock_Digital.ino +++ b/examples/160 x 128/TFT_Clock_Digital/TFT_Clock_Digital.ino @@ -79,7 +79,7 @@ void loop() { if (ss==0 || initial) { initial = 0; tft.setTextColor(TFT_GREEN, TFT_BLACK); - tft.setCursor (8, 52); + tft.setcursor (8, 52); tft.print(__DATE__); // This uses the standard ADAFruit small font tft.setTextColor(TFT_BLUE, TFT_BLACK); diff --git a/examples/160 x 128/TFT_Ellipse/TFT_Ellipse.ino b/examples/160 x 128/TFT_Ellipse/TFT_Ellipse.ino index 1e8b86c..f28bab9 100644 --- a/examples/160 x 128/TFT_Ellipse/TFT_Ellipse.ino +++ b/examples/160 x 128/TFT_Ellipse/TFT_Ellipse.ino @@ -20,7 +20,7 @@ void loop() { tft.fillScreen(TFT_BLACK); - // Draw some random filled elipses + // Draw some random filled ellipses for (int i = 0; i < 20; i++) { int rx = random(40); @@ -33,7 +33,7 @@ void loop() { delay(2000); tft.fillScreen(TFT_BLACK); - // Draw some random outline elipses + // Draw some random outline ellipses for (int i = 0; i < 20; i++) { int rx = random(40); diff --git a/examples/160 x 128/TFT_Meter_5/TFT_Meter_5.ino b/examples/160 x 128/TFT_Meter_5/TFT_Meter_5.ino index 1f9c8eb..0d4541a 100644 --- a/examples/160 x 128/TFT_Meter_5/TFT_Meter_5.ino +++ b/examples/160 x 128/TFT_Meter_5/TFT_Meter_5.ino @@ -73,7 +73,7 @@ void analogMeter() // Long scale tick length int tl = 15; - // Coodinates of tick to draw + // Coordinates of tick to draw float sx = cos((i - 90) * 0.0174532925); float sy = sin((i - 90) * 0.0174532925); uint16_t x0 = sx * (M_SIZE*100 + tl) + M_SIZE*120; diff --git a/examples/160 x 128/TFT_Print_Test/TFT_Print_Test.ino b/examples/160 x 128/TFT_Print_Test/TFT_Print_Test.ino index 8563c0d..927eb28 100644 --- a/examples/160 x 128/TFT_Print_Test/TFT_Print_Test.ino +++ b/examples/160 x 128/TFT_Print_Test/TFT_Print_Test.ino @@ -1,5 +1,5 @@ /* - Test the tft.print() viz embedded tft.write() function + Test the tft.print() viz. embedded tft.write() function This sketch used font 2, 4, 7 @@ -36,7 +36,7 @@ void loop() { // Set "cursor" at top left corner of display (0,0) and select font 2 // (cursor will move to next line automatically during printing with 'tft.println' // or stay on the line is there is room for the text with tft.print) - tft.setCursor(0, 0, 2); + tft.setcursor(0, 0, 2); // Set the font colour to be white with a black background, set text size multiplier to 1 tft.setTextColor(TFT_WHITE,TFT_BLACK); tft.setTextSize(1); // We can now plot text on screen using the "print" class diff --git a/examples/160 x 128/TFT_Rainbow/TFT_Rainbow.ino b/examples/160 x 128/TFT_Rainbow/TFT_Rainbow.ino index ce2bb16..3cf8858 100644 --- a/examples/160 x 128/TFT_Rainbow/TFT_Rainbow.ino +++ b/examples/160 x 128/TFT_Rainbow/TFT_Rainbow.ino @@ -90,13 +90,13 @@ void loop() { // The standard ADAFruit font still works as before tft.setTextColor(TFT_BLACK); - tft.setCursor (12, 5); + tft.setcursor (12, 5); tft.print("Original ADAfruit font!"); - // The new larger fonts do not use the .setCursor call, coords are embedded + // The new larger fonts do not use the .setcursor call, coords are embedded tft.setTextColor(TFT_BLACK, TFT_BLACK); // Do not plot the background colour - // Overlay the black text on top of the rainbow plot (the advantage of not drawing the backgorund colour!) + // Overlay the black text on top of the rainbow plot (the advantage of not drawing the background colour!) tft.drawCentreString("Font size 2", 80, 14, 2); // Draw text centre at position 80, 12 using font 2 //tft.drawCentreString("Font size 2",81,12,2); // Draw text centre at position 80, 12 using font 2 diff --git a/examples/160 x 128/TFT_flash_jpg/TFT_flash_jpg.ino b/examples/160 x 128/TFT_flash_jpg/TFT_flash_jpg.ino index 7179945..a54f92d 100644 --- a/examples/160 x 128/TFT_flash_jpg/TFT_flash_jpg.ino +++ b/examples/160 x 128/TFT_flash_jpg/TFT_flash_jpg.ino @@ -1,7 +1,7 @@ // Sketch to display images on a 160 x 128 TFT // Renders images stored in an array in program (FLASH) -// The JPEG images are stored in header files (see jpeg1.h etc) +// The JPEG images are stored in header files (see jpeg1.h etc.) // As well as the TFT_eSPI library: // https://github.com/Bodmer/TFT_eSPI @@ -95,7 +95,7 @@ void drawArrayJpeg(const uint8_t arrayname[], uint32_t array_size, int xpos, int // fit totally on the screen are cropped to the nearest MCU size and may leave right/bottom borders. void renderJPEG(int xpos, int ypos) { - // retrieve infomration about the image + // retrieve information about the image uint16_t *pImg; uint16_t mcu_w = JpegDec.MCUWidth; uint16_t mcu_h = JpegDec.MCUHeight; @@ -193,12 +193,12 @@ void jpegInfo() { // Show the execution time (optional) //#################################################################################################### // WARNING: for UNO/AVR legacy reasons printing text to the screen with the Mega might not work for -// sketch sizes greater than ~70KBytes because 16 bit address pointers are used in some libraries. +// sketch sizes greater than ~70KBytes because 16-bit address pointers are used in some libraries. // The Due will work fine with the HX8357_Due library. void showTime(uint32_t msTime) { - //tft.setCursor(0, 0); + //tft.setcursor(0, 0); //tft.setTextFont(1); //tft.setTextSize(2); //tft.setTextColor(TFT_WHITE, TFT_BLACK); diff --git a/examples/160 x 128/TFT_graphicstest_PDQ3/TFT_graphicstest_PDQ3.ino b/examples/160 x 128/TFT_graphicstest_PDQ3/TFT_graphicstest_PDQ3.ino index d159ac3..4a0668c 100644 --- a/examples/160 x 128/TFT_graphicstest_PDQ3/TFT_graphicstest_PDQ3.ino +++ b/examples/160 x 128/TFT_graphicstest_PDQ3/TFT_graphicstest_PDQ3.ino @@ -132,7 +132,7 @@ void loop(void) d = -d; } - tft.setCursor(0, 0); + tft.setcursor(0, 0); tft.setTextColor(TFT_MAGENTA); tft.println(F("Bodmer's TFT_eSPI")); @@ -343,7 +343,7 @@ uint32_t testHaD() uint32_t t = micros() - start; tft.setTextColor(TFT_YELLOW); - tft.setCursor(0, 145); + tft.setcursor(0, 145); tft.print(F(" http://hackaday.io/")); tft.print(F(" Xark")); @@ -371,7 +371,7 @@ uint32_t testFillScreen() uint32_t testText() { tft.fillScreen(TFT_BLACK); uint32_t start = micros_start(); - tft.setCursor(0, 0); + tft.setcursor(0, 0); tft.setTextColor(TFT_WHITE); tft.setTextSize(1); tft.println(F("Hello World!")); tft.setTextColor(tft.color565(0xff, 0x00, 0x00)); diff --git a/examples/160 x 128/TFT_graphicstest_small/TFT_graphicstest_small.ino b/examples/160 x 128/TFT_graphicstest_small/TFT_graphicstest_small.ino index 07e89e2..f610ac4 100644 --- a/examples/160 x 128/TFT_graphicstest_small/TFT_graphicstest_small.ino +++ b/examples/160 x 128/TFT_graphicstest_small/TFT_graphicstest_small.ino @@ -126,7 +126,7 @@ void testlines(uint16_t color) { } void testdrawtext(char *text, uint16_t color) { - tft.setCursor(0, 0); + tft.setcursor(0, 0); tft.setTextColor(color); tft.setTextWrap(true); tft.print(text); @@ -215,7 +215,7 @@ void testroundrects() { void tftPrintTest() { tft.setTextWrap(false); tft.fillScreen(TFT_BLACK); - tft.setCursor(0, 30); + tft.setcursor(0, 30); tft.setTextColor(TFT_RED); tft.setTextSize(1); tft.println("Hello World!"); @@ -229,7 +229,7 @@ void tftPrintTest() { tft.setTextSize(4); tft.print(1234.567); delay(1500); - tft.setCursor(0, 0); + tft.setcursor(0, 0); tft.fillScreen(TFT_BLACK); tft.setTextColor(TFT_WHITE); tft.setTextSize(0); diff --git a/examples/320 x 240/All_Free_Fonts_Demo/All_Free_Fonts_Demo.ino b/examples/320 x 240/All_Free_Fonts_Demo/All_Free_Fonts_Demo.ino index dbbd6d4..7bb3858 100644 --- a/examples/320 x 240/All_Free_Fonts_Demo/All_Free_Fonts_Demo.ino +++ b/examples/320 x 240/All_Free_Fonts_Demo/All_Free_Fonts_Demo.ino @@ -376,7 +376,7 @@ void loop() { } // There follows a crude way of flagging that this example sketch needs fonts which -// have not been enbabled in the User_Setup.h file inside the TFT_HX8357 library. +// have not been enabled in the User_Setup.h file inside the TFT_HX8357 library. // // These lines produce errors during compile time if settings in User_Setup are not correct // diff --git a/examples/320 x 240/Cellular_Automata/Cellular_Automata.ino b/examples/320 x 240/Cellular_Automata/Cellular_Automata.ino index a673991..c94fda2 100644 --- a/examples/320 x 240/Cellular_Automata/Cellular_Automata.ino +++ b/examples/320 x 240/Cellular_Automata/Cellular_Automata.ino @@ -38,7 +38,7 @@ void setup() { tft.fillScreen(TFT_BLACK); tft.setTextSize(1); tft.setTextColor(TFT_WHITE); - tft.setCursor(0, 0); + tft.setcursor(0, 0); } @@ -48,11 +48,11 @@ void loop() { tft.fillScreen(TFT_BLACK); tft.setTextSize(2); tft.setTextColor(TFT_WHITE); - tft.setCursor(40, 5); + tft.setcursor(40, 5); tft.println(F("Arduino")); - tft.setCursor(35, 25); + tft.setcursor(35, 25); tft.println(F("Cellular")); - tft.setCursor(35, 45); + tft.setcursor(35, 45); tft.println(F("Automata")); delay(1000); diff --git a/examples/320 x 240/Free_Font_Demo/Free_Font_Demo.ino b/examples/320 x 240/Free_Font_Demo/Free_Font_Demo.ino index 2a4c63a..0b7b13e 100644 --- a/examples/320 x 240/Free_Font_Demo/Free_Font_Demo.ino +++ b/examples/320 x 240/Free_Font_Demo/Free_Font_Demo.ino @@ -70,7 +70,7 @@ void loop() { // For comaptibility with Adafruit_GFX library the text background is not plotted when using the print class // even if we specify it. tft.setTextColor(TFT_YELLOW); - tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen + tft.setcursor(xpos, ypos); // Set cursor near top left corner of screen tft.setFreeFont(TT1); // Select the orginal small TomThumb font tft.println(); // Move cursor down a line @@ -280,7 +280,7 @@ void drawDatumMarker(int x, int y) // There follows a crude way of flagging that this example sketch needs fonts which -// have not been enbabled in the User_Setup.h file inside the TFT_HX8357 library. +// have not been enabled in the User_Setup.h file inside the TFT_HX8357 library. // // These lines produce errors during compile time if settings in User_Setup are not correct // diff --git a/examples/320 x 240/Keypad_240x320/Keypad_240x320.ino b/examples/320 x 240/Keypad_240x320/Keypad_240x320.ino index e38e6f4..2699914 100644 --- a/examples/320 x 240/Keypad_240x320/Keypad_240x320.ino +++ b/examples/320 x 240/Keypad_240x320/Keypad_240x320.ino @@ -3,8 +3,8 @@ button handling class, this sketch is based on the Arduin-o-phone example. - This example diplays a keypad where numbers can be entered and - send to the Serial Monitor window. + This example displays a keypad where numbers can be entered and + sent to the Serial Monitor window. The sketch has been tested on the ESP8266 (which supports SPIFFS) @@ -164,7 +164,7 @@ void loop(void) { // Update the number display field tft.setTextDatum(TL_DATUM); // Use top left corner as text coord datum - tft.setFreeFont(&FreeSans18pt7b); // Choose a nicefont that fits box + tft.setFreeFont(&FreeSans18pt7b); // Choose a nice font that fits box tft.setTextColor(DISP_TCOLOR); // Set the font colour // Draw the string, the value returned is the width in pixels @@ -209,7 +209,7 @@ void touch_calibrate() // check file system exists if (!SPIFFS.begin()) { - Serial.println("Formating file system"); + Serial.println("formatting file system"); SPIFFS.format(); SPIFFS.begin(); } @@ -238,7 +238,7 @@ void touch_calibrate() } else { // data not valid so recalibrate tft.fillScreen(TFT_BLACK); - tft.setCursor(20, 0); + tft.setcursor(20, 0); tft.setTextFont(2); tft.setTextSize(1); tft.setTextColor(TFT_WHITE, TFT_BLACK); @@ -272,7 +272,7 @@ void touch_calibrate() // Print something in the mini status bar void status(const char *msg) { tft.setTextPadding(240); - //tft.setCursor(STATUS_X, STATUS_Y); + //tft.setcursor(STATUS_X, STATUS_Y); tft.setTextColor(TFT_WHITE, TFT_DARKGREY); tft.setTextFont(0); tft.setTextDatum(TC_DATUM); diff --git a/examples/320 x 240/Read_ID_bitbash/Read_ID_bitbash.ino b/examples/320 x 240/Read_ID_bitbash/Read_ID_bitbash.ino index 599d354..51f4ea2 100644 --- a/examples/320 x 240/Read_ID_bitbash/Read_ID_bitbash.ino +++ b/examples/320 x 240/Read_ID_bitbash/Read_ID_bitbash.ino @@ -11,7 +11,7 @@ // Change the pin settings to suit your hardware -// UNO etc +// UNO etc. //#define TFT_MOSI 11 //#define TFT_SCK 13 //#define TFT_CS 9 @@ -116,7 +116,7 @@ void setup() { uint32_t ID = 0; Serial.begin(115200); - delay(4000); // Delay to allow USB to connect to a Leonardo etc + delay(4000); // Delay to allow USB to connect to a Leonardo etc. Serial.println("TFT driver register values:"); Serial.println("==========================="); diff --git a/examples/320 x 240/TFT_ArcFill/TFT_ArcFill.ino b/examples/320 x 240/TFT_ArcFill/TFT_ArcFill.ino index 4ad06ca..cfeeab0 100644 --- a/examples/320 x 240/TFT_ArcFill/TFT_ArcFill.ino +++ b/examples/320 x 240/TFT_ArcFill/TFT_ArcFill.ino @@ -11,7 +11,7 @@ TFT_eSPI tft = TFT_eSPI(); // Invoke custom library byte inc = 0; unsigned int col = 0; -byte red = 31; // Red is the top 5 bits of a 16 bit colour value +byte red = 31; // Red is the top 5 bits of a 16-bit colour value byte green = 0;// Green is the middle 6 bits byte blue = 0; // Blue is the bottom 5 bits byte state = 0; @@ -56,7 +56,7 @@ void loop() { // rx = x axis outer radius // ry = y axis outer radius // w = width (thickness) of arc in pixels -// colour = 16 bit colour value +// colour = 16-bit colour value // Note if rx and ry are the same then an arc of a circle is drawn void fillArc(int x, int y, int start_angle, int seg_count, int rx, int ry, int w, unsigned int colour) @@ -87,7 +87,7 @@ void fillArc(int x, int y, int start_angle, int seg_count, int rx, int ry, int w tft.fillTriangle(x0, y0, x1, y1, x2, y2, colour); tft.fillTriangle(x1, y1, x2, y2, x3, y3, colour); - // Copy segment end to sgement start for next segment + // Copy segment end to segment start for next segment x0 = x2; y0 = y2; x1 = x3; @@ -96,7 +96,7 @@ void fillArc(int x, int y, int start_angle, int seg_count, int rx, int ry, int w } // ######################################################################### -// Return the 16 bit colour with brightness 0-100% +// Return the 16-bit colour with brightness 0-100% // ######################################################################### unsigned int brightness(unsigned int colour, int brightness) { @@ -112,7 +112,7 @@ unsigned int brightness(unsigned int colour, int brightness) } // ######################################################################### -// Return a 16 bit rainbow colour +// Return a 16-bit rainbow colour // ######################################################################### unsigned int rainbow(byte value) { diff --git a/examples/320 x 240/TFT_Custom_Fonts/TFT_Custom_Fonts.ino b/examples/320 x 240/TFT_Custom_Fonts/TFT_Custom_Fonts.ino index 6485e75..b605123 100644 --- a/examples/320 x 240/TFT_Custom_Fonts/TFT_Custom_Fonts.ino +++ b/examples/320 x 240/TFT_Custom_Fonts/TFT_Custom_Fonts.ino @@ -19,7 +19,7 @@ ######################################################################### */ -// Note the the tilda symbol ~ does not exist in some fonts at the moment +// Note the the tilde symbol ~ does not exist in some fonts at the moment #define TEXT "abc MWy 123 |" // Text that will be printed on screen in any font #include "SPI.h" diff --git a/examples/320 x 240/TFT_FillArcSpiral/TFT_FillArcSpiral.ino b/examples/320 x 240/TFT_FillArcSpiral/TFT_FillArcSpiral.ino index 83b8f60..9ea0d7c 100644 --- a/examples/320 x 240/TFT_FillArcSpiral/TFT_FillArcSpiral.ino +++ b/examples/320 x 240/TFT_FillArcSpiral/TFT_FillArcSpiral.ino @@ -13,7 +13,7 @@ int segment = 0; unsigned int col = 0; int delta = -1; - byte red = 31; // Red is the top 5 bits of a 16 bit colour value + byte red = 31; // Red is the top 5 bits of a 16-bit colour value byte green = 0;// Green is the middle 6 bits byte blue = 0; // Blue is the bottom 5 bits byte state = 0; @@ -48,7 +48,7 @@ void loop() { // rx = x axis radius // yx = y axis radius // w = width (thickness) of arc in pixels -// colour = 16 bit colour value +// colour = 16-bit colour value // Note if rx and ry are the same an arc of a circle is drawn void fillArc(int x, int y, int start_angle, int seg_count, int rx, int ry, int w, unsigned int colour) @@ -82,7 +82,7 @@ void fillArc(int x, int y, int start_angle, int seg_count, int rx, int ry, int w } // ######################################################################### -// Return a 16 bit colour with brightness 0 - 100% +// Return a 16-bit colour with brightness 0 - 100% // ######################################################################### unsigned int brightness(unsigned int colour, int brightness) { @@ -98,7 +98,7 @@ unsigned int brightness(unsigned int colour, int brightness) } // ######################################################################### -// Return a 16 bit rainbow colour +// Return a 16-bit rainbow colour // ######################################################################### unsigned int rainbow(byte value) { diff --git a/examples/320 x 240/TFT_Mandlebrot/TFT_Mandlebrot.ino b/examples/320 x 240/TFT_Mandlebrot/TFT_Mandlebrot.ino index 2a04556..c491192 100644 --- a/examples/320 x 240/TFT_Mandlebrot/TFT_Mandlebrot.ino +++ b/examples/320 x 240/TFT_Mandlebrot/TFT_Mandlebrot.ino @@ -62,7 +62,7 @@ unsigned int rainbow(int value) // Value is expected to be in range 0-127 // The value is converted to a spectrum colour from 0 = blue through to red = blue - byte red = 0; // Red is the top 5 bits of a 16 bit colour value + byte red = 0; // Red is the top 5 bits of a 16-bit colour value byte green = 0;// Green is the middle 6 bits byte blue = 0; // Blue is the bottom 5 bits diff --git a/examples/320 x 240/TFT_Meter_linear/TFT_Meter_linear.ino b/examples/320 x 240/TFT_Meter_linear/TFT_Meter_linear.ino index 9d62485..aa9521d 100644 --- a/examples/320 x 240/TFT_Meter_linear/TFT_Meter_linear.ino +++ b/examples/320 x 240/TFT_Meter_linear/TFT_Meter_linear.ino @@ -47,7 +47,7 @@ void setup(void) { void loop() { if (updateTime <= millis()) { - updateTime = millis() + 35; // Update emter every 35 milliseconds + updateTime = millis() + 35; // Update meter every 35 milliseconds // Create a Sine wave for testing d += 4; if (d >= 360) d = 0; @@ -75,7 +75,7 @@ void analogMeter() // Long scale tick length int tl = 15; - // Coodinates of tick to draw + // Coordinates of tick to draw float sx = cos((i - 90) * 0.0174532925); float sy = sin((i - 90) * 0.0174532925); uint16_t x0 = sx * (M_SIZE*100 + tl) + M_SIZE*120; @@ -175,7 +175,7 @@ void plotNeedle(int value, byte ms_delay) if (ms_delay == 0) old_analog = value; // Update immediately if delay is 0 float sdeg = map(old_analog, -10, 110, -150, -30); // Map value to angle - // Calcualte tip of needle coords + // Calculate tip of needle coords float sx = cos(sdeg * 0.0174532925); float sy = sin(sdeg * 0.0174532925); diff --git a/examples/320 x 240/TFT_Meters/TFT_Meters.ino b/examples/320 x 240/TFT_Meters/TFT_Meters.ino index 419b1f5..094f476 100644 --- a/examples/320 x 240/TFT_Meters/TFT_Meters.ino +++ b/examples/320 x 240/TFT_Meters/TFT_Meters.ino @@ -95,7 +95,7 @@ void analogMeter() // Long scale tick length int tl = 15; - // Coodinates of tick to draw + // Coordinates of tick to draw float sx = cos((i - 90) * 0.0174532925); float sy = sin((i - 90) * 0.0174532925); uint16_t x0 = sx * (100 + tl) + 120; @@ -195,7 +195,7 @@ void plotNeedle(int value, byte ms_delay) if (ms_delay == 0) old_analog = value; // Update immediately id delay is 0 float sdeg = map(old_analog, -10, 110, -150, -30); // Map value to angle - // Calcualte tip of needle coords + // Calculate tip of needle coords float sx = cos(sdeg * 0.0174532925); float sy = sin(sdeg * 0.0174532925); diff --git a/examples/320 x 240/TFT_Pie_Chart/TFT_Pie_Chart.ino b/examples/320 x 240/TFT_Pie_Chart/TFT_Pie_Chart.ino index b239049..cd4fdb2 100644 --- a/examples/320 x 240/TFT_Pie_Chart/TFT_Pie_Chart.ino +++ b/examples/320 x 240/TFT_Pie_Chart/TFT_Pie_Chart.ino @@ -44,7 +44,7 @@ void loop() { // start_angle = 0 - 359 // sub_angle = 0 - 360 = subtended angle // r = radius -// colour = 16 bit colour value +// colour = 16-bit colour value int fillSegment(int x, int y, int start_angle, int sub_angle, int r, unsigned int colour) { @@ -63,7 +63,7 @@ int fillSegment(int x, int y, int start_angle, int sub_angle, int r, unsigned in tft.fillTriangle(x1, y1, x2, y2, x, y, colour); - // Copy segment end to sgement start for next segment + // Copy segment end to segment start for next segment x1 = x2; y1 = y2; } @@ -71,7 +71,7 @@ int fillSegment(int x, int y, int start_angle, int sub_angle, int r, unsigned in // ######################################################################### -// Return the 16 bit colour with brightness 0-100% +// Return the 16-bit colour with brightness 0-100% // ######################################################################### unsigned int brightness(unsigned int colour, int brightness) { diff --git a/examples/320 x 240/TFT_Print_Test/TFT_Print_Test.ino b/examples/320 x 240/TFT_Print_Test/TFT_Print_Test.ino index 9caecbb..6897ab6 100644 --- a/examples/320 x 240/TFT_Print_Test/TFT_Print_Test.ino +++ b/examples/320 x 240/TFT_Print_Test/TFT_Print_Test.ino @@ -1,5 +1,5 @@ /* - Test the tft.print() viz embedded tft.write() function + Test the tft.print() viz. embedded tft.write() function This sketch used font 2, 4, 7 @@ -34,7 +34,7 @@ void loop() { // Set "cursor" at top left corner of display (0,0) and select font 2 // (cursor will move to next line automatically during printing with 'tft.println' // or stay on the line is there is room for the text with tft.print) - tft.setCursor(0, 0, 2); + tft.setcursor(0, 0, 2); // Set the font colour to be white with a black background, set text size multiplier to 1 tft.setTextColor(TFT_WHITE,TFT_BLACK); tft.setTextSize(1); // We can now plot text on screen using the "print" class diff --git a/examples/320 x 240/TFT_Rainbow_one_lib/TFT_Rainbow_one_lib.ino b/examples/320 x 240/TFT_Rainbow_one_lib/TFT_Rainbow_one_lib.ino index 88180fd..2234bfc 100644 --- a/examples/320 x 240/TFT_Rainbow_one_lib/TFT_Rainbow_one_lib.ino +++ b/examples/320 x 240/TFT_Rainbow_one_lib/TFT_Rainbow_one_lib.ino @@ -45,15 +45,15 @@ void loop() { // The standard AdaFruit font still works as before tft.setTextColor(TFT_BLACK); // Background is not defined so it is transparent - tft.setCursor (60, 5); + tft.setcursor (60, 5); tft.setTextFont(0); // Select font 0 which is the Adafruit font tft.print("Original Adafruit font!"); //tft.drawString("Original Adafruit font!",60,5,1); - // The new larger fonts do not need to use the .setCursor call, coords are embedded + // The new larger fonts do not need to use the .setcursor call, coords are embedded tft.setTextColor(TFT_BLACK); // Do not plot the background colour - // Overlay the black text on top of the rainbow plot (the advantage of not drawing the backgorund colour!) + // Overlay the black text on top of the rainbow plot (the advantage of not drawing the background colour!) tft.drawCentreString("Font size 2", 120, 14, 2); // Draw text centre at position 120, 14 using font 2 tft.drawCentreString("Font size 4", 120, 30, 4); // Draw text centre at position 120, 30 using font 4 tft.drawCentreString("12.34", 120, 54, 6); // Draw text centre at position 120, 54 using font 6 @@ -74,15 +74,15 @@ void loop() { tft.setTextColor(TFT_BLACK); // Set text colour to black, no background (so transparent) - tft.setCursor(36, 150, 4); // Set cursor to x = 36, y = 150 and use font 4 + tft.setcursor(36, 150, 4); // Set cursor to x = 36, y = 150 and use font 4 tft.println("Transparent..."); // As we use println, the cursor moves to the next line - tft.setCursor(30, 175); // Set cursor to x = 30, y = 175 + tft.setcursor(30, 175); // Set cursor to x = 30, y = 175 tft.setTextColor(TFT_WHITE, TFT_BLACK); // Set text colour to white and background to black tft.println("White on black"); tft.setTextFont(4); // Select font 4 without moving cursor - tft.setCursor(50, 210); // Set cursor to x = 50, y = 210 without changing the font + tft.setcursor(50, 210); // Set cursor to x = 50, y = 210 without changing the font tft.setTextColor(TFT_WHITE); // By using #TFT print we can use all the formatting features like printing HEX tft.print(57005, HEX); // Cursor does no move to next line @@ -98,7 +98,7 @@ void loop() { // Fill screen with a rainbow pattern void rainbow_fill() { - // The colours and state are not initialised so the start colour changes each time the funtion is called + // The colours and state are not initialised so the start colour changes each time the function is called for (int i = 319; i > 0; i--) { // Draw a vertical line 1 pixel wide in the selected colour diff --git a/examples/320 x 240/TFT_Read_Reg/TFT_Read_Reg.ino b/examples/320 x 240/TFT_Read_Reg/TFT_Read_Reg.ino index d622e44..bc82974 100644 --- a/examples/320 x 240/TFT_Read_Reg/TFT_Read_Reg.ino +++ b/examples/320 x 240/TFT_Read_Reg/TFT_Read_Reg.ino @@ -38,7 +38,7 @@ void setup(void) { void loop() { tft.fillScreen(TFT_BLUE); - tft.setCursor(0, 0, 2); + tft.setcursor(0, 0, 2); // Set the font colour to be white with a black background tft.setTextColor(TFT_WHITE, TFT_BLACK); // We can now plot text on screen using the "print" class @@ -56,7 +56,7 @@ void loop() { printSubset(); // Print a useful subset of the readable registers - readTest(); // Test 8, 16 and 32 bit reads and index on the ID register + readTest(); // Test 8, 16 and 32-bit reads and index on the ID register //printRange32(0x00, 0xFF); // Print a range of registers (32 bits, index = 0) @@ -70,8 +70,8 @@ void loop() { void readTest(void) { - Serial.println(); Serial.println("Test 8, 16 and 32 bit reads and the index..."); - // Test 8, 16 and 32 bit reads and index + Serial.println(); Serial.println("Test 8, 16 and 32-bit reads and the index..."); + // Test 8, 16 and 32-bit reads and index // Note at index 0 the register values are typically undefined (Bxxxxxxxx) Serial.println(tft.readcommand8(ILI9341_RDID4, 2), HEX); Serial.println(tft.readcommand16(ILI9341_RDID4, 2), HEX); diff --git a/examples/320 x 240/TFT_Spiro/TFT_Spiro.ino b/examples/320 x 240/TFT_Spiro/TFT_Spiro.ino index 3e7f8d7..fddf0af 100644 --- a/examples/320 x 240/TFT_Spiro/TFT_Spiro.ino +++ b/examples/320 x 240/TFT_Spiro/TFT_Spiro.ino @@ -1,5 +1,5 @@ // Spiro -// Rainbow patern generator +// Rainbow pattern generator #include // Hardware-specific library #include @@ -67,7 +67,7 @@ unsigned int rainbow(int value) // Value is expected to be in range 0-127 // The value is converted to a spectrum colour from 0 = blue through to red = blue //int value = random (128); - byte red = 0; // Red is the top 5 bits of a 16 bit colour value + byte red = 0; // Red is the top 5 bits of a 16-bit colour value byte green = 0;// Green is the middle 6 bits byte blue = 0; // Blue is the bottom 5 bits diff --git a/examples/320 x 240/TFT_Starfield/TFT_Starfield.ino b/examples/320 x 240/TFT_Starfield/TFT_Starfield.ino index 1e72197..f8891f2 100644 --- a/examples/320 x 240/TFT_Starfield/TFT_Starfield.ino +++ b/examples/320 x 240/TFT_Starfield/TFT_Starfield.ino @@ -59,7 +59,7 @@ void loop() int old_screen_x = ((int)sx[i] - 160) * 256 / sz[i] + 160; int old_screen_y = ((int)sy[i] - 120) * 256 / sz[i] + 120; - // This is a faster pixel drawing function for occassions where many single pixels must be drawn + // This is a faster pixel drawing function for occasions where many single pixels must be drawn tft.drawPixel(old_screen_x, old_screen_y,TFT_BLACK); sz[i] -= 2; @@ -82,7 +82,7 @@ void loop() unsigned long t1 = micros(); //static char timeMicros[8] = {}; - // Calcualte frames per second + // Calculate frames per second Serial.println(1.0/((t1 - t0)/1000000.0)); } diff --git a/examples/320 x 240/TFT_Terminal/TFT_Terminal.ino b/examples/320 x 240/TFT_Terminal/TFT_Terminal.ino index 27fb4f1..bd6b69e 100644 --- a/examples/320 x 240/TFT_Terminal/TFT_Terminal.ino +++ b/examples/320 x 240/TFT_Terminal/TFT_Terminal.ino @@ -7,7 +7,7 @@ Connect GND to target board GND Connect RX line to TX line of target board Make sure the target and terminal have the same baud rate - and serial stettings! + and serial settings! The sketch works with the ILI9341 TFT 240x320 display and the called up libraries. diff --git a/examples/320 x 240/TFT_graphicstest_PDQ/TFT_graphicstest_PDQ.ino b/examples/320 x 240/TFT_graphicstest_PDQ/TFT_graphicstest_PDQ.ino index 2d2ce8a..9e62eed 100644 --- a/examples/320 x 240/TFT_graphicstest_PDQ/TFT_graphicstest_PDQ.ino +++ b/examples/320 x 240/TFT_graphicstest_PDQ/TFT_graphicstest_PDQ.ino @@ -117,7 +117,7 @@ void loop(void) d = -d; } - tft.setCursor(0, 0); + tft.setcursor(0, 0); tft.setTextColor(TFT_MAGENTA); tft.setTextSize(2); @@ -362,9 +362,9 @@ uint32_t testHaD() tft.setTextColor(TFT_YELLOW); tft.setTextSize(2); - tft.setCursor(8, 285); + tft.setcursor(8, 285); tft.print(F("http://hackaday.io/")); - tft.setCursor(96, 302); + tft.setcursor(96, 302); tft.print(F("Xark")); delay(3 * 1000L); @@ -389,7 +389,7 @@ uint32_t testText() { tft.fillScreen(TFT_BLACK); uint32_t start = micros_start(); - tft.setCursor(0, 0); + tft.setcursor(0, 0); tft.setTextColor(TFT_WHITE,TFT_BLACK); tft.setTextSize(1); tft.println(F("Hello World!")); tft.setTextSize(2); diff --git a/examples/320 x 240/TFT_graphicstest_one_lib/TFT_graphicstest_one_lib.ino b/examples/320 x 240/TFT_graphicstest_one_lib/TFT_graphicstest_one_lib.ino index 4651567..6dcd293 100644 --- a/examples/320 x 240/TFT_graphicstest_one_lib/TFT_graphicstest_one_lib.ino +++ b/examples/320 x 240/TFT_graphicstest_one_lib/TFT_graphicstest_one_lib.ino @@ -121,7 +121,7 @@ unsigned long testFillScreen() { unsigned long testText() { tft.fillScreen(TFT_BLACK); unsigned long start = micros(); - tft.setCursor(0, 0); + tft.setcursor(0, 0); tft.setTextColor(TFT_WHITE); tft.setTextSize(1); tft.println("Hello World!"); tft.setTextColor(TFT_YELLOW); tft.setTextSize(2); diff --git a/examples/480 x 320/Cellular_Automata/Cellular_Automata.ino b/examples/480 x 320/Cellular_Automata/Cellular_Automata.ino index e1867e6..ebada5b 100644 --- a/examples/480 x 320/Cellular_Automata/Cellular_Automata.ino +++ b/examples/480 x 320/Cellular_Automata/Cellular_Automata.ino @@ -38,7 +38,7 @@ void setup() { tft.fillScreen(TFT_BLACK); tft.setTextSize(1); tft.setTextColor(TFT_WHITE); - tft.setCursor(0, 0); + tft.setcursor(0, 0); } @@ -48,11 +48,11 @@ void loop() { tft.fillScreen(TFT_BLACK); tft.setTextSize(2); tft.setTextColor(TFT_WHITE); - tft.setCursor(40, 5); + tft.setcursor(40, 5); tft.println(F("Arduino")); - tft.setCursor(35, 25); + tft.setcursor(35, 25); tft.println(F("Cellular")); - tft.setCursor(35, 45); + tft.setcursor(35, 45); tft.println(F("Automata")); delay(1000); diff --git a/examples/480 x 320/Free_Font_Demo/Free_Font_Demo.ino b/examples/480 x 320/Free_Font_Demo/Free_Font_Demo.ino index 50c09c1..805294b 100644 --- a/examples/480 x 320/Free_Font_Demo/Free_Font_Demo.ino +++ b/examples/480 x 320/Free_Font_Demo/Free_Font_Demo.ino @@ -56,7 +56,7 @@ void loop() { // For comaptibility with Adafruit_GFX library the text background is not plotted when using the print class // even if we specify it. tft.setTextColor(TFT_YELLOW, TFT_BLACK); - tft.setCursor(xpos, ypos); // Set cursor near top left corner of screen + tft.setcursor(xpos, ypos); // Set cursor near top left corner of screen tft.setTextFont(GLCD); // Select the orginal small GLCD font by using NULL or GLCD tft.println(); // Move cursor down a line @@ -249,7 +249,7 @@ void drawDatum(int x, int y) // There follows a crude way of flagging that this example sketch needs fonts which -// have not been enbabled in the User_Setup.h file inside the TFT_HX8357 library. +// have not been enabled in the User_Setup.h file inside the TFT_HX8357 library. // // These lines produce errors during compile time if settings in User_Setup are not correct // diff --git a/examples/480 x 320/Keypad_480x320/Keypad_480x320.ino b/examples/480 x 320/Keypad_480x320/Keypad_480x320.ino index 9614d6a..4e4bfa2 100644 --- a/examples/480 x 320/Keypad_480x320/Keypad_480x320.ino +++ b/examples/480 x 320/Keypad_480x320/Keypad_480x320.ino @@ -3,8 +3,8 @@ button handling class, this sketch is based on the Arduin-o-phone example. - This example diplays a keypad where numbers can be entered and - send to the Serial Monitor window. + This example displays a keypad where numbers can be entered and + sent to the Serial Monitor window. The sketch has been tested on the ESP8266 (which supports SPIFFS) @@ -167,7 +167,7 @@ void loop(void) { // Update the number display field tft.setTextDatum(TL_DATUM); // Use top left corner as text coord datum - tft.setFreeFont(&FreeSans18pt7b); // Choose a nicefont that fits box + tft.setFreeFont(&FreeSans18pt7b); // Choose a nice font that fits box tft.setTextColor(DISP_TCOLOR); // Set the font colour // Draw the string, the value returned is the width in pixels @@ -212,7 +212,7 @@ void touch_calibrate() // check file system exists if (!SPIFFS.begin()) { - Serial.println("Formating file system"); + Serial.println("formatting file system"); SPIFFS.format(); SPIFFS.begin(); } @@ -241,7 +241,7 @@ void touch_calibrate() } else { // data not valid so recalibrate tft.fillScreen(TFT_BLACK); - tft.setCursor(20, 0); + tft.setcursor(20, 0); tft.setTextFont(2); tft.setTextSize(1); tft.setTextColor(TFT_WHITE, TFT_BLACK); @@ -275,7 +275,7 @@ void touch_calibrate() // Print something in the mini status bar void status(const char *msg) { tft.setTextPadding(240); - //tft.setCursor(STATUS_X, STATUS_Y); + //tft.setcursor(STATUS_X, STATUS_Y); tft.setTextColor(TFT_WHITE, TFT_DARKGREY); tft.setTextFont(0); tft.setTextDatum(TC_DATUM); diff --git a/examples/480 x 320/TFT_Meter_4/TFT_Meter_4.ino b/examples/480 x 320/TFT_Meter_4/TFT_Meter_4.ino index 11d00d2..77a82cb 100644 --- a/examples/480 x 320/TFT_Meter_4/TFT_Meter_4.ino +++ b/examples/480 x 320/TFT_Meter_4/TFT_Meter_4.ino @@ -49,7 +49,7 @@ void setup(void) { void loop() { if (updateTime <= millis()) { - updateTime = millis() + 35; // Update emter every 35 milliseconds + updateTime = millis() + 35; // Update meter every 35 milliseconds // Create a Sine wave for testing d += 4; if (d >= 360) d = 0; @@ -77,7 +77,7 @@ void analogMeter() // Long scale tick length int tl = 15; - // Coodinates of tick to draw + // Coordinates of tick to draw float sx = cos((i - 90) * 0.0174532925); float sy = sin((i - 90) * 0.0174532925); uint16_t x0 = sx * (M_SIZE*100 + tl) + M_SIZE*120; @@ -177,7 +177,7 @@ void plotNeedle(int value, byte ms_delay) if (ms_delay == 0) old_analog = value; // Update immediately if delay is 0 float sdeg = map(old_analog, -10, 110, -150, -30); // Map value to angle - // Calcualte tip of needle coords + // Calculate tip of needle coords float sx = cos(sdeg * 0.0174532925); float sy = sin(sdeg * 0.0174532925); diff --git a/examples/480 x 320/TFT_Meters/TFT_Meters.ino b/examples/480 x 320/TFT_Meters/TFT_Meters.ino index 339fc32..007e954 100644 --- a/examples/480 x 320/TFT_Meters/TFT_Meters.ino +++ b/examples/480 x 320/TFT_Meters/TFT_Meters.ino @@ -97,7 +97,7 @@ void analogMeter() // Long scale tick length int tl = 15; - // Coodinates of tick to draw + // Coordinates of tick to draw float sx = cos((i - 90) * 0.0174532925); float sy = sin((i - 90) * 0.0174532925); uint16_t x0 = sx * (100 + tl) + 120; @@ -197,7 +197,7 @@ void plotNeedle(int value, byte ms_delay) if (ms_delay == 0) old_analog = value; // Update immediately id delay is 0 float sdeg = map(old_analog, -10, 110, -150, -30); // Map value to angle - // Calcualte tip of needle coords + // Calculate tip of needle coords float sx = cos(sdeg * 0.0174532925); float sy = sin(sdeg * 0.0174532925); diff --git a/examples/480 x 320/TFT_Print_Test/TFT_Print_Test.ino b/examples/480 x 320/TFT_Print_Test/TFT_Print_Test.ino index 14f75b3..0434982 100644 --- a/examples/480 x 320/TFT_Print_Test/TFT_Print_Test.ino +++ b/examples/480 x 320/TFT_Print_Test/TFT_Print_Test.ino @@ -1,5 +1,5 @@ /* - Test the tft.print() viz the libraries embedded write() function + Test the tft.print() viz. the libraries embedded write() function This sketch used font 2, 4, 7 @@ -34,7 +34,7 @@ void loop() { // Set "cursor" at top left corner of display (0,0) and select font 2 // (cursor will move to next line automatically during printing with 'tft.println' // or stay on the line is there is room for the text with tft.print) - tft.setCursor(0, 0, 2); + tft.setcursor(0, 0, 2); // Set the font colour to be white with a black background, set text size multiplier to 1 tft.setTextColor(TFT_WHITE,TFT_BLACK); tft.setTextSize(1); // We can now plot text on screen using the "print" class diff --git a/examples/480 x 320/TFT_Rainbow480/TFT_Rainbow480.ino b/examples/480 x 320/TFT_Rainbow480/TFT_Rainbow480.ino index a2e1aa1..6ab9a02 100644 --- a/examples/480 x 320/TFT_Rainbow480/TFT_Rainbow480.ino +++ b/examples/480 x 320/TFT_Rainbow480/TFT_Rainbow480.ino @@ -44,13 +44,13 @@ void loop() { // The standard AdaFruit font still works as before tft.setTextColor(TFT_BLACK); // Background is not defined so it is transparent - tft.setCursor (100, 5); + tft.setcursor (100, 5); tft.setTextFont(1); // Select font 1 which is the Adafruit GLCD font tft.print("Original Adafruit font!"); - // The new larger fonts do not need to use the .setCursor call, coords are embedded + // The new larger fonts do not need to use the .setcursor call, coords are embedded tft.setTextColor(TFT_BLACK); // Do not plot the background colour - // Overlay the black text on top of the rainbow plot (the advantage of not drawing the backgorund colour!) + // Overlay the black text on top of the rainbow plot (the advantage of not drawing the background colour!) tft.drawCentreString("Font size 2", 160, 14, 2); // Draw text centre at position 120, 14 using font 2 tft.drawCentreString("Font size 4", 160, 30, 4); // Draw text centre at position 120, 30 using font 4 tft.drawCentreString("12.34", 160, 54, 6); // Draw text centre at position 120, 54 using font 6 @@ -69,15 +69,15 @@ void loop() { tft.setTextSize(1); // We are using a text size multiplier of 1 tft.setTextColor(TFT_BLACK); // Set text colour to black, no background (so transparent) - tft.setCursor(76, 150, 4); // Set cursor to x = 76, y = 150 and use font 4 + tft.setcursor(76, 150, 4); // Set cursor to x = 76, y = 150 and use font 4 tft.println("Transparent..."); // As we use println, the cursor moves to the next line - tft.setCursor(70, 175); // Set cursor to x = 70, y = 175 + tft.setcursor(70, 175); // Set cursor to x = 70, y = 175 tft.setTextColor(TFT_WHITE, TFT_BLACK); // Set text colour to white and background to black tft.println("White on black"); tft.setTextFont(4); // Select font 4 without moving cursor - tft.setCursor(00, 210); // Set cursor to x = 90, y = 210 without changing the font + tft.setcursor(00, 210); // Set cursor to x = 90, y = 210 without changing the font tft.setTextColor(TFT_WHITE); // By using the print class we can use all the formatting features like printing HEX @@ -100,7 +100,7 @@ void loop() { // Fill screen with a rainbow pattern void rainbow_fill() { - // The colours and state are not initialised so the start colour changes each time the funtion is called + // The colours and state are not initialised so the start colour changes each time the function is called for (int i = 479; i > 0; i--) { // Draw a vertical line 1 pixel wide in the selected colour diff --git a/examples/480 x 320/TFT_flash_jpg/TFT_flash_jpg.ino b/examples/480 x 320/TFT_flash_jpg/TFT_flash_jpg.ino index f8ebcb1..97c21b4 100644 --- a/examples/480 x 320/TFT_flash_jpg/TFT_flash_jpg.ino +++ b/examples/480 x 320/TFT_flash_jpg/TFT_flash_jpg.ino @@ -1,8 +1,8 @@ // Sketch to display images on a 480 x 320 ILI9486 Raspberry Pi 3.5" TFT (Waveshare design) -// which has a 16 bit serial interface based on 74HC04, 74HC4040 and 2 x 74HC4094 logic chips +// which has a 16-bit serial interface based on 74HC04, 74HC4040 and 2 x 74HC4094 logic chips // Renders images stored in an array in program (FLASH)JPEG images are stored in header files -// (see jpeg1.h etc) +// (see jpeg1.h etc.) // The sketch does not need the SD or sdFat libraries since it does not access an SD Card. @@ -108,7 +108,7 @@ void drawArrayJpeg(const uint8_t arrayname[], uint32_t array_size, int xpos, int // fit totally on the screen are cropped to the nearest MCU size and may leave right/bottom borders. void renderJPEG(int xpos, int ypos) { - // retrieve infomration about the image + // retrieve information about the image uint16_t *pImg; uint16_t mcu_w = JpegDec.MCUWidth; uint16_t mcu_h = JpegDec.MCUHeight; @@ -222,12 +222,12 @@ void jpegInfo() { // Show the execution time (optional) //#################################################################################################### // WARNING: for UNO/AVR legacy reasons printing text to the screen with the Mega might not work for -// sketch sizes greater than ~70KBytes because 16 bit address pointers are used in some libraries. +// sketch sizes greater than ~70KBytes because 16-bit address pointers are used in some libraries. // The Due will work fine with the HX8357_Due library. void showTime(uint32_t msTime) { - //tft.setCursor(0, 0); + //tft.setcursor(0, 0); //tft.setTextFont(1); //tft.setTextSize(2); //tft.setTextColor(TFT_WHITE, TFT_BLACK); diff --git a/examples/480 x 320/TFT_graphicstest_one_lib/TFT_graphicstest_one_lib.ino b/examples/480 x 320/TFT_graphicstest_one_lib/TFT_graphicstest_one_lib.ino index a777f4f..0f4dbdd 100644 --- a/examples/480 x 320/TFT_graphicstest_one_lib/TFT_graphicstest_one_lib.ino +++ b/examples/480 x 320/TFT_graphicstest_one_lib/TFT_graphicstest_one_lib.ino @@ -121,7 +121,7 @@ unsigned long testFillScreen() { unsigned long testText() { tft.fillScreen(TFT_BLACK); unsigned long start = micros(); - tft.setCursor(0, 0); + tft.setcursor(0, 0); tft.setTextColor(TFT_WHITE); tft.setTextSize(1); tft.println("Hello World!"); tft.setTextColor(TFT_YELLOW); tft.setTextSize(2); diff --git a/examples/480 x 320/TFT_ring_meter/TFT_ring_meter.ino b/examples/480 x 320/TFT_ring_meter/TFT_ring_meter.ino index bbd1834..bdd9bb3 100644 --- a/examples/480 x 320/TFT_ring_meter/TFT_ring_meter.ino +++ b/examples/480 x 320/TFT_ring_meter/TFT_ring_meter.ino @@ -13,7 +13,7 @@ #define GREEN2RED 4 #define RED2GREEN 5 -#define TFT_GREY 0x2104 // Dark grey 16 bit colour +#define TFT_GREY 0x2104 // Dark grey 16-bit colour #include "Alert.h" // Out of range alert icon @@ -127,8 +127,8 @@ int ringMeter(int value, int vmin, int vmax, int x, int y, int r, const char *un case 1: colour = TFT_GREEN; break; // Fixed colour case 2: colour = TFT_BLUE; break; // Fixed colour case 3: colour = rainbow(map(i, -angle, angle, 0, 127)); break; // Full spectrum blue to red - case 4: colour = rainbow(map(i, -angle, angle, 70, 127)); break; // Green to red (high temperature etc) - case 5: colour = rainbow(map(i, -angle, angle, 127, 63)); break; // Red to green (low battery etc) + case 4: colour = rainbow(map(i, -angle, angle, 70, 127)); break; // Green to red (high temperature etc.) + case 5: colour = rainbow(map(i, -angle, angle, 127, 63)); break; // Red to green (low battery etc.) default: colour = TFT_BLUE; break; // Fixed colour } tft.fillTriangle(x0, y0, x1, y1, x2, y2, colour); @@ -193,14 +193,14 @@ void drawAlert(int x, int y , int side, bool draw) } // ######################################################################### -// Return a 16 bit rainbow colour +// Return a 16-bit rainbow colour // ######################################################################### unsigned int rainbow(byte value) { // Value is expected to be in range 0-127 // The value is converted to a spectrum colour from 0 = blue through to 127 = red - byte red = 0; // Red is the top 5 bits of a 16 bit colour value + byte red = 0; // Red is the top 5 bits of a 16-bit colour value byte green = 0;// Green is the middle 6 bits byte blue = 0; // Blue is the bottom 5 bits diff --git a/examples/480 x 320/Touch_Controller_Demo/Touch_Controller_Demo.ino b/examples/480 x 320/Touch_Controller_Demo/Touch_Controller_Demo.ino index f0b14d8..ed7db9f 100644 --- a/examples/480 x 320/Touch_Controller_Demo/Touch_Controller_Demo.ino +++ b/examples/480 x 320/Touch_Controller_Demo/Touch_Controller_Demo.ino @@ -17,13 +17,13 @@ void setup(void) { tft.setRotation(3); tft.fillScreen((0xFFFF)); - tft.setCursor(20, 0, 2); + tft.setcursor(20, 0, 2); tft.setTextColor(TFT_BLACK, TFT_WHITE); tft.setTextSize(1); tft.println("calibration run"); // check file system if (!SPIFFS.begin()) { - Serial.println("formating file system"); + Serial.println("formatting file system"); SPIFFS.format(); SPIFFS.begin(); @@ -62,9 +62,9 @@ void loop() { if (tft.getTouch(&x, &y)) { - tft.setCursor(5, 5, 2); + tft.setcursor(5, 5, 2); tft.printf("x: %i ", x); - tft.setCursor(5, 20, 2); + tft.setcursor(5, 20, 2); tft.printf("y: %i ", y); tft.drawPixel(x, y, color); diff --git a/examples/DMA test/Bouncy_Circles/Bouncy_Circles.ino b/examples/DMA test/Bouncy_Circles/Bouncy_Circles.ino index 43d10bb..e2a661e 100644 --- a/examples/DMA test/Bouncy_Circles/Bouncy_Circles.ino +++ b/examples/DMA test/Bouncy_Circles/Bouncy_Circles.ino @@ -153,7 +153,7 @@ void drawUpdate (bool sel) { } // ######################################################################### -// Return a 16 bit rainbow colour +// Return a 16-bit rainbow colour // ######################################################################### uint16_t rainbow(byte value) { @@ -163,7 +163,7 @@ uint16_t rainbow(byte value) value = value % 192; - byte red = 0; // Red is the top 5 bits of a 16 bit colour value + byte red = 0; // Red is the top 5 bits of a 16-bit colour value byte green = 0; // Green is the middle 6 bits, but only top 5 bits used here byte blue = 0; // Blue is the bottom 5 bits diff --git a/examples/DMA test/Flash_Jpg_DMA/Flash_Jpg_DMA.ino b/examples/DMA test/Flash_Jpg_DMA/Flash_Jpg_DMA.ino index d45e593..f0b70a5 100644 --- a/examples/DMA test/Flash_Jpg_DMA/Flash_Jpg_DMA.ino +++ b/examples/DMA test/Flash_Jpg_DMA/Flash_Jpg_DMA.ino @@ -76,7 +76,7 @@ void setup() tft.setSwapBytes(true); // The decoder must be given the exact name of the rendering function above - TJpgDec.setCallback(tft_output); + TJpgDec.setcallback(tft_output); } void loop() diff --git a/examples/DMA test/SpriteRotatingCube/SpriteRotatingCube.ino b/examples/DMA test/SpriteRotatingCube/SpriteRotatingCube.ino index 0b9590f..4625ded 100644 --- a/examples/DMA test/SpriteRotatingCube/SpriteRotatingCube.ino +++ b/examples/DMA test/SpriteRotatingCube/SpriteRotatingCube.ino @@ -2,7 +2,7 @@ // https://en.wikipedia.org/wiki/Direct_memory_access // Tested with ESP32, Nucleo 64 STM32F446RE and Nucleo 144 STM32F767ZI -// TFT's with SPI can use DMA, the sketch also works with 8 bit +// TFT's with SPI can use DMA, the sketch also works with 8-bit // parallel TFT's (tested with ILI9341 and ILI9481) // The sketch will run on processors without DMA and also parallel @@ -36,7 +36,7 @@ // Color depth has to be 16 bits if DMA is used to render image #define COLOR_DEPTH 16 -// 128x128 for a 16 bit colour Sprite (32Kbytes RAM) +// 128x128 for a 16-bit colour Sprite (32Kbytes RAM) // Maximum is 181x181 (64Kbytes) for DMA - restricted by processor design #define IWIDTH 128 #define IHEIGHT 128 @@ -147,8 +147,8 @@ void setup() { ypos = (tft.height() - IHEIGHT) / 2; // Define cprite colour depth - spr[0].setColorDepth(COLOR_DEPTH); - spr[1].setColorDepth(COLOR_DEPTH); + spr[0].setcolorDepth(COLOR_DEPTH); + spr[1].setcolorDepth(COLOR_DEPTH); // Create the 2 sprites sprPtr[0] = (uint16_t*)spr[0].createSprite(IWIDTH, IHEIGHT); diff --git a/examples/DMA test/boing_ball/boing_ball.ino b/examples/DMA test/boing_ball/boing_ball.ino index 36dbb77..a6e5e70 100644 --- a/examples/DMA test/boing_ball/boing_ball.ino +++ b/examples/DMA test/boing_ball/boing_ball.ino @@ -19,7 +19,7 @@ // Blue Pill overclocked to 128MHz *no* DMA - 32MHz SPI 64 fps // Blue Pill overclocked to 128MHz with DMA - 32MHz SPI 116 fps -// ESP32 - 8 bit parallel 110 fps (no DMA) +// ESP32 - 8-bit parallel 110 fps (no DMA) // ESP32 - 40MHz SPI *no* DMA 93 fps // ESP32 - 40MHz SPI with DMA 112 fps diff --git a/examples/GUI Widgets/Buttons/Button_demo/Button_demo.ino b/examples/GUI Widgets/Buttons/Button_demo/Button_demo.ino index 47f5464..a162cc6 100644 --- a/examples/GUI Widgets/Buttons/Button_demo/Button_demo.ino +++ b/examples/GUI Widgets/Buttons/Button_demo/Button_demo.ino @@ -132,7 +132,7 @@ void touch_calibrate() // check file system exists if (!LittleFS.begin()) { - Serial.println("Formating file system"); + Serial.println("formatting file system"); LittleFS.format(); LittleFS.begin(); } @@ -161,7 +161,7 @@ void touch_calibrate() } else { // data not valid so recalibrate tft.fillScreen(TFT_BLACK); - tft.setCursor(20, 0); + tft.setcursor(20, 0); tft.setTextFont(2); tft.setTextSize(1); tft.setTextColor(TFT_WHITE, TFT_BLACK); diff --git a/examples/GUI Widgets/Graphs/Graph_demo_1/Graph_demo_1.ino b/examples/GUI Widgets/Graphs/Graph_demo_1/Graph_demo_1.ino index e3020c4..5e9f74f 100644 --- a/examples/GUI Widgets/Graphs/Graph_demo_1/Graph_demo_1.ino +++ b/examples/GUI Widgets/Graphs/Graph_demo_1/Graph_demo_1.ino @@ -66,7 +66,7 @@ void loop() { if (gy < -500.0) delta = 10.0; gy += delta; - // If the end of the graph x ais is reached start a new trace at 0.0,0.0 + // If the end of the graph x axis is reached start a new trace at 0.0,0.0 if (gx > gxHigh) { gx = 0.0; gy = 0.0; diff --git a/examples/GUI Widgets/Graphs/Graph_demo_2/Graph_demo_2.ino b/examples/GUI Widgets/Graphs/Graph_demo_2/Graph_demo_2.ino index ff540ca..a7eb3cd 100644 --- a/examples/GUI Widgets/Graphs/Graph_demo_2/Graph_demo_2.ino +++ b/examples/GUI Widgets/Graphs/Graph_demo_2/Graph_demo_2.ino @@ -1,4 +1,4 @@ -// Demonstrate graph widget functions with two independant trace instances +// Demonstrate graph widget functions with two independent trace instances // Multiple traces can be drawn at a time with multiple trace instances // Note: Traces are automatically clipped at graph boundaries by widget library diff --git a/examples/GUI Widgets/Sliders/Slider_demo/Slider_demo.ino b/examples/GUI Widgets/Sliders/Slider_demo/Slider_demo.ino index a31d935..b9e7ef2 100644 --- a/examples/GUI Widgets/Sliders/Slider_demo/Slider_demo.ino +++ b/examples/GUI Widgets/Sliders/Slider_demo/Slider_demo.ino @@ -142,7 +142,7 @@ void touch_calibrate() // check file system exists if (!LittleFS.begin()) { - Serial.println("Formating file system"); + Serial.println("formatting file system"); LittleFS.format(); LittleFS.begin(); } @@ -171,7 +171,7 @@ void touch_calibrate() } else { // data not valid so recalibrate tft.fillScreen(TFT_BLACK); - tft.setCursor(20, 0); + tft.setcursor(20, 0); tft.setTextFont(2); tft.setTextSize(1); tft.setTextColor(TFT_WHITE, TFT_BLACK); diff --git a/examples/Generic/Animated_Eyes_1/config.h b/examples/Generic/Animated_Eyes_1/config.h index b99db41..d601d64 100644 --- a/examples/Generic/Animated_Eyes_1/config.h +++ b/examples/Generic/Animated_Eyes_1/config.h @@ -64,7 +64,7 @@ // JOYSTICK_X_PIN and JOYSTICK_Y_PIN specify analog input pins for manually // controlling the eye with an analog joystick. If set to -1 or if not // defined, the eye will move on its own. -// IRIS_PIN speficies an analog input pin for a photocell to make pupils +// IRIS_PIN specifies an analog input pin for a photocell to make pupils // react to light (or potentiometer for manual control). If set to -1 or // if not defined, the pupils will change on their own. // BLINK_PIN specifies an input pin for a button (to ground) that will diff --git a/examples/Generic/Animated_Eyes_1/eye_functions.ino b/examples/Generic/Animated_Eyes_1/eye_functions.ino index 96a583e..2db27dc 100644 --- a/examples/Generic/Animated_Eyes_1/eye_functions.ino +++ b/examples/Generic/Animated_Eyes_1/eye_functions.ino @@ -11,7 +11,7 @@ // boards and WILL NOT work on normal Arduino or other boards! // // SEE FILE "config.h" FOR MOST CONFIGURATION (graphics, pins, display type, -// etc). Probably won't need to edit THIS file unless you're doing some +// etc.). Probably won't need to edit THIS file unless you're doing some // extremely custom modifications. // // Adafruit invests time and resources providing this open source code, @@ -91,7 +91,7 @@ void updateEye (void) // EYE-RENDERING FUNCTION -------------------------------------------------- void drawEye( // Renders one eye. Inputs must be pre-clipped & valid. - // Use native 32 bit variables where possible as this is 10% faster! + // Use native 32-bit variables where possible as this is 10% faster! uint8_t e, // Eye array index; 0 or 1 for left/right uint32_t iScale, // Scale factor for iris uint32_t scleraX, // First pixel X offset into sclera image diff --git a/examples/Generic/Animated_Eyes_2/config.h b/examples/Generic/Animated_Eyes_2/config.h index e7e29e2..d519c9f 100644 --- a/examples/Generic/Animated_Eyes_2/config.h +++ b/examples/Generic/Animated_Eyes_2/config.h @@ -64,7 +64,7 @@ // JOYSTICK_X_PIN and JOYSTICK_Y_PIN specify analog input pins for manually // controlling the eye with an analog joystick. If set to -1 or if not // defined, the eye will move on its own. -// IRIS_PIN speficies an analog input pin for a photocell to make pupils +// IRIS_PIN specifies an analog input pin for a photocell to make pupils // react to light (or potentiometer for manual control). If set to -1 or // if not defined, the pupils will change on their own. // BLINK_PIN specifies an input pin for a button (to ground) that will diff --git a/examples/Generic/Animated_Eyes_2/eye_functions.ino b/examples/Generic/Animated_Eyes_2/eye_functions.ino index 96a583e..2db27dc 100644 --- a/examples/Generic/Animated_Eyes_2/eye_functions.ino +++ b/examples/Generic/Animated_Eyes_2/eye_functions.ino @@ -11,7 +11,7 @@ // boards and WILL NOT work on normal Arduino or other boards! // // SEE FILE "config.h" FOR MOST CONFIGURATION (graphics, pins, display type, -// etc). Probably won't need to edit THIS file unless you're doing some +// etc.). Probably won't need to edit THIS file unless you're doing some // extremely custom modifications. // // Adafruit invests time and resources providing this open source code, @@ -91,7 +91,7 @@ void updateEye (void) // EYE-RENDERING FUNCTION -------------------------------------------------- void drawEye( // Renders one eye. Inputs must be pre-clipped & valid. - // Use native 32 bit variables where possible as this is 10% faster! + // Use native 32-bit variables where possible as this is 10% faster! uint8_t e, // Eye array index; 0 or 1 for left/right uint32_t iScale, // Scale factor for iris uint32_t scleraX, // First pixel X offset into sclera image diff --git a/examples/Generic/ESP32_SDcard_jpeg/ESP32_SDcard_jpeg.ino b/examples/Generic/ESP32_SDcard_jpeg/ESP32_SDcard_jpeg.ino index 7ab3e00..ba48f6c 100644 --- a/examples/Generic/ESP32_SDcard_jpeg/ESP32_SDcard_jpeg.ino +++ b/examples/Generic/ESP32_SDcard_jpeg/ESP32_SDcard_jpeg.ino @@ -249,12 +249,12 @@ void jpegInfo() { // Show the execution time (optional) //#################################################################################################### // WARNING: for UNO/AVR legacy reasons printing text to the screen with the Mega might not work for -// sketch sizes greater than ~70KBytes because 16 bit address pointers are used in some libraries. +// sketch sizes greater than ~70KBytes because 16-bit address pointers are used in some libraries. // The Due will work fine with the HX8357_Due library. void showTime(uint32_t msTime) { - //tft.setCursor(0, 0); + //tft.setcursor(0, 0); //tft.setTextFont(1); //tft.setTextSize(2); //tft.setTextColor(TFT_WHITE, TFT_BLACK); diff --git a/examples/Generic/ESP8266_uncannyEyes/ESP8266_uncannyEyes.ino b/examples/Generic/ESP8266_uncannyEyes/ESP8266_uncannyEyes.ino index c78e0bf..7cc3db2 100644 --- a/examples/Generic/ESP8266_uncannyEyes/ESP8266_uncannyEyes.ino +++ b/examples/Generic/ESP8266_uncannyEyes/ESP8266_uncannyEyes.ino @@ -120,7 +120,7 @@ void setup(void) { // EYE-RENDERING FUNCTION -------------------------------------------------- #define BUFFER_SIZE 256 // 64 to 512 seems optimum = 30 fps for default eye void drawEye( // Renders one eye. Inputs must be pre-clipped & valid. - // Use native 32 bit variables where possible as this is 10% faster! + // Use native 32-bit variables where possible as this is 10% faster! uint8_t e, // Eye array index; 0 or 1 for left/right uint32_t iScale, // Scale factor for iris uint32_t scleraX, // First pixel X offset into sclera image @@ -134,7 +134,7 @@ void drawEye( // Renders one eye. Inputs must be pre-clipped & valid. uint32_t d; uint32_t pixels = 0; - uint16_t pbuffer[BUFFER_SIZE]; // This one needs to be 16 bit + uint16_t pbuffer[BUFFER_SIZE]; // This one needs to be 16-bit // Set up raw pixel dump to entire screen. Although such writes can wrap // around automatically from end of rect back to beginning, the region is diff --git a/examples/Generic/ESP8266_uncannyEyes/screenshotToConsole.ino b/examples/Generic/ESP8266_uncannyEyes/screenshotToConsole.ino index daa60ac..9dd98f3 100644 --- a/examples/Generic/ESP8266_uncannyEyes/screenshotToConsole.ino +++ b/examples/Generic/ESP8266_uncannyEyes/screenshotToConsole.ino @@ -58,7 +58,7 @@ void screenshotToConsole() // Get first pixel to prime the Run Length Encoded // Function format is: tft.readRectRGB( x, y, width, height, buffer); - // color is a pointer to a buffer that the RGB 8 bit values are piped into + // color is a pointer to a buffer that the RGB 8-bit values are piped into // the buffer size must be >= (width * height * 3) bytes eye[e].tft.readRectRGB(0, 0, 1, 1, color); // 1 x 1 so reading 1 pixel at 0,0 diff --git a/examples/Generic/Gradient_Fill/Gradient_Fill.ino b/examples/Generic/Gradient_Fill/Gradient_Fill.ino index 84b619f..cd44967 100644 --- a/examples/Generic/Gradient_Fill/Gradient_Fill.ino +++ b/examples/Generic/Gradient_Fill/Gradient_Fill.ino @@ -27,11 +27,11 @@ void setup(void) { void loop() { tft.fillRectHGradient(0, 0, 160, 50, TFT_MAGENTA, TFT_BLUE); - tft.setCursor(10,10); + tft.setcursor(10,10); tft.print("Horizontal gradient"); tft.fillRectVGradient(0, 60, 160, 50, TFT_ORANGE, TFT_RED); - tft.setCursor(10,70); + tft.setcursor(10,70); tft.print("Vertical gradient"); while(1) delay(100); // Wait here diff --git a/examples/Generic/Julia_Set/Julia_Set.ino b/examples/Generic/Julia_Set/Julia_Set.ino index c7164c6..9e00608 100644 --- a/examples/Generic/Julia_Set/Julia_Set.ino +++ b/examples/Generic/Julia_Set/Julia_Set.ino @@ -31,7 +31,7 @@ void loop() { /* Dessine la fractale */ draw_Julia(-0.8,+0.156,zoom); tft.fillRect(0, 0, 150, 20, TFT_BLACK); - tft.setCursor(0,15); + tft.setcursor(0,15); tft.setTextColor(TFT_WHITE); tft.print(" Zoom = "); tft.println(zoom); @@ -46,12 +46,12 @@ void loop() { void draw_Julia(float c_r, float c_i, float zoom) { - tft.setCursor(0,0); + tft.setcursor(0,0); float new_r = 0.0, new_i = 0.0, old_r = 0.0, old_i = 0.0; /* Pour chaque pixel en X */ - for(int16_t x = SCREEN_WIDTH/2 - 1; x >= 0; x--) { // Rely on inverted symettry + for(int16_t x = SCREEN_WIDTH/2 - 1; x >= 0; x--) { // Rely on inverted symmetry /* Pour chaque pixel en Y */ for(uint16_t y = 0; y < SCREEN_HEIGHT; y++) { old_r = 1.5 * (x - SCREEN_WIDTH / 2) / (0.5 * zoom * SCREEN_WIDTH); diff --git a/examples/Generic/Local_Custom_Fonts/Local_Custom_Fonts.ino b/examples/Generic/Local_Custom_Fonts/Local_Custom_Fonts.ino index b8342e4..b5c67c7 100644 --- a/examples/Generic/Local_Custom_Fonts/Local_Custom_Fonts.ino +++ b/examples/Generic/Local_Custom_Fonts/Local_Custom_Fonts.ino @@ -112,7 +112,7 @@ void loop() { // Setting textDatum does nothing when using tft.print tft.fillScreen(TFT_BLUE); // Clear screen - tft.setCursor(0,60); // To be compatible with Adafruit_GFX the cursor datum is always bottom left + tft.setcursor(0,60); // To be compatible with Adafruit_GFX the cursor datum is always bottom left tft.print("âäàå"); // Using tft.print means text background is NEVER rendered delay(2000); diff --git a/examples/Generic/On_Off_Button/On_Off_Button.ino b/examples/Generic/On_Off_Button/On_Off_Button.ino index 17f4ac1..e8ee007 100644 --- a/examples/Generic/On_Off_Button/On_Off_Button.ino +++ b/examples/Generic/On_Off_Button/On_Off_Button.ino @@ -144,7 +144,7 @@ void touch_calibrate() } else { // data not valid so recalibrate tft.fillScreen(TFT_BLACK); - tft.setCursor(20, 0); + tft.setcursor(20, 0); tft.setTextFont(2); tft.setTextSize(1); tft.setTextColor(TFT_WHITE, TFT_BLACK); diff --git a/examples/Generic/TFT_Button_Label_Datum/TFT_Button_Label_Datum.ino b/examples/Generic/TFT_Button_Label_Datum/TFT_Button_Label_Datum.ino index 494faaf..4f131ac 100644 --- a/examples/Generic/TFT_Button_Label_Datum/TFT_Button_Label_Datum.ino +++ b/examples/Generic/TFT_Button_Label_Datum/TFT_Button_Label_Datum.ino @@ -162,7 +162,7 @@ void touch_calibrate() } else { // data not valid so recalibrate tft.fillScreen(TFT_BLACK); - tft.setCursor(20, 0); + tft.setcursor(20, 0); tft.setTextFont(2); tft.setTextSize(1); tft.setTextColor(TFT_WHITE, TFT_BLACK); diff --git a/examples/Generic/TFT_Flash_Bitmap/TFT_Flash_Bitmap.ino b/examples/Generic/TFT_Flash_Bitmap/TFT_Flash_Bitmap.ino index cde4ecb..14d52db 100644 --- a/examples/Generic/TFT_Flash_Bitmap/TFT_Flash_Bitmap.ino +++ b/examples/Generic/TFT_Flash_Bitmap/TFT_Flash_Bitmap.ino @@ -1,4 +1,4 @@ -// Icon images are stored in tabs ^ e.g. Alert.h etc above this line +// Icon images are stored in tabs ^ e.g. Alert.h etc.above this line // more than one icon can be in a header file // Arrays containing FLASH images can be created with UTFT library tool: diff --git a/examples/Generic/TFT_SPIFFS_BMP/BMP_functions.ino b/examples/Generic/TFT_SPIFFS_BMP/BMP_functions.ino index b3905e9..1d9de1e 100644 --- a/examples/Generic/TFT_SPIFFS_BMP/BMP_functions.ino +++ b/examples/Generic/TFT_SPIFFS_BMP/BMP_functions.ino @@ -46,7 +46,7 @@ void drawBmp(const char *filename, int16_t x, int16_t y) { bmpFS.read(lineBuffer, sizeof(lineBuffer)); uint8_t* bptr = lineBuffer; uint16_t* tptr = (uint16_t*)lineBuffer; - // Convert 24 to 16 bit colours + // Convert 24 to 16-bit colours for (uint16_t col = 0; col < w; col++) { b = *bptr++; diff --git a/examples/Generic/TFT_Screen_Capture/TFT_Screen_Capture.ino b/examples/Generic/TFT_Screen_Capture/TFT_Screen_Capture.ino index 5d3e401..f40f4df 100644 --- a/examples/Generic/TFT_Screen_Capture/TFT_Screen_Capture.ino +++ b/examples/Generic/TFT_Screen_Capture/TFT_Screen_Capture.ino @@ -84,7 +84,7 @@ void loop() { tft.setTextFont(0); // Select font 0 which is the Adafruit font tft.drawString("Original Adafruit font!", xpos, 5); - // The new larger fonts do not need to use the .setCursor call, coords are embedded + // The new larger fonts do not need to use the .setcursor call, coords are embedded tft.setTextColor(TFT_BLACK); // Do not plot the background colour // Overlay the black text on top of the rainbow plot (the advantage of not drawing the background colour!) diff --git a/examples/Generic/TFT_Screen_Capture/processing_sketch.ino b/examples/Generic/TFT_Screen_Capture/processing_sketch.ino index 3e71f41..d657a08 100644 --- a/examples/Generic/TFT_Screen_Capture/processing_sketch.ino +++ b/examples/Generic/TFT_Screen_Capture/processing_sketch.ino @@ -63,7 +63,7 @@ int max_allowed = 1000; // Maximum number of save images allowed before a resta // These are default values, this sketch obtains the actual values from the Arduino board int tft_width = 480; // default TFT width (automatic - sent by Arduino) int tft_height = 480; // default TFT height (automatic - sent by Arduino) -int color_bytes = 2; // 2 for 16 bit, 3 for three RGB bytes (automatic - sent by Arduino) +int color_bytes = 2; // 2 for 16-bit, 3 for three RGB bytes (automatic - sent by Arduino) import processing.serial.*; diff --git a/examples/Generic/TFT_Screen_Capture/screenServer.ino b/examples/Generic/TFT_Screen_Capture/screenServer.ino index 82bbbd7..733c4ff 100644 --- a/examples/Generic/TFT_Screen_Capture/screenServer.ino +++ b/examples/Generic/TFT_Screen_Capture/screenServer.ino @@ -2,8 +2,8 @@ // over the serial port. Use a high baud rate, e.g. for an ESP8266: // Serial.begin(921600); -// At 921600 baud a 320 x 240 image with 16 bit colour transfers can be sent to the -// PC client in ~1.67s and 24 bit colour in ~2.5s which is close to the theoretical +// At 921600 baud a 320 x 240 image with 16-bit colour transfers can be sent to the +// PC client in ~1.67s and 24-bit colour in ~2.5s which is close to the theoretical // minimum transfer time. // This sketch has been created to work with the TFT_eSPI library here: @@ -40,7 +40,7 @@ // Number of pixels to send in a burst (minimum of 1), no benefit above 8 // NPIXELS values and render times: -// NPIXELS 1 = use readPixel() = >5s and 16 bit pixels only +// NPIXELS 1 = use readPixel() = >5s and 16-bit pixels only // NPIXELS >1 using rectRead() 2 = 1.75s, 4 = 1.68s, 8 = 1.67s #define NPIXELS 8 // Must be integer division of both TFT width and TFT height @@ -104,7 +104,7 @@ bool serialScreenServer(String filename) wait = false; // No need to wait anymore lastCmdTime = millis(); // Set last received command time - // Send screen size etc using a simple header with delimiters for client checks + // Send screen size etc.using a simple header with delimiters for client checks sendParameters(filename); } } @@ -169,7 +169,7 @@ bool serialScreenServer(String filename) } //==================================================================================== -// Send screen size etc using a simple header with delimiters for client checks +// Send screen size etc.using a simple header with delimiters for client checks //==================================================================================== void sendParameters(String filename) { @@ -183,7 +183,7 @@ void sendParameters(String filename) Serial.write('Y'); // Bits per pixel (16 or 24) if (NPIXELS > 1) Serial.write(BITS_PER_PIXEL); - else Serial.write(16); // readPixel() only provides 16 bit values + else Serial.write(16); // readPixel() only provides 16-bit values Serial.write('?'); // Filename next Serial.print(filename); diff --git a/examples/Generic/Touch_calibrate/Touch_calibrate.ino b/examples/Generic/Touch_calibrate/Touch_calibrate.ino index 92eadb5..26ba178 100644 --- a/examples/Generic/Touch_calibrate/Touch_calibrate.ino +++ b/examples/Generic/Touch_calibrate/Touch_calibrate.ino @@ -66,7 +66,7 @@ void touch_calibrate() // Calibrate tft.fillScreen(TFT_BLACK); - tft.setCursor(20, 0); + tft.setcursor(20, 0); tft.setTextFont(2); tft.setTextSize(1); tft.setTextColor(TFT_WHITE, TFT_BLACK); diff --git a/examples/Generic/Viewport_Demo/Viewport_Demo.ino b/examples/Generic/Viewport_Demo/Viewport_Demo.ino index 8391652..07d43df 100644 --- a/examples/Generic/Viewport_Demo/Viewport_Demo.ino +++ b/examples/Generic/Viewport_Demo/Viewport_Demo.ino @@ -10,7 +10,7 @@ // Viewports have a number of potential uses: // - create a "virtual" TFT screen smaller than the actual TFT screen -// - render GUI items (menus etc) in a viewport, erase GUI item by redrawing whole screen, +// - render GUI items (menus etc.) in a viewport, erase GUI item by redrawing whole screen, // this will be fast because only the viewport will be refreshed (e.g. clearing menu) // - limit screen refresh to a particular area, e.g. changing numbers, icons or graph plotting // - showing a small portion of a larger image or sprite, this allows panning and scrolling diff --git a/examples/Generic/Viewport_graphicstest/Viewport_graphicstest.ino b/examples/Generic/Viewport_graphicstest/Viewport_graphicstest.ino index 75ec428..420e95f 100644 --- a/examples/Generic/Viewport_graphicstest/Viewport_graphicstest.ino +++ b/examples/Generic/Viewport_graphicstest/Viewport_graphicstest.ino @@ -134,7 +134,7 @@ unsigned long testFillScreen() { unsigned long testText() { tft.fillScreen(TFT_BLACK); unsigned long start = micros(); - tft.setCursor(0, 0); + tft.setcursor(0, 0); tft.setTextColor(TFT_WHITE); tft.setTextSize(1); tft.println("Hello World!"); tft.setTextColor(TFT_YELLOW); tft.setTextSize(2); diff --git a/examples/Generic/alphaBlend_Test/alphaBlend_Test.ino b/examples/Generic/alphaBlend_Test/alphaBlend_Test.ino index f267195..a436dcc 100644 --- a/examples/Generic/alphaBlend_Test/alphaBlend_Test.ino +++ b/examples/Generic/alphaBlend_Test/alphaBlend_Test.ino @@ -6,7 +6,7 @@ blendedColor = tft.alphaBlend(alpha, fg_color, bg_color); - The alphaBlend() function operates on 16 bit colours only + The alphaBlend() function operates on 16-bit colours only A test is included where the colours are mapped to 8 bits after blending Information on alpha blending is here @@ -43,7 +43,7 @@ void setup(void) { // ------------------------------------------------------------------------- void loop() { - // 16 bit colours (5 bits red, 6 bits green, 5 bits blue) + // 16-bit colours (5 bits red, 6 bits green, 5 bits blue) // Blend from white to full spectrum for (int a = 0; a < 256; a+=2) // Alpha 0 = 100% background, alpha 255 = 100% foreground { @@ -79,18 +79,18 @@ void loop() delay(4000); //* - // Decrease to 8 bit colour (3 bits red, 3 bits green, 2 bits blue) + // Decrease to 8-bit colour (3 bits red, 3 bits green, 2 bits blue) // Blend from white to full spectrum for (int a = 0; a < 256; a+=2) // Alpha 0 = 100% background, alpha 255 = 100% foreground { - // Convert blended 16 bit colour to 8 bits to reduce colour resolution, then map back to 16 bits for displaying + // Convert blended 16-bit colour to 8 bits to reduce colour resolution, then map back to 16 bits for displaying for (int c = 0; c < 192; c++) tft.drawPixel(c, a/2, tft.color8to16(tft.color16to8(tft.alphaBlend(a, rainbow(c), 0xFFFF)))); } // Blend from full spectrum to black for (int a = 255; a > 2; a-=2) { - // Convert blended 16 bit colour to 8 bits to reduce colour resolution, then map back to 16 bits for displaying + // Convert blended 16-bit colour to 8 bits to reduce colour resolution, then map back to 16 bits for displaying for (int c = 0; c < 192; c++) tft.drawPixel(c, 128 + (255-a)/2, tft.color8to16(tft.color16to8(tft.alphaBlend(a, rainbow(c), 0)))); } @@ -108,7 +108,7 @@ void loop() //*/ /* - // 16 bit colours (5 bits red, 6 bits green, 5 bits blue) + // 16-bit colours (5 bits red, 6 bits green, 5 bits blue) for (int a = 0; a < 256; a+=2) // Alpha 0 = 100% background, alpha 255 = 100% foreground { for (int c = 0; c < 192; c++) tft.drawPixel(c, a/2, tft.alphaBlend(a, rainbow(c), TFT_CYAN)); @@ -137,7 +137,7 @@ void loop() // ######################################################################### -// Return a 16 bit rainbow colour +// Return a 16-bit rainbow colour // ######################################################################### unsigned int rainbow(byte value) { @@ -147,7 +147,7 @@ unsigned int rainbow(byte value) value = value%192; - byte red = 0; // Red is the top 5 bits of a 16 bit colour value + byte red = 0; // Red is the top 5 bits of a 16-bit colour value byte green = 0; // Green is the middle 6 bits, but only top 5 bits used here byte blue = 0; // Blue is the bottom 5 bits diff --git a/examples/PNG Images/Flash_PNG/Flash_PNG.ino b/examples/PNG Images/Flash_PNG/Flash_PNG.ino index ca05753..e602340 100644 --- a/examples/PNG Images/Flash_PNG/Flash_PNG.ino +++ b/examples/PNG Images/Flash_PNG/Flash_PNG.ino @@ -14,9 +14,9 @@ // Include the PNG decoder library #include -#include "panda.h" // Image is stored here in an 8 bit array +#include "panda.h" // Image is stored here in an 8-bit array -PNG png; // PNG decoder inatance +PNG png; // PNG decoder instance #define MAX_IMAGE_WIDTH 240 // Adjust for your images diff --git a/examples/Smooth Fonts/FLASH_Array/Font_Demo_1_Array/Font_Demo_1_Array.ino b/examples/Smooth Fonts/FLASH_Array/Font_Demo_1_Array/Font_Demo_1_Array.ino index 4efff44..f2ef472 100644 --- a/examples/Smooth Fonts/FLASH_Array/Font_Demo_1_Array/Font_Demo_1_Array.ino +++ b/examples/Smooth Fonts/FLASH_Array/Font_Demo_1_Array/Font_Demo_1_Array.ino @@ -61,7 +61,7 @@ void loop() { tft.setTextColor(TFT_WHITE, TFT_BLACK); // Set the font colour AND the background colour // so the anti-aliasing works - tft.setCursor(0, 0); // Set cursor at top left of screen + tft.setcursor(0, 0); // Set cursor at top left of screen // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> @@ -102,7 +102,7 @@ void loop() { // Get ready for the next demo while we have this font loaded tft.fillScreen(TFT_BLACK); - tft.setCursor(0, 0); // Set cursor at top left of screen + tft.setcursor(0, 0); // Set cursor at top left of screen tft.setTextColor(TFT_WHITE, TFT_BLACK); tft.println("Wrong and right ways to"); tft.println("print changing values..."); @@ -121,17 +121,17 @@ void loop() { // Draw changing numbers - does not work unless a filled rectangle is drawn over the old text for (int i = 0; i <= 99; i++) { - tft.setCursor(50, 50); + tft.setcursor(50, 50); tft.setTextColor(TFT_GREEN, TFT_BLACK); // TFT_BLACK is used for anti-aliasing only // By default background fill is off tft.print(" "); // Overprinting old number with spaces DOES NOT WORK! - tft.setCursor(50, 50); + tft.setcursor(50, 50); tft.print(i / 10.0, 1); // Adding a parameter "true" to the setTextColor() function fills character background // This extra parameter is only for smooth fonts! tft.setTextColor(TFT_GREEN, TFT_BLACK, true); - tft.setCursor(50, 90); + tft.setcursor(50, 90); tft.print(i / 10.0, 1); delay (200); @@ -147,7 +147,7 @@ void loop() { tft.setTextColor(TFT_YELLOW, TFT_BLACK); // Change the font colour and the background colour - tft.setCursor(0, 0); // Set cursor at top left of screen + tft.setcursor(0, 0); // Set cursor at top left of screen tft.println("Large font!"); diff --git a/examples/Smooth Fonts/FLASH_Array/Font_Demo_3_Array/Font_Demo_3_Array.ino b/examples/Smooth Fonts/FLASH_Array/Font_Demo_3_Array/Font_Demo_3_Array.ino index a15ee44..8e39b49 100644 --- a/examples/Smooth Fonts/FLASH_Array/Font_Demo_3_Array/Font_Demo_3_Array.ino +++ b/examples/Smooth Fonts/FLASH_Array/Font_Demo_3_Array/Font_Demo_3_Array.ino @@ -11,7 +11,7 @@ This sketch uses method 3, the font characters are first plotted in a Sprite, then the Sprite is pushed to the screen. This method is very flexible and the Sprite can be created, deleted, resized as needed. To render anti-aliased fonts well the Sprite - needs to be 16 bit. The fonts will render in 1 bit per pixel sprites but there + needs to be 16-bit. The fonts will render in 1 bit per pixel sprites but there will then be no anti-aliasing. Using 1 bit per pixel Sprites is however useful to use the extended Unicode range in fonts on mono displays like ePaper. @@ -50,7 +50,7 @@ void setup(void) { tft.setRotation(1); - spr.setColorDepth(16); // 16 bit colour needed to show antialiased fonts + spr.setcolorDepth(16); // 16-bit colour needed to show antialiased fonts } void loop() { @@ -93,7 +93,7 @@ void loop() { tft.fillScreen(TFT_BLACK); - // Beware: Sprites are a differerent "class" to TFT, so different fonts can be loaded + // Beware: Sprites are a different "class" to TFT, so different fonts can be loaded // in the tft and sprite instances, so load the font in the class instance you use! // In this example this means the spr. instance. @@ -181,8 +181,8 @@ void button(int x, int y, int num ) #define IWIDTH 40 #define IHEIGHT 25 - // Create a 16 bit sprite 40 pixels wide, 25 high (2000 bytes of RAM needed) - spr.setColorDepth(16); + // Create a 16-bit sprite 40 pixels wide, 25 high (2000 bytes of RAM needed) + spr.setcolorDepth(16); spr.createSprite(IWIDTH, IHEIGHT); // Fill it with black (this will be the transparent colour this time) diff --git a/examples/Smooth Fonts/FLASH_Array/Font_Demo_4_Array/Font_Demo_4_Array.ino b/examples/Smooth Fonts/FLASH_Array/Font_Demo_4_Array/Font_Demo_4_Array.ino index 225ae96..b71c8ca 100644 --- a/examples/Smooth Fonts/FLASH_Array/Font_Demo_4_Array/Font_Demo_4_Array.ino +++ b/examples/Smooth Fonts/FLASH_Array/Font_Demo_4_Array/Font_Demo_4_Array.ino @@ -58,7 +58,7 @@ void setup(void) { tft.setRotation(1); - spr.setColorDepth(16); // 16 bit colour needed to show anti-aliased fonts + spr.setcolorDepth(16); // 16-bit colour needed to show anti-aliased fonts } void loop() { @@ -81,7 +81,7 @@ void loop() { spr.setTextColor(TFT_YELLOW, TFT_BLACK); // Set the sprite font colour and the background colour - tft.setCursor(xpos - 50, ypos); // Set the tft cursor position, yes tft position! + tft.setcursor(xpos - 50, ypos); // Set the tft cursor position, yes tft position! spr.printToSprite("Small 15pt font"); // Prints to tft cursor position, tft cursor NOT moved ypos += spr.fontHeight(); // Get the font height and move ypos down @@ -100,14 +100,14 @@ void loop() { spr.setTextColor(TFT_WHITE, TFT_BLUE); // Set the font colour and the background colour - tft.setCursor(xpos - 90, ypos); // Set the tft cursor position + tft.setcursor(xpos - 90, ypos); // Set the tft cursor position spr.printToSprite("36pt font"); // Text is rendered via a minimally sized sprite ypos += spr.fontHeight(); // Get the font height and move ypos down // Draw changing numbers - no flicker using this plot method! for (int i = 0; i <= 200; i++) { - tft.setCursor(10, 10); + tft.setcursor(10, 10); // Number is converted to String type by (String) (number) spr.printToSprite(" " + (String) (i / 100.0) + " "); // Space padding helps over-write old numbers delay (20); diff --git a/examples/Smooth Fonts/FLASH_Array/Print_Smooth_Font/Print_Smooth_Font.ino b/examples/Smooth Fonts/FLASH_Array/Print_Smooth_Font/Print_Smooth_Font.ino index 16c53ce..82b9b1d 100644 --- a/examples/Smooth Fonts/FLASH_Array/Print_Smooth_Font/Print_Smooth_Font.ino +++ b/examples/Smooth Fonts/FLASH_Array/Print_Smooth_Font/Print_Smooth_Font.ino @@ -8,7 +8,7 @@ sketch in the library Tools folder. The Processing sketch can convert TrueType fonts in *.ttf or *.otf files. - The library supports 16 bit unicode characters: + The library supports 16-bit Unicode characters: https://en.wikipedia.org/wiki/Unicode_font The characters supported are in the in the Basic Multilingual Plane: @@ -60,7 +60,7 @@ void loop() { // Set "cursor" at top left corner of display (0,0) // (cursor will move to next line automatically during printing with 'tft.println' // or stay on the line is there is room for the text with tft.print) - tft.setCursor(0, 0); + tft.setcursor(0, 0); // Set the font colour to be white with a black background, set text size multiplier to 1 tft.setTextColor(TFT_WHITE, TFT_BLACK); diff --git a/examples/Smooth Fonts/FLASH_Array/Smooth_font_gradient/Smooth_font_gradient.ino b/examples/Smooth Fonts/FLASH_Array/Smooth_font_gradient/Smooth_font_gradient.ino index dc28874..da3005e 100644 --- a/examples/Smooth Fonts/FLASH_Array/Smooth_font_gradient/Smooth_font_gradient.ino +++ b/examples/Smooth Fonts/FLASH_Array/Smooth_font_gradient/Smooth_font_gradient.ino @@ -11,7 +11,7 @@ will return the pixel color at a position x,y on the TFT. In this sketch that function is called gradientColor, so this line is included in setup(): - tft.setCallback(gradientColor); + tft.setcallback(gradientColor); TFT_eSPI will call this function during the rendering of the anti-aliased font to blend the edges of each character with the returned color. @@ -66,8 +66,8 @@ void setup(void) { tft.begin(); - tft.setCallback(gradientColor); // Switch on color callback for anti-aliased fonts - //tft.setCallback(nullptr); // Switch off callback (off by default) + tft.setcallback(gradientColor); // Switch on color callback for anti-aliased fonts + //tft.setcallback(nullptr); // Switch off callback (off by default) tft.setRotation(1); } @@ -83,7 +83,7 @@ void loop() { fillGradient(); // Put here after selecting the font so fontHeight() is already set tft.setTextColor(TFT_WHITE); // Background color is ignored in gradient area - tft.setCursor(0, 10); // Set cursor at top left of screen + tft.setcursor(0, 10); // Set cursor at top left of screen uint32_t t = millis(); tft.println(" Ode to a small\n lump of green\n putty I found\n in my armpit\n one midsummer\n morning "); diff --git a/examples/Smooth Fonts/FLASH_Array/Smooth_font_reading_TFT/Smooth_font_reading_TFT.ino b/examples/Smooth Fonts/FLASH_Array/Smooth_font_reading_TFT/Smooth_font_reading_TFT.ino index ec6cb73..82598ec 100644 --- a/examples/Smooth Fonts/FLASH_Array/Smooth_font_reading_TFT/Smooth_font_reading_TFT.ino +++ b/examples/Smooth Fonts/FLASH_Array/Smooth_font_reading_TFT/Smooth_font_reading_TFT.ino @@ -9,7 +9,7 @@ that will return the pixel color at a position x,y on the TFT. In this sketch that function is called pixelColor, so this line is included: - tft.setCallback(pixelColor); + tft.setcallback(pixelColor); TFT_eSPI will call this function during the rendering of the anti-aliased font and use it to blend the edges of each character with the screen color. @@ -43,8 +43,8 @@ void setup(void) { tft.begin(); - tft.setCallback(pixelColor); // Switch on color callback for anti-aliased fonts - //tft.setCallback(nullptr); // Switch off callback (off by default) + tft.setcallback(pixelColor); // Switch on color callback for anti-aliased fonts + //tft.setcallback(nullptr); // Switch off callback (off by default) tft.setRotation(1); } @@ -61,7 +61,7 @@ void loop() { tft.loadFont(AA_FONT_SMALL); tft.setTextColor(TFT_BLACK, TFT_WHITE); // Background color is ignored if callback is set - tft.setCursor(0, 10); // Set cursor at top left of screen + tft.setcursor(0, 10); // Set cursor at top left of screen uint32_t t = millis(); tft.println(" Ode to a small\n lump of green\n putty I found\n in my armpit\n one midsummer\n morning "); @@ -83,7 +83,7 @@ unsigned int colour = red << 11; // Colour order is RGB 5+6+5 bits each void rainbow_fill() { - // The colours and state are not initialised so the start colour changes each time the funtion is called + // The colours and state are not initialised so the start colour changes each time the function is called for (int i = 319; i >= 0; i--) { // Draw a vertical line 1 pixel wide in the selected colour diff --git a/examples/Smooth Fonts/FLASH_Array/Unicode_test/Unicode_test.ino b/examples/Smooth Fonts/FLASH_Array/Unicode_test/Unicode_test.ino index a36c368..de2a669 100644 --- a/examples/Smooth Fonts/FLASH_Array/Unicode_test/Unicode_test.ino +++ b/examples/Smooth Fonts/FLASH_Array/Unicode_test/Unicode_test.ino @@ -8,14 +8,14 @@ The library expects strings to be in UTF-8 encoded format: https://www.fileformat.info/info/unicode/utf8.htm - Creating varaibles needs to be done with care when using character arrays: + Creating variables needs to be done with care when using character arrays: char c = 'µ'; // Wrong char bad[4] = "5µA"; // Wrong char good[] = "5µA"; // Good String okay = "5µA"; // Good This is because UTF-8 characters outside the basic Latin set occupy more than - 1 byte per character! A 16 bit Unicode character occupies 3 bytes! + 1 byte per character! A 16-bit Unicode character occupies 3 bytes! */ @@ -77,7 +77,7 @@ void loop() tft.showFont(2000); // Note: This function moves the cursor position! tft.fillScreen(bg); - tft.setCursor(0,0); + tft.setcursor(0,0); tft.println(test1); @@ -89,7 +89,7 @@ void loop() //---------------------------------------------------------------------------- // We can have any random mix of characters in the font - String test2 = "仝倀"; // Unicodes 0x4EDD, 0x5000 + String test2 = "仝倀"; // Unicode 0x4EDD, 0x5000 tft.loadFont(Unicode_Test_72); @@ -99,7 +99,7 @@ void loop() tft.showFont(2000); // Note: This function moves the cursor position! tft.fillScreen(bg); - tft.setCursor(0,0); + tft.setcursor(0,0); tft.setTextColor(TFT_CYAN, bg); tft.println(test2); @@ -129,7 +129,7 @@ void loop() tft.fillScreen(bg); tft.setTextColor(TFT_GREEN, bg); - tft.setCursor(0,0); + tft.setcursor(0,0); tft.println("Konnichiwa"); tft.println(test3); diff --git a/examples/Smooth Fonts/LittleFS/Font_Demo_1/Font_Demo_1.ino b/examples/Smooth Fonts/LittleFS/Font_Demo_1/Font_Demo_1.ino index 061f0c1..34de4ba 100644 --- a/examples/Smooth Fonts/LittleFS/Font_Demo_1/Font_Demo_1.ino +++ b/examples/Smooth Fonts/LittleFS/Font_Demo_1/Font_Demo_1.ino @@ -80,7 +80,7 @@ void loop() { tft.setTextColor(TFT_WHITE, TFT_BLACK); // Set the font colour AND the background colour // so the anti-aliasing works - tft.setCursor(0, 0); // Set cursor at top left of screen + tft.setcursor(0, 0); // Set cursor at top left of screen // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> @@ -120,7 +120,7 @@ void loop() { // Get ready for the next demo while we have this font loaded tft.fillScreen(TFT_BLACK); - tft.setCursor(0, 0); // Set cursor at top left of screen + tft.setcursor(0, 0); // Set cursor at top left of screen tft.setTextColor(TFT_WHITE, TFT_BLACK); tft.println("Wrong and right ways to"); tft.println("print changing values..."); @@ -139,17 +139,17 @@ void loop() { // Draw changing numbers - does not work unless a filled rectangle is drawn over the old text for (int i = 0; i <= 20; i++) { - tft.setCursor(50, 50); + tft.setcursor(50, 50); tft.setTextColor(TFT_GREEN, TFT_BLACK); // TFT_BLACK is used for anti-aliasing only // By default background fill is off tft.print(" "); // Overprinting old number with spaces DOES NOT WORK! - tft.setCursor(50, 50); + tft.setcursor(50, 50); tft.print(i / 10.0, 1); // Adding a parameter "true" to the setTextColor() function fills character background // This extra parameter is only for smooth fonts! tft.setTextColor(TFT_GREEN, TFT_BLACK, true); - tft.setCursor(50, 90); + tft.setcursor(50, 90); tft.print(i / 10.0, 1); delay (200); @@ -165,7 +165,7 @@ void loop() { tft.setTextColor(TFT_YELLOW, TFT_BLACK); // Change the font colour and the background colour - tft.setCursor(0, 0); // Set cursor at top left of screen + tft.setcursor(0, 0); // Set cursor at top left of screen tft.println("Large font!"); diff --git a/examples/Smooth Fonts/LittleFS/Font_Demo_3/Font_Demo_3.ino b/examples/Smooth Fonts/LittleFS/Font_Demo_3/Font_Demo_3.ino index 312e4a7..4157698 100644 --- a/examples/Smooth Fonts/LittleFS/Font_Demo_3/Font_Demo_3.ino +++ b/examples/Smooth Fonts/LittleFS/Font_Demo_3/Font_Demo_3.ino @@ -4,7 +4,7 @@ This sketch uses method 3, the font characters are first plotted in a Sprite, then the Sprite is pushed to the screen. This method is very flexible and the Sprite can be created, deleted, resized as needed. To render anti-aliased fonts well the Sprite - needs to be 16 bit. The fonts will render in 1 bit per pixel sprites but there + needs to be 16-bit. The fonts will render in 1 bit per pixel sprites but there will then be no anti-aliasing. Using 1 bit per pixel Sprites is however useful to use the extended Unicode range in fonts on mono displays like ePaper. @@ -51,7 +51,7 @@ void setup(void) { tft.setRotation(1); - spr.setColorDepth(16); // 16 bit colour needed to show antialiased fonts + spr.setcolorDepth(16); // 16-bit colour needed to show antialiased fonts if (!LittleFS.begin()) { Serial.println("Flash FS initialisation failed!"); @@ -200,8 +200,8 @@ void button(int x, int y, int num ) #define IWIDTH 40 #define IHEIGHT 25 - // Create a 16 bit sprite 40 pixels wide, 25 high (2000 bytes of RAM needed) - spr.setColorDepth(16); + // Create a 16-bit sprite 40 pixels wide, 25 high (2000 bytes of RAM needed) + spr.setcolorDepth(16); spr.createSprite(IWIDTH, IHEIGHT); // Fill it with black (this will be the transparent colour this time) diff --git a/examples/Smooth Fonts/LittleFS/Font_Demo_4/Font_Demo_4.ino b/examples/Smooth Fonts/LittleFS/Font_Demo_4/Font_Demo_4.ino index eb4ce04..f7eb6c1 100644 --- a/examples/Smooth Fonts/LittleFS/Font_Demo_4/Font_Demo_4.ino +++ b/examples/Smooth Fonts/LittleFS/Font_Demo_4/Font_Demo_4.ino @@ -61,7 +61,7 @@ void setup(void) { tft.setRotation(1); - spr.setColorDepth(16); // 16 bit colour needed to show anti-aliased fonts + spr.setcolorDepth(16); // 16-bit colour needed to show anti-aliased fonts if (!LittleFS.begin()) { Serial.println("Flash FS initialisation failed!"); @@ -102,7 +102,7 @@ void loop() { spr.setTextColor(TFT_YELLOW, TFT_BLACK); // Set the sprite font colour and the background colour - tft.setCursor(xpos - 50, ypos); // Set the tft cursor position, yes tft position! + tft.setcursor(xpos - 50, ypos); // Set the tft cursor position, yes tft position! spr.printToSprite("Small 15pt font"); // Prints to tft cursor position, tft cursor NOT moved ypos += spr.fontHeight(); // Get the font height and move ypos down @@ -121,14 +121,14 @@ void loop() { spr.setTextColor(TFT_WHITE, TFT_BLUE); // Set the font colour and the background colour - tft.setCursor(xpos - 90, ypos); // Set the tft cursor position + tft.setcursor(xpos - 90, ypos); // Set the tft cursor position spr.printToSprite("36pt font"); // Text is rendered via a minimally sized sprite ypos += spr.fontHeight(); // Get the font height and move ypos down // Draw changing numbers - no flicker using this plot method! for (int i = 0; i <= 200; i++) { - tft.setCursor(10, 10); + tft.setcursor(10, 10); // Number is converted to String type by (String) (number) spr.printToSprite(" " + (String) (i / 100.0) + " "); // Space padding helps over-write old numbers delay (20); diff --git a/examples/Smooth Fonts/LittleFS/Print_Smooth_Font/Print_Smooth_Font.ino b/examples/Smooth Fonts/LittleFS/Print_Smooth_Font/Print_Smooth_Font.ino index 1b4f1c2..623f610 100644 --- a/examples/Smooth Fonts/LittleFS/Print_Smooth_Font/Print_Smooth_Font.ino +++ b/examples/Smooth Fonts/LittleFS/Print_Smooth_Font/Print_Smooth_Font.ino @@ -12,7 +12,7 @@ sketch in the library Tools folder. The Processing sketch can convert TrueType fonts in *.ttf or *.otf files. - The library supports 16 bit Unicode characters: + The library supports 16-bit Unicode characters: https://en.wikipedia.org/wiki/Unicode_font The characters supported are in the in the Basic Multilingual Plane: @@ -78,7 +78,7 @@ void loop() { // Set "cursor" at top left corner of display (0,0) // (cursor will move to next line automatically during printing with 'tft.println' // or stay on the line is there is room for the text with tft.print) - tft.setCursor(0, 0); + tft.setcursor(0, 0); // Set the font colour to be white with a black background, set text size multiplier to 1 tft.setTextColor(TFT_WHITE, TFT_BLACK); diff --git a/examples/Smooth Fonts/LittleFS/Smooth_font_gradient/Smooth_font_gradient.ino b/examples/Smooth Fonts/LittleFS/Smooth_font_gradient/Smooth_font_gradient.ino index caf1e27..c025a1d 100644 --- a/examples/Smooth Fonts/LittleFS/Smooth_font_gradient/Smooth_font_gradient.ino +++ b/examples/Smooth Fonts/LittleFS/Smooth_font_gradient/Smooth_font_gradient.ino @@ -10,7 +10,7 @@ that will return the pixel xolor at a position x,y on the TFT. In this sketch that function is called gradientColor, so this line is included: - tft.setCallback(gradientColor); + tft.setcallback(gradientColor); TFT_eSPI will call this function during the rendering of the anti-aliased font to blend the edges of each character with the returned color. @@ -73,8 +73,8 @@ void setup(void) { tft.begin(); - tft.setCallback(gradientColor); // Switch on color callback for anti-aliased fonts - //tft.setCallback(nullptr); // Switch off callback (off by default) + tft.setcallback(gradientColor); // Switch on color callback for anti-aliased fonts + //tft.setcallback(nullptr); // Switch off callback (off by default) tft.setRotation(1); @@ -108,7 +108,7 @@ void loop() { fillGradient(); // Put here after selecting the font so fontHeight() is already set tft.setTextColor(TFT_WHITE); // Background color is ignored in gradient area - tft.setCursor(0, 10); // Set cursor at top left of screen + tft.setcursor(0, 10); // Set cursor at top left of screen uint32_t t = millis(); tft.println(" Ode to a small\n lump of green\n putty I found\n in my armpit\n one midsummer\n morning "); diff --git a/examples/Smooth Fonts/LittleFS/Smooth_font_reading_TFT/Smooth_font_reading_TFT.ino b/examples/Smooth Fonts/LittleFS/Smooth_font_reading_TFT/Smooth_font_reading_TFT.ino index 87981cf..07ee3ef 100644 --- a/examples/Smooth Fonts/LittleFS/Smooth_font_reading_TFT/Smooth_font_reading_TFT.ino +++ b/examples/Smooth Fonts/LittleFS/Smooth_font_reading_TFT/Smooth_font_reading_TFT.ino @@ -10,7 +10,7 @@ that will return the pixel color at a position x,y on the TFT. In this sketch that function is called pixelColor, so this line is included: - tft.setCallback(pixelColor); + tft.setcallback(pixelColor); TFT_eSPI will call this function during the rendering of the anti-aliased font and use it to blend the edges of each character with the screen color. @@ -52,8 +52,8 @@ void setup(void) { tft.begin(); - tft.setCallback(pixelColor); // The callback is only used during font rendering - //tft.setCallback(nullptr); // Switch off callback (off by default) + tft.setcallback(pixelColor); // The callback is only used during font rendering + //tft.setcallback(nullptr); // Switch off callback (off by default) tft.setRotation(1); @@ -88,7 +88,7 @@ void loop() { tft.loadFont(AA_FONT_SMALL, LittleFS); tft.setTextColor(TFT_BLACK, TFT_WHITE); // Background color is ignored if callback is set - tft.setCursor(0, 10); // Set cursor at top left of screen + tft.setcursor(0, 10); // Set cursor at top left of screen uint32_t t = millis(); tft.println(" Ode to a small\n lump of green\n putty I found\n in my armpit\n one midsummer\n morning "); diff --git a/examples/Smooth Fonts/LittleFS/Unicode_test/Unicode_test.ino b/examples/Smooth Fonts/LittleFS/Unicode_test/Unicode_test.ino index 530ae5b..4d19506 100644 --- a/examples/Smooth Fonts/LittleFS/Unicode_test/Unicode_test.ino +++ b/examples/Smooth Fonts/LittleFS/Unicode_test/Unicode_test.ino @@ -15,7 +15,7 @@ String okay = "5µA"; // Good This is because UTF-8 characters outside the basic Latin set occupy more than - 1 byte per character! A 16 bit Unicode character occupies 3 bytes! + 1 byte per character! A 16-bit Unicode character occupies 3 bytes! */ @@ -82,7 +82,7 @@ void loop() tft.showFont(2000); // Note: This function moves the cursor position! tft.fillScreen(bg); - tft.setCursor(0,0); + tft.setcursor(0,0); tft.println(test1); @@ -104,7 +104,7 @@ void loop() tft.showFont(2000); // Note: This function moves the cursor position! tft.fillScreen(bg); - tft.setCursor(0,0); + tft.setcursor(0,0); uint32_t dt = millis(); tft.setTextColor(TFT_CYAN, bg); tft.println(test2); @@ -134,7 +134,7 @@ dt = millis(); Serial.println(millis()-dt); tft.fillScreen(bg); tft.setTextColor(TFT_GREEN, bg); - tft.setCursor(0,0); + tft.setcursor(0,0); dt = millis(); tft.println("Konnichiwa"); tft.println(test3); diff --git a/examples/Smooth Fonts/SD_Card/ESP32_Smooth_Font_SD/ESP32_Smooth_Font_SD.ino b/examples/Smooth Fonts/SD_Card/ESP32_Smooth_Font_SD/ESP32_Smooth_Font_SD.ino index 8013a5c..73ad4bd 100644 --- a/examples/Smooth Fonts/SD_Card/ESP32_Smooth_Font_SD/ESP32_Smooth_Font_SD.ino +++ b/examples/Smooth Fonts/SD_Card/ESP32_Smooth_Font_SD/ESP32_Smooth_Font_SD.ino @@ -10,7 +10,7 @@ Load the font file onto the root directory of the SD Card. The font files used by this sketch can be found in the Data folder, press Ctrl+K to see it. - The library supports 16 bit Unicode characters: + The library supports 16-bit Unicode characters: https://en.wikipedia.org/wiki/Unicode_font The characters supported are in the in the Basic Multilingual Plane: @@ -103,7 +103,7 @@ void loop() { // Set "cursor" at top left corner of display (0,0) // (cursor will move to next line automatically during printing with 'tft.println' // or stay on the line is there is room for the text with tft.print) - tft.setCursor(0, 0); + tft.setcursor(0, 0); // Set the font colour to be white with a black background, set text size multiplier to 1 tft.setTextColor(TFT_WHITE, TFT_BLACK); diff --git a/examples/Smooth Fonts/SPIFFS/Font_Demo_1/Font_Demo_1.ino b/examples/Smooth Fonts/SPIFFS/Font_Demo_1/Font_Demo_1.ino index 5b8c781..b58f175 100644 --- a/examples/Smooth Fonts/SPIFFS/Font_Demo_1/Font_Demo_1.ino +++ b/examples/Smooth Fonts/SPIFFS/Font_Demo_1/Font_Demo_1.ino @@ -81,7 +81,7 @@ void loop() { tft.setTextColor(TFT_WHITE, TFT_BLACK); // Set the font colour AND the background colour // so the anti-aliasing works - tft.setCursor(0, 0); // Set cursor at top left of screen + tft.setcursor(0, 0); // Set cursor at top left of screen // >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> @@ -121,7 +121,7 @@ void loop() { // Get ready for the next demo while we have this font loaded tft.fillScreen(TFT_BLACK); - tft.setCursor(0, 0); // Set cursor at top left of screen + tft.setcursor(0, 0); // Set cursor at top left of screen tft.setTextColor(TFT_WHITE, TFT_BLACK); tft.println("Wrong and right ways to"); tft.println("print changing values..."); @@ -140,17 +140,17 @@ void loop() { // Draw changing numbers - does not work unless a filled rectangle is drawn over the old text for (int i = 0; i <= 20; i++) { - tft.setCursor(50, 50); + tft.setcursor(50, 50); tft.setTextColor(TFT_GREEN, TFT_BLACK); // TFT_BLACK is used for anti-aliasing only // By default background fill is off tft.print(" "); // Overprinting old number with spaces DOES NOT WORK! - tft.setCursor(50, 50); + tft.setcursor(50, 50); tft.print(i / 10.0, 1); // Adding a parameter "true" to the setTextColor() function fills character background // This extra parameter is only for smooth fonts! tft.setTextColor(TFT_GREEN, TFT_BLACK, true); - tft.setCursor(50, 90); + tft.setcursor(50, 90); tft.print(i / 10.0, 1); delay (200); @@ -166,7 +166,7 @@ void loop() { tft.setTextColor(TFT_YELLOW, TFT_BLACK); // Change the font colour and the background colour - tft.setCursor(0, 0); // Set cursor at top left of screen + tft.setcursor(0, 0); // Set cursor at top left of screen tft.println("Large font!"); diff --git a/examples/Smooth Fonts/SPIFFS/Font_Demo_3/Font_Demo_3.ino b/examples/Smooth Fonts/SPIFFS/Font_Demo_3/Font_Demo_3.ino index 6cbaca2..dbd38de 100644 --- a/examples/Smooth Fonts/SPIFFS/Font_Demo_3/Font_Demo_3.ino +++ b/examples/Smooth Fonts/SPIFFS/Font_Demo_3/Font_Demo_3.ino @@ -4,7 +4,7 @@ This sketch uses method 3, the font characters are first plotted in a Sprite, then the Sprite is pushed to the screen. This method is very flexible and the Sprite can be created, deleted, resized as needed. To render anti-aliased fonts well the Sprite - needs to be 16 bit. The fonts will render in 1 bit per pixel sprites but there + needs to be 16-bit. The fonts will render in 1 bit per pixel sprites but there will then be no anti-aliasing. Using 1 bit per pixel Sprites is however useful to use the extended Unicode range in fonts on mono displays like ePaper. @@ -50,7 +50,7 @@ void setup(void) { tft.setRotation(1); - spr.setColorDepth(16); // 16 bit colour needed to show anti aliased fonts + spr.setcolorDepth(16); // 16-bit colour needed to show anti aliased fonts if (!SPIFFS.begin()) { Serial.println("SPIFFS initialisation failed!"); @@ -200,8 +200,8 @@ void button(int x, int y, int num ) #define IWIDTH 40 #define IHEIGHT 25 - // Create a 16 bit sprite 40 pixels wide, 25 high (2000 bytes of RAM needed) - spr.setColorDepth(16); + // Create a 16-bit sprite 40 pixels wide, 25 high (2000 bytes of RAM needed) + spr.setcolorDepth(16); spr.createSprite(IWIDTH, IHEIGHT); // Fill it with black (this will be the transparent colour this time) diff --git a/examples/Smooth Fonts/SPIFFS/Font_Demo_4/Font_Demo_4.ino b/examples/Smooth Fonts/SPIFFS/Font_Demo_4/Font_Demo_4.ino index 8259723..7356c5f 100644 --- a/examples/Smooth Fonts/SPIFFS/Font_Demo_4/Font_Demo_4.ino +++ b/examples/Smooth Fonts/SPIFFS/Font_Demo_4/Font_Demo_4.ino @@ -61,7 +61,7 @@ void setup(void) { tft.setRotation(1); - spr.setColorDepth(16); // 16 bit colour needed to show anti-aliased fonts + spr.setcolorDepth(16); // 16-bit colour needed to show anti-aliased fonts if (!SPIFFS.begin()) { Serial.println("SPIFFS initialisation failed!"); @@ -102,7 +102,7 @@ void loop() { spr.setTextColor(TFT_YELLOW, TFT_BLACK); // Set the sprite font colour and the background colour - tft.setCursor(xpos - 50, ypos); // Set the tft cursor position, yes tft position! + tft.setcursor(xpos - 50, ypos); // Set the tft cursor position, yes tft position! spr.printToSprite("Small 15pt font"); // Prints to tft cursor position, tft cursor NOT moved ypos += spr.fontHeight(); // Get the font height and move ypos down @@ -121,14 +121,14 @@ void loop() { spr.setTextColor(TFT_WHITE, TFT_BLUE); // Set the font colour and the background colour - tft.setCursor(xpos - 90, ypos); // Set the tft cursor position + tft.setcursor(xpos - 90, ypos); // Set the tft cursor position spr.printToSprite("36pt font"); // Text is rendered via a minimally sized sprite ypos += spr.fontHeight(); // Get the font height and move ypos down // Draw changing numbers - no flicker using this plot method! for (int i = 0; i <= 200; i++) { - tft.setCursor(10, 10); + tft.setcursor(10, 10); // Number is converted to String type by (String) (number) spr.printToSprite(" " + (String) (i / 100.0) + " "); // Space padding helps over-write old numbers delay (20); diff --git a/examples/Smooth Fonts/SPIFFS/Print_Smooth_Font/Print_Smooth_Font.ino b/examples/Smooth Fonts/SPIFFS/Print_Smooth_Font/Print_Smooth_Font.ino index d142d51..fbf5ef0 100644 --- a/examples/Smooth Fonts/SPIFFS/Print_Smooth_Font/Print_Smooth_Font.ino +++ b/examples/Smooth Fonts/SPIFFS/Print_Smooth_Font/Print_Smooth_Font.ino @@ -15,7 +15,7 @@ Note: SPIFFS does not accept an underscore _ in filenames! - The library supports 16 bit Unicode characters: + The library supports 16-bit Unicode characters: https://en.wikipedia.org/wiki/Unicode_font The characters supported are in the in the Basic Multilingual Plane: @@ -80,7 +80,7 @@ void loop() { // Set "cursor" at top left corner of display (0,0) // (cursor will move to next line automatically during printing with 'tft.println' // or stay on the line is there is room for the text with tft.print) - tft.setCursor(0, 0); + tft.setcursor(0, 0); // Set the font colour to be white with a black background, set text size multiplier to 1 tft.setTextColor(TFT_WHITE, TFT_BLACK); diff --git a/examples/Smooth Fonts/SPIFFS/Smooth_font_gradient/Smooth_font_gradient.ino b/examples/Smooth Fonts/SPIFFS/Smooth_font_gradient/Smooth_font_gradient.ino index 9efe983..2348758 100644 --- a/examples/Smooth Fonts/SPIFFS/Smooth_font_gradient/Smooth_font_gradient.ino +++ b/examples/Smooth Fonts/SPIFFS/Smooth_font_gradient/Smooth_font_gradient.ino @@ -10,7 +10,7 @@ that will return the pixel color at a position x,y on the TFT. In this sketch that function is called gradientColor, so this line is included: - tft.setCallback(gradientColor); + tft.setcallback(gradientColor); TFT_eSPI will call this function during the rendering of the anti-aliased font to blend the edges of each character with the returned color. @@ -73,8 +73,8 @@ void setup(void) { tft.begin(); - tft.setCallback(gradientColor); // Switch on color callback for anti-aliased fonts - //tft.setCallback(nullptr); // Switch off callback (off by default) + tft.setcallback(gradientColor); // Switch on color callback for anti-aliased fonts + //tft.setcallback(nullptr); // Switch off callback (off by default) tft.setRotation(1); @@ -109,7 +109,7 @@ void loop() { fillGradient(); // Put here after selecting the font so fontHeight() is already set tft.setTextColor(TFT_WHITE); // Background color is ignored in gradient area - tft.setCursor(0, 10); // Set cursor at top left of screen + tft.setcursor(0, 10); // Set cursor at top left of screen uint32_t t = millis(); tft.println(" Ode to a small\n lump of green\n putty I found\n in my armpit\n one midsummer\n morning "); diff --git a/examples/Smooth Fonts/SPIFFS/Smooth_font_reading_TFT/Smooth_font_reading_TFT.ino b/examples/Smooth Fonts/SPIFFS/Smooth_font_reading_TFT/Smooth_font_reading_TFT.ino index 99c6e62..deaccab 100644 --- a/examples/Smooth Fonts/SPIFFS/Smooth_font_reading_TFT/Smooth_font_reading_TFT.ino +++ b/examples/Smooth Fonts/SPIFFS/Smooth_font_reading_TFT/Smooth_font_reading_TFT.ino @@ -10,7 +10,7 @@ that will return the pixel color at a position x,y on the TFT. In this sketch that function is called pixelColor, so this line is included: - tft.setCallback(pixelColor); + tft.setcallback(pixelColor); TFT_eSPI will call this function during the rendering of the anti-aliased font and use it to blend the edges of each character with the screen color. @@ -52,8 +52,8 @@ void setup(void) { tft.begin(); - tft.setCallback(pixelColor); // The callback is only used during font rendering - //tft.setCallback(nullptr); // Switch off callback (off by default) + tft.setcallback(pixelColor); // The callback is only used during font rendering + //tft.setcallback(nullptr); // Switch off callback (off by default) tft.setRotation(1); @@ -88,7 +88,7 @@ void loop() { tft.loadFont(AA_FONT_SMALL); tft.setTextColor(TFT_BLACK, TFT_WHITE); // Background color is ignored if callback is set - tft.setCursor(0, 10); // Set cursor at top left of screen + tft.setcursor(0, 10); // Set cursor at top left of screen uint32_t t = millis(); tft.println(" Ode to a small\n lump of green\n putty I found\n in my armpit\n one midsummer\n morning "); diff --git a/examples/Smooth Fonts/SPIFFS/Unicode_test/Unicode_test.ino b/examples/Smooth Fonts/SPIFFS/Unicode_test/Unicode_test.ino index 26567d6..ec4e57c 100644 --- a/examples/Smooth Fonts/SPIFFS/Unicode_test/Unicode_test.ino +++ b/examples/Smooth Fonts/SPIFFS/Unicode_test/Unicode_test.ino @@ -15,7 +15,7 @@ String okay = "5µA"; // Good This is because UTF-8 characters outside the basic Latin set occupy more than - 1 byte per character! A 16 bit Unicode character occupies 3 bytes! + 1 byte per character! A 16-bit Unicode character occupies 3 bytes! */ @@ -77,7 +77,7 @@ void loop() tft.showFont(2000); // Note: This function moves the cursor position! tft.fillScreen(bg); - tft.setCursor(0,0); + tft.setcursor(0,0); tft.println(test1); @@ -99,7 +99,7 @@ void loop() tft.showFont(2000); // Note: This function moves the cursor position! tft.fillScreen(bg); - tft.setCursor(0,0); + tft.setcursor(0,0); tft.setTextColor(TFT_CYAN, bg); tft.println(test2); @@ -129,7 +129,7 @@ void loop() tft.fillScreen(bg); tft.setTextColor(TFT_GREEN, bg); - tft.setCursor(0,0); + tft.setcursor(0,0); tft.println("Konnichiwa"); tft.println(test3); diff --git a/examples/Smooth Graphics/Anti-aliased_Clock/Anti-aliased_Clock.ino b/examples/Smooth Graphics/Anti-aliased_Clock/Anti-aliased_Clock.ino index b4181f3..da8c948 100644 --- a/examples/Smooth Graphics/Anti-aliased_Clock/Anti-aliased_Clock.ino +++ b/examples/Smooth Graphics/Anti-aliased_Clock/Anti-aliased_Clock.ino @@ -74,7 +74,7 @@ void setup() { tft.fillScreen(TFT_BLACK); // Create the clock face sprite - //face.setColorDepth(8); // 8 bit will work, but reduces effectiveness of anti-aliasing + //face.setcolorDepth(8); // 8-bit will work, but reduces effectiveness of anti-aliasing face.createSprite(FACE_W, FACE_H); // Only 1 font used in the sprite, so can remain loaded @@ -138,7 +138,7 @@ static void renderFace(float t) { // Draw digits around clock perimeter for (uint32_t h = 1; h <= 12; h++) { - getCoord(CLOCK_R, CLOCK_R, &xp, &yp, dialOffset, h * 360.0 / 12); + getcoord(CLOCK_R, CLOCK_R, &xp, &yp, dialOffset, h * 360.0 / 12); face.drawNumber(h, xp, 2 + yp); } @@ -147,12 +147,12 @@ static void renderFace(float t) { face.drawString("TFT_eSPI", CLOCK_R, CLOCK_R * 0.75); // Draw minute hand - getCoord(CLOCK_R, CLOCK_R, &xp, &yp, M_HAND_LENGTH, m_angle); + getcoord(CLOCK_R, CLOCK_R, &xp, &yp, M_HAND_LENGTH, m_angle); face.drawWideLine(CLOCK_R, CLOCK_R, xp, yp, 6.0f, CLOCK_FG); face.drawWideLine(CLOCK_R, CLOCK_R, xp, yp, 2.0f, CLOCK_BG); // Draw hour hand - getCoord(CLOCK_R, CLOCK_R, &xp, &yp, H_HAND_LENGTH, h_angle); + getcoord(CLOCK_R, CLOCK_R, &xp, &yp, H_HAND_LENGTH, h_angle); face.drawWideLine(CLOCK_R, CLOCK_R, xp, yp, 6.0f, CLOCK_FG); face.drawWideLine(CLOCK_R, CLOCK_R, xp, yp, 2.0f, CLOCK_BG); @@ -160,7 +160,7 @@ static void renderFace(float t) { face.fillSmoothCircle(CLOCK_R, CLOCK_R, 4, CLOCK_FG); // Draw cecond hand - getCoord(CLOCK_R, CLOCK_R, &xp, &yp, S_HAND_LENGTH, s_angle); + getcoord(CLOCK_R, CLOCK_R, &xp, &yp, S_HAND_LENGTH, s_angle); face.drawWedgeLine(CLOCK_R, CLOCK_R, xp, yp, 2.5, 1.0, SECCOND_FG); face.pushSprite(5, 5, TFT_TRANSPARENT); } @@ -170,7 +170,7 @@ static void renderFace(float t) { // ========================================================================= // Coordinates are returned to caller via the xp and yp pointers #define DEG2RAD 0.0174532925 -void getCoord(int16_t x, int16_t y, float *xp, float *yp, int16_t r, float a) +void getcoord(int16_t x, int16_t y, float *xp, float *yp, int16_t r, float a) { float sx1 = cos( (a - 90) * DEG2RAD); float sy1 = sin( (a - 90) * DEG2RAD); diff --git a/examples/Smooth Graphics/Anti-aliased_Clock/NTP_Time.h b/examples/Smooth Graphics/Anti-aliased_Clock/NTP_Time.h index bb72e32..2ccc453 100644 --- a/examples/Smooth Graphics/Anti-aliased_Clock/NTP_Time.h +++ b/examples/Smooth Graphics/Anti-aliased_Clock/NTP_Time.h @@ -31,16 +31,16 @@ WiFiUDP udp; // Settings //==================================================================================== -#define TIMEZONE UK // See below for other "Zone references", UK, usMT etc +#define TIMEZONE UK // See below for other "Zone references", UK, usMT etc. #ifdef ESP32 // Temporary fix, ESP8266 fails to communicate with some servers... -// Try to use pool url instead so the server IP address is looked up from those available +// Try to use pool URL instead so the server IP address is looked up from those available // (use a pool server in your own country to improve response time and reliability) //const char* ntpServerName = "time.nist.gov"; //const char* ntpServerName = "pool.ntp.org"; const char* ntpServerName = "time.google.com"; #else -// Try to use pool url instead so the server IP address is looked up from those available +// Try to use pool URL instead so the server IP address is looked up from those available // (use a pool server in your own country to improve response time and reliability) // const char* ntpServerName = "time.nist.gov"; const char* ntpServerName = "pool.ntp.org"; diff --git a/examples/Smooth Graphics/Arc_meter_demo/Arc_meter_demo.ino b/examples/Smooth Graphics/Arc_meter_demo/Arc_meter_demo.ino index 69f04a6..5aba759 100644 --- a/examples/Smooth Graphics/Arc_meter_demo/Arc_meter_demo.ino +++ b/examples/Smooth Graphics/Arc_meter_demo/Arc_meter_demo.ino @@ -43,7 +43,7 @@ OpenFontRender ofr; uint32_t runTime = 0; // time for next update int reading = 0; // Value to be displayed -int d = 0; // Variable used for the sinewave test waveform +int d = 0; // Variable used for the sine wave test waveform bool range_error = 0; int8_t ramp = 1; @@ -109,12 +109,12 @@ void loop() { } #ifdef DRAW_DIGITS - ofr.unloadFont(); // Recover space used by font metrics etc + ofr.unloadFont(); // Recover space used by font metrics etc. #endif } // ######################################################################### -// Draw the meter on the screen, returns x coord of righthand side +// Draw the meter on the screen, returns x coord of right-hand side // ######################################################################### // x,y is centre of meter, r the radius, val a number in range 0-100 // units is the meter scale label @@ -154,10 +154,10 @@ void ringMeter(int x, int y, int r, int val, const char *units) // The OpenFontRender library only has simple print functions... - // Digit jiggle for chaging values often happens with proportional fonts because + // Digit jiggle for changing values often happens with proportional fonts because // digit glyph width varies ( 1 narrower that 4 for example). This code prints up to // 3 digits with even spacing. - // A few experiemntal fudge factors are used here to position the + // A few experimental fudge factors are used here to position the // digits in the sprite... // Create a sprite to draw the digits into uint8_t w = ofr.getTextWidth("444"); @@ -167,12 +167,12 @@ void ringMeter(int x, int y, int r, int val, const char *units) char str_buf[8]; // Buffed for string itoa (val, str_buf, 10); // Convert value to string (null terminated) uint8_t ptr = 0; // Pointer to a digit character - uint8_t dx = 4; // x offfset for cursor position + uint8_t dx = 4; // x offset for cursor position if (val < 100) dx = ofr.getTextWidth("4") / 2; // Adjust cursor x for 2 digits if (val < 10) dx = ofr.getTextWidth("4"); // Adjust cursor x for 1 digit while ((uint8_t)str_buf[ptr] != 0) ptr++; // Count the characters while (ptr) { - ofr.setCursor(w - dx - w / 20, -h / 2.5); // Offset cursor position in sprtie + ofr.setcursor(w - dx - w / 20, -h / 2.5); // Offset cursor position in sprite ofr.rprintf(str_buf + ptr - 1); // Draw a character str_buf[ptr - 1] = 0; // Replace character with a null dx += 1 + w / 3; // Adjust cursor for next character @@ -185,12 +185,12 @@ void ringMeter(int x, int y, int r, int val, const char *units) ofr.setDrawer(tft); ofr.setFontColor(TFT_GOLD, DARKER_GREY); ofr.setFontSize(r / 2.0); - ofr.setCursor(x, y + (r * 0.4)); + ofr.setcursor(x, y + (r * 0.4)); ofr.cprintf("Watts"); } #endif - //ofr.unloadFont(); // Recover space used by font metrics etc + //ofr.unloadFont(); // Recover space used by font metrics etc. // Allocate a value to the arc thickness dependant of radius uint8_t thickness = r / 5; diff --git a/examples/Smooth Graphics/Draw_Smooth_Circles/Draw_Smooth_Circles.ino b/examples/Smooth Graphics/Draw_Smooth_Circles/Draw_Smooth_Circles.ino index ea49d65..32aa156 100644 --- a/examples/Smooth Graphics/Draw_Smooth_Circles/Draw_Smooth_Circles.ino +++ b/examples/Smooth Graphics/Draw_Smooth_Circles/Draw_Smooth_Circles.ino @@ -44,7 +44,7 @@ void loop() // ------------------------------------------------------------------------- -// Return a 16 bit rainbow colour +// Return a 16-bit rainbow colour // ------------------------------------------------------------------------- unsigned int rainbow(byte value) { @@ -54,7 +54,7 @@ unsigned int rainbow(byte value) value = value%192; - byte red = 0; // Red is the top 5 bits of a 16 bit colour value + byte red = 0; // Red is the top 5 bits of a 16-bit colour value byte green = 0; // Green is the middle 6 bits, but only top 5 bits used here byte blue = 0; // Blue is the bottom 5 bits diff --git a/examples/Smooth Graphics/Smooth_Graphics_Demo/Smooth_Graphics_Demo.ino b/examples/Smooth Graphics/Smooth_Graphics_Demo/Smooth_Graphics_Demo.ino index b8638e9..2073109 100644 --- a/examples/Smooth Graphics/Smooth_Graphics_Demo/Smooth_Graphics_Demo.ino +++ b/examples/Smooth Graphics/Smooth_Graphics_Demo/Smooth_Graphics_Demo.ino @@ -1,4 +1,4 @@ -// Sketch to demonstrate smooth (anti-aliased) graphics funtions: +// Sketch to demonstrate smooth (anti-aliased) graphics functions: // Smooth graphics result in less pixel resolution jaggedness. #include // Master copy here: https://github.com/Bodmer/TFT_eSPI @@ -35,7 +35,7 @@ void loop() { // drawSpot is for small anti-aliased circles, coordinates and radius are // floating point to allow sub-pixel positioning (large circles will // be slow to draw). Use fillSmoothCircle() for large circles. - // In this case black is the backgorund colour for the anti-aliasing + // In this case black is the background colour for the anti-aliasing float x = 10.5; float y = 10.5; float r = 8.6; @@ -43,7 +43,7 @@ void loop() { // Fill sprite with a colour spr.fillSprite(TFT_RED); - // Draw spot in sprite, the backgorund colour is ommitted so function + // Draw spot in sprite, the background colour is omitted so function // reads background colour for aliasing. (To use this method with direct write // to TFT (tft.drawSpot...) requires the capability to read data from the TFT!) spr.drawSpot(x, y, r, TFT_WHITE); @@ -63,7 +63,7 @@ void loop() { int w1 = r1 / 25; int w2 = r2 / 20; - // The following will be updated by the getCoord function + // The following will be updated by the getcoord function float px1 = 0.0; float py1 = 0.0; float px2 = 0.0; @@ -72,7 +72,7 @@ void loop() { // Wedge line function, an anti-aliased wide line between 2 points, with different // line widths at the two ends. Background colour is black. for (int angle = -130; angle <= 130; angle += 10) { - getCoord(cx, cy, &px1, &py1, &px2, &py2, r1, r2, angle); + getcoord(cx, cy, &px1, &py1, &px2, &py2, r1, r2, angle); uint16_t colour = rainbow(map(angle, -130, 130, 0, 127)); if (angle > 45) colour = TFT_DARKGREY; tft.drawWedgeLine(px1, py1, px2, py2, w1, w2, colour, TFT_BLACK); @@ -82,7 +82,7 @@ void loop() { tft.fillSmoothCircle(cx, cy, r1 - 8, TFT_MAROON, TFT_BLACK); // Draw a white dial pointer using wedge line function - getCoord(cx, cy, &px1, &py1, &px2, &py2, 0, r1 - 10, 45); + getcoord(cx, cy, &px1, &py1, &px2, &py2, 0, r1 - 10, 45); // Magenta wedge line pointer on red background // Line tapers from radius 5 to zero tft.drawWedgeLine(cx, cy, px2, py2, 5, 0, TFT_WHITE, TFT_MAROON); @@ -133,7 +133,7 @@ void loop() { // ========================================================================= // Coordinates are returned to caller via the xp and yp pointers #define DEG2RAD 0.0174532925 -void getCoord(int16_t x, int16_t y, float *xp1, float *yp1, float *xp2, float *yp2, int16_t r1, int16_t r2, float a) +void getcoord(int16_t x, int16_t y, float *xp1, float *yp1, float *xp2, float *yp2, int16_t r1, int16_t r2, float a) { float sx = cos( (a - 90) * DEG2RAD); float sy = sin( (a - 90) * DEG2RAD); @@ -144,14 +144,14 @@ void getCoord(int16_t x, int16_t y, float *xp1, float *yp1, float *xp2, float *y } // ========================================================================= -// Return a 16 bit rainbow colour +// Return a 16-bit rainbow colour // ========================================================================= unsigned int rainbow(byte value) { // Value is expected to be in range 0-127 // The value is converted to a spectrum colour from 0 = blue through to 127 = red - byte red = 0; // Red is the top 5 bits of a 16 bit colour value + byte red = 0; // Red is the top 5 bits of a 16-bit colour value byte green = 0;// Green is the middle 6 bits byte blue = 0; // Blue is the bottom 5 bits diff --git a/examples/Smooth Graphics/Smooth_Rounded_Rectangles/Smooth_Rounded_Rectangles.ino b/examples/Smooth Graphics/Smooth_Rounded_Rectangles/Smooth_Rounded_Rectangles.ino index 802282f..c31c3e3 100644 --- a/examples/Smooth Graphics/Smooth_Rounded_Rectangles/Smooth_Rounded_Rectangles.ino +++ b/examples/Smooth Graphics/Smooth_Rounded_Rectangles/Smooth_Rounded_Rectangles.ino @@ -11,7 +11,7 @@ void setup(void) { void loop() { tft.fillScreen(TFT_BLACK); - tft.setCursor(0, 0); + tft.setcursor(0, 0); // Draw some random smooth rounded rectangles for (int i = 0; i < 20; i++) @@ -30,7 +30,7 @@ void loop() { delay(2000); tft.fillScreen(TFT_BLACK); - tft.setCursor(0, 0); + tft.setcursor(0, 0); // Draw some random minimum thickness smooth rounded rectangles for (int i = 0; i < 20; i++) diff --git a/examples/Sprite/Animated_dial/Animated_dial.ino b/examples/Sprite/Animated_dial/Animated_dial.ino index ed71e86..526b428 100644 --- a/examples/Sprite/Animated_dial/Animated_dial.ino +++ b/examples/Sprite/Animated_dial/Animated_dial.ino @@ -70,7 +70,7 @@ void setup() { TJpgDec.setSwapBytes(true); // The jpeg decoder must be given the exact name of the rendering function above - TJpgDec.setCallback(tft_output); + TJpgDec.setcallback(tft_output); tft.begin(); tft.setRotation(0); @@ -128,7 +128,7 @@ void loop() { // ======================================================================================= void createNeedle(void) { - needle.setColorDepth(16); + needle.setcolorDepth(16); needle.createSprite(NEEDLE_WIDTH, NEEDLE_LENGTH); // create the needle Sprite needle.fillSprite(TFT_BLACK); // Fill with black diff --git a/examples/Sprite/One_bit_Sprite_Demo/One_bit_Sprite_Demo.ino b/examples/Sprite/One_bit_Sprite_Demo/One_bit_Sprite_Demo.ino index dacf64f..fb474b2 100644 --- a/examples/Sprite/One_bit_Sprite_Demo/One_bit_Sprite_Demo.ino +++ b/examples/Sprite/One_bit_Sprite_Demo/One_bit_Sprite_Demo.ino @@ -12,7 +12,7 @@ any position. If there is sufficient RAM then the Sprite can be the same size as the screen and used as a frame buffer. - A 1 bit Sprite occupies (width * height)/8 bytes in RAM. So, + A 1-bit Sprite occupies (width * height)/8 bytes in RAM. So, for example, a 320 x 240 pixel Sprite occupies 9600 bytes. */ // A new setBitmapColor(fg_color, bg_color) function allows @@ -76,7 +76,7 @@ void drawStar(int x, int y, int star_color) // Create an 1 bit (2 colour) sprite 70x80 pixels (uses 70*80/8 = 700 bytes of RAM) // Colour depths of 8 bits per pixel and 16 bits are also supported. - img.setColorDepth(BITS_PER_PIXEL); // Set colour depth first + img.setcolorDepth(BITS_PER_PIXEL); // Set colour depth first img.createSprite(70, 80); // then create the sprite // Fill Sprite with the colour that will be defined later as "transparent" diff --git a/examples/Sprite/One_bit_Yin_Yang/One_bit_Yin_Yang.ino b/examples/Sprite/One_bit_Yin_Yang/One_bit_Yin_Yang.ino index 8ba6f82..bbeeaa0 100644 --- a/examples/Sprite/One_bit_Yin_Yang/One_bit_Yin_Yang.ino +++ b/examples/Sprite/One_bit_Yin_Yang/One_bit_Yin_Yang.ino @@ -34,7 +34,7 @@ void setup(void) tft.setRotation(0); tft.fillScreen(TFT_BLUE); - img.setColorDepth(COLOR_DEPTH); + img.setcolorDepth(COLOR_DEPTH); img.createSprite(RADIUS*2+1, RADIUS*2+1); img.fillSprite(TFT_BLACK); } @@ -68,14 +68,14 @@ void loop() { void yinyang(int x, int y, int start_angle, int r) { - int x1 = 0; // getCoord() will update these + int x1 = 0; // getcoord() will update these int y1 = 0; - getCoord(x, y, &x1, &y1, r/2, start_angle); // Get x1 ,y1 + getcoord(x, y, &x1, &y1, r/2, start_angle); // Get x1 ,y1 img.fillCircle( x1, y1, r/2, TFT_WHITE); img.fillCircle( x1, y1, r/8, TFT_BLACK); - getCoord(x, y, &x1, &y1, r/2, start_angle + 180); + getcoord(x, y, &x1, &y1, r/2, start_angle + 180); img.fillCircle( x1, y1, r/2, TFT_BLACK); img.fillCircle( x1, y1, r/8, TFT_WHITE); @@ -87,7 +87,7 @@ void yinyang(int x, int y, int start_angle, int r) // ========================================================================= // Coordinates are returned to caller via the xp and yp pointers #define RAD2DEG 0.0174532925 -void getCoord(int x, int y, int *xp, int *yp, int r, int a) +void getcoord(int x, int y, int *xp, int *yp, int r, int a) { float sx1 = cos( (a-90) * RAD2DEG ); float sy1 = sin( (a-90) * RAD2DEG ); diff --git a/examples/Sprite/Orrery/Orrery.ino b/examples/Sprite/Orrery/Orrery.ino index 658a711..3ab7da3 100644 --- a/examples/Sprite/Orrery/Orrery.ino +++ b/examples/Sprite/Orrery/Orrery.ino @@ -90,7 +90,7 @@ void loop() { // ========================================================================= // Coordinates are returned to caller via the xp and yp pointers #define DEG2RAD 0.0174532925 -void getCoord(int x, int y, int *xp, int *yp, int r, float a) +void getcoord(int x, int y, int *xp, int *yp, int r, float a) { float sx1 = cos( -a * DEG2RAD ); float sy1 = sin( -a * DEG2RAD ); @@ -131,10 +131,10 @@ int plot_planets(void) { ang = Astronomy_EclipticLongitude(body[i], astro_time); - int x1 = 0; // getCoord() will update these + int x1 = 0; // getcoord() will update these int y1 = 0; - getCoord(0, 0, &x1, &y1, i * 28, ang.angle); // Get x1 ,y1 + getcoord(0, 0, &x1, &y1, i * 28, ang.angle); // Get x1 ,y1 img.fillSprite(TFT_TRANSPARENT); img.fillCircle(9, 9, 9, TFT_BLACK); @@ -149,7 +149,7 @@ int plot_planets(void) int xm = 0; int ym = 0; - getCoord(x1, y1, &xm, &ym, 15, 180 + ang.angle + mang.angle); // Get x1 ,y1 + getcoord(x1, y1, &xm, &ym, 15, 180 + ang.angle + mang.angle); // Get x1 ,y1 img.fillSprite(TFT_TRANSPARENT); img.fillCircle(9, 9, 7, TFT_BLACK); diff --git a/examples/Sprite/Rotated_Sprite_1/Rotated_Sprite_1.ino b/examples/Sprite/Rotated_Sprite_1/Rotated_Sprite_1.ino index a6a0a6a..0e2adff 100644 --- a/examples/Sprite/Rotated_Sprite_1/Rotated_Sprite_1.ino +++ b/examples/Sprite/Rotated_Sprite_1/Rotated_Sprite_1.ino @@ -10,7 +10,7 @@ // screen very simple. The rotation is clockwise with increasing angle. The angle is in // degrees, an angle of 0 means no Sprite rotation. -// The pushRotated() function works with 1, 4, 8 and 16 bit per pixel (bpp) Sprites. +// The pushRotated() function works with 1, 4, 8 and 16-bit per pixel (bpp) Sprites. // The original Sprite is unchanged so can be plotted again at a different angle. @@ -20,7 +20,7 @@ // For 1 bpp Sprites the foreground and background colours are defined with the // function spr.setBitmapColor(foregroundColor, backgroundColor). -// For 4 bpp Sprites the colour map index is used instead of the 16 bit colour +// For 4 bpp Sprites the colour map index is used instead of the 16-bit colour // e.g. spr.setTextColor(5); // Green text in default colour map // See "Transparent_Sprite_Demo_4bit" example for default colour map details @@ -59,7 +59,7 @@ void loop() { drawX(xw, yh); // Show where screen pivot is // Create the Sprite - spr.setColorDepth(8); // Create an 8bpp Sprite of 60x30 pixels + spr.setcolorDepth(8); // Create an 8bpp Sprite of 60x30 pixels spr.createSprite(64, 30); // 8bpp requires 64 * 30 = 1920 bytes spr.setPivot(32, 55); // Set pivot relative to top left corner of Sprite spr.fillSprite(TFT_BLACK); // Fill the Sprite with black @@ -120,7 +120,7 @@ void loop() { spr.deleteSprite(); - spr.setColorDepth(8); // Create a 8bpp Sprite + spr.setcolorDepth(8); // Create a 8bpp Sprite spr.createSprite(40, 30); // Create a new Sprite 40x30 spr.setPivot(20, 70); // Set Sprite pivot at 20,80 diff --git a/examples/Sprite/Rotated_Sprite_2/Rotated_Sprite_2.ino b/examples/Sprite/Rotated_Sprite_2/Rotated_Sprite_2.ino index bb27922..5d80c93 100644 --- a/examples/Sprite/Rotated_Sprite_2/Rotated_Sprite_2.ino +++ b/examples/Sprite/Rotated_Sprite_2/Rotated_Sprite_2.ino @@ -14,7 +14,7 @@ // The rotation angle is in degrees, an angle of 0 means no Sprite rotation. -// The pushRotated() function works with 1, 8 and 16 bit per pixel (bpp) Sprites. +// The pushRotated() function works with 1, 8 and 16-bit per pixel (bpp) Sprites. // For 1 bpp Sprites the foreground and background colours are defined with the // member function setBitmapColor(foregroundColor, backgroundColor). @@ -99,7 +99,7 @@ void loop() { void createDialScale(int16_t start_angle, int16_t end_angle, int16_t increment) { // Create the dial Sprite - dial.setColorDepth(8); // Size is odd (i.e. 91) so there is a centre pixel at 45,45 + dial.setcolorDepth(8); // Size is odd (i.e. 91) so there is a centre pixel at 45,45 dial.createSprite(91, 91); // 8bpp requires 91 * 91 = 8281 bytes dial.setPivot(45, 45); // set pivot in middle of dial Sprite @@ -158,7 +158,7 @@ void plotDial(int16_t x, int16_t y, int16_t angle, String label, uint16_t val) void createNeedle(void) { - needle.setColorDepth(8); + needle.setcolorDepth(8); needle.createSprite(11, 49); // create the needle Sprite 11 pixels wide by 49 high needle.fillSprite(TFT_BLACK); // Fill with black diff --git a/examples/Sprite/Rotated_Sprite_3/Rotated_Sprite_3.ino b/examples/Sprite/Rotated_Sprite_3/Rotated_Sprite_3.ino index 2b93dc9..5341be9 100644 --- a/examples/Sprite/Rotated_Sprite_3/Rotated_Sprite_3.ino +++ b/examples/Sprite/Rotated_Sprite_3/Rotated_Sprite_3.ino @@ -80,7 +80,7 @@ void setup() // Send jpeg info to serial port fex.jpegInfo("/Eye_80x64.jpg"); - // Draw jpeg iamge in Sprite spr at 0,0 + // Draw jpeg image in Sprite spr at 0,0 fex.drawJpeg("/Eye_80x64.jpg", 0 , 0, &spr); } @@ -105,7 +105,7 @@ void loop() delay(1000); // Push copies of Sprite rotated through increasing angles 0-360 degrees - // with 45 fegree increments + // with 45 degree increments for (int16_t angle = 0; angle <= 360; angle += 45) { spr.pushRotated(angle); delay(500); diff --git a/examples/Sprite/Sprite_RLE_Font_test/Sprite_RLE_Font_test.ino b/examples/Sprite/Sprite_RLE_Font_test/Sprite_RLE_Font_test.ino index 9d6cf8e..4522532 100644 --- a/examples/Sprite/Sprite_RLE_Font_test/Sprite_RLE_Font_test.ino +++ b/examples/Sprite/Sprite_RLE_Font_test/Sprite_RLE_Font_test.ino @@ -9,7 +9,7 @@ ######################################################################### */ -// Specify sprite 160 x 128 pixels (needs 40Kbytes of RAM for 16 bit colour) +// Specify sprite 160 x 128 pixels (needs 40Kbytes of RAM for 16-bit colour) #define IWIDTH 160 #define IHEIGHT 128 @@ -31,7 +31,7 @@ void setup(void) { tft.fillScreen(TFT_BLUE); - //img.setColorDepth(8); // Optionally set depth to 8 to halve RAM use + //img.setcolorDepth(8); // Optionally set depth to 8 to halve RAM use img.createSprite(IWIDTH, IHEIGHT); img.fillSprite(TFT_BLACK); } diff --git a/examples/Sprite/Sprite_draw/Sprite_draw.ino b/examples/Sprite/Sprite_draw/Sprite_draw.ino index e167d68..7a665e4 100644 --- a/examples/Sprite/Sprite_draw/Sprite_draw.ino +++ b/examples/Sprite/Sprite_draw/Sprite_draw.ino @@ -14,12 +14,12 @@ any position. If there is sufficient RAM then the Sprite can be the same size as the screen and used as a frame buffer. - A 16 bit Sprite occupies (2 * width * height) bytes in RAM. + A 16-bit Sprite occupies (2 * width * height) bytes in RAM. On a ESP8266 Sprite sizes up to 126 x 160 can be accommodated, - this size requires 40kBytes of RAM for a 16 bit colour depth. + this size requires 40kBytes of RAM for a 16-bit colour depth. - When 8 bit colour depth sprites are created they occupy + When 8-bit colour depth sprites are created they occupy (width * height) bytes in RAM, so larger sprites can be created, or the RAM required is halved. @@ -47,7 +47,7 @@ void setup() tft.init(); // Optionally set colour depth to 8 or 16 bits, default is 16 if not specified - // spr.setColorDepth(8); + // spr.setcolorDepth(8); // Create a sprite of defined size spr.createSprite(WIDTH, HEIGHT); diff --git a/examples/Sprite/Sprite_draw_4bit/Sprite_draw_4bit.ino b/examples/Sprite/Sprite_draw_4bit/Sprite_draw_4bit.ino index ca3ebe4..df20bad 100644 --- a/examples/Sprite/Sprite_draw_4bit/Sprite_draw_4bit.ino +++ b/examples/Sprite/Sprite_draw_4bit/Sprite_draw_4bit.ino @@ -1,9 +1,9 @@ /* - Sketch to show how a 4 bit Sprite is created, how to draw pixels + Sketch to show how a 4-bit Sprite is created, how to draw pixels and text within the Sprite and then push the Sprite onto the display screen. - The advantage of 4 bit sprites is: + The advantage of 4-bit sprites is: 1. Small memory footprint 2. Any set of 16 colours can be specified 3. Colours can be changed without redrawing in Sprite @@ -21,7 +21,7 @@ any position. If there is sufficient RAM then the Sprite can be the same size as the screen and used as a frame buffer. - A 4 bit Sprite occupies (width * height)/2 bytes in RAM. + A 4-bit Sprite occupies (width * height)/2 bytes in RAM. */ @@ -50,7 +50,7 @@ void setup() tft.init(); // Set the sprite colour depth to 4 - spr.setColorDepth(4); + spr.setcolorDepth(4); // Create a sprite of defined size spr.createSprite(WIDTH, HEIGHT); @@ -64,7 +64,7 @@ void loop(void) // Fill the whole sprite with color 0 (Sprite is in memory so not visible yet) spr.fillSprite(0); - // create a color map with known colors (16 maximum for 4 bit Sprite + // create a color map with known colors (16 maximum for 4-bit Sprite uint16_t cmap[16]; diff --git a/examples/Sprite/Sprite_image_4bit/Sprite_image_4bit.ino b/examples/Sprite/Sprite_image_4bit/Sprite_image_4bit.ino index 53bd4fa..1fc173f 100644 --- a/examples/Sprite/Sprite_image_4bit/Sprite_image_4bit.ino +++ b/examples/Sprite/Sprite_image_4bit/Sprite_image_4bit.ino @@ -14,12 +14,12 @@ any position. If there is sufficient RAM then the Sprite can be the same size as the screen and used as a frame buffer. - A 16 bit Sprite occupies (2 * width * height) bytes in RAM. + A 16-bit Sprite occupies (2 * width * height) bytes in RAM. On a ESP8266 Sprite sizes up to 126 x 160 can be accommodated, - this size requires 40kBytes of RAM for a 16 bit color depth. + this size requires 40kBytes of RAM for a 16-bit color depth. - When 8 bit color depth sprites are created they occupy + When 8-bit color depth sprites are created they occupy (width * height) bytes in RAM, so larger sprites can be created, or the RAM required is halved. @@ -39,7 +39,7 @@ TFT_eSPI tft = TFT_eSPI(); // Declare object "tft" TFT_eSprite spr = TFT_eSprite(&tft); // Declare Sprite object "spr" with pointer to "tft" object -byte red = 31; // Red is the top 5 bits of a 16 bit colour value +byte red = 31; // Red is the top 5 bits of a 16-bit colour value byte green = 0;// Green is the middle 6 bits byte blue = 0; // Blue is the bottom 5 bits byte state = 0; @@ -59,7 +59,7 @@ void setup() // Initialise the TFT registers tft.init(); - spr.setColorDepth(4); + spr.setcolorDepth(4); // Create a sprite of defined size spr.createSprite(WIDTH, HEIGHT); @@ -99,7 +99,7 @@ void loop(void) } // ######################################################################### -// Return a 16 bit rainbow colour +// Return a 16-bit rainbow colour // ######################################################################### unsigned int rainbow() { diff --git a/examples/Sprite/Sprite_scroll/Sprite_scroll.ino b/examples/Sprite/Sprite_scroll/Sprite_scroll.ino index 1968849..26b7c54 100644 --- a/examples/Sprite/Sprite_scroll/Sprite_scroll.ino +++ b/examples/Sprite/Sprite_scroll/Sprite_scroll.ino @@ -14,9 +14,9 @@ any position. If there is sufficient RAM then the Sprite can be the same size as the screen and used as a frame buffer. - A 16 bit Sprite occupies (2 * width * height) bytes in RAM. + A 16-bit Sprite occupies (2 * width * height) bytes in RAM. - An 8 bit Sprite occupies (width * height) bytes in RAM. + An 8-bit Sprite occupies (width * height) bytes in RAM. */ @@ -41,7 +41,7 @@ void setup() { tft.fillScreen(TFT_BLACK); // Create a sprite for the graph - graph1.setColorDepth(8); + graph1.setcolorDepth(8); graph1.createSprite(128, 61); graph1.fillSprite(TFT_BLUE); // Note: Sprite is filled with black when created @@ -51,7 +51,7 @@ void setup() { //graph1.setScrollRect(64, 0, 64, 61, TFT_DARKGREY); // Try this line to change the graph scroll area // Create a sprite for the scrolling numbers - stext1.setColorDepth(8); + stext1.setcolorDepth(8); stext1.createSprite(32, 64); stext1.fillSprite(TFT_BLUE); // Fill sprite with blue stext1.setScrollRect(0, 0, 32, 64, TFT_BLUE); // here we set scroll gap fill color to blue @@ -59,7 +59,7 @@ void setup() { stext1.setTextDatum(BR_DATUM); // Bottom right coordinate datum // Create a sprite for Hello World - stext2.setColorDepth(8); + stext2.setcolorDepth(8); stext2.createSprite(80, 16); stext2.fillSprite(TFT_DARKGREY); stext2.setScrollRect(0, 0, 40, 16, TFT_DARKGREY); // Scroll the "Hello" in the first 40 pixels diff --git a/examples/Sprite/Sprite_scroll_16bit/Sprite_scroll_16bit.ino b/examples/Sprite/Sprite_scroll_16bit/Sprite_scroll_16bit.ino index 2ffbc53..f0cf1f4 100644 --- a/examples/Sprite/Sprite_scroll_16bit/Sprite_scroll_16bit.ino +++ b/examples/Sprite/Sprite_scroll_16bit/Sprite_scroll_16bit.ino @@ -126,7 +126,7 @@ void numberBox(int num, int x, int y) // Fill it with black img.fillSprite(TFT_BLACK); - // Draw a backgorund of 2 filled triangles + // Draw a background of 2 filled triangles img.fillTriangle( 0, 0, 0, 49, 40, 25, TFT_RED); img.fillTriangle( 79, 0, 79, 49, 40, 25, TFT_DARKGREEN); @@ -150,14 +150,14 @@ void numberBox(int num, int x, int y) // ######################################################################### -// Return a 16 bit rainbow colour +// Return a 16-bit rainbow colour // ######################################################################### unsigned int rainbow(byte value) { // Value is expected to be in range 0-127 // The value is converted to a spectrum colour from 0 = red through to 127 = blue - byte red = 0; // Red is the top 5 bits of a 16 bit colour value + byte red = 0; // Red is the top 5 bits of a 16-bit colour value byte green = 0;// Green is the middle 6 bits byte blue = 0; // Blue is the bottom 5 bits diff --git a/examples/Sprite/Sprite_scroll_1bit/Sprite_scroll_1bit.ino b/examples/Sprite/Sprite_scroll_1bit/Sprite_scroll_1bit.ino index dfdee88..d79e4b8 100644 --- a/examples/Sprite/Sprite_scroll_1bit/Sprite_scroll_1bit.ino +++ b/examples/Sprite/Sprite_scroll_1bit/Sprite_scroll_1bit.ino @@ -3,7 +3,7 @@ This sketch scrolls a 1 bit per pixel (1 bpp) Sprite. - In a 1 bit Sprite any colour except TFT_BLACK turns a pixel "ON" + In a 1-bit Sprite any colour except TFT_BLACK turns a pixel "ON" TFT_BLACK turns a pixel "OFF". ON and OFF pixels can be set to any two colours before @@ -24,7 +24,7 @@ any position. If there is sufficient RAM then the Sprite can be the same size as the screen and used as a frame buffer. - A 1 bit Sprite occupies (width * height)/8 bytes in RAM. + A 1-bit Sprite occupies (width * height)/8 bytes in RAM. */ diff --git a/examples/Sprite/Sprite_scroll_4bit/Sprite_scroll_4bit.ino b/examples/Sprite/Sprite_scroll_4bit/Sprite_scroll_4bit.ino index aa29948..b198c85 100644 --- a/examples/Sprite/Sprite_scroll_4bit/Sprite_scroll_4bit.ino +++ b/examples/Sprite/Sprite_scroll_4bit/Sprite_scroll_4bit.ino @@ -1,5 +1,5 @@ /* - Sketch to show scrolling of the graphics in 4 bit sprites. + Sketch to show scrolling of the graphics in 4-bit sprites. Scrolling in this way moves the pixels in a defined rectangle within the Sprite. By default the whole sprite is scrolled. The gap left by scrolling is filled with a defined colour. @@ -14,7 +14,7 @@ any position. If there is sufficient RAM then the Sprite can be the same size as the screen and used as a frame buffer. - A 4 bit Sprite occupies (width * height)/2 bytes in RAM. + A 4-bit Sprite occupies (width * height)/2 bytes in RAM. */ #include diff --git a/examples/Sprite/Sprite_scroll_8bit/Sprite_scroll_8bit.ino b/examples/Sprite/Sprite_scroll_8bit/Sprite_scroll_8bit.ino index a843589..551f875 100644 --- a/examples/Sprite/Sprite_scroll_8bit/Sprite_scroll_8bit.ino +++ b/examples/Sprite/Sprite_scroll_8bit/Sprite_scroll_8bit.ino @@ -1,7 +1,7 @@ /* Display "flicker free" scrolling text and updating number - This sketch uses 8 bit colour sprites to save RAM. + This sketch uses 8-bit colour sprites to save RAM. Example for library: https://github.com/Bodmer/TFT_eSPI @@ -16,15 +16,15 @@ any position. If there is sufficient RAM then the Sprite can be the same size as the screen and used as a frame buffer. - A 16 bit colour Sprite occupies (2 * width * height) bytes. + A 16-bit colour Sprite occupies (2 * width * height) bytes. - An 8 bit colour Sprite occupies (width * height) bytes. + An 8-bit colour Sprite occupies (width * height) bytes. - On a ESP8266, 16 bit Sprite sizes up to 128 x 160 can be accommodated, + On a ESP8266, 16-bit Sprite sizes up to 128 x 160 can be accommodated, this size requires 128*160*2 bytes (40kBytes) of RAM. This sketch sets the colour depth to 8 bits so larger sprites can be - created. 8 bit colour sprites use half amount of RAM. If the colour + created. 8-bit colour sprites use half amount of RAM. If the colour depth is not specified then 16 bits is assumed. You need to make the sprite small enough to fit, with RAM spare for @@ -137,7 +137,7 @@ void numberBox(int num, int x, int y) // Fill it with black img.fillSprite(TFT_BLACK); - // Draw a backgorund of 2 filled triangles + // Draw a background of 2 filled triangles img.fillTriangle( 0, 0, 0, 49, 40, 25, TFT_RED); img.fillTriangle( 79, 0, 79, 49, 40, 25, TFT_DARKGREEN); @@ -161,14 +161,14 @@ void numberBox(int num, int x, int y) // ######################################################################### -// Return a 16 bit rainbow colour +// Return a 16-bit rainbow colour // ######################################################################### unsigned int rainbow(byte value) { // Value is expected to be in range 0-127 // The value is converted to a spectrum colour from 0 = red through to 127 = blue - byte red = 0; // Red is the top 5 bits of a 16 bit colour value + byte red = 0; // Red is the top 5 bits of a 16-bit colour value byte green = 0;// Green is the middle 6 bits byte blue = 0; // Blue is the bottom 5 bits diff --git a/examples/Sprite/Sprite_scroll_wrap_1bit/Sprite_scroll_wrap_1bit.ino b/examples/Sprite/Sprite_scroll_wrap_1bit/Sprite_scroll_wrap_1bit.ino index 76fcfc6..d97d58b 100644 --- a/examples/Sprite/Sprite_scroll_wrap_1bit/Sprite_scroll_wrap_1bit.ino +++ b/examples/Sprite/Sprite_scroll_wrap_1bit/Sprite_scroll_wrap_1bit.ino @@ -1,5 +1,5 @@ // This **ONLY** works for 1 bpp Sprites due to lack of bounds checking in the -// Sprite pushImage() function for 8 and 16 bit Sprites (it is on the TO DO list) +// Sprite pushImage() function for 8 and 16-bit Sprites (it is on the TO DO list) // Wrapping scroll example by Bodmer for the TFT_eSPI library diff --git a/examples/Sprite/Transparent_Sprite_Demo/Transparent_Sprite_Demo.ino b/examples/Sprite/Transparent_Sprite_Demo/Transparent_Sprite_Demo.ino index 37615ac..e492ab6 100644 --- a/examples/Sprite/Transparent_Sprite_Demo/Transparent_Sprite_Demo.ino +++ b/examples/Sprite/Transparent_Sprite_Demo/Transparent_Sprite_Demo.ino @@ -12,12 +12,12 @@ any position. If there is sufficient RAM then the Sprite can be the same size as the screen and used as a frame buffer. - A 16 bit Sprite occupies (2 * width * height) bytes in RAM. + A 16-bit Sprite occupies (2 * width * height) bytes in RAM. On a ESP8266 Sprite sizes up to 126 x 160 can be accommodated, - this size requires 40kBytes of RAM for a 16 bit colour depth. + this size requires 40kBytes of RAM for a 16-bit colour depth. - When 8 bit colour depth sprites are created they occupy + When 8-bit colour depth sprites are created they occupy (width * height) bytes in RAM, so larger sprites can be created, or the RAM required is halved. */ @@ -76,7 +76,7 @@ void loop() { // ######################################################################### void drawStar(int x, int y, int star_color) { - // Create an 8 bit sprite 70x 80 pixels (uses 5600 bytes of RAM) + // Create an 8-bit sprite 70x 80 pixels (uses 5600 bytes of RAM) img.setColorDepth(8); img.createSprite(70, 80); @@ -113,7 +113,7 @@ void numberBox(int x, int y, float num ) #define IWIDTH 80 #define IHEIGHT 35 - // Create a 8 bit sprite 80 pixels wide, 35 high (2800 bytes of RAM needed) + // Create a 8-bit sprite 80 pixels wide, 35 high (2800 bytes of RAM needed) img.setColorDepth(8); img.createSprite(IWIDTH, IHEIGHT); diff --git a/examples/Sprite/Transparent_Sprite_Demo_4bit/Transparent_Sprite_Demo_4bit.ino b/examples/Sprite/Transparent_Sprite_Demo_4bit/Transparent_Sprite_Demo_4bit.ino index c116ed4..0840648 100644 --- a/examples/Sprite/Transparent_Sprite_Demo_4bit/Transparent_Sprite_Demo_4bit.ino +++ b/examples/Sprite/Transparent_Sprite_Demo_4bit/Transparent_Sprite_Demo_4bit.ino @@ -1,5 +1,5 @@ /* - Sketch to show creation of a 4 bit sprite with a transparent + Sketch to show creation of a 4-bit sprite with a transparent background, then plot it on the TFT. The palette setup and palette update functions are also shown in this example. @@ -13,11 +13,11 @@ any position. If there is sufficient RAM then the Sprite can be the same size as the screen and used as a frame buffer. - A 4 bit Sprite occupies (width * height)/2 bytes in RAM. + A 4-bit Sprite occupies (width * height)/2 bytes in RAM. For example the "star" 70x80 Sprite uses 2800 bytes. */ -// This is the default palette for 4 bit colour sprites +// This is the default palette for 4-bit colour sprites // which is built into the library. You can create your // own palette (use a different array name!). The palette // is captured and stored in RAM by the Sprite class so a @@ -80,25 +80,25 @@ void loop() { // spr.createPalette(default_4bit_palette, 12); // After rendering a Sprite you can change the palette to increase the range of colours - // plotted to the screen to the full 16 bit set. + // plotted to the screen to the full 16-bit set. // Change palette colour 11 to violet spr.setPaletteColor(11, TFT_VIOLET); - uint16_t color15 = spr.getPaletteColor(15); // The 16 bit colour in a palette can be read back + uint16_t color15 = spr.getPaletteColor(15); // The 16-bit colour in a palette can be read back // Draw 50 sprites containing a "transparent" colour for (int i = 0; i < 50; i++) { int x = random(tft.width() - 70); int y = random(tft.height() - 80); - int c = random(15); // Random colour 0-14 (4 bit index into color map). Leave 15 for transparent. + int c = random(15); // Random colour 0-14 (4-bit index into color map). Leave 15 for transparent. drawStar(x, y, c); } delay(2000); - // Change the palette to a 16 bit grey scale colour + // Change the palette to a 16-bit grey scale colour for (uint8_t i = 0; i < 16; i++) { // (i*16+i) produces a value in range 0-255 for the RGB colours // Red Green Blue diff --git a/examples/ePaper/Floyd_Steinberg/Floyd_Steinberg.ino b/examples/ePaper/Floyd_Steinberg/Floyd_Steinberg.ino index a856d69..0a71685 100644 --- a/examples/ePaper/Floyd_Steinberg/Floyd_Steinberg.ino +++ b/examples/ePaper/Floyd_Steinberg/Floyd_Steinberg.ino @@ -84,7 +84,7 @@ void setup() { Serial.println(" SPIFFS initialisation OK"); - frame.setColorDepth(1); // Must set the bits per pixel to 1 for ePaper displays + frame.setcolorDepth(1); // Must set the bits per pixel to 1 for ePaper displays // Set bit depth BEFORE creating Sprite, default is 16! // Create a frame buffer in RAM of defined size and save the pointer to it @@ -106,7 +106,7 @@ void loop() { frame.fillSprite(PAPER); - // Draw 8 bit grey-scale bitmap using Floyd-Steinberg dithering at x,y + // Draw 8-bit grey-scale bitmap using Floyd-Steinberg dithering at x,y // /File name x y //drawFSBmp("/TestCard.bmp", 0, 0); // 176 x 264 pixels diff --git a/examples/ePaper/Floyd_Steinberg/Floyd_Steinberg_BMP.ino b/examples/ePaper/Floyd_Steinberg/Floyd_Steinberg_BMP.ino index e52dbe0..414365d 100644 --- a/examples/ePaper/Floyd_Steinberg/Floyd_Steinberg_BMP.ino +++ b/examples/ePaper/Floyd_Steinberg/Floyd_Steinberg_BMP.ino @@ -27,14 +27,14 @@ SOFTWARE. Note: drawFSBmp() is a simplified function and does not handle all possible - BMP file header variants. It works OK with 8 bit per pixel grey-scale images + BMP file header variants. It works OK with 8-bit per pixel grey-scale images generated by MS Paint and IrfanView. */ // https://github.com/Bodmer/TFT_eSPI //==================================================================================== -// Draw an 8 bit grey-scale bitmap (*.BMP) on a Monochrome display using dithering +// Draw an 8-bit grey-scale bitmap (*.BMP) on a Monochrome display using dithering //==================================================================================== // Uses RAM for buffers (3 * width + 4) ( 532 bytes for 176 pixels) @@ -102,10 +102,10 @@ void drawFSBmp(const char *filename, int16_t x, int16_t y) { uint16_t padding = (4 - (w & 3)) & 3; // Calculate the BMP line padding - // Create an zero an 8 bit pixel line buffer + // Create an zero an 8-bit pixel line buffer uint8_t* lineBuffer = ( uint8_t*) calloc(w , sizeof(uint8_t)); - // Create a 16 bit signed line buffer for the quantisation error + // Create a 16-bit signed line buffer for the quantisation error // Diffusion spreads to x-1 and x+1 so w + 2 avoids a bounds check int16_t* qerrBuffer = ( int16_t*) calloc((w + 2)<<1, sizeof(uint8_t)); @@ -174,7 +174,7 @@ void drawFSBmp(const char *filename, int16_t x, int16_t y) { } //==================================================================================== -// Read a 16 bit value from the filing system +// Read a 16-bit value from the filing system //==================================================================================== uint16_t read16(fs::File &f) { uint16_t result; @@ -184,7 +184,7 @@ uint16_t read16(fs::File &f) { } //==================================================================================== -// Read a 32 bit value from the filing system +// Read a 32-bit value from the filing system //==================================================================================== uint32_t read32(fs::File &f) { uint32_t result; diff --git a/library.properties b/library.properties index 5fa9768..d7b726c 100644 --- a/library.properties +++ b/library.properties @@ -3,7 +3,7 @@ version=2.5.40 author=Bodmer maintainer=Bodmer sentence=TFT graphics library for Arduino processors with performance optimisation for RP2040, STM32, ESP8266 and ESP32 -paragraph=Supports TFT displays using drivers (ILI9341 etc) that operate with hardware SPI or 8/16 bit parallel. +paragraph=Supports TFT displays using drivers (ILI9341 etc.) that operate with hardware SPI or 8/16-bit parallel. category=Display url=https://github.com/Bodmer/TFT_eSPI architectures=* diff --git a/license.txt b/license.txt index 61a62a5..e0b40d2 100644 --- a/license.txt +++ b/license.txt @@ -94,9 +94,9 @@ graphics. In 2018 anti-aliased fonts were added along with a Processing font conversion sketch. -In 2019 the library was adapted to be able to use it with any 32 bit Arduino -compatible processor. It will run on 8 bit and 16 bit processors but will be -slow due to extensive use of 32 bit variables. +In 2019 the library was adapted to be able to use it with any 32-bit Arduino +compatible processor. It will run on 8-bit and 16-bit processors but will be +slow due to extensive use of 32-bit variables. Many of the example sketches are original work that contain code created for my own projects. For all the original code the FreeBSD licence applies