The One Wire
module provides functionality for communication with devices using the One-Wire protocol on Microchip PIC16F microcontrollers. It includes functions for initializing the One-Wire bus, sending and receiving data, and handling specific timing requirements for the One-Wire protocol.
File Information #
- Files:
one_wire.h
,one_wire.c
- Version: 1.0.1
One Wire Interface #
The ONE_WIRE
instance provides access to the One-Wire interface functions for handling One-Wire communication on the bus.
Interface Functions #
void Initialize(void)
- Purpose: Initializes the One-Wire bus by configuring the relevant GPIO pin for One-Wire communication. This involves disabling the analog functionality of the pin and setting it as a digital input.
LogicEnum_t Reset(void)
- Purpose: Sends a reset pulse on the One-Wire bus to signal the start of communication and synchronizes with slave devices. It checks if any devices respond with a presence pulse.
void WriteByte(uint8_t data)
- Purpose: Sends an entire byte of data to the One-Wire bus.
uint8_t ReadByte(void)
- Purpose: Reads a full byte of data from the One-Wire bus.
uint8_t ReadBit(void)
- Purpose: Reads a single bit from the One-Wire bus. This is typically used during low-level communication with a One-Wire device when individual bits need to be checked.