onewire.h File Reference

1 wire protocol functions. Target: PIC16F876 More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define W1_OK   0x00
 Function call success. More...
 
#define W1_CRC   0x01
 CRC verification fail. More...
 
#define W1_FOUND   0x02
 No device found. More...
 

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.h.

Macro Definition Documentation

◆ W1_CRC

#define W1_CRC   0x01

CRC verification fail.

Definition at line 27 of file onewire.h.

◆ W1_FOUND

#define W1_FOUND   0x02

No device found.

Definition at line 28 of file onewire.h.

◆ W1_OK

#define W1_OK   0x00

Function call success.

Definition at line 26 of file onewire.h.

Function Documentation

◆ OneWire_Crc8()

BYTE OneWire_Crc8 ( BYTE  Data,
BYTE  Accum 
)

Computes CRC8.

Parameters
Data- data byte to compute.
Accum- accumulated result.
Returns
the CRC8 accumulated result based on the params.

Definition at line 154 of file onewire.c.

Here is the caller graph for this function:

◆ OneWire_GetID()

BYTE OneWire_GetID ( BYTE buff)

1-wire prototypes

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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OneWire_Init()

BYTE OneWire_Init ( void  )

Send initialization flags to the 1 wire network.

Returns
TRUE on device presence.

Definition at line 69 of file onewire.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OneWire_Read()

BYTE OneWire_Read ( void  )

Read a byte from the 1 wire network.

Returns
byte read.

Definition at line 93 of file onewire.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OneWire_Write()

void OneWire_Write ( BYTE  d)

Send a byte to the 1 wire network.

Parameters
d- data byte to send.
Returns
none.

Definition at line 124 of file onewire.c.

Here is the call graph for this function:
Here is the caller graph for this function: