Implementation of 1-Wire with added Alarm Search Functionality
Dependents: Max32630_One_Wire_Interface
OneWire_Masters/DS248x/ds248x.h@17:b646b1e3970b, 2016-03-18 (annotated)
- Committer:
- j3
- Date:
- Fri Mar 18 20:21:05 2016 +0000
- Revision:
- 17:b646b1e3970b
- Parent:
- 15:f6cb0d906fb6
- Child:
- 21:00c94aeb533e
Updated library with error codes on return statements
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
j3 | 1:91e52f8ab8bf | 1 | /******************************************************************//** |
j3 | 1:91e52f8ab8bf | 2 | * Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved. |
j3 | 1:91e52f8ab8bf | 3 | * |
j3 | 1:91e52f8ab8bf | 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
j3 | 1:91e52f8ab8bf | 5 | * copy of this software and associated documentation files (the "Software"), |
j3 | 1:91e52f8ab8bf | 6 | * to deal in the Software without restriction, including without limitation |
j3 | 1:91e52f8ab8bf | 7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
j3 | 1:91e52f8ab8bf | 8 | * and/or sell copies of the Software, and to permit persons to whom the |
j3 | 1:91e52f8ab8bf | 9 | * Software is furnished to do so, subject to the following conditions: |
j3 | 1:91e52f8ab8bf | 10 | * |
j3 | 1:91e52f8ab8bf | 11 | * The above copyright notice and this permission notice shall be included |
j3 | 1:91e52f8ab8bf | 12 | * in all copies or substantial portions of the Software. |
j3 | 1:91e52f8ab8bf | 13 | * |
j3 | 1:91e52f8ab8bf | 14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
j3 | 1:91e52f8ab8bf | 15 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
j3 | 1:91e52f8ab8bf | 16 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
j3 | 1:91e52f8ab8bf | 17 | * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES |
j3 | 1:91e52f8ab8bf | 18 | * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
j3 | 1:91e52f8ab8bf | 19 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
j3 | 1:91e52f8ab8bf | 20 | * OTHER DEALINGS IN THE SOFTWARE. |
j3 | 1:91e52f8ab8bf | 21 | * |
j3 | 1:91e52f8ab8bf | 22 | * Except as contained in this notice, the name of Maxim Integrated |
j3 | 1:91e52f8ab8bf | 23 | * Products, Inc. shall not be used except as stated in the Maxim Integrated |
j3 | 1:91e52f8ab8bf | 24 | * Products, Inc. Branding Policy. |
j3 | 1:91e52f8ab8bf | 25 | * |
j3 | 1:91e52f8ab8bf | 26 | * The mere transfer of this software does not imply any licenses |
j3 | 1:91e52f8ab8bf | 27 | * of trade secrets, proprietary technology, copyrights, patents, |
j3 | 1:91e52f8ab8bf | 28 | * trademarks, maskwork rights, or any other form of intellectual |
j3 | 1:91e52f8ab8bf | 29 | * property whatsoever. Maxim Integrated Products, Inc. retains all |
j3 | 1:91e52f8ab8bf | 30 | * ownership rights. |
j3 | 1:91e52f8ab8bf | 31 | **********************************************************************/ |
j3 | 1:91e52f8ab8bf | 32 | |
j3 | 1:91e52f8ab8bf | 33 | |
j3 | 1:91e52f8ab8bf | 34 | #ifndef DS248X_H |
j3 | 1:91e52f8ab8bf | 35 | #define DS248X_H |
j3 | 1:91e52f8ab8bf | 36 | |
j3 | 1:91e52f8ab8bf | 37 | |
j3 | 1:91e52f8ab8bf | 38 | #include "mbed.h" |
j3 | 1:91e52f8ab8bf | 39 | #include "OneWireInterface.h" |
j3 | 15:f6cb0d906fb6 | 40 | #include "OneWireMaster.h" |
j3 | 1:91e52f8ab8bf | 41 | |
j3 | 1:91e52f8ab8bf | 42 | |
j3 | 15:f6cb0d906fb6 | 43 | class Ds248x: public OneWireMaster |
j3 | 1:91e52f8ab8bf | 44 | { |
j3 | 1:91e52f8ab8bf | 45 | public: |
j3 | 1:91e52f8ab8bf | 46 | |
j3 | 5:ce108eeb878d | 47 | enum DS248X_I2C_ADRS |
j3 | 1:91e52f8ab8bf | 48 | { |
j3 | 1:91e52f8ab8bf | 49 | DS248X_I2C_ADRS0 = 0x18, |
j3 | 1:91e52f8ab8bf | 50 | DS248X_I2C_ADRS1, |
j3 | 1:91e52f8ab8bf | 51 | DS248X_I2C_ADRS2, |
j3 | 1:91e52f8ab8bf | 52 | DS248X_I2C_ADRS3, |
j3 | 1:91e52f8ab8bf | 53 | DS248X_I2C_ADRS4, |
j3 | 1:91e52f8ab8bf | 54 | DS248X_I2C_ADRS5, |
j3 | 1:91e52f8ab8bf | 55 | DS248X_I2C_ADRS6, |
j3 | 5:ce108eeb878d | 56 | DS248X_I2C_ADRS7 |
j3 | 5:ce108eeb878d | 57 | }; |
j3 | 5:ce108eeb878d | 58 | |
j3 | 5:ce108eeb878d | 59 | enum DS248X_CMDS |
j3 | 5:ce108eeb878d | 60 | { |
j3 | 5:ce108eeb878d | 61 | CMD_DRST = 0xF0, |
j3 | 5:ce108eeb878d | 62 | CMD_WCFG = 0xD2, |
j3 | 5:ce108eeb878d | 63 | CMD_A1WP = 0xC3, //DS2484 only |
j3 | 5:ce108eeb878d | 64 | CMD_CHSL = 0xC3, //DS2482-800 only |
j3 | 5:ce108eeb878d | 65 | CMD_SRP = 0xE1, |
j3 | 5:ce108eeb878d | 66 | CMD_1WRS = 0xB4, |
j3 | 5:ce108eeb878d | 67 | CMD_1WWB = 0xA5, |
j3 | 5:ce108eeb878d | 68 | CMD_1WRB = 0x96, |
j3 | 5:ce108eeb878d | 69 | CMD_1WSB = 0x87, |
j3 | 5:ce108eeb878d | 70 | CMD_1WT = 0x78 |
j3 | 5:ce108eeb878d | 71 | }; |
j3 | 5:ce108eeb878d | 72 | |
j3 | 5:ce108eeb878d | 73 | enum DS248X_CONFIG_BITS |
j3 | 5:ce108eeb878d | 74 | { |
j3 | 5:ce108eeb878d | 75 | CONFIG_APU = 0x01, |
j3 | 5:ce108eeb878d | 76 | CONFIG_PDN = 0x02, |
j3 | 5:ce108eeb878d | 77 | CONFIG_SPU = 0x04, |
j3 | 5:ce108eeb878d | 78 | CONFIG_1WS = 0x08 |
j3 | 5:ce108eeb878d | 79 | }; |
j3 | 5:ce108eeb878d | 80 | |
j3 | 5:ce108eeb878d | 81 | enum DS248X_STATUS_BITS |
j3 | 5:ce108eeb878d | 82 | { |
j3 | 5:ce108eeb878d | 83 | STATUS_1WB = 0x01, |
j3 | 5:ce108eeb878d | 84 | STATUS_PPD = 0x02, |
j3 | 5:ce108eeb878d | 85 | STATUS_SD = 0x04, |
j3 | 5:ce108eeb878d | 86 | STATUS_LL = 0x08, |
j3 | 5:ce108eeb878d | 87 | STATUS_RST = 0x10, |
j3 | 5:ce108eeb878d | 88 | STATUS_SBR = 0x20, |
j3 | 5:ce108eeb878d | 89 | STATUS_TSB = 0x40, |
j3 | 5:ce108eeb878d | 90 | STATUS_DIR = 0x80 |
j3 | 5:ce108eeb878d | 91 | }; |
j3 | 5:ce108eeb878d | 92 | |
j3 | 5:ce108eeb878d | 93 | enum DS2484_ADJST_PARAMS |
j3 | 5:ce108eeb878d | 94 | { |
j3 | 5:ce108eeb878d | 95 | TRSTL = 0, |
j3 | 5:ce108eeb878d | 96 | TRSTL_OD, |
j3 | 5:ce108eeb878d | 97 | TMSP, |
j3 | 5:ce108eeb878d | 98 | TMSP_OD, |
j3 | 5:ce108eeb878d | 99 | TW0L, |
j3 | 5:ce108eeb878d | 100 | TW0L_OD, |
j3 | 5:ce108eeb878d | 101 | TREC0, //OD NA |
j3 | 5:ce108eeb878d | 102 | RWPU = 8 //OD NA, see DS2484 datasheet page 13 |
j3 | 5:ce108eeb878d | 103 | }; |
j3 | 17:b646b1e3970b | 104 | |
j3 | 17:b646b1e3970b | 105 | enum SEARCH_DIRECTION |
j3 | 17:b646b1e3970b | 106 | { |
j3 | 17:b646b1e3970b | 107 | DIRECTION_WRITE_ZERO = 0, |
j3 | 17:b646b1e3970b | 108 | DIRECTION_WRITE_ONE = 1 |
j3 | 17:b646b1e3970b | 109 | }; |
j3 | 5:ce108eeb878d | 110 | |
j3 | 5:ce108eeb878d | 111 | static const size_t POLL_LIMIT = 200; |
j3 | 1:91e52f8ab8bf | 112 | |
j3 | 17:b646b1e3970b | 113 | static const int I2C_WRITE_OK = 0; |
j3 | 17:b646b1e3970b | 114 | |
j3 | 17:b646b1e3970b | 115 | static const int I2C_READ_OK = 0; |
j3 | 17:b646b1e3970b | 116 | |
j3 | 3:644fc630f958 | 117 | /** |
j3 | 3:644fc630f958 | 118 | * Member functions that directly support DS248x I2C to 1-wire |
j3 | 3:644fc630f958 | 119 | * masters are documented in this file. Virtual function |
j3 | 3:644fc630f958 | 120 | * inerited from the interface class 'OneWireInterface' |
j3 | 3:644fc630f958 | 121 | * are documented in 'OneWireInterface.h', trying to follow |
j3 | 3:644fc630f958 | 122 | * a 'DRY' methodology, Don't Repeat Yourself. |
j3 | 3:644fc630f958 | 123 | */ |
j3 | 3:644fc630f958 | 124 | |
j3 | 1:91e52f8ab8bf | 125 | /**********************************************************//** |
j3 | 1:91e52f8ab8bf | 126 | * @brief Ds248x constructor |
j3 | 1:91e52f8ab8bf | 127 | * |
j3 | 1:91e52f8ab8bf | 128 | * @details allows user to use existing I2C object |
j3 | 1:91e52f8ab8bf | 129 | * |
j3 | 1:91e52f8ab8bf | 130 | * On Entry: |
j3 | 1:91e52f8ab8bf | 131 | * @param[in] p_i2c_bus - pointer to existing I2C object |
j3 | 1:91e52f8ab8bf | 132 | * |
j3 | 1:91e52f8ab8bf | 133 | * On Exit: |
j3 | 1:91e52f8ab8bf | 134 | * @return |
j3 | 1:91e52f8ab8bf | 135 | **************************************************************/ |
j3 | 5:ce108eeb878d | 136 | Ds248x(I2C &i2c_bus, DS248X_I2C_ADRS adrs); |
j3 | 1:91e52f8ab8bf | 137 | |
j3 | 1:91e52f8ab8bf | 138 | |
j3 | 1:91e52f8ab8bf | 139 | /**********************************************************//** |
j3 | 1:91e52f8ab8bf | 140 | * @brief Ds248x constructor |
j3 | 1:91e52f8ab8bf | 141 | * |
j3 | 3:644fc630f958 | 142 | * @details Object instantiates a new I2C object with no |
j3 | 3:644fc630f958 | 143 | * public access |
j3 | 1:91e52f8ab8bf | 144 | * |
j3 | 1:91e52f8ab8bf | 145 | * On Entry: |
j3 | 1:91e52f8ab8bf | 146 | * @param[in] sda - sda pin of I2C bus |
j3 | 1:91e52f8ab8bf | 147 | * @param[in] scl - scl pin of I2C bus |
j3 | 1:91e52f8ab8bf | 148 | * |
j3 | 1:91e52f8ab8bf | 149 | * On Exit: |
j3 | 1:91e52f8ab8bf | 150 | * @return |
j3 | 1:91e52f8ab8bf | 151 | **************************************************************/ |
j3 | 5:ce108eeb878d | 152 | Ds248x(PinName sda, PinName scl, DS248X_I2C_ADRS adrs); |
j3 | 1:91e52f8ab8bf | 153 | |
j3 | 1:91e52f8ab8bf | 154 | |
j3 | 1:91e52f8ab8bf | 155 | /**********************************************************//** |
j3 | 1:91e52f8ab8bf | 156 | * @brief Ds248x destructor |
j3 | 1:91e52f8ab8bf | 157 | * |
j3 | 1:91e52f8ab8bf | 158 | * @details deletes I2C object if owner |
j3 | 1:91e52f8ab8bf | 159 | * |
j3 | 1:91e52f8ab8bf | 160 | * On Entry: |
j3 | 1:91e52f8ab8bf | 161 | * |
j3 | 1:91e52f8ab8bf | 162 | * On Exit: |
j3 | 1:91e52f8ab8bf | 163 | * @return |
j3 | 1:91e52f8ab8bf | 164 | **************************************************************/ |
j3 | 5:ce108eeb878d | 165 | virtual ~Ds248x(); |
j3 | 1:91e52f8ab8bf | 166 | |
j3 | 1:91e52f8ab8bf | 167 | |
j3 | 1:91e52f8ab8bf | 168 | /**********************************************************//** |
j3 | 1:91e52f8ab8bf | 169 | * @brief detect() |
j3 | 1:91e52f8ab8bf | 170 | * |
j3 | 1:91e52f8ab8bf | 171 | * @details Detect routine that performs a device reset |
j3 | 1:91e52f8ab8bf | 172 | * followed by writing the configuration byte to default |
j3 | 1:91e52f8ab8bf | 173 | * values: |
j3 | 1:91e52f8ab8bf | 174 | * 1-Wire speed (c1WS) = standard (0) |
j3 | 1:91e52f8ab8bf | 175 | * Strong pull-up (cSPU) = off (0) |
j3 | 1:91e52f8ab8bf | 176 | * Presence pulse masking (cPPM) = off (0) |
j3 | 1:91e52f8ab8bf | 177 | * Active pull-up (cAPU) = on (CONFIG_APU = 0x01) |
j3 | 1:91e52f8ab8bf | 178 | * |
j3 | 1:91e52f8ab8bf | 179 | * On Entry: |
j3 | 1:91e52f8ab8bf | 180 | * |
j3 | 1:91e52f8ab8bf | 181 | * On Exit: |
j3 | 1:91e52f8ab8bf | 182 | * @return TRUE if device was detected and written |
j3 | 1:91e52f8ab8bf | 183 | * FALSE device not detected or failure to write |
j3 | 1:91e52f8ab8bf | 184 | * configuration byte |
j3 | 1:91e52f8ab8bf | 185 | **************************************************************/ |
j3 | 17:b646b1e3970b | 186 | OneWireInterface::CmdResult detect(void); |
j3 | 1:91e52f8ab8bf | 187 | |
j3 | 1:91e52f8ab8bf | 188 | |
j3 | 1:91e52f8ab8bf | 189 | /**********************************************************//** |
j3 | 1:91e52f8ab8bf | 190 | * @brief reset() |
j3 | 1:91e52f8ab8bf | 191 | * |
j3 | 1:91e52f8ab8bf | 192 | * @details Perform a device reset on the Ds248x |
j3 | 1:91e52f8ab8bf | 193 | * |
j3 | 1:91e52f8ab8bf | 194 | * On Entry: |
j3 | 1:91e52f8ab8bf | 195 | * |
j3 | 1:91e52f8ab8bf | 196 | * On Exit: |
j3 | 1:91e52f8ab8bf | 197 | * @return TRUE if device was reset |
j3 | 1:91e52f8ab8bf | 198 | * FALSE device not detected or failure to perform reset |
j3 | 1:91e52f8ab8bf | 199 | **************************************************************/ |
j3 | 17:b646b1e3970b | 200 | OneWireInterface::CmdResult reset(void); |
j3 | 1:91e52f8ab8bf | 201 | |
j3 | 1:91e52f8ab8bf | 202 | |
j3 | 1:91e52f8ab8bf | 203 | /**********************************************************//** |
j3 | 1:91e52f8ab8bf | 204 | * @brief write_config() |
j3 | 1:91e52f8ab8bf | 205 | * |
j3 | 1:91e52f8ab8bf | 206 | * @details Write the configuration register in the Ds248x. The |
j3 | 1:91e52f8ab8bf | 207 | * configuration options are provided in the lower nibble |
j3 | 1:91e52f8ab8bf | 208 | * of the provided config byte. The uppper nibble is |
j3 | 1:91e52f8ab8bf | 209 | * bitwise inverted when written to the Ds248x. |
j3 | 1:91e52f8ab8bf | 210 | * |
j3 | 1:91e52f8ab8bf | 211 | * On Entry: |
j3 | 1:91e52f8ab8bf | 212 | * @param[in] config - lower nib of configuration register |
j3 | 1:91e52f8ab8bf | 213 | * |
j3 | 1:91e52f8ab8bf | 214 | * On Exit: |
j3 | 1:91e52f8ab8bf | 215 | * @return TRUE: config written and response correct |
j3 | 1:91e52f8ab8bf | 216 | * FALSE: response incorrect |
j3 | 1:91e52f8ab8bf | 217 | **************************************************************/ |
j3 | 17:b646b1e3970b | 218 | OneWireInterface::CmdResult write_config(uint8_t config); |
j3 | 2:02d228c25fd4 | 219 | |
j3 | 2:02d228c25fd4 | 220 | |
j3 | 2:02d228c25fd4 | 221 | /**********************************************************//** |
j3 | 2:02d228c25fd4 | 222 | * @brief channel_select() |
j3 | 2:02d228c25fd4 | 223 | * |
j3 | 2:02d228c25fd4 | 224 | * @details Select the 1-Wire channel on a DS2482-800. |
j3 | 2:02d228c25fd4 | 225 | * Min channel = 1 |
j3 | 2:02d228c25fd4 | 226 | * |
j3 | 2:02d228c25fd4 | 227 | * On Entry: |
j3 | 2:02d228c25fd4 | 228 | * @param[in] channel - desired channel of the DS2482 |
j3 | 2:02d228c25fd4 | 229 | * |
j3 | 2:02d228c25fd4 | 230 | * On Exit: |
j3 | 2:02d228c25fd4 | 231 | * @return TRUE if channel selected |
j3 | 2:02d228c25fd4 | 232 | * FALSE device not detected or failure to perform select |
j3 | 2:02d228c25fd4 | 233 | **************************************************************/ |
j3 | 17:b646b1e3970b | 234 | OneWireInterface::CmdResult channel_select(uint8_t channel); |
j3 | 1:91e52f8ab8bf | 235 | |
j3 | 1:91e52f8ab8bf | 236 | |
j3 | 1:91e52f8ab8bf | 237 | /**********************************************************//** |
j3 | 1:91e52f8ab8bf | 238 | * @brief adjust_timing() |
j3 | 1:91e52f8ab8bf | 239 | * |
j3 | 2:02d228c25fd4 | 240 | * @details adjustable timming available in DS2484 only |
j3 | 1:91e52f8ab8bf | 241 | * |
j3 | 1:91e52f8ab8bf | 242 | * On Entry: |
j3 | 1:91e52f8ab8bf | 243 | * @param[in] param - 1 of 8 adjustable parameters |
j3 | 1:91e52f8ab8bf | 244 | * @param[in] val - new value for parameter, see datasheet |
j3 | 1:91e52f8ab8bf | 245 | * for codes |
j3 | 1:91e52f8ab8bf | 246 | * |
j3 | 1:91e52f8ab8bf | 247 | * On Exit: |
j3 | 1:91e52f8ab8bf | 248 | * @return TRUE: parameter successfully adjusted |
j3 | 1:91e52f8ab8bf | 249 | * FALSE: failed to adjust parameter |
j3 | 1:91e52f8ab8bf | 250 | **************************************************************/ |
j3 | 17:b646b1e3970b | 251 | OneWireInterface::CmdResult adjust_timing(uint8_t param, uint8_t val); |
j3 | 1:91e52f8ab8bf | 252 | |
j3 | 1:91e52f8ab8bf | 253 | |
j3 | 1:91e52f8ab8bf | 254 | /**********************************************************//** |
j3 | 1:91e52f8ab8bf | 255 | * @brief search_triplet() |
j3 | 1:91e52f8ab8bf | 256 | * |
j3 | 1:91e52f8ab8bf | 257 | * @details Use the Ds248x help command '1-Wire triplet' to perform |
j3 | 1:91e52f8ab8bf | 258 | * one bit of a 1-Wire search. This command does two read |
j3 | 1:91e52f8ab8bf | 259 | * bits and one write bit. The write bit is either the |
j3 | 1:91e52f8ab8bf | 260 | * default direction (all device have same bit) or in case |
j3 | 1:91e52f8ab8bf | 261 | * of a discrepancy, the 'search_direction' parameter is |
j3 | 1:91e52f8ab8bf | 262 | * used. |
j3 | 1:91e52f8ab8bf | 263 | * |
j3 | 1:91e52f8ab8bf | 264 | * On Entry: |
j3 | 1:91e52f8ab8bf | 265 | * @param[in] search_direction |
j3 | 1:91e52f8ab8bf | 266 | * |
j3 | 1:91e52f8ab8bf | 267 | * On Exit: |
j3 | 1:91e52f8ab8bf | 268 | * @return The Ds248x status byte result from the triplet command |
j3 | 1:91e52f8ab8bf | 269 | **************************************************************/ |
j3 | 17:b646b1e3970b | 270 | OneWireInterface::CmdResult search_triplet(uint8_t search_direction, uint8_t & status); |
j3 | 1:91e52f8ab8bf | 271 | |
j3 | 5:ce108eeb878d | 272 | |
j3 | 15:f6cb0d906fb6 | 273 | //Part of OneWireInterface that should be implemented for each master |
j3 | 15:f6cb0d906fb6 | 274 | //See OneWireInterface.h for documentation |
j3 | 15:f6cb0d906fb6 | 275 | |
j3 | 17:b646b1e3970b | 276 | virtual OneWireInterface::CmdResult OWInitMaster(void); |
j3 | 14:7b2886a50321 | 277 | |
j3 | 17:b646b1e3970b | 278 | virtual OneWireInterface::CmdResult OWReset(void); |
j3 | 1:91e52f8ab8bf | 279 | |
j3 | 17:b646b1e3970b | 280 | virtual OneWireInterface::CmdResult OWTouchBit(uint8_t & sendrecvbit); |
j3 | 17:b646b1e3970b | 281 | |
j3 | 17:b646b1e3970b | 282 | virtual OneWireInterface::CmdResult OWWriteByte(uint8_t sendbyte); |
j3 | 3:644fc630f958 | 283 | |
j3 | 17:b646b1e3970b | 284 | virtual OneWireInterface::CmdResult OWReadByte(uint8_t & recvbyte); |
j3 | 17:b646b1e3970b | 285 | |
j3 | 17:b646b1e3970b | 286 | virtual OneWireInterface::CmdResult OWWriteBlock(const uint8_t *tran_buf, uint8_t tran_len); |
j3 | 1:91e52f8ab8bf | 287 | |
j3 | 17:b646b1e3970b | 288 | virtual OneWireInterface::CmdResult OWReadBlock(uint8_t *rx_buf, uint8_t rx_len); |
j3 | 17:b646b1e3970b | 289 | |
j3 | 17:b646b1e3970b | 290 | virtual OneWireInterface::CmdResult OWSearch(RomId & romId); |
j3 | 3:644fc630f958 | 291 | |
j3 | 17:b646b1e3970b | 292 | virtual OneWireInterface::CmdResult OWSpeed(OW_SPEED new_speed); |
j3 | 3:644fc630f958 | 293 | |
j3 | 17:b646b1e3970b | 294 | virtual OneWireInterface::CmdResult OWLevel(OW_LEVEL new_level); |
j3 | 3:644fc630f958 | 295 | |
j3 | 17:b646b1e3970b | 296 | virtual OneWireInterface::CmdResult OWWriteBytePower(uint8_t sendbyte); |
j3 | 3:644fc630f958 | 297 | |
j3 | 17:b646b1e3970b | 298 | virtual OneWireInterface::CmdResult OWReadBitPower(uint8_t applyPowerResponse); |
j3 | 2:02d228c25fd4 | 299 | |
j3 | 1:91e52f8ab8bf | 300 | private: |
j3 | 1:91e52f8ab8bf | 301 | |
j3 | 6:1faafa0b3cd7 | 302 | //private fx for initializing _w_adrs and _r_adrs |
j3 | 6:1faafa0b3cd7 | 303 | void set_i2c_adrs(DS248X_I2C_ADRS adrs); |
j3 | 5:ce108eeb878d | 304 | |
j3 | 1:91e52f8ab8bf | 305 | I2C *_p_i2c_bus; |
j3 | 1:91e52f8ab8bf | 306 | uint8_t _w_adrs, _r_adrs; |
j3 | 5:ce108eeb878d | 307 | bool _i2c_owner; |
j3 | 2:02d228c25fd4 | 308 | |
j3 | 2:02d228c25fd4 | 309 | // ds248x state |
j3 | 2:02d228c25fd4 | 310 | uint8_t _short_detected; |
j3 | 15:f6cb0d906fb6 | 311 | uint8_t _c1WS, _cSPU, _cPDN, _cAPU; |
j3 | 1:91e52f8ab8bf | 312 | }; |
j3 | 1:91e52f8ab8bf | 313 | |
j3 | 1:91e52f8ab8bf | 314 | #endif /*DS248X_H*/ |