Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
LCD.c
Package: str711USB.rar [view]
Upload User: yyyd609
Upload Date: 2022-07-18
Package Size: 183k
Code Size: 1k
Category:
ARM-PowerPC-ColdFire-MIPS
Development Platform:
C/C++
- #include <stdio.h>
- #include <stdarg.h>
- #include "LCD.h"
- static void Delay(void)
- {
- int i;
- for(i = 0; i < 0x180; i++);
- }
- void LCD_Init(void)
- {
- static const u8 LCD_InitCmd[4]= {0x38, 0x0C, 0x06, 0x01};
- int i;
- GPIO_Config(GPIO2, 0x000F, GPIO_AF_PP);
- EMI_Config(3, EMI_ENABLE | EMI_WAITSTATE(15) | EMI_SIZE_8);
- for(i = 0; i < 4; i++)
- {
- *(vu16*)&LCD_CMD_PORT = LCD_InitCmd[i] << 8 | LCD_InitCmd[i];
- Delay();
- }
- for(i = 0; i < 40; i++)
- Delay();
- }
- void LCD_Goto(int line, int col)
- {
- unsigned cmd = 0x80 | line << 6 | col;
- *(vu16*)&LCD_CMD_PORT = cmd << 8 | cmd;
- Delay();
- }
- void LCD_Putc(char c)
- {
- *(vu16*)&LCD_DAT_PORT = (u8)c << 8 | (u8)c;
- Delay();
- }
- void LCD_Puts(const char *s)
- {
- while(*s)
- {
- *(vu16*)&LCD_DAT_PORT = *s << 8 | *s;
- s++;
- Delay();
- }
- }
- void LCD_Printf(const char *format, ...)
- {
- static char buf[256];
- va_list args;
- va_start(args, format);
- vsprintf(buf, format, args);
- va_end(args);
- LCD_Puts(buf);
- }