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