diff options
author | Daniel Friesel <derf@finalrewind.org> | 2016-01-24 16:42:58 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2016-01-24 16:42:58 +0100 |
commit | d6b2c7707b92f6daada2577dac51ba226f7b5046 (patch) | |
tree | 8cbf1c696da5363cf3c9451f27a6fa833202bb38 /src/main.cc | |
parent | b69f2a177a4613d1d9ccf93b5fe2f7dff68f468a (diff) |
I2C proof of concept: works!
Diffstat (limited to 'src/main.cc')
-rw-r--r-- | src/main.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main.cc b/src/main.cc index 4398d02..0fb68ff 100644 --- a/src/main.cc +++ b/src/main.cc @@ -6,11 +6,16 @@ #include "display.h" #include "font.h" +#include "i2c.h" #include "modem.h" #include "system.h" int main (void) { + char testbuf[] = "..Olol I2C extra lang bla foo wololo moep "; + char testbuf2[32]; + testbuf[0] = 1; + testbuf[1] = 0; // disable ADC to save power PRR |= _BV(PRADC); @@ -24,8 +29,17 @@ int main (void) display.enable(); modem.enable(); + i2c.enable(); sei(); + //display.setString("tx"); + + i2c.xmit(64, 0, (uint8_t *)testbuf, (uint8_t *)testbuf); + + //display.setString("rx"); + + i2c.xmit(2, 64, (uint8_t *)testbuf, (uint8_t *)testbuf2); + display.setString(testbuf2); while (1) { // nothing to do here, go to idle to save power |