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: OneWire_Masters/OneWireMaster.cpp
- Revision:
- 71:562f5c702094
- Parent:
- 57:1635f247ceae
diff -r 7db8ff74bcbe -r 562f5c702094 OneWire_Masters/OneWireMaster.cpp --- a/OneWire_Masters/OneWireMaster.cpp Mon May 09 08:31:53 2016 -0500 +++ b/OneWire_Masters/OneWireMaster.cpp Mon May 09 15:04:23 2016 -0500 @@ -50,6 +50,42 @@ }; +//********************************************************************* +OneWireMaster::CmdResult OneWireMaster::OWWriteBlock(const uint8_t *tran_buf, uint8_t tran_len) +{ + CmdResult result; + + for(uint8_t idx = 0; idx < tran_len; idx++) + { + result = OWWriteByte(tran_buf[idx]); + if(result != Success) + { + break; + } + } + + return result; +} + + +//********************************************************************* +OneWireMaster::CmdResult OneWireMaster::OWReadBlock(uint8_t *rx_buf, uint8_t rx_len) +{ + CmdResult result; + + for(uint8_t idx = 0; idx < rx_len; idx++) + { + result = OWReadByte(rx_buf[idx]); + if(result != Success) + { + break; + } + } + + return result; +} + + OneWireMaster::CmdResult OneWireMaster::OWFirst(SearchState & searchState) { // reset the search state