25 #define RDDID 0x04 //4 arguments
28 #define RDDMADCTL 0x0B // Read Display MADCTL
29 #define RDDCOLMOD 0x0C // Read Display Pixel Format
30 #define RDDIM 0x0D // Read Display Image Mode
31 #define RDDSM 0x0E // Read Display Signal Mode
32 #define RDDSDR 0x0F // Read Display Self-Diagnostic Result
34 #define SLEEP_OUT 0x11
35 #define PTLON 0x12 // Partial Display Mode On
36 #define NORON 0x13 // Normal Display Mode On
38 #define INVON 0x21 // Display Inversion On
39 #define GAMSET 0x26 // Gamma Set
45 #define RGBSET 0x2D //Color set
48 #define SCRLAR 0x33 // Scroll Area Set
52 #define VSCSAD 0x37 // Vertical Scroll Start Address of RAM
53 #define IDLE_MODE_OFF 0x38
54 #define IDLE_MODE_ON 0x39
55 #define COLMOD 0x3A // Interface Pixel Format
58 #define RDID3 0xDC // Read ID3 Value
60 #define FRMCTR1 0xB1 // Frame Rate Control (In normal mode/ Full colors)
61 #define FRMCTR2 0xB2 // Frame Rate Control (In Idle mode/ 8-colors)
62 #define FRMCTR3 0xB3 // Frame Rate Control (In Partial mode/ full colors)
63 #define INVCTR 0xB4 // Display Inversion Control
74 #define NVFCTR1 0xD9 // NVM Control Status
77 #define GMCTRP1 0xE0 // Gamma (‘+’polarity) Correction Characteristics Setting .
78 #define GMCTRN1 0xE1 // Gamma ‘-’polarity Correction Characteristics Setting
79 #define GCV 0xFC // Gate Pump Clock Frequency Variable
85 #define MADCTL_MY 0x80
86 #define MADCTL_MX 0x40
87 #define MADCTL_MV 0x20
88 #define MADCTL_ML 0x10
89 #define MADCTL_MH 0x04
94 #define MADCTL_M1 0x00
95 #define MADCTL_M2 0b10000000
96 #define MADCTL_M3 0b01000000
97 #define MADCTL_M4 0b11000000
98 #define MADCTL_M5 0b00100000
99 #define MADCTL_M6 0b10100000
100 #define MADCTL_M7 0b01100000
101 #define MADCTL_M8 0b11100000
103 #define MADCTL_RGB 0x00
104 #define MADCTL_BGR 0x08
116 #define YELLOW 0xFFE0
121 #define MAROON 0x8000
124 #define PURPLE 0x8010
127 #define CS_OUTPUT() bcm2835_gpio_fsel(RPI_V2_GPIO_P1_24,BCM2835_GPIO_FSEL_OUTP); //Set GPIO24 as output
128 #define CS_LOW() bcm2835_gpio_write(RPI_V2_GPIO_P1_24, LOW);
129 #define CS_HIGH() bcm2835_gpio_write(RPI_V2_GPIO_P1_24, HIGH);
131 #define DC_OUTPUT() bcm2835_gpio_fsel(RPI_V2_GPIO_P1_22,BCM2835_GPIO_FSEL_OUTP); //Set
132 #define DC_LOW() bcm2835_gpio_write(RPI_V2_GPIO_P1_22, LOW);
133 #define DC_HIGH() bcm2835_gpio_write(RPI_V2_GPIO_P1_22, HIGH);
135 #define RST_OUTPUT() bcm2835_gpio_fsel(RPI_V2_GPIO_P1_16,BCM2835_GPIO_FSEL_OUTP); //Set GPIO23 as output
136 #define RST_LOW() bcm2835_gpio_write(RPI_V2_GPIO_P1_16, LOW);
137 #define RST_HIGH() bcm2835_gpio_write(RPI_V2_GPIO_P1_16, HIGH);
169 void TFT_SetPixel(
unsigned char x_start,
unsigned char y_start,
unsigned int color);
180 void TFT_ShowPic(
unsigned int picture[],
unsigned char width,
unsigned char height,
unsigned int x,
unsigned int y);
182 unsigned int TFT_Color565(
unsigned char r,
unsigned char g,
unsigned char b);
184 void TFT_ASCII(
char x,
char y,
int color,
int background,
char letter,
char size);
185 void TFT_PrintString(
char x,
char y,
int color,
int background,
char * message,
char size);
186 void TFT_PrintInteger(
char x,
char y,
int color,
int background,
int integer,
char size);
void TFT_SetOrientation(orientation_t mode)
Sets the display text orientation. Mirrored modes are also supported on top of portrait and landscape...
void TFT_Background(int color)
This function paints the display background a specific color.
void TFT_InvertDisplayOff(void)
Disables color inversion on the display.
void TFT_TurnOnDisplay(void)
This function turns on the display from idle mode.
void TFT_WriteCommand(unsigned char command)
This function writes a command byte to the display controller.
void TFT_ShowPic(unsigned int picture[], unsigned char width, unsigned char height, unsigned int x, unsigned int y)
This function paints an image with a specific heigh and width on the display at a specific coordinate...
void TFT_Sleep(void)
Puts the display in a low power mode.
void TFT_WakeUp(void)
Wakes the display from sleep mode.
void TFT_SetPixel(unsigned char x_start, unsigned char y_start, unsigned int color)
This functions sets a specific pixel on the TFT display.
void TFT_InvertDisplay(void)
Enables color inversion on the display.
void TFT_WriteData(unsigned char datab)
This function is used to write data to the TFT controller.
orientation_t
Orientation type. Specific orientation modes of the device.
void TFT_PrintString(char x, char y, int color, int background, char *message, char size)
Orint a colored string at coordinates x,y with a specific font size.
void TFT_TurnOffDisplay(void)
Blanks out the display.
struct _Image Image_t
Image type. Contains image array with height and width dimensions.
void TFT_DisplayImage(Image_t *image, unsigned char x, unsigned char y)
This function displays an image of type Image_t on screen.
void TFT_WriteDataWord(int wdata)
This function writes a 16 bit word on the display controller registers.
unsigned int TFT_Color565(unsigned char r, unsigned char g, unsigned char b)
Pass 8-bit (each) R,G,B, get back 16-bit packed color.
void TFT_ASCII(char x, char y, int color, int background, char letter, char size)
Plot an ASCII char on the display. A specific font is used.
void TFT_PrintInteger(char x, char y, int color, int background, int integer, char size)
Prints an integer at coordinates x,y with a specific color on a specific background. The integer font size is deterined bu var size.
Image type. Contains image array with height and width dimensions.
void TFT_Initialize(void)
This function intializes the display controller and prepares it for any subsequent operations...