Parallel bus emulation by GPIO ports

Dependencies:   mbed parallel_bus

Files at this revision

API Documentation at this revision

Comitter:
nxp_ip
Date:
Thu Jul 12 05:53:12 2012 +0000
Parent:
0:b0587d0181e1
Child:
2:57997f9f23ea
Commit message:
comment added

Changed in this revision

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
parallel_bus.lib Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue Jul 10 05:39:46 2012 +0000
+++ b/main.cpp	Thu Jul 12 05:53:12 2012 +0000
@@ -1,22 +1,30 @@
+//  paprallel bus library demo 
+//      10-Jul-2012 : original
+//      12-Jul-2012 : using version 2 library 
+
 #include "mbed.h"
 #include "hardware_abs.h"
 
-#define ADDR    0xC3
-
-char    data[]  =   { 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8, 0xF7, 0xF6, 0xF5, 0xF4, 0xF3, 0xF2, 0xF1, 0xF0, 0xEF };
-char    v;
+char    data[]  =   { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F };
+char    rd[ 16 ];
+char    a;
+char    b;
 
 int main() {
     hardware_initialize();
     reset( 10, 1000 );
 
-    write_data( 0xCA, 0x55 );
+    write_data( 0xCA, 0x55 );    
     write_data( 0xDA, 0xAA );
-    v   = read_data( 0xCA );
-    v   = read_data( 0xDA );
+    a   = read_data( 0xCA );
+    b   = read_data( 0xDA );
 
+    write_data( 0xC0, 0x02 );    
     write_data_burst( 0xC3, data, sizeof( data ) );
 
+    write_data( 0xC0, 0x02 );
+    read_data_burst( 0xC3, rd, sizeof( rd ) );
+
     while (1)
         ;
 }
--- a/mbed.bld	Tue Jul 10 05:39:46 2012 +0000
+++ b/mbed.bld	Thu Jul 12 05:53:12 2012 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/63bcd7ba4912
+http://mbed.org/users/mbed_official/code/mbed/builds/63bcd7ba4912
\ No newline at end of file
--- a/parallel_bus.lib	Tue Jul 10 05:39:46 2012 +0000
+++ b/parallel_bus.lib	Thu Jul 12 05:53:12 2012 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/nxp_ip/code/parallel_bus/#2d9795162649
+http://mbed.org/users/nxp_ip/code/parallel_bus/#5526d3e04b7a