User manual

Table Of Contents
384
mikoC PRO for PIC32
MikroElektronika
Ow_Read
Ow_Write
Prototype
unsigned short Ow_Read(unsigned int *port, unsigned int pin);
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
unsigned short read_data;
...
read_data = Ow_Read(&PORTF, 6);
Notes None.
Prototype
void Ow_Write(unsigned int *port, unsigned int pin, unsigned short data_);
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.