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:
IanBenzMaxim
Date:
Fri May 13 14:52:50 2016 -0500
Revision:
75:8b627804927c
Parent:
74:23be10c32fa3
Child:
76:84e6c4994e29
Code cleanup.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
IanBenzMaxim 75:8b627804927c 1 /******************************************************************//**
IanBenzMaxim 75:8b627804927c 2 * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved.
IanBenzMaxim 75:8b627804927c 3 *
IanBenzMaxim 75:8b627804927c 4 * Permission is hereby granted, free of charge, to any person obtaining a
IanBenzMaxim 75:8b627804927c 5 * copy of this software and associated documentation files (the "Software"),
IanBenzMaxim 75:8b627804927c 6 * to deal in the Software without restriction, including without limitation
IanBenzMaxim 75:8b627804927c 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
IanBenzMaxim 75:8b627804927c 8 * and/or sell copies of the Software, and to permit persons to whom the
IanBenzMaxim 75:8b627804927c 9 * Software is furnished to do so, subject to the following conditions:
IanBenzMaxim 75:8b627804927c 10 *
IanBenzMaxim 75:8b627804927c 11 * The above copyright notice and this permission notice shall be included
IanBenzMaxim 75:8b627804927c 12 * in all copies or substantial portions of the Software.
IanBenzMaxim 75:8b627804927c 13 *
IanBenzMaxim 75:8b627804927c 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
IanBenzMaxim 75:8b627804927c 15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
IanBenzMaxim 75:8b627804927c 16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IanBenzMaxim 75:8b627804927c 17 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
IanBenzMaxim 75:8b627804927c 18 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
IanBenzMaxim 75:8b627804927c 19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
IanBenzMaxim 75:8b627804927c 20 * OTHER DEALINGS IN THE SOFTWARE.
IanBenzMaxim 75:8b627804927c 21 *
IanBenzMaxim 75:8b627804927c 22 * Except as contained in this notice, the name of Maxim Integrated
IanBenzMaxim 75:8b627804927c 23 * Products, Inc. shall not be used except as stated in the Maxim Integrated
IanBenzMaxim 75:8b627804927c 24 * Products, Inc. Branding Policy.
IanBenzMaxim 75:8b627804927c 25 *
IanBenzMaxim 75:8b627804927c 26 * The mere transfer of this software does not imply any licenses
IanBenzMaxim 75:8b627804927c 27 * of trade secrets, proprietary technology, copyrights, patents,
IanBenzMaxim 75:8b627804927c 28 * trademarks, maskwork rights, or any other form of intellectual
IanBenzMaxim 75:8b627804927c 29 * property whatsoever. Maxim Integrated Products, Inc. retains all
IanBenzMaxim 75:8b627804927c 30 * ownership rights.
IanBenzMaxim 75:8b627804927c 31 **********************************************************************/
IanBenzMaxim 75:8b627804927c 32
IanBenzMaxim 74:23be10c32fa3 33 #ifndef OneWire_OneWireSlave
IanBenzMaxim 74:23be10c32fa3 34 #define OneWire_OneWireSlave
IanBenzMaxim 25:bdb1c5a53b58 35
IanBenzMaxim 73:2cecc1372acc 36 #include "RomId.h"
IanBenzMaxim 25:bdb1c5a53b58 37
IanBenzMaxim 73:2cecc1372acc 38 namespace OneWire
IanBenzMaxim 25:bdb1c5a53b58 39 {
IanBenzMaxim 74:23be10c32fa3 40 /// Base class for all 1-Wire Slaves.
IanBenzMaxim 74:23be10c32fa3 41 class OneWireSlave
IanBenzMaxim 73:2cecc1372acc 42 {
IanBenzMaxim 74:23be10c32fa3 43 public:
IanBenzMaxim 74:23be10c32fa3 44 enum CmdResult
IanBenzMaxim 74:23be10c32fa3 45 {
IanBenzMaxim 74:23be10c32fa3 46 Success,
IanBenzMaxim 74:23be10c32fa3 47 CommunicationError,
IanBenzMaxim 74:23be10c32fa3 48 TimeoutError,
IanBenzMaxim 74:23be10c32fa3 49 OperationFailure
IanBenzMaxim 74:23be10c32fa3 50 };
IanBenzMaxim 74:23be10c32fa3 51
IanBenzMaxim 74:23be10c32fa3 52 /// 1-Wire ROM ID for this slave device.
IanBenzMaxim 74:23be10c32fa3 53 RomId romId;
IanBenzMaxim 73:2cecc1372acc 54 };
IanBenzMaxim 73:2cecc1372acc 55 }
IanBenzMaxim 25:bdb1c5a53b58 56
IanBenzMaxim 49:36954b62f503 57 #endif