User manual
346
mikoPascal PRO for PIC32
MikroElektronika
Ow_Read
Ow_Write
Prototype
function Ow_Read(var port : word; pin : word): byte;
Description Reads one byte of data via the OneWire bus.
Parameters - port: OneWire bus port
- pin: OneWire bus pin
Returns Data read from an external device over the OneWire bus.
Requires Devices compliant with the Dallas OneWire protocol.
Example
// Read a byte from the One-Wire Bus connected to pin RF6
var read_data : byte;
...
read_data := Ow_Read(PORTF, 6);
Notes None.
Prototype
procedure Ow_Write(var port: word; pin, data_ : byte);
Description Writes one byte of data via the OneWire bus.
Parameters - port: OneWire bus port
- pin: OneWire bus pin
- data_: data to be written
Returns Nothing.
Requires Devices compliant with the Dallas OneWire protocol.
Example
// Send a byte to the One-Wire Bus connected to pin RF6
Ow_Write(&PORTF, 6, 0xCC);
Notes None.
Ow_Reset
Prototype
function Ow_Reset(var port: word; pin: word): word;
Description Issues OneWire reset signal for DS18x20.
Parameters - port: OneWire bus port
- pin: OneWire bus pin
Returns - 0 if the device is present
- 1 if the device is not present
Requires Devices compliant with the Dallas OneWire protocol.
Example
// Issue Reset signal on One-Wire Bus connected to pin RF6
Ow_Reset(&PORTF,6);
Notes None.