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:
141:cf38f48a2a49
Parent:
118:d184e69051ad
--- a/Slaves/Memory/DS2431/DS2431.h	Fri Feb 17 19:09:11 2017 +0000
+++ b/Slaves/Memory/DS2431/DS2431.h	Fri Feb 17 21:54:14 2017 +0000
@@ -36,9 +36,7 @@
 #include "Slaves/OneWireSlave.h"
 
 namespace OneWire
-{
-    class OneWireMaster;
-    
+{    
     /**
     * @brief DS2431 1024-Bit 1-Wire EEPROM
     * @details The DS2431 is a 1024-bit, 1-Wire® EEPROM chip organized 
@@ -56,7 +54,9 @@
     class DS2431 : public OneWireSlave
     {
     public:
-
+        typedef array<uint8_t, 8> Scratchpad;
+        typedef uint16_t Address;
+    
         /**********************************************************//**
         * @brief DS2431 constructor
         *
@@ -78,7 +78,7 @@
         *
         * @return
         **************************************************************/
-        DS2431(RandomAccessRomIterator &selector);
+        DS2431(RandomAccessRomIterator & selector);
         
         /**********************************************************//**
         * @brief writeMemory
@@ -98,7 +98,7 @@
         *
         * @return Result of operation
         **************************************************************/
-        OneWireSlave::CmdResult writeMemory(uint16_t targetAddress, const uint8_t *data, uint8_t numBytes);
+        OneWireSlave::CmdResult writeMemory(Address targetAddress, const Scratchpad & data);
         
         /**********************************************************//**
         * @brief readMemory
@@ -117,12 +117,9 @@
         *
         * @return Result of operation
         **************************************************************/
-        OneWireSlave::CmdResult readMemory(uint16_t targetAddress, uint8_t *data, uint8_t numBytes);
+        OneWireSlave::CmdResult readMemory(Address targetAddress, uint8_t numBytes, uint8_t * data);
         
-    private:
-    
-        typedef array<uint8_t, 8> Scratchpad;
-    
+    private:    
         /**********************************************************//**
         * @brief writeScratchpad
         *
@@ -138,7 +135,7 @@
         *
         * @return Result of operation
         **************************************************************/
-        OneWireSlave::CmdResult writeScratchpad(uint16_t targetAddress, const Scratchpad &data);
+        OneWireSlave::CmdResult writeScratchpad(Address targetAddress, const Scratchpad & data);
         
         /**********************************************************//**
         * @brief readScratchpad
@@ -152,7 +149,7 @@
         *
         * @return Result of operation
         **************************************************************/
-        OneWireSlave::CmdResult readScratchpad(Scratchpad &data, uint8_t &esByte);
+        OneWireSlave::CmdResult readScratchpad(Scratchpad & data, uint8_t & esByte);
         
         /**********************************************************//**
         * @brief copyScratchpad
@@ -169,7 +166,7 @@
         *
         * @return Result of operation
         **************************************************************/
-        OneWireSlave::CmdResult copyScratchpad(uint16_t targetAddress, uint8_t esByte);
+        OneWireSlave::CmdResult copyScratchpad(Address targetAddress, uint8_t esByte);
     };
 }