1 wire protocol functions. Target: PIC16F876 More...
#include <app.h>
Go to the source code of this file.
Macros | |
#define | PWR_ON_PIN RA1 |
RA.1 - power to DS2401. More... | |
#define | PWR_ON_DIR TRISA1 |
#define | ID_DQ_PIN RB0 |
RB.0 - DQ for DS2401. More... | |
#define | ID_DQ_DIR TRISB0 |
#define | OneWire_PinHI() TRISB0 = DIR_IN |
#define | OneWire_PinLO() { RB0 = 0x00; TRISB0 = DIR_OUT; } |
#define | W_CELL 4 |
#define | W_INIT 50 |
#define | W_WAIT 2000 |
Functions | |
BYTE | OneWire_GetID (BYTE *buff) |
BYTE | OneWire_Init (void) |
BYTE | OneWire_Read (void) |
void | OneWire_Write (BYTE d) |
BYTE | OneWire_Crc8 (BYTE Data, BYTE Accum) |
Detailed Description
1 wire protocol functions. Target: PIC16F876
This file is part of JADEKU Portable ADQ device for Routines Control.
Copyright (C) 2002-2009, Hernan Monserrat hemonserrat<at>gmail<dot>com
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file onewire.c.
Macro Definition Documentation
◆ ID_DQ_DIR
◆ ID_DQ_PIN
◆ OneWire_PinHI
◆ OneWire_PinLO
#define OneWire_PinLO | ( | ) | { RB0 = 0x00; TRISB0 = DIR_OUT; } |
◆ PWR_ON_DIR
◆ PWR_ON_PIN
◆ W_CELL
◆ W_INIT
◆ W_WAIT
Function Documentation
◆ OneWire_Crc8()
◆ OneWire_GetID()
Test for the 1 wire device presence, read ROM code and calculates crc.
- Parameters
-
buff - buffer to store read data.
- Returns
- TRUE on packet received, FALSE timeout.
- Remarks
- note that 8-byte ID is returned in array buff.
Definition at line 43 of file onewire.c.
◆ OneWire_Init()
BYTE OneWire_Init | ( | void | ) |
◆ OneWire_Read()
BYTE OneWire_Read | ( | void | ) |