n-Blocks-HALL / RM25C512C-L_driver
Revision:
4:17e602b21ac5
Parent:
3:e846980a1536
Child:
6:0434e89c2d68
--- a/rm25c512cl.cpp	Wed Sep 12 16:02:49 2018 +0000
+++ b/rm25c512cl.cpp	Wed Sep 12 16:09:01 2018 +0000
@@ -3,7 +3,7 @@
 
 rm25c512cl::rm25c512cl(PinName MOSI,PinName MISO,PinName SCLK,PinName CS): _spi(MOSI,MISO,SCLK),_cs(CS){
    
-   _cs = 1; // always set chip select to initial state of high 
+   _cs = HIGH; // always set chip select to initial state of high 
     
 }
 
@@ -25,11 +25,11 @@
     
     _spi.lock();
       
-    _cs = 0;
+    _cs = LOW;
     
     _spi.write(&cmd[0],1,&data_buffer[0],0);
         
-    _cs = 1;
+    _cs = HIGH;
     
     _spi.unlock();
     
@@ -59,7 +59,7 @@
     
    _spi.lock();
     
-   _cs = 0;
+   _cs = LOW;
     
    _spi.write(&cmd[0],1,&data_buffer[0],0); 
     
@@ -67,7 +67,7 @@
     
    _spi.write(&cmd[0],1,&data_buffer[0],1);
        
-   _cs = 1;
+   _cs = HIGH;
     
    _spi.unlock();
     
@@ -102,12 +102,12 @@
     
     _spi.lock();
     
-    _cs = 0;   
+    _cs = LOW;   
     
     _spi.write(&cmd[0],3,&data_buffer[0],0);
     _spi.write(&data[0],data_size,&data_buffer[0],0);
   
-    _cs = 1;
+    _cs = HIGH;
     
     _spi.unlock();
     
@@ -138,11 +138,11 @@
     
     _spi.lock();
     
-    _cs = 0;   
+    _cs = LOW;   
     
     _spi.write(&cmd[0],4,&data_buffer[0],0);
     
-    _cs =1;
+    _cs = HIGH;
     
     _spi.unlock();
     
@@ -173,7 +173,7 @@
     
     _spi.lock();
     
-    _cs = 0;
+    _cs = LOW;
     
     _spi.write(&cmd[0],3,&data_buffer[0],0);
     
@@ -181,7 +181,7 @@
         
     _spi.write(&cmd[0],1,&data_buffer[0],data_buffer_size);
       
-    _cs = 1;
+    _cs = HIGH;
     
     _spi.unlock();
     
@@ -208,7 +208,7 @@
     
     _spi.lock();
     
-    _cs = 0;
+    _cs = LOW;
     
     _spi.write(&cmd[0],3,&data_buffer[0],0);
     
@@ -216,7 +216,7 @@
     
     _spi.write(&cmd[0],1,&data_buffer[0],1);
     
-    _cs = 1;
+    _cs = HIGH;
     
     _spi.unlock();
     
@@ -246,11 +246,11 @@
     
     _spi.lock();
     
-    _cs = 0;
+    _cs = LOW;
     
     _spi.write(&cmd[0],3,&data_buffer[0],0);
     
-    _cs = 1;
+    _cs = HIGH;
     
     _spi.unlock();
     
@@ -277,11 +277,11 @@
         
     _spi.lock();
     
-    _cs = 0;
+    _cs = LOW;
     
     _spi.write(&cmd[0],1,&data_buffer[0],0);
     
-    _cs = 1;
+    _cs = HIGH;
     
     _spi.unlock();