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.

Committer:
j3
Date:
Fri Aug 05 20:20:53 2016 +0000
Revision:
110:a3b5e2a4fdf2
Child:
115:a1ca2f3bf46d
Started to add support for DS2431

Who changed what in which revision?

UserRevisionLine numberNew contents of line
j3 110:a3b5e2a4fdf2 1 /******************************************************************//**
j3 110:a3b5e2a4fdf2 2 * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved.
j3 110:a3b5e2a4fdf2 3 *
j3 110:a3b5e2a4fdf2 4 * Permission is hereby granted, free of charge, to any person obtaining a
j3 110:a3b5e2a4fdf2 5 * copy of this software and associated documentation files (the "Software"),
j3 110:a3b5e2a4fdf2 6 * to deal in the Software without restriction, including without limitation
j3 110:a3b5e2a4fdf2 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
j3 110:a3b5e2a4fdf2 8 * and/or sell copies of the Software, and to permit persons to whom the
j3 110:a3b5e2a4fdf2 9 * Software is furnished to do so, subject to the following conditions:
j3 110:a3b5e2a4fdf2 10 *
j3 110:a3b5e2a4fdf2 11 * The above copyright notice and this permission notice shall be included
j3 110:a3b5e2a4fdf2 12 * in all copies or substantial portions of the Software.
j3 110:a3b5e2a4fdf2 13 *
j3 110:a3b5e2a4fdf2 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
j3 110:a3b5e2a4fdf2 15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
j3 110:a3b5e2a4fdf2 16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
j3 110:a3b5e2a4fdf2 17 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
j3 110:a3b5e2a4fdf2 18 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
j3 110:a3b5e2a4fdf2 19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
j3 110:a3b5e2a4fdf2 20 * OTHER DEALINGS IN THE SOFTWARE.
j3 110:a3b5e2a4fdf2 21 *
j3 110:a3b5e2a4fdf2 22 * Except as contained in this notice, the name of Maxim Integrated
j3 110:a3b5e2a4fdf2 23 * Products, Inc. shall not be used except as stated in the Maxim Integrated
j3 110:a3b5e2a4fdf2 24 * Products, Inc. Branding Policy.
j3 110:a3b5e2a4fdf2 25 *
j3 110:a3b5e2a4fdf2 26 * The mere transfer of this software does not imply any licenses
j3 110:a3b5e2a4fdf2 27 * of trade secrets, proprietary technology, copyrights, patents,
j3 110:a3b5e2a4fdf2 28 * trademarks, maskwork rights, or any other form of intellectual
j3 110:a3b5e2a4fdf2 29 * property whatsoever. Maxim Integrated Products, Inc. retains all
j3 110:a3b5e2a4fdf2 30 * ownership rights.
j3 110:a3b5e2a4fdf2 31 **********************************************************************/
j3 110:a3b5e2a4fdf2 32
j3 110:a3b5e2a4fdf2 33 #ifndef OneWire_Switches_DS2413
j3 110:a3b5e2a4fdf2 34 #define OneWire_Switches_DS2413
j3 110:a3b5e2a4fdf2 35
j3 110:a3b5e2a4fdf2 36 #include <stdint.h>
j3 110:a3b5e2a4fdf2 37 #include "Slaves/OneWireSlave.h"
j3 110:a3b5e2a4fdf2 38
j3 110:a3b5e2a4fdf2 39 namespace OneWire
j3 110:a3b5e2a4fdf2 40 {
j3 110:a3b5e2a4fdf2 41 /**
j3 110:a3b5e2a4fdf2 42 * @brief DS2431
j3 110:a3b5e2a4fdf2 43 */
j3 110:a3b5e2a4fdf2 44 class DS2431 : public OneWireSlave
j3 110:a3b5e2a4fdf2 45 {
j3 110:a3b5e2a4fdf2 46 public:
j3 110:a3b5e2a4fdf2 47
j3 110:a3b5e2a4fdf2 48 ///Result of operations
j3 110:a3b5e2a4fdf2 49 enum CmdResult
j3 110:a3b5e2a4fdf2 50 {
j3 110:a3b5e2a4fdf2 51 Success,
j3 110:a3b5e2a4fdf2 52 CommsReadError,
j3 110:a3b5e2a4fdf2 53 CommsWriteError,
j3 110:a3b5e2a4fdf2 54 OpFailure
j3 110:a3b5e2a4fdf2 55 };
j3 110:a3b5e2a4fdf2 56
j3 110:a3b5e2a4fdf2 57 /**********************************************************//**
j3 110:a3b5e2a4fdf2 58 * @brief DS2431 constructor
j3 110:a3b5e2a4fdf2 59 *
j3 110:a3b5e2a4fdf2 60 * @details
j3 110:a3b5e2a4fdf2 61 *
j3 110:a3b5e2a4fdf2 62 * On Entry:
j3 110:a3b5e2a4fdf2 63 * @param[in] owm - reference to 1-wire master
j3 110:a3b5e2a4fdf2 64 *
j3 110:a3b5e2a4fdf2 65 * On Exit:
j3 110:a3b5e2a4fdf2 66 *
j3 110:a3b5e2a4fdf2 67 * @return
j3 110:a3b5e2a4fdf2 68 **************************************************************/
j3 110:a3b5e2a4fdf2 69 DS2431(RandomAccessRomIterator &selector);
j3 110:a3b5e2a4fdf2 70
j3 110:a3b5e2a4fdf2 71 private:
j3 110:a3b5e2a4fdf2 72
j3 110:a3b5e2a4fdf2 73 };
j3 110:a3b5e2a4fdf2 74 }
j3 110:a3b5e2a4fdf2 75
j3 110:a3b5e2a4fdf2 76 #endif