#include <i2c.h>
Go to the source code of this file.
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.
- Parameters
-
crystal_frequency_MHz | Clock frequency expressed in MHz |
baud_rate_KHz | Baud rate expressed in KHz |
- Returns
- Note
- If other devices are connected on the I2C bus the baud rate would be changed by the function. Among several calls from different device initializations, only the last one will be reflected in the I2C module configuration.
Definition at line 53 of file PCF8574.c.
signed char read_data_PCF8574 |
( |
unsigned char |
control, |
|
|
unsigned char * |
data |
|
) |
| |
This function reads to the data Port of the I2C I/O expander.
- Parameters
-
control | Is the address of the PCF8574 (Internal Address + Pin address |
data | Address where the data is written into. |
- Returns
- status 1: The byte has been properly written -1: Bus Collision error -2: Not Ack error condition -3: Write collision
- Note
- PCF8574 Address : 0100xxx0 PCF8574A Address : 0111xxx0
xxx = A2 A1 A0 (External Address Pins)
Definition at line 151 of file PCF8574.c.
signed char write_data_PCF8574 |
( |
unsigned char |
control, |
|
|
unsigned char |
data |
|
) |
| |
This function writes to the data Port of the I2C I/O expander.
- Parameters
-
control | Is the address of the PCF8574 (Internal Address + Pin address) |
data | Byte to write [min: 0, max: 255] |
- Returns
- status 1: The byte has been properly written -1: Bus Collision error -2: Not Ack error condition -3: Write collision
- Note
- PCF8574 Address : 0100xxx0 PCF8574A Address : 0111xxx0
xxx = A2 A1 A0 (External Address Pins)
Definition at line 65 of file PCF8574.c.