/* * 1 wire header code * * $Id: 1wire.h,v 1.4 2004/09/01 08:15:24 darius Exp $ * * Copyright (c) 2004 * Daniel O'Connor . All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ uint16_t DS18B20_read_temp(uint8_t *ROM); uint8_t OWTouchReset(void); void OWWriteBit(uint8_t bit); uint8_t OWReadBit(void); void OWWriteByte(uint8_t data); uint8_t OWReadByte(void); uint8_t OWTouchByte(uint8_t data); void OWBlock(uint8_t *data, int len); uint8_t OWFirst(uint8_t *ROM, uint8_t do_reset, uint8_t alarm_only); uint8_t OWNext(uint8_t *ROM, uint8_t do_reset, uint8_t alarm_only); void OWCRC(uint8_t x, uint8_t *crc); void OWSendCmd(uint8_t *ROM, uint8_t cmd); /*definovanie vstupno vystupneho portu/pinu*/ // nas procesor: ATMega16 - pouzity port A, Pin 0, #define THERM_PORT PORTC #define THERM_DDR DDRC #define THERM_PIN PINC #define THERM_DQ PC0 /* Utils */ #define THERM_INPUT_MODE() THERM_DDR &= ~(1<