Chinese module HY-1.8 SPI TFT lcd Display library.
Dependents: KL25Z_DCF77_HY-1_8LCD
Fork of HY-1_8TFT_ST7735 by
Diff: ST7735_TFT.h
- Revision:
- 2:26149011665e
- Parent:
- 1:ef70eaf15b18
--- a/ST7735_TFT.h Fri Apr 19 20:46:47 2013 +0000 +++ b/ST7735_TFT.h Sun Oct 11 21:30:26 2015 +0000 @@ -5,6 +5,7 @@ #include "mbed.h" #include "GraphicsDisplay.h" +#include "BurstSPI.h" #define RGB(r,g,b) (((r&0xF8)<<8)|((g&0xFC)<<3)|((b&0xF8)>>3)) //5 red | 6 green | 5 blue @@ -56,27 +57,33 @@ #define ST7735_GMCTRP1 0xE0 #define ST7735_GMCTRN1 0xE1 -/* some RGB color definitions RED BLUE GREEN */ -#define Black 0x0000 /* 0, 0, 0 */ -#define Navy 0x000F /* 0, 0, 128 */ -#define DarkGreen 0x03E0 /* 0, 128, 0 */ -#define DarkCyan 0x03EF /* 0, 128, 128 */ -#define Maroon 0x7800 /* 128, 0, 0 */ -#define Purple 0x780F /* 128, 0, 128 */ -#define Olive 0x7BE0 /* 128, 128, 0 */ -#define LightGrey 0xC618 /* 192, 192, 192 */ -#define DarkGrey 0x7BEF /* 128, 128, 128 */ -#define Green 0x002F /* 0, 0, 255 */ -#define Blue 0x07E0 /* 0, 255, 0 */ -#define Cyan 0x07FF /* 0, 255, 255 */ -#define Red 0xFF00 /* 255, 0, 0 */ -#define Yellow 0xFF1F /* 255, 0, 255 */ -#define Magenta 0xFFE0 /* 255, 255, 0 */ -#define White 0xFFFF /* 255, 255, 255 */ -#define Orange 0xFD20 /* 255, 165, 0 */ -#define GreenYellow 0xAFE5 /* 173, 255, 47 */ -#define LightBlue 0x04FF +// some RGB color definitions RED GREEN BLUE +#define Black 0x0000 // 0, 0, 0 +#define Navy 0x8000 // 0, 0, 128 +#define DarkGreen 0x0400 // 0, 128, 0 +#define DarkCyan 0x8400 // 0, 128, 128 +#define Maroon 0x0010 // 128, 0, 0 +#define Purple 0x8010 // 128, 0, 128 +#define Olive 0x0410 // 128, 128, 0 +#define LightGrey 0xC618 // 192, 192, 192 +#define DarkGrey 0x7BEF // 128, 128, 128 +#define Red 0x001F // 255, 0, 0 +#define Green 0x07E0 // 0, 255, 0 +#define Yellow 0x07FF // 255, 255, 0 +#define Blue 0xF800 // 0, 0, 255 +#define Magenta 0xF81F // 255, 0, 255 +#define Cyan 0xFFE0 // 0, 255, 255 +#define White 0xFFFF // 255, 255, 255 +#define Orange 0x053F // 255, 165, 0 +#define GreenYellow 0x2FF5 // 173, 255, 47 + + /* Use this to Calculate and define any colour + + #define RGB565CONVERT(red, green, blue) (uint16_t)( (( blue >> 3 ) << 11 ) | (( green >> 2 ) << 5 ) | ( red >> 3 )) + lcd.printf("%4X ",RGB565CONVERT(red value 0-255,green value 0-255,blue value 0-255)); + */ + class ST7735_TFT : public GraphicsDisplay { public: @@ -288,7 +295,8 @@ */ void set_orientation(unsigned int o); - SPI _spi; + //SPI _spi; + BurstSPI _spi; DigitalOut _cs; DigitalOut _rs; DigitalOut _reset;