LCD display text function-ARM system-2440

Publisher:superstar11Latest update time:2019-09-16 Source: eefocusKeywords:LCD Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

/*

* 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;

    }

}


Keywords:LCD Reference address:LCD display text function-ARM system-2440

Previous article:LCD display image function-ARM system-2440
Next article:Touch screen driver-JZ2440

Recommended ReadingLatest update time:2024-11-23 03:09

Taiwanese media: LCD driver IC demand remains strong, order visibility is already until next year
There have been recent reports that LCD panel prices have begun to fall due to slowing demand for TVs and other end-market devices, affecting shipments of LCD driver IC suppliers. However, according to digitimes, LCD driver IC manufacturers in Taiwan said that their order-to-shipment ratio remains above 1, and there i
[Mobile phone portable]
Taiwanese media: LCD driver IC demand remains strong, order visibility is already until next year
LCD design based on RA8806 controller of STM32
0 Introduction In modern electronic devices, the application of touch screens makes electronic devices more intelligent and user-friendly. In mobile phones, navigators, electronic instruments, consulting terminals and other devices, as a medium for information exchange, touch screens have the characteristics of flexi
[Microcontroller]
LCD design based on RA8806 controller of STM32
S3C2440 code relocation experiment (I)
lab environment This experiment is based on the following development environment: compiled with the arm-linux-gcc compiler (arm-none-linux-gnueabi, 4.3.2 Sourcery G++ Lite 2008q3-72) on Ubuntu 18.04.3 and run on the S3C2440 ARM hardware platform. The S3C2440 is a 32-bit ARM SoC. Linking Linking is the process of co
[Microcontroller]
S3C2440 code relocation experiment (I)
TQ2440 uboot---3.make EmbedSky_config
Although there are countless analyses on the Internet, I still feel it is necessary to analyze it myself. Uboot usually requires two steps when compiling: make EmbedSky_config make all 1. Let's analyze what happens after executing make EmbedSky_config. In the Makefile, there are the following EmbedSky_config:unconfi
[Microcontroller]
(3) s3c2440-interruption experiment
1. Preparation before entering the interrupt:   1. Save the environment before entering the interrupt.   2. Enter the interrupt mode and set the stack in interrupt mode.   2. Detailed explanation of interrupt processing block diagram:             First way:       When an interrupt is triggered internally, the corres
[Microcontroller]
(3) s3c2440-interruption experiment
S3C2440 reads and writes large capacity SD cards
First understand the SD card protocol 1. SD Card Protocol Overview Command: Sent by the host on the CMD line Response: Sent on the CMD line by the addressed card. Data: On the data line, use DAT0 or DAT0~DAT3. The CRC status response and Busy indication can only be sent via DAT0 2. Command format: High, 48th Low, 1st
[Microcontroller]
【JZ2440 Notes】Timer
I. Introduction The timer can be said to be a standard peripheral in any microcontroller. After learning so many MCUs, the timer module is very simple and almost all have the same workflow. Use a register to continuously count to mark the elapsed time. After this counting register overflows, it can trigger events such
[Microcontroller]
【JZ2440 Notes】Timer
TQ2440 Study Notes - 2. Network settings for pinging between Win7PC and virtual machine Ubuntu
I have studied for a long time how to ping Win7PC with the Ubuntu operating system in the virtual machine. I also referred to some information on the Internet. I always forget the configuration and it is very troublesome to do it again. Now I record it: Computer Configuration: Win7 64-bit operating system Virtua
[Microcontroller]
TQ2440 Study Notes - 2. Network settings for pinging between Win7PC and virtual machine Ubuntu
Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号