communication mbed/pld altera lib

Dependents:   scooter_mbed_etudiant scooter_mbed_correction_mbed_os scooter_ scooter_mbed_etudiant_fini_1 ... more

Revision:
1:7b4e6771a530
Parent:
0:49abff3f269a
diff -r 49abff3f269a -r 7b4e6771a530 bloc_io.cpp
--- a/bloc_io.cpp	Thu Aug 06 06:27:00 2015 +0000
+++ b/bloc_io.cpp	Tue Aug 11 15:00:09 2015 +0000
@@ -12,6 +12,7 @@
     
      _CS=1;
      _RD_WRn=0; //Write Mode
+     Bloc_IoPort.output();// set bus as output
     Bloc_IoPort.write((int)byWrVal);// update Bloc_Io port
      _CS=0;// enable write
      _CS=1;// disable write
@@ -24,8 +25,11 @@
    unsigned char byRedVal ;
      _CS=1;
      _RD_WRn=1; //Read Mode
-    byRedVal=(unsigned char) Bloc_IoPort.read();// update Bloc_Io port
+     
+      Bloc_IoPort.input(); // set bus as input
+   
      _CS=0;// enable read
+      byRedVal=(unsigned char) Bloc_IoPort.read();// update Bloc_Io port
      _CS=1;// disable read
      _RD_WRn=1;// read mode 
      return byRedVal;