Implementation of 1-Wire with added Alarm Search Functionality

Dependents:   Max32630_One_Wire_Interface

Revision:
141:cf38f48a2a49
Parent:
118:d184e69051ad
diff -r 6f32bf635c9d -r cf38f48a2a49 Slaves/Memory/DS2431/DS2431.h
--- 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);
     };
 }