Implementation of 1-Wire with added Alarm Search Functionality

Dependents:   Max32630_One_Wire_Interface

Committer:
mfruge
Date:
Tue Aug 13 14:42:37 2019 +0000
Revision:
142:85b71cfd617e
Parent:
140:6f32bf635c9d
Added functions to ROMCommands to add Alarm Search functionality

Who changed what in which revision?

UserRevisionLine numberNew contents of line
j3 140:6f32bf635c9d 1 /******************************************************************//**
j3 140:6f32bf635c9d 2 * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved.
j3 140:6f32bf635c9d 3 *
j3 140:6f32bf635c9d 4 * Permission is hereby granted, free of charge, to any person obtaining a
j3 140:6f32bf635c9d 5 * copy of this software and associated documentation files (the "Software"),
j3 140:6f32bf635c9d 6 * to deal in the Software without restriction, including without limitation
j3 140:6f32bf635c9d 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
j3 140:6f32bf635c9d 8 * and/or sell copies of the Software, and to permit persons to whom the
j3 140:6f32bf635c9d 9 * Software is furnished to do so, subject to the following conditions:
j3 140:6f32bf635c9d 10 *
j3 140:6f32bf635c9d 11 * The above copyright notice and this permission notice shall be included
j3 140:6f32bf635c9d 12 * in all copies or substantial portions of the Software.
j3 140:6f32bf635c9d 13 *
j3 140:6f32bf635c9d 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
j3 140:6f32bf635c9d 15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
j3 140:6f32bf635c9d 16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
j3 140:6f32bf635c9d 17 * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
j3 140:6f32bf635c9d 18 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
j3 140:6f32bf635c9d 19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
j3 140:6f32bf635c9d 20 * OTHER DEALINGS IN THE SOFTWARE.
j3 140:6f32bf635c9d 21 *
j3 140:6f32bf635c9d 22 * Except as contained in this notice, the name of Maxim Integrated
j3 140:6f32bf635c9d 23 * Products, Inc. shall not be used except as stated in the Maxim Integrated
j3 140:6f32bf635c9d 24 * Products, Inc. Branding Policy.
j3 140:6f32bf635c9d 25 *
j3 140:6f32bf635c9d 26 * The mere transfer of this software does not imply any licenses
j3 140:6f32bf635c9d 27 * of trade secrets, proprietary technology, copyrights, patents,
j3 140:6f32bf635c9d 28 * trademarks, maskwork rights, or any other form of intellectual
j3 140:6f32bf635c9d 29 * property whatsoever. Maxim Integrated Products, Inc. retains all
j3 140:6f32bf635c9d 30 * ownership rights.
j3 140:6f32bf635c9d 31 **********************************************************************/
j3 140:6f32bf635c9d 32
j3 140:6f32bf635c9d 33 #ifndef OneWire_Masters_OWM
j3 140:6f32bf635c9d 34 #define OneWire_Masters_OWM
j3 140:6f32bf635c9d 35
j3 140:6f32bf635c9d 36 #if defined(TARGET_MAX32620) || defined(TARGET_MAX32625) || defined(TARGET_MAX32630)
j3 140:6f32bf635c9d 37
j3 140:6f32bf635c9d 38 #include <owm.h>
j3 140:6f32bf635c9d 39 #include "Masters/OneWireMaster.h"
j3 140:6f32bf635c9d 40
j3 140:6f32bf635c9d 41 namespace OneWire
j3 140:6f32bf635c9d 42 {
j3 140:6f32bf635c9d 43 /// MCU peripheral 1-Wire master (OWM)
j3 140:6f32bf635c9d 44 class MCU_OWM : public OneWireMaster
j3 140:6f32bf635c9d 45 {
j3 140:6f32bf635c9d 46 public:
j3 140:6f32bf635c9d 47 MCU_OWM(bool extWeakPup = false, bool extStrongPup = false);
j3 140:6f32bf635c9d 48
j3 140:6f32bf635c9d 49 virtual OneWireMaster::CmdResult OWInitMaster();
j3 140:6f32bf635c9d 50 virtual OneWireMaster::CmdResult OWReset();
j3 140:6f32bf635c9d 51 virtual OneWireMaster::CmdResult OWTouchBitSetLevel(uint8_t & sendRecvBit, OWLevel afterLevel);
j3 140:6f32bf635c9d 52 virtual OneWireMaster::CmdResult OWWriteByteSetLevel(uint8_t sendByte, OWLevel afterLevel);
j3 140:6f32bf635c9d 53 virtual OneWireMaster::CmdResult OWReadByteSetLevel(uint8_t & recvByte, OWLevel afterLevel);
j3 140:6f32bf635c9d 54 virtual OneWireMaster::CmdResult OWSetSpeed(OWSpeed newSpeed);
j3 140:6f32bf635c9d 55 virtual OneWireMaster::CmdResult OWSetLevel(OWLevel newLevel);
j3 140:6f32bf635c9d 56
j3 140:6f32bf635c9d 57 private:
j3 140:6f32bf635c9d 58 bool extStrongPup() const;
j3 140:6f32bf635c9d 59
j3 140:6f32bf635c9d 60 owm_cfg_t m_owmCfg;
j3 140:6f32bf635c9d 61 sys_cfg_owm_t m_sysCfgOwm;
j3 140:6f32bf635c9d 62 };
j3 140:6f32bf635c9d 63 }
j3 140:6f32bf635c9d 64
j3 140:6f32bf635c9d 65 #endif /* TARGET_MAX326xx */
j3 140:6f32bf635c9d 66
j3 140:6f32bf635c9d 67 #endif /* OneWire_Masters_OWM */
j3 140:6f32bf635c9d 68