Cortex-M3 로 캐릭터 LCD 제어하기
|
LCD.c |
|
#include "LCD.h"
GPIOG_BRR = LCD_EN ; //EN clear for(iCnt = 0; LCD_DELAY - LCD_DELAY1> iCnt; ++iCnt); //시간지연 GPIOG_BSRR = LCD_EN ; //EN set for(iCnt = 0; LCD_DELAY - LCD_DELAY2 > iCnt; ++iCnt); //시간지연 GPIOG_BRR = (0xFF << LCD_BS); // BUS clear GPIOG_BSRR = (ucdata<<LCD_BS); // BUS data input for(iCnt = 0; LCD_DELAY - LCD_DELAY3 > iCnt; ++iCnt); //시간지연 GPIOG_BRR = LCD_EN ; //EN clear for(iCnt = 0; LCD_DELAY - LCD_DELAY4 > iCnt; ++iCnt); //시간지연
GPIOG_BRR = LCD_EN ; //EN clear for(iCnt = 0; LCD_DELAY - LCD_DELAY1> iCnt; ++iCnt); //시간지연 GPIOG_BSRR = LCD_EN ; //EN set for(iCnt = 0; LCD_DELAY - LCD_DELAY2 > iCnt; ++iCnt); //시간지연 GPIOG_BRR = (0xFF << LCD_BS); // BUS clear GPIOG_BSRR = (ucdata<<LCD_BS); // BUS data input for(iCnt = 0; LCD_DELAY - LCD_DELAY3 > iCnt; ++iCnt); //시간지연 GPIOG_BRR = LCD_EN ; //EN clear for(iCnt = 0; LCD_DELAY - LCD_DELAY4 > iCnt; ++iCnt); //시간지연
void LCD_String(void *vp) while(1) return;
|
|
LCD.h |
|
#ifndef _LCD_H_ #define IOPG (8) //GPIOG(0x40012000) #define GPIOG_CRL (*((volatile unsigned int *)(0x40012000)))
#define LCD_CLEAR 0x01 //0000 0001, P13, 화면 클리어
void LCD_Cmd_write (unsigned char); void LCD_Data_write (unsigned char); void LCD_String(void *); void LCD_Number(unsigned int, unsigned short); #endif //_LCD_H_ |