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