The I2C1
module provides a hardware abstraction layer for the I2C communication protocol on Microchip PIC16F series microcontrollers. It includes functions for initializing the I2C module, sending and receiving data, and handling start/stop conditions in master mode.
File Information #
- Files:
i2c1.h
,i2c1.c
- Version: 1.0.1
Supported Processors: #
I2C1 Interface #
The I2C1
interface provides a set of functions for I2C communication in master mode. Here is the list of functions in the updated I2C1
interface from the files you provided:
Functions in the I2C1 Interface #
void Initialize(void)
- Initializes the I2C1 module in master mode, configuring the clock and setting up the I2C pins.
void WriteStart(void)
- Sends a start condition on the I2C bus.
I2C_Status_Enum_t WriteAddress(uint8_t address, I2C_Address_Mode_Enum_t address_mode)
- Sends a 7-bit slave address on the I2C bus, with a read or write bit appended, and checks for acknowledgment.
void WriteStop(void)
- Sends a stop condition on the I2C bus, signaling the end of communication.
I2C_Status_Enum_t WriteByte(uint8_t data)
- Sends a single byte of data on the I2C bus and checks for acknowledgment from the slave.
I2C_Status_Enum_t WriteBlock(uint8_t *datablock, uint8_t data_length)
- Sends a block of data (multiple bytes) to the slave device and checks for acknowledgment.
uint8_t ReadByte(void)
- Receives a single byte of data from the I2C bus.
I2C_Status_Enum_t ReadBlock(uint8_t *datablock, uint8_t data_length)
- Receives a block of data (multiple bytes) from the I2C bus.