LF20

Dependencies:   max32630fthr USBDevice

Files at this revision

API Documentation at this revision

Comitter:
mikevanderploeg
Date:
Mon Feb 17 19:41:41 2020 +0000
Parent:
0:d4d0421bd4e2
Commit message:
checkpoint for help with compiler;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r d4d0421bd4e2 -r 6915bb808b58 main.cpp
--- a/main.cpp	Thu Oct 24 23:50:33 2019 +0000
+++ b/main.cpp	Mon Feb 17 19:41:41 2020 +0000
@@ -137,9 +137,30 @@
                 microUSB.printf("ack.%i\r\n",val);
             }
             
+            else if (strncmp(buf, "scan",4)==0) {
+                // send 1000 clocks with a 1100 pattern on data
+                // csb=1 since that is SCAN_EN
+                // SEL1/NC=SCAN_RESET is not controlled via feather
+                int val;
+                int i;
+                csb = 1;
+                for(i = 0; i<500; i++) {
+                    clk = 0;
+                    data = (data==0)?1:0;
+                    wait_us(1);
+                    clk = 1;
+                    wait_us(1);
+                    clk = 0;
+                    wait_us(1);
+                    clk = 1;
+                    wait_us(1);
+                }
+                microUSB.printf("scan ack.%i\r\n",val);
+            }
             // set ldo voltage
             else if (strncmp(buf,"ldo",3)==0) {
                 int setting = ldo((int)buf[4],(int)buf[5]);
+                //microUSB.printf("Setting:%i\r\n",setting);
                 pegasus.max14690.ldo3SetVoltage(setting*100);
                 pegasus.max14690.ldo2SetVoltage(setting*100);
                 wait(0.01);