Akizuki I2C 8x2 Character LCD AQM0802A driver class for LPC1768
Fork of AQM0802A by
Revision 5:92e827dc6b1f, committed 2014-09-29
- Comitter:
- mataro777
- Date:
- Mon Sep 29 17:56:02 2014 +0000
- Parent:
- 4:5cc8d4df601d
- Commit message:
- It seems, the LPC1768 doesn't support the send byte array function?; ; ;
Changed in this revision
AQM0802A.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- 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); }