intiial commit

Dependencies:   MAX8614X USBDevice max32630hsp_test

Files at this revision

API Documentation at this revision

Comitter:
phonemacro
Date:
Sat Aug 11 00:39:38 2018 +0000
Parent:
2:5cbb6762f344
Child:
4:46919eec2c28
Commit message:
updated CS to P5_3;

Changed in this revision

MAX8614X.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/MAX8614X.lib	Fri Aug 10 23:56:00 2018 +0000
+++ b/MAX8614X.lib	Sat Aug 11 00:39:38 2018 +0000
@@ -1,1 +1,1 @@
-https://os.mbed.com/teams/MaximIntegrated/code/MAX8614X/#77ee0ceb503a
+https://os.mbed.com/teams/MaximIntegrated/code/MAX8614X/#7ae9b934ee55
--- a/main.cpp	Fri Aug 10 23:56:00 2018 +0000
+++ b/main.cpp	Sat Aug 11 00:39:38 2018 +0000
@@ -40,7 +40,8 @@
 MAX32630HSP icarus(MAX32630HSP::VIO_1V8);
 //    MAX32630FTHR mbed_board(MAX32630FTHR::VIO_1V8);
 SPI spi(P5_1, P5_2, P5_0); /* mosi, miso, sclk */
-DigitalOut cs(P3_0);
+//DigitalOut cs(P3_0);
+DigitalOut cs(P5_3);
 PinName interrupt_pin = P5_4;
 // Virtual serial port over USB
 USBSerial microUSB; 
@@ -50,7 +51,7 @@
 DigitalOut bLED(LED3);
 int main()
 {
-    uint8_t data[1];
+    uint8_t data[5];
     int c;
 
 //    daplink.printf("daplink serial port\r\n");
@@ -60,16 +61,16 @@
     bLED = LED_OFF;
 
     rLED = LED_OFF;
-    
     printf("\r\n\rmax86140 authenication software\r\n");
     MAX8614X m(spi,cs,interrupt_pin);
     m.readRegister(0xff, data, 1);
     printf("device id should be 0x24, read val = %x\r\n", data[0]);
-    
+    m.writeRegister(0x3,1);
+
+    m.readRegister(0x3, data, 1);
+    printf("enable sha, read val = %d\r\n", data[0]);
+
     while(1) {
-//        c = microUSB.getc();
-//        microUSB.putc(c);
- //       daplink.putc(c);
         gLED = !gLED;
         wait(1.0);
     }