PIC18 LaurTec Library
3.2.0
Open Source C Library for PIC18 Microcontrollers based on C18 - XC8 Compilers
|
#include "PCF8574.h"
Go to the source code of this file.
Functions | |
void | initialize_PCF8574 (unsigned char crystal_frequency_MHz, unsigned int baud_rate_KHz) |
signed char | write_data_PCF8574 (unsigned char control, unsigned char data) |
signed char | read_data_PCF8574 (unsigned char control, unsigned char *data) |
void initialize_PCF8574 | ( | unsigned char | crystal_frequency_MHz, |
unsigned int | baud_rate_KHz | ||
) |
This function initialize the I2C module accordingly to the clock and baud rate.
crystal_frequency_MHz | Clock frequency expressed in MHz |
baud_rate_KHz | Baud rate expressed in KHz |
signed char read_data_PCF8574 | ( | unsigned char | control, |
unsigned char * | data | ||
) |
This function reads to the data Port of the I2C I/O expander.
control | Is the address of the PCF8574 (Internal Address + Pin address |
data | Address where the data is written into. |
xxx = A2 A1 A0 (External Address Pins)
signed char write_data_PCF8574 | ( | unsigned char | control, |
unsigned char | data | ||
) |
This function writes to the data Port of the I2C I/O expander.
control | Is the address of the PCF8574 (Internal Address + Pin address) |
data | Byte to write [min: 0, max: 255] |
xxx = A2 A1 A0 (External Address Pins)