Test program for DS1683, Maxim Total-Elapsed-Time and Event Recorder with Alarm.
Dependencies: DS1683 mbed vt100
Diff: testDS1683.cpp
- Revision:
- 3:7043500e6f93
- Parent:
- 2:746993c2ea4a
- Child:
- 4:8fac856f8a67
diff -r 746993c2ea4a -r 7043500e6f93 testDS1683.cpp --- a/testDS1683.cpp Mon Jan 23 08:35:56 2017 +0000 +++ b/testDS1683.cpp Wed Apr 12 07:24:02 2017 +0000 @@ -8,10 +8,10 @@ vt100 *tty = 0 ; DS1683 *ds1683 = 0 ; int ds_alarm_flag = 0 ; -DigitalOut ledD1(PTD1, 1) ; -DigitalOut ledD2(PTD3, 1) ; -DigitalOut ledD3(PTD2, 1) ; -DigitalOut ledD4(PTD0, 1) ; +DigitalOut ledD1(PIN_SCK, 1) ; +DigitalOut ledD2(PIN_MISO, 1) ; +DigitalOut ledD3(PIN_MOSI, 1) ; +DigitalOut ledD4(PIN_CS0, 1) ; void doHelp(void) { @@ -85,16 +85,25 @@ void init_hardware(void) { +#if defined (TARGET_MAX32600MBED) + tty = new vt100(57600) ; + DigitalIn tmpIn(P2_5, PullUp) ; + DigitalOut tmpOut(P1_2) ; +#else tty = new vt100() ; - tty->cls() ; DigitalIn tmpIn(PIN_INT0, PullUp) ; DigitalOut tmpOut(PIN_AN0) ; +#endif + tty->cls() ; + ds1683 = new DS1683( PIN_SDA, /* I2C SDA */ PIN_SCL, /* I2C SCL */ - PIN_AN0, /* event GPIO output */ - PIN_INT0, /* alarm interrupt */ + // PIN_AN0, /* event GPIO output */ + P1_2, /* MAX32600 only */ +// PIN_INT0, /* alarm interrupt */ + P2_5, MSU_DS1683_ADDRESS ) ; /* 0x6B as 7bit address */ ds1683->enterPW(0xFFFFFFFF) ; }