Display_Avr_3/pcf8574.h

22 lines
936 B
C
Raw Blame History

#ifndef PCF8574_H_
#define PCF8574_H_
#define PCF8574_ADDRBASE (0x27) // <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>-<2D><>
#define PCF8574_I2CINIT 1 // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> i2c
#define PCF8574_MAXDEVICES 1 // <20><><EFBFBD><EFBFBD> <20><><EFBFBD>-<2D><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#define PCF8574_MAXPINS 8 // <20><><EFBFBD><EFBFBD> <20><><EFBFBD>-<2D><> <20><><EFBFBD><EFBFBD><EFBFBD>
void pcf8574_init();
int8_t pcf8574_getoutput(uint8_t deviceid);
int8_t pcf8574_getoutputpin(uint8_t deviceid, uint8_t pin);
int8_t pcf8574_setoutput(uint8_t deviceid, uint8_t data);
int8_t pcf8574_setoutputpins(uint8_t deviceid, uint8_t pinstart, uint8_t pinlength, int8_t data);
int8_t pcf8574_setoutputpin(uint8_t deviceid, uint8_t pin, uint8_t data);
int8_t pcf8574_setoutputpinhigh(uint8_t deviceid, uint8_t pin);
int8_t pcf8574_setoutputpinlow(uint8_t deviceid, uint8_t pin);
int8_t pcf8574_getinput(uint8_t deviceid);
int8_t pcf8574_getinputpin(uint8_t deviceid, uint8_t pin);
#endif