1 #ifndef SRLM_PROPGCC_I2C_MOCK_H__ 2 #define SRLM_PROPGCC_I2C_MOCK_H__ 29 void Init(
const int SCLPin,
const int SDAPin) {
33 bool Ping(
unsigned char device) {
37 bool Put(
unsigned char device,
unsigned char address,
char byte) {
38 putStack[++putStackTop] = byte;
43 #pragma GCC optimize ("0") 45 bool Get(
unsigned char device,
unsigned char address,
char * bytes,
int size) {
46 if (address == (0x28 | 0x80))
48 for (
volatile int i = 0; i < size; ++i) {
52 }
else if (address == (0x03 | 0x80))
54 for (
volatile int i = 0; i < size; ++i) {
70 if (putStackTop == -1)
return -1;
71 else return putStack[putStackTop--];
74 void SetXYZ(
char * bytes,
int size) {
75 for (
int i = 0; i < size; i++) {
86 #endif // SRLM_PROPGCC_I2C_MOCK_H__ bool Put(const unsigned char device, const unsigned char address, const char byte)
bool Ping(const unsigned char device)
void Init(const int scl=28, const int sda=29, const int frequency=400000)
unsigned char Get(const unsigned char device, const unsigned char address)