Plamen Totev
/
peltier
peltier with 2 fans
DS18B20Multiple/OneWireDefs.h@4:5213bee8158e, 2014-04-14 (annotated)
- Committer:
- redplam
- Date:
- Mon Apr 14 02:15:32 2014 +0000
- Revision:
- 4:5213bee8158e
myproject;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
redplam | 4:5213bee8158e | 1 | /* |
redplam | 4:5213bee8158e | 2 | * OneWireCRC. This is a port to mbed of Jim Studt's Adruino One Wire |
redplam | 4:5213bee8158e | 3 | * library. |
redplam | 4:5213bee8158e | 4 | * |
redplam | 4:5213bee8158e | 5 | * Copyright (C) <2009> Petras Saduikis <petras@petras.co.uk> |
redplam | 4:5213bee8158e | 6 | * |
redplam | 4:5213bee8158e | 7 | * This file is part of OneWireCRC. |
redplam | 4:5213bee8158e | 8 | * |
redplam | 4:5213bee8158e | 9 | * OneWireCRC is free software: you can redistribute it and/or modify |
redplam | 4:5213bee8158e | 10 | * it under the terms of the GNU General Public License as published by |
redplam | 4:5213bee8158e | 11 | * the Free Software Foundation, either version 3 of the License, or |
redplam | 4:5213bee8158e | 12 | * (at your option) any later version. |
redplam | 4:5213bee8158e | 13 | * |
redplam | 4:5213bee8158e | 14 | * OneWireCRC is distributed in the hope that it will be useful, |
redplam | 4:5213bee8158e | 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
redplam | 4:5213bee8158e | 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
redplam | 4:5213bee8158e | 17 | * GNU General Public License for more details. |
redplam | 4:5213bee8158e | 18 | * |
redplam | 4:5213bee8158e | 19 | * You should have received a copy of the GNU General Public License |
redplam | 4:5213bee8158e | 20 | * along with OneWireCRC. If not, see <http://www.gnu.org/licenses/>. |
redplam | 4:5213bee8158e | 21 | */ |
redplam | 4:5213bee8158e | 22 | |
redplam | 4:5213bee8158e | 23 | #ifndef SNATCH59_ONEWIREDEFS_H |
redplam | 4:5213bee8158e | 24 | #define SNATCH59_ONEWIREDEFS_H |
redplam | 4:5213bee8158e | 25 | |
redplam | 4:5213bee8158e | 26 | // device ids |
redplam | 4:5213bee8158e | 27 | #define DS18B20_ID 0x28 |
redplam | 4:5213bee8158e | 28 | #define DS18S20_ID 0x10 |
redplam | 4:5213bee8158e | 29 | |
redplam | 4:5213bee8158e | 30 | #define ALARM_CONFIG_SIZE 3 |
redplam | 4:5213bee8158e | 31 | #define THERMOM_SCRATCHPAD_SIZE 9 |
redplam | 4:5213bee8158e | 32 | #define THERMOM_CRC_BYTE 8 |
redplam | 4:5213bee8158e | 33 | #define ADDRESS_SIZE 8 |
redplam | 4:5213bee8158e | 34 | #define ADDRESS_CRC_BYTE 7 |
redplam | 4:5213bee8158e | 35 | |
redplam | 4:5213bee8158e | 36 | // One Wire command codes |
redplam | 4:5213bee8158e | 37 | #define OVERDRIVE_SKIP 0x3C |
redplam | 4:5213bee8158e | 38 | // ROM commands |
redplam | 4:5213bee8158e | 39 | #define SEARCH_ROM 0xF0 |
redplam | 4:5213bee8158e | 40 | #define READ_ROM 0x33 |
redplam | 4:5213bee8158e | 41 | #define MATCH_ROM 0x55 |
redplam | 4:5213bee8158e | 42 | #define SKIP_ROM 0xCC |
redplam | 4:5213bee8158e | 43 | #define ALARM_SEARCH 0xEC |
redplam | 4:5213bee8158e | 44 | // Functions Commnds |
redplam | 4:5213bee8158e | 45 | #define CONVERT 0x44 |
redplam | 4:5213bee8158e | 46 | #define WRITESCRATCH 0x4E |
redplam | 4:5213bee8158e | 47 | #define READSCRATCH 0xBE |
redplam | 4:5213bee8158e | 48 | #define COPYSCRATCH 0x48 |
redplam | 4:5213bee8158e | 49 | #define RECALLE2 0xB8 |
redplam | 4:5213bee8158e | 50 | #define READPOWERSUPPLY 0xB4 |
redplam | 4:5213bee8158e | 51 | |
redplam | 4:5213bee8158e | 52 | // temperature read resolutions |
redplam | 4:5213bee8158e | 53 | enum eResolution {nineBit = 0, tenBit, elevenBit, twelveBit}; |
redplam | 4:5213bee8158e | 54 | const int CONVERSION_TIME[] = {94, 188, 375, 750}; // milli-seconds |
redplam | 4:5213bee8158e | 55 | |
redplam | 4:5213bee8158e | 56 | // DS18B20/DS18S20 related |
redplam | 4:5213bee8158e | 57 | #define TEMPERATURE_LSB 0 |
redplam | 4:5213bee8158e | 58 | #define TEMPERATURE_MSB 1 |
redplam | 4:5213bee8158e | 59 | #define HIGH_ALARM_BYTE 2 |
redplam | 4:5213bee8158e | 60 | #define LOW_ALARM_BYTE 3 |
redplam | 4:5213bee8158e | 61 | #define CONFIG_REG_BYTE 4 |
redplam | 4:5213bee8158e | 62 | #define CONFIG_READ_END 5 |
redplam | 4:5213bee8158e | 63 | #define COUNT_REMAIN_BYTE 6 |
redplam | 4:5213bee8158e | 64 | #define COUNT_PER_DEG_BYTE 7 |
redplam | 4:5213bee8158e | 65 | |
redplam | 4:5213bee8158e | 66 | #endif |