SPI or I2C to UART Bridge

Dependents:   SC16IS750_Test mbed_SC16IS750 Xadow_SC16IS750_Test Xadow_MPU9150AHRS

Revision:
5:ff3e57bebb6a
Parent:
4:12446ee9f9c8
--- a/SC16IS750.h	Mon Dec 22 19:04:38 2014 +0000
+++ b/SC16IS750.h	Wed Dec 24 01:05:49 2014 +0000
@@ -3,6 +3,7 @@
  *                      https://forum.sparkfun.com/viewtopic.php?f=13&t=21846
  *   v0.2 WH, Feb 2014, Added Doxygen Documentation, Added Hardware Reset pin methods.
  *   v0.3 WH, Dec 2014, Added support for SC16IS752 dual UART. 
+ *   v0.4 WH, Dec 2014, Added Repeated Start for I2C readRegister(). Set I2C clock at 100kb/s. Fixed and added some comments. 
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
  * and associated documentation files (the "Software"), to deal in the Software without restriction,
@@ -349,7 +350,7 @@
         TXLVL       = 0x08 << 3, /* TX FIFO Level register - Read only    */
         RXLVL       = 0x09 << 3, /* RX FIFO Level register - Read only    */
         IODIR       = 0x0A << 3, /* IO Pin Direction reg   - RD/WR access */
-        IOSTATE     = 0x0B << 3, /* IO Pin State reg       - Read only    */
+        IOSTATE     = 0x0B << 3, /* IO Pin State reg       - RD/WR access */
         IOINTENA    = 0x0C << 3, /* IO Interrupt Enable    - RD/WR access */
 //        reserved    = 0x0D << 3,
         IOCTRL      = 0x0E << 3, /* IO Control register    - RD/WR access */
@@ -568,6 +569,7 @@
 
 /** Set direction of I/O port pins.
   * This method is specific to the SPI-I2C UART and not found on the 16750
+  * Note: The SC16IS752 does not have separate GPIOs for Channel_A and Channel_B.    
   *   @param  bits Bitpattern for I/O (1=output, 0=input)
   *   @return none
   */
@@ -575,6 +577,7 @@
 
 /** Set bits of I/O port pins.
   * This method is specific to the SPI-I2C UART and not found on the 16750
+  * Note: The SC16IS752 does not have separate GPIOs for Channel_A and Channel_B.    
   *   @param  bits Bitpattern for I/O (1= set output bit, 0 = clear output bit)
   *   @return none
   */
@@ -582,6 +585,7 @@
 
 /** Get bits of I/O port pins.
   * This method is specific to the SPI-I2C UART and not found on the 16750
+  * Note: The SC16IS752 does not have separate GPIOs for Channel_A and Channel_B.    
   *   @param  none
   *   @return bits Bitpattern for I/O (1= bit set, 0 = bit cleared)
   */
@@ -590,6 +594,7 @@
 
 /** Software Reset SC16IS750 device.
   * This method is specific to the SPI-I2C UART and not found on the 16750
+  * Note: The SC16IS752 does not have separate Reset for Channel_A and Channel_B.    
   *   @param  none
   *   @return none
   */
@@ -784,7 +789,7 @@
  * #include "SC16IS750.h"
  *
  * I2C i2c(PTE0, PTE1);       //SDA, SCL
- * SC16IS750_I2C serial_i2c(&i2c, DEFAULT_SC16IS750_ADDR);
+ * SC16IS750_I2C serial_i2c(&i2c, SC16IS750_DEFAULT_ADDR);
  *
  * Serial pc(USBTX,USBRX);
  *
@@ -903,6 +908,8 @@
 public:
 
 /** Create an SC16IS752_SPI object using a specified SPI bus and CS
+  * Note: The SC16IS752 does not have separate GPIOs for Channel_A and Channel_B.  
+  * Note: The SC16IS752 does not have separate Reset for Channel_A and Channel_B.    
   *
   * @param SPI &spi the SPI port to connect to 
   * @param cs  Pinname of the CS pin (active low)
@@ -965,7 +972,6 @@
 
 // Save Channel setting
   ChannelName _channel; 
-
 };
 
 
@@ -977,7 +983,7 @@
  * #include "SC16IS750.h"
  *
  * I2C i2c(PTE0, PTE1);       //SDA, SCL
- * SC16IS752_I2C serial_i2c(&i2c, DEFAULT_SC16IS750_ADDR, NC, SC16IS750::Channel_A);
+ * SC16IS752_I2C serial_i2c(&i2c, SC16IS750_DEFAULT_ADDR, NC, SC16IS750::Channel_A);
  *
  * Serial pc(USBTX,USBRX);
  *
@@ -1000,6 +1006,8 @@
 public:
 
 /** Create an SC16IS752_I2C object using a specified I2C bus, slaveaddress and Channel
+  * Note: The SC16IS752 does not have separate GPIOs for Channel_A and Channel_B. 
+  * Note: The SC16IS752 does not have separate Reset for Channel_A and Channel_B.     
   *
   * @param I2C &i2c the I2C port to connect to 
   * @param char deviceAddress the address of the SC16IS750