LTlib LaurTec Library
4.0.1
Open Source C Library for Microchip Microcontrollers based on XC8 Compiler
|
#include "LTlib.h"
Go to the source code of this file.
Macros | |
#define | PCF8574_I2C_MODULE_1 |
#define | PCF8574_I2C_open I2C1_open |
#define | PCF8574_I2C_baud_rate I2C1_baud_rate |
#define | PCF8574_I2C_wait_bus_IDLE I2C1_wait_bus_IDLE |
#define | PCF8574_I2C_start_bit I2C1_start_bit |
#define | PCF8574_I2C_check_bus_collision I2C1_check_bus_collision |
#define | PCF8574_I2C_write_byte I2C1_write_byte |
#define | PCF8574_I2C_stop_bit I2C1_stop_bit |
#define | PCF8574_I2C_check_ACK I2C1_check_ACK |
#define | PCF8574_I2C_negative_ACK I2C1_negative_ACK |
#define | PCF8574_I2C_read_byte I2C1_read_byte |
#define | PCF8574_I2C_set_master_as_receiver I2C1_set_master_as_receiver |
#define | USED_DEVICE_PCF8574 0x40 |
#define | USED_DEVICE_PCF8574A 0x70 |
#define | PCF8574_INTERNAL_ADDRESS USED_DEVICE_PCF8574A |
#define | initialize_PCF8574 PCF8574_initialize |
#define | write_data_PCF8574 PCF8574_write_data |
#define | read_data_PCF8574 PCF8574_read_data |
Functions | |
void | PCF8574_initialize (unsigned int baud_rate_KHz) |
signed char | PCF8574_write_data (unsigned char device_address, unsigned char data) |
signed char | PCF8574_read_data (unsigned char device_address, unsigned char *data) |
#define initialize_PCF8574 PCF8574_initialize |
#define PCF8574_I2C_baud_rate I2C1_baud_rate |
#define PCF8574_I2C_check_ACK I2C1_check_ACK |
#define PCF8574_I2C_check_bus_collision I2C1_check_bus_collision |
#define PCF8574_I2C_negative_ACK I2C1_negative_ACK |
#define PCF8574_I2C_read_byte I2C1_read_byte |
#define PCF8574_I2C_set_master_as_receiver I2C1_set_master_as_receiver |
#define PCF8574_I2C_start_bit I2C1_start_bit |
#define PCF8574_I2C_stop_bit I2C1_stop_bit |
#define PCF8574_I2C_wait_bus_IDLE I2C1_wait_bus_IDLE |
#define PCF8574_I2C_write_byte I2C1_write_byte |
#define PCF8574_INTERNAL_ADDRESS USED_DEVICE_PCF8574A |
#define read_data_PCF8574 PCF8574_read_data |
#define write_data_PCF8574 PCF8574_write_data |
void PCF8574_initialize | ( | unsigned int | baud_rate_KHz | ) |
This function initialize the I2C module accordingly to the clock and baud rate.
baud_rate_KHz | Baud rate expressed in KHz |
Definition at line 46 of file PCF8574.c.
References I2C_MASTER, PCF8574_I2C_baud_rate, and PCF8574_I2C_open.
signed char PCF8574_read_data | ( | unsigned char | device_address, |
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)
Definition at line 119 of file PCF8574.c.
References PCF8574_I2C_check_ACK, PCF8574_I2C_check_bus_collision, PCF8574_I2C_negative_ACK, PCF8574_I2C_read_byte, PCF8574_I2C_set_master_as_receiver, PCF8574_I2C_start_bit, PCF8574_I2C_stop_bit, PCF8574_I2C_wait_bus_IDLE, PCF8574_I2C_write_byte, and PCF8574_INTERNAL_ADDRESS.
signed char PCF8574_write_data | ( | unsigned char | device_address, |
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)
Definition at line 57 of file PCF8574.c.
References PCF8574_I2C_check_ACK, PCF8574_I2C_check_bus_collision, PCF8574_I2C_start_bit, PCF8574_I2C_stop_bit, PCF8574_I2C_wait_bus_IDLE, PCF8574_I2C_write_byte, and PCF8574_INTERNAL_ADDRESS.