Akizuki I2C 8x2 Character LCD AQM0802A driver class for LPC1768
Fork of AQM0802A by
Diff: AQM0802A.cpp
- Revision:
- 5:92e827dc6b1f
- Parent:
- 0:2b187f29704e
--- a/AQM0802A.cpp Sat Sep 06 01:29:25 2014 +0000 +++ b/AQM0802A.cpp Mon Sep 29 17:56:02 2014 +0000 @@ -32,14 +32,31 @@ } void AQM0802A::lcd_cmd(uint8_t dat) { - char buf[] = { 0, dat }; - i2c->write(AQM0802A_ADDR, buf, sizeof(buf)); + + i2c->start(); + i2c->write(AQM0802A_ADDR); + i2c->write(0); + i2c->write(dat); + i2c->stop(); + + //LPC1768 doesn't support the send byte array function? + //char buf[] = { 0, dat }; + //i2c->write(AQM0802A_ADDR, buf, sizeof(buf)); + wait_us(AQM0802A_CMD_WAIT); } void AQM0802A::lcd_data(char dat) { - char buf[] = { 0x40, dat }; - i2c->write(AQM0802A_ADDR, buf, sizeof(buf)); + + i2c->start(); + i2c->write(AQM0802A_ADDR); + i2c->write(0x40); + i2c->write(dat); + i2c->stop(); + + //LPC1768 doesn't support the send byte array function? + //char buf[] = { 0x40, dat }; + //i2c->write(AQM0802A_ADDR, buf, sizeof(buf)); wait_us(AQM0802A_CMD_WAIT); }