intiial commit

Dependencies:   MAX8614X USBDevice max32630hsp_test

Committer:
phonemacro
Date:
Fri Aug 10 23:50:13 2018 +0000
Revision:
1:854f8a89a527
Parent:
0:9e5a4f845510
Child:
3:2272f89aad7e
remove extraneous code

Who changed what in which revision?

UserRevisionLine numberNew contents of line
phonemacro 0:9e5a4f845510 1 /**********************************************************************
phonemacro 1:854f8a89a527 2 * Copyright (C) 2018 Maxim Integrated Products, Inc., All Rights Reserved.
phonemacro 0:9e5a4f845510 3 *
phonemacro 0:9e5a4f845510 4 * Permission is hereby granted, free of charge, to any person obtaining a
phonemacro 0:9e5a4f845510 5 * copy of this software and associated documentation files (the "Software"),
phonemacro 0:9e5a4f845510 6 * to deal in the Software without restriction, including without limitation
phonemacro 0:9e5a4f845510 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
phonemacro 0:9e5a4f845510 8 * and/or sell copies of the Software, and to permit persons to whom the
phonemacro 0:9e5a4f845510 9 * Software is furnished to do so, subject to the following conditions:
phonemacro 0:9e5a4f845510 10 *
phonemacro 0:9e5a4f845510 11 * The above copyright notice and this permission notice shall be included
phonemacro 0:9e5a4f845510 12 * in all copies or substantial portions of the Software.
phonemacro 0:9e5a4f845510 13 *
phonemacro 0:9e5a4f845510 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
phonemacro 0:9e5a4f845510 15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
phonemacro 0:9e5a4f845510 16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
phonemacro 0:9e5a4f845510 17 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
phonemacro 0:9e5a4f845510 18 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
phonemacro 0:9e5a4f845510 19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
phonemacro 0:9e5a4f845510 20 * OTHER DEALINGS IN THE SOFTWARE.
phonemacro 0:9e5a4f845510 21 *
phonemacro 0:9e5a4f845510 22 * Except as contained in this notice, the name of Maxim Integrated
phonemacro 0:9e5a4f845510 23 * Products, Inc. shall not be used except as stated in the Maxim Integrated
phonemacro 0:9e5a4f845510 24 * Products, Inc. Branding Policy.
phonemacro 0:9e5a4f845510 25 *
phonemacro 0:9e5a4f845510 26 * The mere transfer of this software does not imply any licenses
phonemacro 0:9e5a4f845510 27 * of trade secrets, proprietary technology, copyrights, patents,
phonemacro 0:9e5a4f845510 28 * trademarks, maskwork rights, or any other form of intellectual
phonemacro 0:9e5a4f845510 29 * property whatsoever. Maxim Integrated Products, Inc. retains all
phonemacro 0:9e5a4f845510 30 * ownership rights.
phonemacro 0:9e5a4f845510 31 **********************************************************************/
phonemacro 0:9e5a4f845510 32
phonemacro 0:9e5a4f845510 33
phonemacro 0:9e5a4f845510 34 #include "mbed.h"
phonemacro 0:9e5a4f845510 35 //#include "max32630fthr.h"
phonemacro 0:9e5a4f845510 36 #include "max32630hsp.h"
phonemacro 0:9e5a4f845510 37 #include "MAX8614X.h"
phonemacro 0:9e5a4f845510 38 #include "USBSerial.h"
phonemacro 0:9e5a4f845510 39
phonemacro 0:9e5a4f845510 40 MAX32630HSP icarus(MAX32630HSP::VIO_1V8);
phonemacro 0:9e5a4f845510 41 // MAX32630FTHR mbed_board(MAX32630FTHR::VIO_1V8);
phonemacro 0:9e5a4f845510 42 SPI spi(P5_1, P5_2, P5_0); /* mosi, miso, sclk */
phonemacro 0:9e5a4f845510 43 DigitalOut cs(P3_0);
phonemacro 0:9e5a4f845510 44 PinName interrupt_pin = P5_4;
phonemacro 0:9e5a4f845510 45 // Virtual serial port over USB
phonemacro 0:9e5a4f845510 46 USBSerial microUSB;
phonemacro 0:9e5a4f845510 47
phonemacro 0:9e5a4f845510 48 DigitalOut rLED(LED1);
phonemacro 0:9e5a4f845510 49 DigitalOut gLED(LED2);
phonemacro 0:9e5a4f845510 50 DigitalOut bLED(LED3);
phonemacro 0:9e5a4f845510 51 int main()
phonemacro 0:9e5a4f845510 52 {
phonemacro 0:9e5a4f845510 53 uint8_t data[1];
phonemacro 0:9e5a4f845510 54 int c;
phonemacro 0:9e5a4f845510 55
phonemacro 0:9e5a4f845510 56 // daplink.printf("daplink serial port\r\n");
phonemacro 0:9e5a4f845510 57 // microUSB.printf("micro USB serial port\r\n");
phonemacro 0:9e5a4f845510 58 rLED = LED_ON;
phonemacro 0:9e5a4f845510 59 gLED = LED_ON;
phonemacro 0:9e5a4f845510 60 bLED = LED_OFF;
phonemacro 0:9e5a4f845510 61
phonemacro 0:9e5a4f845510 62 rLED = LED_OFF;
phonemacro 0:9e5a4f845510 63
phonemacro 1:854f8a89a527 64 printf("\r\n\rmax86140 authenication software\r\n");
phonemacro 0:9e5a4f845510 65 MAX8614X m(spi,cs,interrupt_pin);
phonemacro 0:9e5a4f845510 66 m.readRegister(0xff, data, 1);
phonemacro 1:854f8a89a527 67 printf("device id should be 0x24, read val = %x\r\n", data[0]);
phonemacro 0:9e5a4f845510 68
phonemacro 0:9e5a4f845510 69 while(1) {
phonemacro 0:9e5a4f845510 70 // c = microUSB.getc();
phonemacro 0:9e5a4f845510 71 // microUSB.putc(c);
phonemacro 0:9e5a4f845510 72 // daplink.putc(c);
phonemacro 1:854f8a89a527 73 gLED = !gLED;
phonemacro 0:9e5a4f845510 74 wait(1.0);
phonemacro 0:9e5a4f845510 75 }
phonemacro 0:9e5a4f845510 76 }
phonemacro 0:9e5a4f845510 77