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:
79:7f22823a5a2d
Parent:
78:0cbbac7f2016
Child:
86:2ce08ca58b9e
--- a/Masters/OneWireMaster.h	Mon May 16 15:18:09 2016 -0500
+++ b/Masters/OneWireMaster.h	Mon May 23 18:57:12 2016 -0500
@@ -43,28 +43,28 @@
     class OneWireMaster
     {
     public:
-        /// Speed of the 1-Wire bus
+        /// Speed of the 1-Wire bus.
         enum OWSpeed
         {
             StandardSpeed = 0x00,
             OverdriveSpeed = 0x01
         };
 
-        /// Level of the 1-Wire bus
+        /// Level of the 1-Wire bus.
         enum OWLevel
         {
             NormalLevel = 0x00,
             StrongLevel = 0x02
         };
 
-        /// Search direction for the Triplet
+        /// Search direction for the triplet operation.
         enum SearchDirection
         {
             WriteZero = 0,
             WriteOne = 1
         };
 
-        /// Result of all 1-Wire commands
+        /// Result of all 1-Wire commands.
         enum CmdResult
         {
             Success,
@@ -144,9 +144,9 @@
         * @details Perform one bit of a 1-Wire search. This command
         * does two read bits and one write bit. The write bit is either
         * the default direction (all device have same bit) or in case
-        * of a discrepancy, the 'search_direction' parameter is used.
+        * of a discrepancy, the 'searchDirection' parameter is used.
         *
-        * @param[in,out] search_direction
+        * @param[in,out] searchDirection
         * Input with desired direction in case both read bits are zero.
         * Output with direction taken based on read bits.
         *
@@ -175,10 +175,10 @@
         CmdResult OWWriteBytePower(uint8_t sendByte) { return OWWriteByteSetLevel(sendByte, StrongLevel); }
         CmdResult OWReadBytePower(uint8_t & recvByte) { return OWReadByteSetLevel(recvByte, StrongLevel); }
         
-        /// Find the 'first' devices on the 1-Wire network.
+        /// Find the 'first' devices on the 1-Wire bus.
         CmdResult OWFirst(SearchState & searchState);
 
-        /// Find the 'next' devices on the 1-Wire network.
+        /// Find the 'next' devices on the 1-Wire bus.
         CmdResult OWNext(SearchState & searchState);
 
         /// Verify that the device with the specified ROM ID is present.
@@ -196,17 +196,20 @@
         CmdResult OWSkipRom();
 
         /// Use the Match ROM command to select the device by its known ID.
+        /// @note This command causes all devices supporting Overdrive
+        ///       mode to switch to Overdrive timing.
         /// @param[in] romId ROM ID of device to select.
         CmdResult OWMatchRom(const RomId & romId);
 
         /// Issue Overdrive Skip ROM command on bus.
-        /// @details This command causes all devices supporting Overdrive
-        ///          mode to switch to Overdrive timing.
+        /// @note This command causes all devices supporting Overdrive
+        ///       mode to switch to Overdrive timing.
         /// @note Only use this command with a single drop bus, data
         ///       collisions will occur if more than 1 device on bus.
         CmdResult OWOverdriveSkipRom();
 
-        
+        /// Use the Overdrive Match ROM command to select the device by its known ID.
+        /// @param[in] romId ROM ID of device to select.
         CmdResult OWOverdriveMatchRom(const RomId & romId);
 
         /// Perform a Resume ROM command on bus.
@@ -214,19 +217,10 @@
         ///          though a Match ROM or Search ROM operation.
         CmdResult OWResume();
 
-        /**********************************************************//**
-        * @brief Enumerate all devices on the 1-Wire bus.
-        *
-        * @details The 'OWSearch' function does a general search.  This
-        *        function continues from the previous search state. The
-        *        search state can be reset by using the 'OWFirst'
-        *        function. This function contains one parameter
-        *        'alarm_only'. When 'alarm_only' is TRUE (1) the find
-        *        alarm command 0xEC is sent instead of the normal search
-        *        command 0xF0. Using the find alarm command 0xEC will
-        *        limit the search to only 1-Wire devices that are in an
-        *        'alarm' state.
-        **************************************************************/
+        /// Find device on the 1-Wire bus.
+        /// @details This command uses the Search ROM command to enumerate all 1-Wire devices in sequence.
+        ///          Begin with a new search state and continue using the same search state until the last
+        ///          device flag is set which indicates that all devices have been discovered.
         CmdResult OWSearch(SearchState & searchState);
     };
 }