11 #ifndef __PCF8574_HEADER
12 #define __PCF8574_HEADER
14 #include "../com/i2c.hpp"
15 #include "../util/byte_operation.hpp"
20 PCF8574_class(uint8_t
const & add): dev_ard_(0x20 + add), input_mask_(0) {
22 void write(uint8_t
const & data) {
46 void mode(uint8_t
const & pm) {
48 if(pm == INPUT_PULLUP or pm == INPUT) {
54 void write(
bool const & state) {
60 if(pm_set_ ==
false) {
74 #endif //__PCF8574_HEADER
uint8_t & mask()
Definition: PCF8574.hpp:31
Definition: PCF8574.hpp:18
class com::i2cout_class i2cout
PCF8574_class(uint8_t const &add)
Definition: PCF8574.hpp:20
void write(uint8_t const &data)
Definition: PCF8574.hpp:22
void clear_bit(T &unit, uint8_t const &pos)
Definition: byte_operation.hpp:44
void write_bit(T &unit, uint8_t const &pos, bool state=true)
Definition: byte_operation.hpp:48
struct ustd::endl_class endl
uint8_t read() const
Definition: PCF8574.hpp:26
void set_bit(T &unit, uint8_t const &pos)
Definition: byte_operation.hpp:40
bool read_bit(T const &unit, uint8_t const &pos)
Definition: byte_operation.hpp:36
class com::i2cin_class i2cin