If the color screen driver is written well, it can be used all the time, and the focus can be on writing the application, but if it is ported, the driver needs to be ported. In fact, porting only changes the very low-level code close to the processor.
Because the STM32F103C8 has only 64K of FLASH on the chip, it cannot store too much image data, and cannot display too large images.
The following program is annotated in detail, and you can basically use it once you understand it.
The header file lcd.h of the color screen driver is as follows:
#define
#define
#define
#define
#define
#define
#define
#define
#define
#define
#define
#define
extern
extern
void
//void
void
void
void
void
void
void
The driver lcd.c file is as follows:
#include
#include
//Header file storing image data
//#include
#include
#include
#include
#define
#define
#define
#define
#define
uint
{
};
void
{
LCD_rest(0);
delayms(5);
LCD_rest(1);
delayms(5);
LCD_cs(0);
//
LCD_Write_COM(0x00,0xE5);
LCD_Write_COM(0x00,0x01);
LCD_Write_COM(0x00,0x02);
LCD_Write_COM(0x00,0x03);
LCD_Write_COM(0x00,0x04);
LCD_Write_COM(0x00,0x08);
LCD_Write_COM(0x00,0x09);
LCD_Write_COM(0x00,0x0A);
LCD_Write_COM(0x00,0x0C);
LCD_Write_COM(0x00,0x0D);
LCD_Write_COM(0x00,0x0F);
//
LCD_Write_COM(0x00,0x10);
LCD_Write_COM(0x00,0x11);
LCD_Write_COM(0x00,0x12);
LCD_Write_COM(0x00,0x13);
LCD_Write_COM(0x00,0x07);
delayms(50);
LCD_Write_COM(0x00,0x10);
LCD_Write_COM(0x00,0x11);
delayms(50);
LCD_Write_COM(0x00,0x12);
delayms(50);
LCD_Write_COM(0x00,0x13);
LCD_Write_COM(0x00,0x29);
LCD_Write_COM(0x00,0x2B);
delayms(50);
LCD_Write_COM(0x00,0x20);
LCD_Write_COM(0x00,0x21);
//
LCD_Write_COM(0x00,0x30);
LCD_Write_COM(0x00,0x31);
LCD_Write_COM(0x00,0x32);
LCD_Write_COM(0x00,0x35);
LCD_Write_COM(0x00,0x36);
LCD_Write_COM(0x00,0x37);
LCD_Write_COM(0x00,0x38);
LCD_Write_COM(0x00,0x39);
LCD_Write_COM(0x00,0x3C);
LCD_Write_COM(0x00,0x3D);
//------------------
LCD_Write_COM(0x00,0x50);
LCD_Write_COM(0x00,0x51);
LCD_Write_COM(0x00,0x52);
LCD_Write_COM(0x00,0x53);
LCD_Write_COM(0x00,0x60);
LCD_Write_COM(0x00,0x61);
LCD_Write_COM(0x00,0x6A);
//--------------
LCD_Write_COM(0x00,0x80);
LCD_Write_COM(0x00,0x81);
LCD_Write_COM(0x00,0x82);
LCD_Write_COM(0x00,0x83);
LCD_Write_COM(0x00,0x84);
LCD_Write_COM(0x00,0x85);
//--------------
LCD_Write_COM(0x00,0x90);
LCD_Write_COM(0x00,0x92);
LCD_Write_COM(0x00,0x07);
[page]
LCD_cs(1);
}
void
{
} #ifdef void { //Shield the upper 8 bits GPIOA->BSRR //Shield the lower 8 bits GPIOB->BSRR LCD_wr(0); LCD_wr(1); } #else //Conditional compilation - 8-bit data mode void { //LCD_wr(1); //LCD_DataPortH=VL; //LCD_wr(0); //LCD_wr(1); } #endif void { LCD_Writ_Bus(VH,VL); } void { LCD_Writ_Bus(VH,VL); } void { int LCD_cs(0); Address_set(0,0,239,319); } void { LCD_Write_COM(0x00,0x20);LCD_Write_DATA(x1>>8,x1); LCD_Write_COM(0x00,0x52);LCD_Write_DATA(y1>>8,y1); LCD_Write_COM(0x00,0x53);LCD_Write_DATA(y2>>8,y2); } void { Address_set(0,90,65,189); for(m=0;m<13200/2;m++) { } for(m=0;m<12600/2;m++) { } } Main program main.c In the main program, complete the initialization configuration of the system, and use the color screen driver to complete the display of pictures and other functions. The program is as follows: #include #include GPIO_InitTypeDef ErrorStatus void void void int { #ifdef #endif [page] } void { } void { #ifdef #else #endif } void { } #ifdef void { } #endif
Previous article:STM32 study notes - TFT2.4 color screen displays characters and Chinese characters
Next article:ucos-ii study notes - s12 lcd led two-task semaphore communication
- Popular Resources
- Popular amplifiers
- Learn ARM development(14)
- Learn ARM development(15)
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Learn ARM development(14)
- Learn ARM development(15)
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- CC2530 General Purpose I/O
- RFID technology realizes the scale of hotel management
- [Qinheng RISC-V core CH582] SPI driver ST7735
- stm32 pwm wave control
- 【GD32450I-EVAL】+ 02 Software Development Environment Configuration (KEIL 5) and Running Light Test
- Zynq UltraScale+MPSOC Development Board Feature List
- Practical RF training tutorials for engineers
- Why is the American Fluke 15B more durable than domestic multimeters? Take a look and you will understand
- A 28-year-old programmer at ByteDance died suddenly. Why haven’t we heard of any sudden deaths of foreign programmers in all these years?
- Antenna impedance matching and design of ultra-wideband antennas