Tisham Dhar / Mbed 2 deprecated Xadow_SC16IS750_Test

Dependencies:   SC16IS750 USBDevice mbed

Fork of SC16IS750_Test by Wim Huiskamp

Files at this revision

API Documentation at this revision

Comitter:
whatnick
Date:
Wed Dec 24 08:13:31 2014 +0000
Parent:
3:3d4269319b51
Commit message:
Xadow modifications

Changed in this revision

SC16IS750.lib Show annotated file Show diff for this revision Revisions of this file
USBDevice.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- a/SC16IS750.lib	Thu Feb 20 19:45:33 2014 +0000
+++ b/SC16IS750.lib	Wed Dec 24 08:13:31 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/wim/code/SC16IS750/#9783b6bde958
+http://mbed.org/users/wim/code/SC16IS750/#ff3e57bebb6a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/USBDevice.lib	Wed Dec 24 08:13:31 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/yihui/code/USBDevice/#74ca09725b68
--- a/main.cpp	Thu Feb 20 19:45:33 2014 +0000
+++ b/main.cpp	Wed Dec 24 08:13:31 2014 +0000
@@ -52,21 +52,30 @@
 
 //SPI Version
 //SPI spi(PTD2, PTD3, PTD1); //MOSI, MISO, SCK
-SPI spi(D_MOSI, D_MISO, D_SCLK); //MOSI, MISO, SCK
+//SPI spi(D_MOSI, D_MISO, D_SCLK); //MOSI, MISO, SCK
 //DigitalOut CS(PTD0);       //CS 
 //SC16IS750_SPI serial_bridge(&spi, PTD0);
-SC16IS750_SPI serial_bridge(&spi, D_CS);
+//SC16IS750_SPI serial_bridge(&spi, D_CS);
 
 //I2C Version
 //I2C i2c(D_SDA, D_SCL);       //SDA, SCL
-//SC16IS750_I2C serial_bridge(&i2c, DEFAULT_SC16IS750_ADDR);
+I2C i2c(I2C_SDA, I2C_SCL);
+SC16IS750_I2C serial_bridge(&i2c, 0x4D);
 
-DigitalOut myled1(LED_RED);
+//DigitalOut myled1(LED_RED);
 //DigitalOut myled2(LED_GREEN); 
 //DigitalOut myled3(LED_BLUE);  // Same as PTD1 (SCK)
-DigitalOut heartbeatLED(LED_GREEN);
+//DigitalOut heartbeatLED(LED_GREEN);
  
-Serial pc(D_TX,D_RX);
+#define DEBUG
+
+#ifdef DEBUG
+#include "USBSerial.h"                       // To use USB virtual serial, a driver is needed, check http://mbed.org/handbook/USBSerial
+#define LOG(args...)    pc.printf(args)
+USBSerial pc;
+#else
+#define LOG(args...)
+#endif
 
 void show_menu() {
     pc.printf("0: Exit\n\r");
@@ -104,7 +113,7 @@
    
 // Heartbeat monitor
 void pulse() {
-  heartbeatLED = !heartbeatLED;
+  //heartbeatLED = !heartbeatLED;
 }
 
 void heartbeat_start() {
@@ -135,7 +144,7 @@
 
   heartbeat_start();     
 
-  myled1 = 1; // LED Off
+  //myled1 = 1; // LED Off
 
  // We need to enable flow control or we overflow buffers and
   // lose data when used with the WiFly. Note that flow control 
@@ -166,7 +175,8 @@
 
           case '2' :
                      pc.printf("Init\n\r");                    
-                     serial_bridge._init();                      
+                     serial_bridge._init();   
+                     pc.printf("Done Init");                  
                      break;
           
           case '3' :        
--- a/mbed.bld	Thu Feb 20 19:45:33 2014 +0000
+++ b/mbed.bld	Wed Dec 24 08:13:31 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/ed8466a608b4
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/4fc01daae5a5
\ No newline at end of file