5 #ifndef __I2C_IO_HEADER
6 #define __I2C_IO_HEADER
9 #include "../ustd/static_vector.hpp"
39 Wire.beginTransmission(target_);
45 Wire.endTransmission(endl_.
end);
75 #ifdef __TYPE_SIZE_CHECK
76 Wire.requestFrom(target_,
sizeof(T) + 1);
77 while(Wire.available() != (
sizeof(T)+1))
DEBUG_MSG(
"FAIL: To earley");
78 #else //__TYPE_SIZE_CHECK
79 Wire.requestFrom(target_,
sizeof(T));
80 while(Wire.available() !=
sizeof(T))
DEBUG_MSG(
"FAIL: To earley");
81 #endif //__TYPE_SIZE_CHECK
96 return Wire.available();
116 #endif //__I2C_IO_HEADER
void serialize(Archive &ar, T &t)
Definition: serializer.hpp:95
bool end
Definition: iostream.hpp:31
void push_back(T const &in)
Definition: static_vector.hpp:40
i2cin_class()
Definition: i2c.hpp:69
i2cout_class & operator()(uint8_t const &adr_)
Definition: i2c.hpp:54
i2cin_class & operator&(T &t)
Definition: i2c.hpp:86
i2cout_class & operator<<(T &t)
Definition: i2c.hpp:24
i2cout_class & operator&(T &t)
Definition: i2c.hpp:33
class com::i2cout_class i2cout
i2cout_class()
Definition: i2c.hpp:21
static archive_enum const type
Definition: i2c.hpp:67
#define DEBUG_MSG(x)
Definition: ard_assert.hpp:32
archive_enum
Definition: archive_enum.hpp:14
i2cin_class & operator>>(T &t)
Definition: i2c.hpp:73
i2cin_class & operator()(uint8_t const &adr_)
Definition: i2c.hpp:98
void i2c_begin()
Definition: i2c.hpp:106
T * data()
Definition: static_vector.hpp:90
uint8_t available()
Definition: i2c.hpp:95
static archive_enum const type
Definition: i2c.hpp:19
byte read()
Definition: i2c.hpp:91
size_type const & size() const
Definition: static_vector.hpp:118
void write(byte const &in)
Definition: i2c.hpp:51
Definition: iostream.hpp:24
i2cout_class & operator<<(T const &t)
Definition: i2c.hpp:28
void clear()
Definition: static_vector.hpp:56
i2cout_class & operator<<(ustd::endl_class &endl_)
Definition: i2c.hpp:37
class com::i2cin_class i2cin