1-Wire® library for mbed. Complete 1-Wire library that supports our silicon masters along with a bit-bang master on the MAX32600MBED platform with one common interface for mbed. Slave support has also been included and more slaves will be added as time permits.
Dependents: MAXREFDES131_Qt_Demo MAX32630FTHR_iButton_uSD_Logger MAX32630FTHR_DS18B20_uSD_Logger MAXREFDES130_131_Demo ... more
Superseded by MaximInterface.
Diff: Switches/DS2413/DS2413.cpp
- Revision:
- 75:8b627804927c
- Parent:
- 74:23be10c32fa3
- Child:
- 76:84e6c4994e29
--- a/Switches/DS2413/DS2413.cpp Fri May 13 07:48:35 2016 -0500 +++ b/Switches/DS2413/DS2413.cpp Fri May 13 14:52:50 2016 -0500 @@ -36,6 +36,19 @@ using OneWire::Switches::DS2413; using OneWire::Masters::OneWireMaster; +enum DS2413_CMDS +{ + PIO_ACCESS_READ = 0xF5, + PIO_ACCESS_WRITE = 0x5A +}; + +enum DS2413_PIO +{ + PIOA, + PIOB, + PIOAB +}; + DS2413::DS2413(OneWireMaster &owm) : _owm(owm) { } @@ -119,11 +132,11 @@ { DS2413::CmdResult result = DS2413::OpFailure; - OneWireMaster::CmdResult ow_result = _owm.OWMatchROM(romId); + OneWireMaster::CmdResult ow_result = _owm.OWMatchRom(romId); if (ow_result == OneWireMaster::Success) { - ow_result = _owm.OWWriteByte(DS2413::PIO_ACCESS_READ); + ow_result = _owm.OWWriteByte(PIO_ACCESS_READ); if (ow_result == OneWireMaster::Success) { @@ -151,11 +164,11 @@ { DS2413::CmdResult result = DS2413::OpFailure; - OneWireMaster::CmdResult ow_result = _owm.OWMatchROM(romId); + OneWireMaster::CmdResult ow_result = _owm.OWMatchRom(romId); if (ow_result == OneWireMaster::Success) { - uint8_t send_block[] = { DS2413::PIO_ACCESS_WRITE, val, ~val }; + uint8_t send_block[] = { PIO_ACCESS_WRITE, val, ~val }; ow_result = _owm.OWWriteBlock(send_block, 3); if (ow_result == OneWireMaster::Success)