Testsoftware for SC16IS750

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:30:30 2014 +0000
Parent:
5:c75ddfd44ae3
Commit message:
Xadow adapatations for SC16IS750

Changed in this revision

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
diff -r c75ddfd44ae3 -r b3a16b127073 USBDevice.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/USBDevice.lib	Wed Dec 24 08:30:30 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/yihui/code/USBDevice/#74ca09725b68
diff -r c75ddfd44ae3 -r b3a16b127073 main.cpp
--- a/main.cpp	Mon Dec 22 19:16:45 2014 +0000
+++ b/main.cpp	Wed Dec 24 08:30:30 2014 +0000
@@ -54,23 +54,35 @@
 
 
 //SPI Version
-SPI spi(D_MOSI, D_MISO, D_SCLK); //MOSI, MISO, SCK
+//SPI spi(D_MOSI, D_MISO, D_SCLK); //MOSI, MISO, SCK
 //SC16IS750_SPI serial_bridge(&spi, D_CS);
 //SC16IS750_SPI serial_bridge(&spi, D_CS, D_RST);  // version with Hardware Reset pin
-SC16IS752_SPI serial_bridge(&spi, D_CS, D_RST, SC16IS750::Channel_A);  // Dual UART version with Hardware Reset pin
-SC16IS752_SPI serial_bridge_B(&spi, D_CS, D_RST, SC16IS750::Channel_B);  // Dual UART version with Hardware Reset pin
+//SC16IS752_SPI serial_bridge(&spi, D_CS, D_RST, SC16IS750::Channel_A);  // Dual UART version with Hardware Reset pin
+//SC16IS752_SPI serial_bridge_B(&spi, D_CS, D_RST, SC16IS750::Channel_B);  // Dual UART version with Hardware Reset pin
 
 //I2C Version
 //I2C i2c(D_SDA, D_SCL);       //SDA, SCL
-//SC16IS750_I2C serial_bridge(&i2c, DEFAULT_SC16IS750_ADDR);
+#define DEFAULT_SC16IS750_ADDR 0x4D
+#define I2C_FREQ            100000
+I2C i2c(I2C_SDA, I2C_SCL);
+SC16IS750_I2C serial_bridge(&i2c, DEFAULT_SC16IS750_ADDR);
 //SC16IS750_I2C serial_bridge(&i2c, DEFAULT_SC16IS750_ADDR, D_RST);
 
-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);
+//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");
@@ -108,7 +120,7 @@
    
 // Heartbeat monitor
 void pulse() {
-  heartbeatLED = !heartbeatLED;
+  //heartbeatLED = !heartbeatLED;
 }
 
 void heartbeat_start() {
@@ -139,7 +151,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 
diff -r c75ddfd44ae3 -r b3a16b127073 mbed.bld
--- a/mbed.bld	Mon Dec 22 19:16:45 2014 +0000
+++ b/mbed.bld	Wed Dec 24 08:30:30 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