ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts
1.0
ESP8266ILI9341DisplayProject
|
ili9341 driver inspired by Adafruit ili9341 code All code in this file has been rewritten by Mike Gore More...
Go to the source code of this file.
Data Structures | |
struct | window |
struct | p2_int16_t |
2D display point - display coordinates are int16 More... | |
struct | p3_int16_t |
3D display point - display coordinates are int16 More... | |
Macros | |
#define | MEMSPACE |
#define | WEAK_ATR __attribute__((weak)) |
#define | FONT_VAR 1 |
#define | WRAP_H 2 |
#define | WRAP_V 4 |
#define | WRAP (WRAP_H | WRAP_V) |
#define | TFT_W (MAX_TFT_X-MIN_TFT_X+1) |
#define | TFT_H (MAX_TFT_Y-MIN_TFT_Y+1) |
#define | TFT_XOFF (MIN_TFT_X) |
#define | TFT_YOFF (MIN_TFT_Y) |
#define | tft_RGBto565(r, g, b) ((uint16_t) (((r) & 0xf8) << 8) | (((g) & 0xfc) << 3) | (((b) & 0xf8) >>3)) |
Pass 8-bit (each) R,G,B, get back 16-bit packed color ILI9341 defaults to MSB/LSB data so we have to reverse it. More... | |
#define | SWAP(a, b) do { a ^= b; b ^= a; a ^= b; } while(0) |
#define | ABS(x) ((x)<0 ? -(x) : (x)) |
Functions | |
int | font_max (void) |
int | font_H (int font) |
Get font height used for line to line spacing. More... | |
int | font_W (int font) |
Get font Width used for character to character spacing. More... | |
int | font_attr (window *win, int c, _fontc *f) |
Get font attributes for a font. More... | |
int16_t | sx (float scale, int16_t xoff, int16_t X) |
int16_t | sy (float scale, int16_t yoff, int16_t Y) |
void | drawSVG (window *win, int16_t x, int16_t y, int16_t c, float scale, uint16_t color, int16_t fill) |
void | tft_Cmd (uint8_t cmd) |
Transmit 8 bit command. More... | |
uint8_t | tft_Data (uint8_t data) |
Transmit 8 bit data amd read 8bit data. More... | |
void | tft_Cmd_Data_TX (uint8_t cmd, uint8_t *data, int bytes) |
Transmit 8 bit command and optionally send data buffer. More... | |
int32_t | tft_abs_window (window *win, int16_t x, int16_t y, int16_t w, int16_t h) |
============================================================= More... | |
int32_t | tft_rel_window (window *win, int16_t x, int16_t y, int16_t w, int16_t h) |
Set the ili9341 working window by relative position and size Note: Function clips x,y,w,y. More... | |
MEMSPACE uint32_t | tft_readRegister (uint8_t command, uint8_t parameter) |
==================================== More... | |
MEMSPACE uint32_t | tft_readId (void) |
Read ILI9341 device ID should be 9341 This does not work for really high SPI clock speeds Make sure that when called the clock speed in reduced. More... | |
void | tft_bit_blit (window *win, uint8_t *ptr, int16_t x, int16_t y, int16_t w, int16_t h) |
BLIT functionsMore... | |
void | tft_fillWin (window *win, uint16_t color) |
Fill functionsMore... | |
void | tft_flood (window *win, int16_t x, int16_t y, uint16_t border, uint16_t fill) |
Flood fill. More... | |
int | tft_push_xy (int16_t x, int16_t y) |
point push More... | |
int | tft_pop_xy (int16_t *x, int16_t *y) |
point push More... | |
int | tft_floodline (window *win, int16_t x, int16_t y, uint16_t border, uint16_t fill) |
Flood using line fill method. More... | |
int | tft_FillPolyLine (window *win, int16_t x, int16_t y, int w, uint16_t color) |
void | tft_fillRectWH (window *win, int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color) |
Partial window Fill with color We clip the window to the current view. More... | |
void | tft_fillRectXY (window *win, int16_t x, int16_t y, int16_t xl, int16_t yl, uint16_t color) |
Fill rectangle with color We clip the window to the current view. More... | |
void | tft_drawPixel (window *win, int16_t x, int16_t y, int16_t color) |
Pixel functionsMore... | |
void | tft_writeRect (window *win, int16_t x, int16_t y, int16_t w, int16_t h, uint16_t *color) |
Write a rectangle pixel array. More... | |
void | tft_readRect (window *win, int16_t x, int16_t y, int16_t w, int16_t h, uint16_t *color) |
void | tft_Vscroll (window *win, int dir) |
Scroll window up by dir lines We start at the top of the window and move down. More... | |
uint16_t | tft_readPixel (window *win, int16_t x, int16_t y) |
Read one pixel and return color in 1bit 565 RGB format We clip the window to the current view Note: Read Memory must be done in a continious write/read operation Chip select can not be deactivated for the transaction. More... | |
MEMSPACE void | tft_setRotation (uint8_t m) |
Set Display rotation, applies to the master window only Set hardware display rotation and memory fill option bits Update software display limits FIXME Work in progress. More... | |
void | tft_565toRGB (uint16_t color, uint8_t *r, uint8_t *g, uint8_t *b) |
Color conversionsMore... | |
MEMSPACE void | tft_invertDisplay (int flag) |
Invert the display. More... | |
MEMSPACE int | tft_window_clip (window *win) |
Clip window structure to TFT limits. More... | |
MEMSPACE void | tft_clip_xy (window *win, int16_t *X, int16_t *Y) |
Clip X,Y to fix inside specifiied window. More... | |
MEMSPACE int | tft_window_clip_args (window *win, int16_t *x, int16_t *y, int16_t *w, int16_t *h) |
clip arguments to window limits Arguments position x,y width w and height h to be clipped More... | |
MEMSPACE void | tft_window_init (window *win, int16_t x, int16_t y, int16_t w, int16_t h) |
Initialize window structure we default values FIXME check x+w, y+h absolute limits against TFT limuts. More... | |
MEMSPACE void | tft_setTextColor (window *win, uint16_t fg, uint16_t bg) |
==================================== More... | |
MEMSPACE void | tft_setpos (window *win, int16_t x, int16_t y) |
Set current window text pointer in pixels (per current rotation) More... | |
MEMSPACE void | tft_set_textpos (window *win, int16_t x, int16_t y) |
Set current window text pointer in characters (per current rotation) - overall font bounding box. More... | |
MEMSPACE void | tft_set_font (window *win, uint16_t index) |
Set current font size (per current rotation) More... | |
MEMSPACE void | tft_font_fixed (window *win) |
MEMSPACE void | tft_font_var (window *win) |
Set current font type to variable. More... | |
int | tft_get_font_height (window *win) |
Get font height. More... | |
void | tft_drawFastVLine (window *win, int16_t x, int16_t y, int16_t h, uint16_t color) |
Fast virtical line drawing. More... | |
void | tft_drawFastHLine (window *win, int16_t x, int16_t y, int16_t w, uint16_t color) |
Fast virtical line drawing. More... | |
void | tft_drawLine (window *win, int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color) |
Draw line From my blit test code testit.c 1984 - 1985 Mike Gore. More... | |
int | tft_Bezier2 (window *win, p2_int16_t S, p2_int16_t C, p2_int16_t T, int steps, uint16_t color) |
Draw lines between points along Quadratic Bézier curve Quadratic Bézier with respect to t, see https://en.wikipedia.org/wiki/Bézier_curve B(t) = (1-t)*(1-t)*S + 2*(1-t)*t*C + t*t*T, 0 <= t <= 1. More... | |
int | tft_Bezier3 (window *win, p2_int16_t S, p2_int16_t C1, p2_int16_t C2, p2_int16_t T, int steps, uint16_t color) |
Draw lines between points along Cubic Bézier curve Quadratic Bézier with respect to t, see https://en.wikipedia.org/wiki/Bézier_curve B(t) = (1-t)(1-t)*(1-t)*S + 3*(1-t)(1-t)*t*C1 + 3(1-t)*t*t*C2 + t*t*t*T, 0 <= t <= 1. More... | |
MEMSPACE void | tft_cleareol (window *win) |
Character and String functionsMore... | |
MEMSPACE void | tft_clearline (window *win) |
Clear display text line. More... | |
void | tft_putch (window *win, int c) |
put character in current winoow More... | |
void | tft_spi_init (uint32_t prescale) |
void | tft_spi_begin (void) |
Obtain SPI bus for TFT display, assert chip select return: void. More... | |
void | tft_spi_end (void) |
Release SPI bus from TFT display, deassert chip select return: void. More... | |
void | tft_reset_init (void) |
Initialize ILI9341 reset GPIO return: void. More... | |
void | tft_reset_enable (void) |
enable ILI9341 reset return: void More... | |
void | tft_addr_init (void) |
Initialize ILI9341 command/data GPIO return: void. More... | |
void | tft_reset_disable (void) |
disnable ILI9341 reset return: void More... | |
void | tft_spi_TX (uint8_t *data, int bytes, uint8_t command) |
Transmit 8 bit data array. More... | |
void | tft_spi_TXRX (uint8_t *data, int bytes, uint8_t command) |
Transmit and read 8 bit data array. More... | |
void | tft_spi_RX (uint8_t *data, int bytes, uint8_t command) |
read 8 bit data array More... | |
MEMSPACE window * | tft_init (void) |
Initialize TFT. More... | |
ili9341 driver inspired by Adafruit ili9341 code All code in this file has been rewritten by Mike Gore
This is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file ili9341.h.
Definition at line 96 of file ili9341.h.
Referenced by tft_drawFastHLine().
#define FONT_VAR 1 |
Definition at line 78 of file ili9341.h.
Referenced by font_attr(), tft_font_fixed(), and tft_font_var().
#define SWAP | ( | a, | |
b | |||
) | do { a ^= b; b ^= a; a ^= b; } while(0) |
Definition at line 95 of file ili9341.h.
Referenced by tft_fillRectXY(), and tft_fillTriangle().
Definition at line 84 of file ili9341.h.
Referenced by tft_init(), and tft_setRotation().
#define tft_RGBto565 | ( | r, | |
g, | |||
b | |||
) | ((uint16_t) (((r) & 0xf8) << 8) | (((g) & 0xfc) << 3) | (((b) & 0xf8) >>3)) |
Pass 8-bit (each) R,G,B, get back 16-bit packed color ILI9341 defaults to MSB/LSB data so we have to reverse it.
[in] | r | red data |
[in] | b | blue data |
[in] | g | green data |
Definition at line 93 of file ili9341.h.
Referenced by test_types(), tft_FillPolyLine(), tft_readPixel(), tft_readRect(), and user_loop().
Definition at line 83 of file ili9341.h.
Referenced by tft_init(), tft_setRotation(), and tft_Vscroll().
#define TFT_XOFF (MIN_TFT_X) |
Definition at line 85 of file ili9341.h.
Referenced by tft_init(), and tft_setRotation().
#define TFT_YOFF (MIN_TFT_Y) |
Definition at line 86 of file ili9341.h.
Referenced by tft_init(), and tft_setRotation().
#define WEAK_ATR __attribute__((weak)) |
#define WRAP_H 2 |
Definition at line 79 of file ili9341.h.
Referenced by tft_drawChar(), tft_putch(), and tft_window_init().
#define WRAP_V 4 |
Definition at line 80 of file ili9341.h.
Referenced by tft_drawChar().
void drawSVG | ( | window * | win, |
int16_t | x, | ||
int16_t | y, | ||
int16_t | c, | ||
float | scale, | ||
uint16_t | color, | ||
int16_t | fill | ||
) |
Referenced by user_tests().
Get font attributes for a font.
[in] | *win | Window Structure |
[in] | c | character |
[in] | *f | font structure |
Definition at line 94 of file font.c.
Referenced by tft_cleareol(), tft_clearline(), tft_drawChar(), tft_get_font_height(), and tft_putch().
int font_H | ( | int | font | ) |
Get font height used for line to line spacing.
[in] | font | font number |
Definition at line 70 of file font.c.
Referenced by test_types(), and tft_set_textpos().
int font_max | ( | void | ) |
Definition at line 59 of file font.c.
Referenced by tft_set_font().
int font_W | ( | int | font | ) |
Get font Width used for character to character spacing.
[in] | font | font number |
Definition at line 80 of file font.c.
Referenced by tft_set_textpos().
int16_t sx | ( | float | scale, |
int16_t | xoff, | ||
int16_t | X | ||
) |
Referenced by tft_drawFastHLine().
int16_t sy | ( | float | scale, |
int16_t | yoff, | ||
int16_t | Y | ||
) |
Referenced by tft_drawFastHLine().
=============================================================
====================================
Set the ili9341 working window by absolute position and size Note: Function clips x,y,w,y
[in] | x | Starting X offset |
[in] | y | Starting Y offset |
[in] | w | Width |
[in] | h | Height |
Definition at line 101 of file ili9341.c.
Referenced by tft_rel_window().
void tft_addr_init | ( | void | ) |
Initialize ILI9341 command/data GPIO return: void.
Definition at line 112 of file ili9341_hal.c.
Referenced by tft_init().
int tft_Bezier2 | ( | window * | win, |
p2_int16_t | S, | ||
p2_int16_t | C, | ||
p2_int16_t | T, | ||
int | steps, | ||
uint16_t | color | ||
) |
Draw lines between points along Quadratic Bézier curve Quadratic Bézier with respect to t, see https://en.wikipedia.org/wiki/Bézier_curve B(t) = (1-t)*(1-t)*S + 2*(1-t)*t*C + t*t*T, 0 <= t <= 1.
====================================
The path traced by the function B(t), given points S, C, and T, S = initial points C = control points T = target points
Derivative of the Bézier curve with respect to t B'(t) = 2*(1-t)*(C-S) + 2*t*(T-C)
Second derivative of the Bézier curve with respect to t is B"(t) = 2*(T-2*C+S)
As t increases from 0 to 1, the curve departs from S in the direction of C, then bends to arrive at T from the direction of C. The tangents to the curve at S and T intersect at C.
[in] | *win | Window Structure of active window |
[in] | S | Start |
[in] | C | Control |
[in] | T | Target |
[in] | steps | line segments along curve (1..N) |
[in] | color | Line color |
int tft_Bezier3 | ( | window * | win, |
p2_int16_t | S, | ||
p2_int16_t | C1, | ||
p2_int16_t | C2, | ||
p2_int16_t | T, | ||
int | steps, | ||
uint16_t | color | ||
) |
Draw lines between points along Cubic Bézier curve Quadratic Bézier with respect to t, see https://en.wikipedia.org/wiki/Bézier_curve B(t) = (1-t)(1-t)*(1-t)*S + 3*(1-t)(1-t)*t*C1 + 3(1-t)*t*t*C2 + t*t*t*T, 0 <= t <= 1.
The path traced by the function B(t), given points S, C, and T, S = initial points C1 = control point 1 C2 = control point 2 T = target points
Derivative of the Bézier curve with respect to t B'(t) = 3(1-t)*(1-t)*(C1-S) + 6*(1-t)*t*(C2-C1) + 3*t*t*(T-C2)
Second derivative of the Bézier curve with respect to t is B"(t) = 6*(1-t)*(C2-2*C1+S) + 6*t*(T-2*C2+C1)
The curve starts at S and moves toward C1 and on to T from the direction of C2. Points C1 and C2 provide directional information and the distance between them determines "how far" and "how fast" the curve moves towards C1 before turning towards C2.
[in] | *win | Window Structure of active window |
[in] | S | Start |
[in] | C1 | Control 1 |
[in] | C2 | Control 2 |
[in] | T | Target |
[in] | steps | line segments along curve (1..N) |
[in] | color | Line color |
BLIT a bit array to the display
[in] | win* | window structure |
[in] | *ptr | bit array w * h in size |
[in] | x | BLITX offset |
[in] | y | BLIT Y offset |
[in] | w | BLIT Width |
[in] | h | BLIT Height |
Definition at line 234 of file ili9341.c.
Referenced by tft_drawChar().
====================================Clear display to end of line
[in] | win* | window structure return: void, win->x = win->w |
Definition at line 1601 of file ili9341.c.
Referenced by tft_putch(), and user_loop().
void tft_Cmd | ( | uint8_t | cmd | ) |
Transmit 8 bit command.
[in] | cmd | display command return: void status is in data array - bytes in size |
Definition at line 53 of file ili9341.c.
Referenced by tft_bit_blit(), tft_Cmd_Data_TX(), tft_FillPolyLine(), tft_fillRectWH(), tft_invertDisplay(), tft_readPixel(), tft_readRect(), tft_readRegister(), and tft_writeRect().
Transmit 8 bit command and optionally send data buffer.
[in] | cmd | display command |
[in] | *data | data buffer to send after command |
[in] | bytes | data buffer size return: void status is in data array - bytes in size |
Definition at line 72 of file ili9341.c.
Referenced by tft_abs_window(), tft_configRegister(), tft_drawPixel(), and tft_setRotation().
Transmit 8 bit data amd read 8bit data.
[in] | data | display command return: read result |
Definition at line 61 of file ili9341.c.
Referenced by tft_readRegister().
Fast virtical line drawing.
[in] | *win | window structure |
[in] | x | X offset |
[in] | y | Y offset |
[in] | w | Width of line |
[in] | color | Color |
Definition at line 1329 of file ili9341.c.
Referenced by tft_drawRect(), tft_drawRoundRect(), tft_FillPolyLine(), and tft_fillTriangle().
Fast virtical line drawing.
[in] | *win | window structure |
[in] | x | X offset |
[in] | y | Y offset |
[in] | h | Height of line |
[in] | color | Color |
Definition at line 1314 of file ili9341.c.
Referenced by tft_drawRect(), tft_drawRoundRect(), tft_fillCircle(), and tft_fillCircleHelper().
Draw line From my blit test code testit.c 1984 - 1985 Mike Gore.
[in] | win* | window structure |
[in] | x0 | X Start |
[in] | y0 | Y Start |
[in] | x1 | X End |
[in] | y1 | Y End |
[in] | color | color to set |
[in] | win* | window structure |
[in] | x0 | X Start |
[in] | y0 | Y Start |
[in] | x1 | X End |
[in] | y1 | Y End |
[in] | color | color to set |
Definition at line 1389 of file ili9341.c.
Referenced by tft_Bezier2(), tft_Bezier3(), tft_drawFastHLine(), tft_drawTriangle(), and wire_draw().
void tft_drawPixel | ( | window * | win, |
int16_t | x, | ||
int16_t | y, | ||
int16_t | color | ||
) |
====================================Draw one pixel set to color in 16bit 565 RGB format We clip the window to the current view
[in] | win* | window structure |
[in] | x | X Start |
[in] | y | Y Start |
[in] | color | color to set |
Definition at line 717 of file ili9341.c.
Referenced by tft_bit_blit(), tft_drawCircle(), tft_drawCircleHelper(), tft_drawFastHLine(), tft_flood(), tft_floodline(), tft_writeRect(), and user_tests().
Partial window Fill with color We clip the window to the current view.
[in] | win* | window structure |
[in] | x | X Start |
[in] | y | Y Start |
[in] | w | Width |
[in] | h | Height |
[in] | color | Fill color |
Definition at line 627 of file ili9341.c.
Referenced by tft_cleareol(), tft_clearline(), tft_drawChar(), tft_drawFastHLine(), tft_drawFastVLine(), tft_fillRectXY(), tft_fillRoundRect(), tft_fillWin(), tft_putch(), and tft_Vscroll().
Fill rectangle with color We clip the window to the current view.
[in] | win* | window structure |
[in] | x | X Start |
[in] | y | Y Start |
[in] | xl | X End |
[in] | yl | Y End |
[in] | color | Fill color |
Definition at line 690 of file ili9341.c.
Referenced by tft_drawFastHLine().
====================================Fill window
[in] | win* | window structure |
[in] | color | Fill color |
Definition at line 334 of file ili9341.c.
Referenced by test_types(), tft_init(), and tft_putch().
Flood fill.
[in] | win* | window structure |
[in] | border | border color |
[in] | fill | Fill color |
Definition at line 346 of file ili9341.c.
Referenced by tft_flood().
Flood using line fill method.
[in] | win* | window structure |
[in] | x | X position to fill from |
[in] | y | Y position to fill from |
[in] | border | border color |
[in] | fill | Fill color @ return true one success, 0 of stack overflow |
Only works if font is proportional type
[in] | win* | window structure return: void |
Definition at line 1278 of file ili9341.c.
Referenced by user_loop().
Set current font type to variable.
[in] | win* | window structure return: void |
Definition at line 1288 of file ili9341.c.
Referenced by test_types().
int tft_get_font_height | ( | window * | win | ) |
Initialize TFT.
Definition at line 178 of file ili9341_hal.c.
Referenced by setup().
MEMSPACE void tft_invertDisplay | ( | int | flag | ) |
int tft_pop_xy | ( | int16_t * | x, |
int16_t * | y | ||
) |
point push
[in] | x | X |
[in] | y | Y @ return true if data exists, 0 of none |
Definition at line 397 of file ili9341.c.
Referenced by tft_floodline().
int tft_push_xy | ( | int16_t | x, |
int16_t | y | ||
) |
point push
[in] | x | X |
[in] | y | Y @ return true on success, 0 of stack overflow |
Definition at line 380 of file ili9341.c.
Referenced by tft_floodline().
void tft_putch | ( | window * | win, |
int | c | ||
) |
put character in current winoow
[in] | win* | window structure |
[in] | c | character return: void |
Definition at line 1643 of file ili9341.c.
Referenced by _putc_win(), and _putc_win_len().
Read ILI9341 device ID should be 9341 This does not work for really high SPI clock speeds Make sure that when called the clock speed in reduced.
Paramter 0 is unused See Read ID4 Command ( 0xd3 ) for a description of the parameters
Definition at line 206 of file ili9341.c.
Referenced by tft_init().
Read one pixel and return color in 1bit 565 RGB format We clip the window to the current view Note: Read Memory must be done in a continious write/read operation Chip select can not be deactivated for the transaction.
[in] | win* | window structure |
[in] | x | X Start |
[in] | y | Y Start |
Definition at line 952 of file ili9341.c.
Referenced by tft_flood(), tft_floodline(), and user_tests().
Definition at line 837 of file ili9341.c.
Referenced by loop(), and tft_Vscroll().
====================================
====================================================================== SPIRead parameters on SPI bus ILI9341 displays For those displays that do not have the EXTC pin asserted. This undocumented command overrides the restriction for reading command parameters. Notes: SPI configurations See M:[0-3] control bits in ILI9341 documenation
[in] | command | command whose parameters we want to read |
[in] | parameter | parameter number |
Definition at line 166 of file ili9341.c.
Referenced by tft_readId().
Set the ili9341 working window by relative position and size Note: Function clips x,y,w,y.
[in] | win* | window structure |
[in] | x | Starting X offset |
[in] | y | Starting Y offset |
[in] | w | Width |
[in] | h | Height |
Definition at line 140 of file ili9341.c.
Referenced by tft_bit_blit(), tft_drawPixel(), tft_FillPolyLine(), tft_fillRectWH(), tft_readPixel(), tft_readRect(), and tft_writeRect().
void tft_reset_disable | ( | void | ) |
disnable ILI9341 reset return: void
Definition at line 120 of file ili9341_hal.c.
Referenced by tft_init().
void tft_reset_enable | ( | void | ) |
enable ILI9341 reset return: void
Definition at line 103 of file ili9341_hal.c.
Referenced by tft_init().
void tft_reset_init | ( | void | ) |
Initialize ILI9341 reset GPIO return: void.
Definition at line 94 of file ili9341_hal.c.
Referenced by tft_init().
Set current font size (per current rotation)
[in] | win* | window structure |
[in] | index | font index (for array of fonts) return: void |
Definition at line 1267 of file ili9341.c.
Referenced by test_types(), and user_loop().
Set current window text pointer in characters (per current rotation) - overall font bounding box.
[in] | win* | window structure |
[in] | x | x offset |
[in] | y | y oofset return: void |
Definition at line 1254 of file ili9341.c.
Referenced by test_types(), and user_loop().
Set Display rotation, applies to the master window only Set hardware display rotation and memory fill option bits Update software display limits FIXME Work in progress.
Definition at line 982 of file ili9341.c.
Referenced by test_types(), tft_init(), and user_tests().
====================================
Set text forground and background color
[in] | win* | window structure |
[in] | fg | forground color |
[in] | bg | background color |
Definition at line 1228 of file ili9341.c.
Referenced by test_types().
void tft_spi_begin | ( | void | ) |
Obtain SPI bus for TFT display, assert chip select return: void.
Definition at line 80 of file ili9341_hal.c.
Referenced by tft_bit_blit(), tft_Cmd_Data_TX(), tft_FillPolyLine(), tft_fillRectWH(), tft_invertDisplay(), tft_readPixel(), tft_readRect(), tft_readRegister(), and tft_writeRect().
void tft_spi_end | ( | void | ) |
Release SPI bus from TFT display, deassert chip select return: void.
Definition at line 87 of file ili9341_hal.c.
Referenced by tft_bit_blit(), tft_Cmd_Data_TX(), tft_FillPolyLine(), tft_fillRectWH(), tft_invertDisplay(), tft_readPixel(), tft_readRect(), tft_readRegister(), and tft_writeRect().
void tft_spi_init | ( | uint32_t | prescale | ) |
read 8 bit data array
[in] | *data | data buffer to send |
[in] | bytes | data buffer size |
[in] | command | 1 = command, 0 = data return: void |
Definition at line 165 of file ili9341_hal.c.
Referenced by tft_FillPolyLine(), tft_readPixel(), and tft_readRect().
Transmit 8 bit data array.
[in] | *data | data buffer to send |
[in] | bytes | data buffer size |
[in] | command | 1 = command, 0 = data return: void |
Definition at line 134 of file ili9341_hal.c.
Referenced by tft_bit_blit(), tft_Cmd(), tft_Cmd_Data_TX(), tft_fillRectWH(), and tft_writeRect().
Transmit and read 8 bit data array.
[in] | *data | data buffer to send |
[in] | bytes | data buffer size |
[in] | command | 1 = command, 0 = data return: void |
Definition at line 149 of file ili9341_hal.c.
Referenced by tft_Data().
void tft_Vscroll | ( | window * | win, |
int | dir | ||
) |
Scroll window up by dir lines We start at the top of the window and move down.
[in] | win* | window structure |
[in] | dir | direction and count TODO +/- scroll direction TODO +/- Horizontal scroll functions |
Definition at line 903 of file ili9341.c.
Referenced by tft_drawChar().
MEMSPACE int tft_window_clip_args | ( | window * | win, |
int16_t * | x, | ||
int16_t * | y, | ||
int16_t * | w, | ||
int16_t * | h | ||
) |
clip arguments to window limits Arguments position x,y width w and height h to be clipped
[in] | *win | window structure we will use to clip arguments to. |
[in] | *x | X argument offset |
[in] | *y | Y argument offset |
[in] | *w | W argument width |
[in] | *h | H argument height |
Definition at line 1145 of file ili9341.c.
Referenced by tft_abs_window(), tft_bit_blit(), and tft_window_init().
Initialize window structure we default values FIXME check x+w, y+h absolute limits against TFT limuts.
[in] | win* | window structure |
[in] | x | X offset to window start - absolute |
[in] | y | Y offset to window start - absolute |
[in] | w | Window width |
[in] | h | Window Height |
Definition at line 1198 of file ili9341.c.
Referenced by test_types(), and tft_init().
Write a rectangle pixel array.
[in] | win* | window structure |
[in] | x | X offset |
[in] | y | Y offset |
[in] | w | Width |
[in] | h | Height |
[in] | *color | pixel array in 565 format |
Definition at line 745 of file ili9341.c.
Referenced by tft_drawBitmap(), and tft_Vscroll().