/*
* LCD displays Chinese characters
*Input parameters:
* x: starting position horizontal coordinate
* y: starting position ordinate
* color: font color
* ch[]: text
*
*/
void Draw_Text16(int x, int y, int color, const unsigned char ch[])
{
unsigned short i, j ;
unsigned char mask, tem;
for(i=0; i<16; i++)
{
mask = 0x80 ;
tem = ch[i*2] ; //Two bytes in a group of 16 bits, take the first byte
for(j=0; j<8; j++)
{
if(term & mask)
{
PutPixel(x+j, y+i, color);
}
mask = mask >> 1 ;
}
mask = 0x80 ;
tem = ch[i*2 + 1] ;
for(j=0; j<8; j++)
{
if(term & mask)
{
PutPixel(x+j+8, y+i, color);
}
mask = mask >> 1 ;
}
}
}
/*
* Draw a dot
* Input parameters:
* x, y: pixel coordinates
* color: color value
* For 16BPP: color format is 0xAARRGGBB (AA = transparency),
* Need to be converted to 5:6:5 format
* For 8BPP: color is the index value in the palette,
* Its color depends on the value in the palette
*/
void PutPixel(UINT32 x, UINT32 y, UINT32 color)
{
UINT8 red,green,blue;
switch (bpp){
case 16:
{
UINT16 *addr = (UINT16 *)fb_base_addr + (y * xsize + x);
red = (color >> 19) & 0x1f;
green = (color >> 10) & 0x3f;
blue = (color >> 3) & 0x1f;
color = (red << 11) | (green << 5) | blue; // format 5:6:5
*addr = (UINT16) color;
break;
}
case 8:
{
UINT8 *addr = (UINT8 *)fb_base_addr + (y * xsize + x);
*addr = (UINT8) color;
break;
}
default:
break;
}
}
Previous article:LCD display image function-ARM system-2440
Next article:Touch screen driver-JZ2440
Recommended ReadingLatest update time:2024-11-23 03:09
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- I suggest doing a PCB layout column, which is what many prospective novices desire!
- True RTOS
- 28335 serial communication method
- Award-winning live broadcast: Comprehensive explanation of TI MSP Academy tutorials. Registration is open~
- The Dragon Boat Festival Chip Coin Exchange Event has begun! Zongzi, practical tool sets, and adjustable temperature soldering stations are waiting for you!
- What external factors interfere with electromagnetic coupling?
- A Simple Study on the Delay Program of Keil C 51 Single Chip Microcomputer
- Basic components and basic functions - wireless data transmission module
- EEWORLD University Hall----On-time Atomic Linux Video
- [GD32L233C-START Review] COREMARK Test