Implementation of 1-Wire with added Alarm Search Functionality
Dependents: Max32630_One_Wire_Interface
Masters/DS248x/DS2482EightChannel/DS2482EightChannel.h@142:85b71cfd617e, 2019-08-13 (annotated)
- Committer:
- mfruge
- Date:
- Tue Aug 13 14:42:37 2019 +0000
- Revision:
- 142:85b71cfd617e
- Parent:
- 139:f0e0a7976846
Added functions to ROMCommands to add Alarm Search functionality
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
j3 | 92:aa40c49b8563 | 1 | /********************************************************************** |
j3 | 92:aa40c49b8563 | 2 | * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved. |
j3 | 92:aa40c49b8563 | 3 | * |
j3 | 92:aa40c49b8563 | 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
j3 | 92:aa40c49b8563 | 5 | * copy of this software and associated documentation files (the "Software"), |
j3 | 92:aa40c49b8563 | 6 | * to deal in the Software without restriction, including without limitation |
j3 | 92:aa40c49b8563 | 7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
j3 | 92:aa40c49b8563 | 8 | * and/or sell copies of the Software, and to permit persons to whom the |
j3 | 92:aa40c49b8563 | 9 | * Software is furnished to do so, subject to the following conditions: |
j3 | 92:aa40c49b8563 | 10 | * |
j3 | 92:aa40c49b8563 | 11 | * The above copyright notice and this permission notice shall be included |
j3 | 92:aa40c49b8563 | 12 | * in all copies or substantial portions of the Software. |
j3 | 92:aa40c49b8563 | 13 | * |
j3 | 92:aa40c49b8563 | 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
j3 | 92:aa40c49b8563 | 15 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
j3 | 92:aa40c49b8563 | 16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
j3 | 92:aa40c49b8563 | 17 | * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES |
j3 | 92:aa40c49b8563 | 18 | * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
j3 | 92:aa40c49b8563 | 19 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
j3 | 92:aa40c49b8563 | 20 | * OTHER DEALINGS IN THE SOFTWARE. |
j3 | 92:aa40c49b8563 | 21 | * |
j3 | 92:aa40c49b8563 | 22 | * Except as contained in this notice, the name of Maxim Integrated |
j3 | 92:aa40c49b8563 | 23 | * Products, Inc. shall not be used except as stated in the Maxim Integrated |
j3 | 92:aa40c49b8563 | 24 | * Products, Inc. Branding Policy. |
j3 | 92:aa40c49b8563 | 25 | * |
j3 | 92:aa40c49b8563 | 26 | * The mere transfer of this software does not imply any licenses |
j3 | 92:aa40c49b8563 | 27 | * of trade secrets, proprietary technology, copyrights, patents, |
j3 | 92:aa40c49b8563 | 28 | * trademarks, maskwork rights, or any other form of intellectual |
j3 | 92:aa40c49b8563 | 29 | * property whatsoever. Maxim Integrated Products, Inc. retains all |
j3 | 92:aa40c49b8563 | 30 | * ownership rights. |
j3 | 92:aa40c49b8563 | 31 | **********************************************************************/ |
j3 | 92:aa40c49b8563 | 32 | |
j3 | 92:aa40c49b8563 | 33 | |
j3 | 92:aa40c49b8563 | 34 | #ifndef OneWire_Masters_DS2482_Eight_Channel |
j3 | 92:aa40c49b8563 | 35 | #define OneWire_Masters_DS2482_Eight_Channel |
j3 | 92:aa40c49b8563 | 36 | |
j3 | 92:aa40c49b8563 | 37 | |
j3 | 104:3f48daed532b | 38 | #include "Masters/DS248x/DS248x.h" |
j3 | 92:aa40c49b8563 | 39 | |
j3 | 92:aa40c49b8563 | 40 | |
j3 | 92:aa40c49b8563 | 41 | namespace OneWire |
j3 | 92:aa40c49b8563 | 42 | { |
j3 | 92:aa40c49b8563 | 43 | ///DS2482-800 I2C to 1-wire Master |
j3 | 139:f0e0a7976846 | 44 | class DS2482EightChannel : public DS248x |
j3 | 92:aa40c49b8563 | 45 | { |
j3 | 139:f0e0a7976846 | 46 | public: |
j3 | 92:aa40c49b8563 | 47 | ///Valid slave addresses for DS2482-800 |
j3 | 92:aa40c49b8563 | 48 | enum I2CAddress |
j3 | 92:aa40c49b8563 | 49 | { |
j3 | 92:aa40c49b8563 | 50 | I2C_ADRS0 = 0x30, |
j3 | 92:aa40c49b8563 | 51 | I2C_ADRS1, |
j3 | 92:aa40c49b8563 | 52 | I2C_ADRS2, |
j3 | 92:aa40c49b8563 | 53 | I2C_ADRS3, |
j3 | 92:aa40c49b8563 | 54 | I2C_ADRS4, |
j3 | 92:aa40c49b8563 | 55 | I2C_ADRS5, |
j3 | 92:aa40c49b8563 | 56 | I2C_ADRS6, |
j3 | 92:aa40c49b8563 | 57 | I2C_ADRS7 |
j3 | 92:aa40c49b8563 | 58 | }; |
j3 | 92:aa40c49b8563 | 59 | |
j3 | 92:aa40c49b8563 | 60 | |
j3 | 92:aa40c49b8563 | 61 | /// Construct to use an existing I2C interface. |
j3 | 92:aa40c49b8563 | 62 | /// @param i2c_bus Configured I2C communication interface for DS248x. |
j3 | 92:aa40c49b8563 | 63 | /// @param adrs I2C bus address of the DS248x in mbed format. |
j3 | 92:aa40c49b8563 | 64 | DS2482EightChannel(mbed::I2C & i2c_bus, uint8_t adrs); |
j3 | 92:aa40c49b8563 | 65 | |
j3 | 92:aa40c49b8563 | 66 | |
j3 | 92:aa40c49b8563 | 67 | /// Select the 1-Wire channel on a DS2482-800. |
j3 | 92:aa40c49b8563 | 68 | /// @note DS2482-800 only |
j3 | 92:aa40c49b8563 | 69 | /// @param channel Channel number to select beginning at 1. |
j3 | 92:aa40c49b8563 | 70 | OneWireMaster::CmdResult selectChannel(uint8_t channel); |
j3 | 92:aa40c49b8563 | 71 | }; |
j3 | 92:aa40c49b8563 | 72 | } |
j3 | 92:aa40c49b8563 | 73 | |
j3 | 92:aa40c49b8563 | 74 | #endif /* OneWire_Masters_DS2482_Eight_Channel */ |