First Publish

Dependencies:   BridgeDriver2 FrontPanelButtons MAX31855 MCP23017 SDFileSystem TextLCD mbed

Committer:
mehatfie
Date:
Mon Nov 10 22:59:49 2014 +0000
Revision:
1:9954bf6d7d25
Parent:
0:20e78c9d2ea9
First Commit

Who changed what in which revision?

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