Implementation of 1-Wire with added Alarm Search Functionality
Dependents: Max32630_One_Wire_Interface
Diff: OneWire_Masters/OneWireMaster.cpp
- Revision:
- 71:562f5c702094
- Parent:
- 57:1635f247ceae
--- 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