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.

Revision:
21:00c94aeb533e
Parent:
17:b646b1e3970b
Child:
23:e8e403d61359
diff -r ba60c076e92b -r 00c94aeb533e OneWire_Masters/DS248x/ds248x.cpp
--- a/OneWire_Masters/DS248x/ds248x.cpp	Mon Mar 21 01:28:34 2016 +0000
+++ b/OneWire_Masters/DS248x/ds248x.cpp	Mon Mar 21 14:12:28 2016 -0500
@@ -849,6 +849,35 @@
 }
 
 
+OneWireInterface::CmdResult Ds248x::OWReadBytePower(uint8_t & recvbyte)
+{
+    OneWireInterface::CmdResult result = Success;
+    uint8_t recvbit;
+    
+    recvbyte = 0;
+    for (unsigned int i = 1; i <= 8; i++)
+    {
+        // Set strong pull-up on last bit
+        if (i == 8)
+        {
+            // set strong pull-up enable
+            _cSPU = CONFIG_SPU;
+
+            // write the new config
+            result = write_config(_c1WS | _cSPU | _cPDN | _cAPU);
+            if (result != Success)
+                break;
+        }
+        result = OWReadBit(recvbit);
+        if (result != Success)
+            break;
+        recvbyte = (recvbyte << 1) | recvbit;
+    }
+    
+    return result;
+}
+
+
 //*********************************************************************
 void Ds248x::set_i2c_adrs(DS248X_I2C_ADRS adrs)
 {