71 #define WEAK_ATR __attribute__((weak)) 81 #define WRAP (WRAP_H | WRAP_V) 83 #define TFT_W (MAX_TFT_X-MIN_TFT_X+1) 84 #define TFT_H (MAX_TFT_Y-MIN_TFT_Y+1) 85 #define TFT_XOFF (MIN_TFT_X) 86 #define TFT_YOFF (MIN_TFT_Y) 93 #define tft_RGBto565(r, g, b) ((uint16_t) (((r) & 0xf8) << 8) | (((g) & 0xfc) << 3) | (((b) & 0xf8) >>3)) 95 #define SWAP(a, b) do { a ^= b; b ^= a; a ^= b; } while(0) 96 #define ABS(x) ((x)<0 ? -(x) : (x)) 108 int16_t
sx (
float scale , int16_t xoff , int16_t
X );
109 int16_t
sy (
float scale , int16_t yoff , int16_t
Y );
173 #endif // _ILI9341_SUP_H_
int16_t sy(float scale, int16_t yoff, int16_t Y)
void tft_Cmd_Data_TX(uint8_t cmd, uint8_t *data, int bytes)
Transmit 8 bit command and optionally send data buffer.
void tft_drawFastHLine(window *win, int16_t x, int16_t y, int16_t w, uint16_t color)
Fast virtical line drawing.
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...
void tft_bit_blit(window *win, uint8_t *ptr, int16_t x, int16_t y, int16_t w, int16_t h)
BLIT functions
MEMSPACE void tft_set_font(window *win, uint16_t index)
Set current font size (per current rotation)
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.
void tft_spi_begin(void)
Obtain SPI bus for TFT display, assert chip select return: void.
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...
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.
Cordic_T X
Main Cordic routine - used for basic trig and vector rotations We use fixed point numbers...
void drawSVG(window *win, int16_t x, int16_t y, int16_t c, float scale, uint16_t color, int16_t fill)
void tft_flood(window *win, int16_t x, int16_t y, uint16_t border, uint16_t fill)
Flood fill.
MEMSPACE void tft_setRotation(uint8_t m)
Set Display rotation, applies to the master window only Set hardware display rotation and memory fill...
uint8_t tft_Data(uint8_t data)
Transmit 8 bit data amd read 8bit data.
MEMSPACE void tft_clip_xy(window *win, int16_t *X, int16_t *Y)
Clip X,Y to fix inside specifiied window.
void tft_drawFastVLine(window *win, int16_t x, int16_t y, int16_t h, uint16_t color)
Fast virtical line drawing.
int font_attr(window *win, int c, _fontc *f)
Get font attributes for a font.
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.
3D display point - display coordinates are int16
void tft_spi_init(uint32_t prescale)
int font_W(int font)
Get font Width used for character to character spacing.
MEMSPACE int tft_window_clip(window *win)
Clip window structure to TFT limits.
int32_t tft_abs_window(window *win, int16_t x, int16_t y, int16_t w, int16_t h)
=============================================================
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.
void tft_drawPixel(window *win, int16_t x, int16_t y, int16_t color)
Pixel functions
void tft_reset_disable(void)
disnable ILI9341 reset return: void
int tft_floodline(window *win, int16_t x, int16_t y, uint16_t border, uint16_t fill)
Flood using line fill method.
MEMSPACE void tft_clearline(window *win)
Clear display text line.
int tft_get_font_height(window *win)
Get font height.
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...
void tft_565toRGB(uint16_t color, uint8_t *r, uint8_t *g, uint8_t *b)
Color conversions
MEMSPACE void tft_setpos(window *win, int16_t x, int16_t y)
Set current window text pointer in pixels (per current rotation)
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...
int font_H(int font)
Get font height used for line to line spacing.
int16_t sx(float scale, int16_t xoff, int16_t X)
int tft_FillPolyLine(window *win, int16_t x, int16_t y, int w, uint16_t color)
MEMSPACE void tft_font_var(window *win)
Set current font type to variable.
void tft_spi_TXRX(uint8_t *data, int bytes, uint8_t command)
Transmit and read 8 bit data array.
MEMSPACE void tft_setTextColor(window *win, uint16_t fg, uint16_t bg)
====================================
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...
MEMSPACE void tft_invertDisplay(int flag)
Invert the display.
void tft_readRect(window *win, int16_t x, int16_t y, int16_t w, int16_t h, uint16_t *color)
2D display point - display coordinates are int16
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 t...
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 ...
void tft_spi_end(void)
Release SPI bus from TFT display, deassert chip select return: void.
void tft_addr_init(void)
Initialize ILI9341 command/data GPIO return: void.
void tft_Cmd(uint8_t cmd)
Transmit 8 bit command.
void tft_putch(window *win, int c)
put character in current winoow
int tft_pop_xy(int16_t *x, int16_t *y)
point push
void tft_Vscroll(window *win, int dir)
Scroll window up by dir lines We start at the top of the window and move down.
void tft_reset_enable(void)
enable ILI9341 reset return: void
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: R...
void tft_fillWin(window *win, uint16_t color)
Fill functions
void tft_spi_TX(uint8_t *data, int bytes, uint8_t command)
Transmit 8 bit data array.
void tft_reset_init(void)
Initialize ILI9341 reset GPIO return: void.
MEMSPACE void tft_cleareol(window *win)
Character and String functions
MEMSPACE uint32_t tft_readRegister(uint8_t command, uint8_t parameter)
====================================
MEMSPACE window * tft_init(void)
Initialize TFT.
int tft_push_xy(int16_t x, int16_t y)
point push
MEMSPACE void tft_font_fixed(window *win)
void tft_spi_RX(uint8_t *data, int bytes, uint8_t command)
read 8 bit data array