1 #ifndef SRLM_PROPGCC_I2C_MOCK_H__
2 #define SRLM_PROPGCC_I2C_MOCK_H__
27 void Init(
const int SCLPin,
const int SDAPin) {
31 bool Ping(
unsigned char device) {
35 bool Put(
unsigned char device,
unsigned char address,
char byte) {
36 putStack[++putStackTop] = byte;
41 #pragma GCC optimize ("0")
43 bool Get(
unsigned char device,
unsigned char address,
char * bytes,
int size) {
44 if (address == (0x28 | 0x80))
46 for (
volatile int i = 0; i < size; ++i) {
50 }
else if (address == (0x03 | 0x80))
52 for (
volatile int i = 0; i < size; ++i) {
68 if (putStackTop == -1)
return -1;
69 else return putStack[putStackTop--];
72 void SetXYZ(
char * bytes,
int size) {
73 for (
int i = 0; i < size; i++) {
82 #endif // SRLM_PROPGCC_I2C_MOCK_H__