26 lines
503 B
C
26 lines
503 B
C
|
#ifndef PCA9554_H_
|
||
|
#define PCA9554_H_ 1
|
||
|
#include <cstdint>
|
||
|
|
||
|
#define PCA9554_ADDR 0x20 //PCA9554 = 0 1 0 0 a2 a1 a0
|
||
|
|
||
|
class Pca9554 {
|
||
|
public:
|
||
|
Pca9554(uint8_t slaveAddress = PCA9554_ADDR);
|
||
|
~Pca9554();
|
||
|
|
||
|
void begin(uint8_t inputMask = 0, uint8_t outputs = 0);
|
||
|
void SetInputPins(uint8_t inputMask);
|
||
|
uint8_t ReadInputs();
|
||
|
void SendOutputValues();
|
||
|
void SendOutputValues(uint8_t values);
|
||
|
|
||
|
uint8_t outputValues;
|
||
|
|
||
|
private:
|
||
|
const uint8_t slaveAddress;
|
||
|
uint8_t inputMask;
|
||
|
};
|
||
|
|
||
|
|
||
|
#endif //PCA9554_H_
|