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:
47:307dc45952db
Parent:
43:23017dcd2ec3
Child:
48:6f9208ae280e
diff -r afe466c96069 -r 307dc45952db OneWire_Masters/OneWireMaster.h
--- a/OneWire_Masters/OneWireMaster.h	Wed Apr 06 10:06:06 2016 -0500
+++ b/OneWire_Masters/OneWireMaster.h	Thu Apr 07 10:26:26 2016 -0500
@@ -106,7 +106,6 @@
     *
     * On Exit:
     *
-    * @return CmdResult - zero on success, non-zero on failure
     **************************************************************/
     virtual CmdResult OWInitMaster(void) = 0;
     
@@ -121,7 +120,8 @@
     *
     * On Exit:
     *
-    * @return CmdResult - zero on success, non-zero on failure
+    * @returns OperationFailure if reset was performed but no
+    *          presence pulse was detected.
     **************************************************************/
     virtual CmdResult OWReset(void) = 0;
     
@@ -140,7 +140,6 @@
     *
     * On Exit:
     *
-    * @return CmdResult - zero on success, non-zero on failure
     **************************************************************/
     virtual CmdResult OWTouchBit(std::uint8_t & sendrecvbit, OWLevel after_level) = 0;
     
@@ -158,7 +157,6 @@
     *
     * On Exit:
     *
-    * @return CmdResult - zero on success, non-zero on failure
     **************************************************************/
     virtual CmdResult OWWriteByte(std::uint8_t sendbyte, OWLevel after_level) = 0;
     
@@ -173,7 +171,6 @@
     *
     * On Exit:
     *
-    * @return CmdResult - zero on success, non-zero on failure
     **************************************************************/
     virtual CmdResult OWReadByte(std::uint8_t & recvbyte, OWLevel after_level) = 0;
     
@@ -190,7 +187,6 @@
     *
     * On Exit:
     *
-    * @return CmdResult - zero on success, non-zero on failure 
     **************************************************************/
     virtual CmdResult OWWriteBlock(const std::uint8_t *tran_buf, std::uint8_t tran_len) = 0;
     
@@ -206,8 +202,7 @@
     *     @param[in] recv_len - number of bytes to read
     *
     * On Exit:
-    *
-    * @return CmdResult - zero on success, non-zero on failure  
+    *  
     **************************************************************/
     virtual CmdResult OWReadBlock(std::uint8_t *rx_buf, std::uint8_t rx_len) = 0;
     
@@ -224,7 +219,6 @@
     *
     * On Exit:
     *
-    * @return CmdResult - zero on success, non-zero on failure
     **************************************************************/
     virtual CmdResult OWSetSpeed(OWSpeed new_speed) = 0;
     
@@ -244,13 +238,25 @@
     *
     * On Exit:
     *
-    * @return CmdResult - zero on success, non-zero on failure
     **************************************************************/
     virtual CmdResult OWSetLevel(OWLevel new_level) = 0;
     
     
-    
-    
+    /**********************************************************//**
+    * @brief OWTriplet()
+    * 
+    * @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.
+    * 
+    * @param[in,out] search_direction
+    * Input with desired direction in case both read bits are zero.
+    * Output with direction taken based on read bits.
+    * 
+    * @param[out] sbr Bit result of first read operation.
+    * @param[out] tsb Bit result of second read operation.
+    **************************************************************/
     virtual CmdResult OWTriplet(SearchDirection & search_direction, std::uint8_t & sbr, std::uint8_t & tsb);
     
     
@@ -276,7 +282,6 @@
     *
     * On Exit:
     *
-    * @return CmdResult - zero on success, non-zero on failure
     **************************************************************/
     CmdResult OWFirst(SearchState & searchState);
     
@@ -290,7 +295,6 @@
     *
     * On Exit:
     *
-    * @return CmdResult - zero on success, non-zero on failure
     **************************************************************/
     CmdResult OWNext(SearchState & searchState);
     
@@ -305,7 +309,6 @@
     *
     * On Exit:
     *
-    * @return CmdResult - zero on success, non-zero on failure
     **************************************************************/
     CmdResult OWVerify(const RomId & romId);
     
@@ -321,7 +324,6 @@
     *
     * On Exit:
     *
-    * @return 
     **************************************************************/
     void OWTargetSetup(SearchState & searchState);
     
@@ -336,7 +338,6 @@
     *
     * On Exit:
     *
-    * @return 
     **************************************************************/
     void OWFamilySkipSetup(SearchState & searchState);
     
@@ -352,7 +353,6 @@
     *
     * On Exit:
     *
-    * @return CmdResult - zero on success, non-zero on failure
     **************************************************************/
     CmdResult OWReadROM(RomId & romId);
     
@@ -366,7 +366,6 @@
     *
     * On Exit:
     *
-    * @return CmdResult - zero on success, non-zero on failure
     **************************************************************/
     CmdResult OWSkipROM(void);
     
@@ -381,7 +380,6 @@
     *
     * On Exit:
     *
-    * @return CmdResult - zero on success, non-zero on failure
     **************************************************************/
     CmdResult OWMatchROM(const RomId & romId);
     
@@ -396,7 +394,6 @@
     *
     * On Exit:
     *
-    * @return CmdResult - zero on success, non-zero on failure
     **************************************************************/
     CmdResult OWOverdriveSkipROM(void);
     
@@ -411,7 +408,6 @@
     *
     * On Exit:
     *
-    * @return CmdResult - zero on success, non-zero on failure
     **************************************************************/
     CmdResult OWOverdriveMatchROM(const RomId & romId);
     
@@ -429,7 +425,6 @@
     *
     * On Exit:
     *
-    * @return CmdResult - zero on success, non-zero on failure
     **************************************************************/
     CmdResult OWResume(void);
     
@@ -451,7 +446,6 @@
     *
     * On Exit:
     *
-    * @return CmdResult - zero on success, non-zero on failure
     **************************************************************/
     CmdResult OWSearch(SearchState & searchState);
 };
@@ -460,4 +454,4 @@
 
 
 
-#endif /*ONEWIREMASTER_H*/
\ No newline at end of file
+#endif /*ONEWIREMASTER_H*/