ARMlcd的简单使用

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mmu.h"
#include "typedef.h"
#include "S3C2451_gpio.h"
#include "S3C2451_uart.h"
#include "S3C2451_lcd.h"
#include "S3C2451_adc.h"
//#include "S3C2451_irq.h"
//#include "S3C2451_eint.h"


//#define CON 0x56000010
//#define DAT 0x56000014

extern const unsigned char ch[][16];
extern const unsigned char gImage_image[];
extern const unsigned char gImage_lamando[69128];

unsigned char one[] = {
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};

void delay(unsigned int count)
{
    int j = 1000;
    int i = 0;
    while(--j)
        for(i = count; i > 0; i --);
}

void Main()
{
    //U32 i;
    U32 adcReg,adcValue;
    //float adcValue;
    char buffer[128];

    //MMU³õʼ»¯£ºÔÚ³ÌÐò×ʼµÄʱºòµ÷ÓÃ
    MMU_Init();

    //LCD¶Ë¿Ú³õʼ»¯
    LCD_GPIO_Init();
    //LCD³õʼ»¯
    LCD_Init();

    //ÇåÆÁº¯Êý,ÆÁÄ»±ä³ÉºÚÉ«
    LCD_Clear(~0);

    //LCDDisplay_String(100,100,0,"asdasdasd");

    //LCDDisplay_Char(10,10,0,'5');
    //LCDDisplay_String(24,10,0,"asdfghjkl");
    //i = 12;
    LCD_Display_Bmp(0,0,480,272,gImage_lamando);
    adcReg = read_adc(0);
    adcValue = 330 * adcReg / 1024;

    LCDDisplay_String(0,0,0,"123456789");
    sprintf(buffer,"adcValue is %d",adcValue);
    LCDDisplay_String(100,240,0,buffer);
    //LCDDisplay_Char(10,8,0,(i/10) + '0');
    //LCDDisplay_Char(10,16,0,(i%10) + '0');
    LCDDisplay_String(141,240,0,"asdfghjkl");
    //LCD_Display_Bmp(0,0,480,272,gImage_image);
    while(1)
    {   
      delay(100);
    }   
}





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值