Haberler:

Forum kuralları güncellendi LÜTFEN  okuyunuz:  https://bit.ly/2IjR3ME

Ana Menü

lpc1769 glcd.h

Başlatan cseb, 03 Mayıs 2012, 22:25:14

cseb

arkadaşlar, aşağıdaki glcd.h dosyasına göre lcd nin data pinleri p2.6-p2.13 arasında mı oluyor? yoksa benmi yanlış anlıyorum?

yani bu satırlardaki yerde mi data pinleri oluşturuluyor?
#define PORT_OUT   {LPC_GPIO2->FIODIR |= 0xFF<<8;      LPC_GPIO3->FIODIR |= 0x3<<25;}
#define PORT_IN      {LPC_GPIO2->FIODIR &=~(0xFF<<8 );   LPC_GPIO3->FIODIR &=~(0x3<<25);}

glcd.h:
#define CTRL_GPIO	LPC_GPIO2
#define CS1_PIN		3	
#define CS2_PIN		4
#define DI_PIN		0
#define RW_PIN		1
#define EN_PIN		2
#define RST_PIN		5

#define CS1(x)      ((x) ? (CTRL_GPIO->FIOSET |= (1<<CS1_PIN))  : (CTRL_GPIO->FIOCLR = (1<<CS1_PIN)) );
#define CS2(x)		((x) ? (CTRL_GPIO->FIOSET |= (1<<CS2_PIN))  : (CTRL_GPIO->FIOCLR = (1<<CS2_PIN)) );
#define DI(x)		((x) ? (CTRL_GPIO->FIOSET |= (1<<DI_PIN ))  : (CTRL_GPIO->FIOCLR = (1<<DI_PIN )) );
#define RW(x)		((x) ? (CTRL_GPIO->FIOSET |= (1<<RW_PIN ))  : (CTRL_GPIO->FIOCLR = (1<<RW_PIN )) );
#define EN(x)		((x) ? (CTRL_GPIO->FIOSET |= (1<<EN_PIN ))  : (CTRL_GPIO->FIOCLR = (1<<EN_PIN )) );
#define RST(x)		((x) ? (CTRL_GPIO->FIOSET |= (1<<RST_PIN))  : (CTRL_GPIO->FIOCLR = (1<<RST_PIN )) );

#define PORT_OUT	{LPC_GPIO2->FIODIR |= 0xFF<<8;		LPC_GPIO3->FIODIR |= 0x3<<25;}
#define PORT_IN		{LPC_GPIO2->FIODIR &=~(0xFF<<8);	LPC_GPIO3->FIODIR &=~(0x3<<25);}
#define GLCD_WIDTH	128	// GLCD uzunlugu

extern void ks0108_init(void);
extern void ks0108_write(unsigned char chip, unsigned char veri);
extern unsigned char ks0108_read(unsigned char chip);
extern void ks0108_write_byte(unsigned char x, unsigned char y, unsigned char veri);
extern void ks0108_pixel(unsigned char x, unsigned char y, unsigned char renk);
extern void ks0108_fill(unsigned char renk);
extern void ks0108_line(unsigned char x1,unsigned char y1,unsigned char x2,unsigned char y2, unsigned char renk);
extern void ks0108_bar(unsigned char amp, unsigned char n,unsigned char ustsinir,unsigned char altsinir);
extern void ks0108_rect(unsigned char x1, unsigned char y1, unsigned char x2, unsigned char y2, unsigned char dolu, unsigned char renk);
extern void ks0108_circle(unsigned char x,unsigned char y, unsigned char r, unsigned char dolu, unsigned char renk);
extern void ks0108_text(unsigned char x, unsigned char y, const char *textptr, unsigned char size,unsigned char color);