Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: SC16IS750 USBDevice mbed
Fork of SC16IS750_Test by
Revision 0:d83a90125711, committed 2014-01-22
- Comitter:
- wim
- Date:
- Wed Jan 22 16:40:03 2014 +0000
- Child:
- 1:f0d3984f2586
- Commit message:
- First Test version for SPI UART Bridge
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SC16IS750.lib Wed Jan 22 16:40:03 2014 +0000 @@ -0,0 +1,1 @@ +SC16IS750#d64854a60f95
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Wed Jan 22 16:40:03 2014 +0000
@@ -0,0 +1,51 @@
+#include "mbed.h"
+#include "SC16IS750.h"
+
+//SPI Version
+SPI spi(PTD2, PTD3, PTD1); //MOSI, MISO, SCK
+//DigitalOut CS(PTD0); //CS
+SC16IS750_SPI serial_spi(&spi, PTD0);
+
+//I2C Version
+I2C i2c(PTE0, PTE1); //SDA, SCL
+SC16IS750_I2C serial_i2c(&i2c, DEFAULT_SC16IS750_ADDR);
+
+DigitalOut myled1(LED_RED);
+DigitalOut myled2(LED_GREEN);
+//DigitalOut myled3(LED_BLUE); //same as PTD1 (SCK)
+
+Serial pc(USBTX,USBRX);
+
+int main() {
+ pc.printf("\nHello World!\n");
+
+ myled1 = 1; // LED Off
+// CS = 1;
+
+ spi.format(8, 0);
+// spi.frequency(100000);
+// spi.frequency(500000);
+ spi.frequency(1000000);
+// spi.frequency(1500000);
+
+ while(1) {
+// serial_spi.writeRegister(SC16IS750::IODIR, 0x81); // direct call to new method
+
+ serial_spi.ioSetState(0x00); // indirect call to new method
+// wait(0.5);
+ pc.putc('*');
+ }
+
+
+#if(0)
+ while(1) {
+ CS=0;
+ spi.write(0xAA);
+ spi.write(0x81);
+ CS=1;
+ wait_us(5);
+ }
+#endif
+
+ pc.printf("\nBye World!\n");
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Wed Jan 22 16:40:03 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f \ No newline at end of file
