完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
#include "2440addr.h"
#include "lcd1.h" #define LOW21BITS(n) ((n)&0x1fffff) #define Lcd_Enable() rLCDCON1|=1 volatile unsigned short LCD_BUFFER[240][320]; static void Lcd_Config(void) { rGPCCON=0xaaaa02a9; rGPDCON=0xaaaaaaaa; rLCDCON1=(CLKVAL_TFT<<8)|(3<<5)|(BPPMODE_TFT<<1); rLCDCON2=(VBPD<<24)|(LINEVAL_TFT<<14)|(VFPD<<6)|(VSPW); rLCDCON3=(HBPD<<19)|(HOZVAL_TFT<<8)|(HFPD); rLCDCON4|=(HSPW); rLCDCON5 = (FRM565_TFT<<11) | (INVVCLK_TFT<<10) | (INVVLINE_TFT<<9) | (INVVFRAME_TFT<<8) | (HWSWP); rLCDSADDR1=(((unsigned int)LCD_BUFFER>>22)<<21)|LOW21BITS((unsigned int)LCD_BUFFER>>1); rLCDSADDR2=LOW21BITS (((unsigned int)LCD_BUFFER+(LCD_YSIZE_TFT*LCD_XSIZE_TFT*2))>>1 ); rLCDSADDR3=(0<<11)|(LCD_XSIZE_TFT/1); } static void Lcd_PowerEnable(int powerEnable) { rGPGCON=rGPGCON&(~(3<<8))|(3<<8); rGPGDAT=rGPGDAT|(1<<4); rLCDCON5=rLCDCON5&(~(1<<3))|(powerEnable<<3); } void PutPixel(unsigned int x,unsigned int y,unsigned short c) { if((x<320)&&(y<240)) LCD_BUFFER[(y)][(x)]=c; } void Lcd_Init(void) { Lcd_Config(); Lcd_Enable(); Lcd_PowerEnable(1); } #include"lcd1.h"int main(){ Lcd_Init();; while(1) { PutPixel(30,10,569); PutPixel(20,200,569); } return 0;}#ifndef __LCD_H__#define __LCD_H__ #define LCD_XSIZE_TFT (320)#define LCD_YSIZE_TFT (240) #define INVVDEN 1#define HWSWP 1#define PNRMODE 3#define BPPMODE 12#define CLKVAL_TFT (7) #define VBPD (14)#define VFPD (11)#define VSPW (2)#define HBPD (37)#define HFPD (19)#define HSPW (29) #define HOZVAL_TFT (320-1)#define LINEVAL_TFT (240-1) #define BPPMODE_TFT 12 #define FRM565_TFT 1#define INVVCLK_TFT 1#define INVVLINE_TFT 1#define INVVFRAME_TFT 1 extern void Lcd_init(void);extern void PutPixel(unsigned int x,unsigned int y,unsigned short c); #endif |
|
相关推荐
1个回答
|
|
GPBCON引脚要初始化。。。。。在LCD驱动文件里面看到要做的。。。不信你试试
|
|
|
|
只有小组成员才能发言,加入小组>>
197个成员聚集在这个小组
加入小组为什么点亮LED的例子放在NORFlash上跑会出现奇怪的现象?
2161 浏览 6 评论
1970 浏览 5 评论
韦东山老师推出的《玩转ARM裸机实战》课程将帮你以上问题一扫而光!
4524 浏览 1 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-30 03:08 , Processed in 0.905415 second(s), Total 81, Slave 60 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号