#define _LCDPORT_CONT_RSbit b0
#define _LCDPORT_CONT_RWbit b1
#define _LCDPORT_CONT_ENbit b2
+#define _LCDPORT_CONT_BLbit b3
#define _LCDPORT_CONT_RS _PORTD_RD0
#define _LCDPORT_CONT_RW _PORTD_RD1
#define _LCDPORT_CONT_EN _PORTD_RD2
+#define _LCDPORT_CONT_BACKLIGHT _PORTD_RD2
#endif
#else
val |= 0x70;
st7032_extcmd(addr, 0x38, val, busyf);
}
+
+void acm1602_setbacklight(unsigned char flag)
+{
+ unsigned char b;
+
+ b = _LCDPORT_CONT;
+ if(flag == 0){
+ b &= ~_LCDPORT_CONT_BACKLIGHT;
+ } else {
+ b |= _LCDPORT_CONT_BACKLIGHT;
+ }
+ _LCDPORT_CONT_LATCH = b;
+}
\ No newline at end of file
extern void acm1602_cursordir(unsigned char addr, unsigned char right);
extern void acm1602_init(unsigned char addr, unsigned char cls);
extern unsigned char acm1602_getchar(unsigned char addr);
+extern void acm1602_setbacklight(unsigned char flag);
/*
* ST7032 extension functions
ui_idlecount = 0xf800;
acm1602_init(0xa0, 1); //Init LCD
-// _AKC6955_WAIT_125_0MS(); // Wait 125ms
+ _AKC6955_WAIT_125_0MS(); // Wait 125ms
_LOCATE(0,0);
printstr("Hello;-)");
-// TRISD = 0x00;
- PORTDbits.RD3 = 1;
-// LATDbits.LATD3 = 1;
-
+ acm1602_setbacklight(0xff);
#if 1
i = 10001;
do {