Mikroelektronika MIKROE-742 데이터 시트

다운로드
페이지 532
Ow_Read
297
MIKROELEKTRONIKA
- SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroPASCAL PRO for AVR
CHAPTER 6
Prototype
function Ow_Read(): byte;
Returns
Data read from an external device over the OneWire bus.
Description
Reads one byte of data via the OneWire bus.
Requires
Devices compliant with the Dallas OneWire protocol.
Global variables : 
OW_Bit_Read
: OneWire read line 
OW_Bit_Write
: OneWire write line. 
OW_Bit_Direction
: Direction of the OneWire pin 
must be defined before using this function.
Example
// OneWire pinout
var OW_Bit_Read : sbit at PINB.B2;     
var OW_Bit_Write : sbit at PORTB.B2;   
var OW_Bit_Direction : sbit at DDRB.B2;
// end of OneWire pinout
// Read a byte from the One-Wire Bus
var read_data : byte;
...
read_data := Ow_Read();