UBlox M10 Support
[openXsensor.git] / openXsensor / arduino_shim.h
blob314ac3bafb1794a6b0b25fa66a2713a18ce8f056
1 #ifndef __ARDUINO_SHIM
2 #define __ARDUINO_SHIM
4 #include "Arduino.h"
7 //#define SERIAL_OUTPUT_DEVICE Serial // comment out if no debugging required
9 #ifdef SERIAL_OUTPUT_DEVICE
11 extern HardwareSerial Serial;
12 #define log_i SERIAL_OUTPUT_DEVICE.println
13 #define log_e SERIAL_OUTPUT_DEVICE.println
15 #else // No Debug Output
17 #define log_i(...) do { } while (0)
18 #define log_e(...) do { } while (0)
20 #endif
22 #define __no_operation() __asm__("nop\n\t") // emit AVR no-op
24 #ifdef __cplusplus
25 #define _EXTERN_ATTRIB extern "C"
26 #else
27 #define _EXTERN_ATTRIB
28 #endif
30 _EXTERN_ATTRIB int shim_i2c_write(unsigned char slave_addr, unsigned char reg_addr,unsigned char length, unsigned char const *data);
31 _EXTERN_ATTRIB int shim_i2c_read(unsigned char slave_addr, unsigned char reg_addr,unsigned char length, unsigned char *data);
32 _EXTERN_ATTRIB int shim_i2c_writeByte( unsigned char reg_addr, unsigned char data) ;
33 _EXTERN_ATTRIB void shim_get_ms(unsigned long *count);
34 _EXTERN_ATTRIB int shim_i2c_writeBlock( unsigned char reg_addr,unsigned char length, unsigned char const *data) ;
36 #endif