Dialog DA7212 evaluating project DEVELOP branch

Dependencies:   FXAS21002 TLV320 mbed sinelookup C12832 FXOS8700

Revision:
15:f9f642239cb6
Parent:
14:c852e468923e
Child:
16:2edf3d4ccbe3
diff -r c852e468923e -r f9f642239cb6 main.cpp
--- a/main.cpp	Mon Jun 05 16:25:29 2017 +0000
+++ b/main.cpp	Fri Jun 09 17:01:20 2017 +0000
@@ -78,8 +78,8 @@
 InterruptIn right(PTC6);
 
 #include "FXOS8700.h"
-FXOS8700 acc(I2C_SDA, I2C_SCL, 0x3A);
-FXOS8700 mag(I2C_SDA, I2C_SCL, 0x3A);
+FXOS8700 acc(PTD9, PTD8);
+FXOS8700 mag(PTD9, PTD8);
 
 #include "C12832.h"
 C12832 lcd(D11, D13, D12, D7, D10);
@@ -91,7 +91,7 @@
 #include "sinelookup.h"
 //DA7212 codec(I2C_SDA, I2C_SCL);
 //TLV320 codec(I2C_SDA, I2C_SCL);
-FrdmI2s i2s(I2S_TRANSMIT, PTC1, PTE11, PTE12);
+FrdmI2s i2s(PTC1, PTE11, PTE12,TRANSMIT);
 
 uint16_t phase_l;
 uint16_t phase_r;
@@ -135,27 +135,26 @@
 
     i2s.frequency(SAMPLERATE);
     i2s.wordsize(16);
-    i2s.stereomono(I2S_STEREO);
-    i2s.masterslave(I2S_MASTER);
-    i2s.attach(&play);
+    i2s.stereomono(STEREO);
+    i2s.role(MASTER);
+//    i2s.attach(&play);
     i2s.start();
 
-    while(1){
-        wait_ms(500);
-        pc.printf(".");
-    }
     while(1) {
         pc.printf(".");
-        wait_ms(500);
-        skipper = pot1.read_u16() >> 8;
-        volume = pot2.read_u16() >> 10; // 6-bit unsigned int
+        wait_ms(50);
+//        skipper = pot1.read_u16() >> 8;
+//        volume = pot2.read_u16() >> 10; // 6-bit unsigned int
 //        codec.headphone_volume((int)(volume));
 
         lcd.locate(0,3);
-        lcd.printf("Volume: %+03d", (volume - 57));
-        lcd.locate(0,15);
-        lcd.printf("Skipper: %04d", skipper);
-
+        lcd.printf("%08X",I2S0->TCSR);
+        I2S0->TCSR |= I2S_TCSR_FEF(1);
+//        lcd.printf("Volume: %+03d", (volume - 57));
+//        lcd.locate(0,15);
+//        lcd.printf("Skipper: %04d", skipper);
+        for(int j=0;j<8;j++){
+            I2S0->TDR[0] = 0x5555AAAA;
+        }
     }
-
 }