add Rf link quality checks
[openXsensor.git] / openXsensor / arduino_shim.cpp
blob90d04f3dab72e1b1a7b7a81c8ea12792118034b7
2 #include "arduino_shim.h"
4 #include "I2C.h"
6 #define INV6050_addrBis 0x68
8 _EXTERN_ATTRIB int shim_i2c_write(unsigned char slave_addr, unsigned char reg_addr,unsigned char length, unsigned char const *data) {
9 return I2c.write( (uint8_t) slave_addr, (uint8_t) reg_addr, (uint8_t) length , (uint8_t *)data ) ; // return 0 on success
12 _EXTERN_ATTRIB int shim_i2c_writeByte( unsigned char reg_addr, unsigned char data) {
13 return I2c.write( INV6050_addrBis , (uint8_t) reg_addr, (uint8_t) data ) ; // return 0 on success
17 _EXTERN_ATTRIB int shim_i2c_read(unsigned char slave_addr, unsigned char reg_addr,unsigned char length, unsigned char *data) {
18 return I2c.read( (uint8_t) slave_addr, (uint8_t) reg_addr, (uint8_t) length , (uint8_t *)data ) ; // return 0 on success
22 _EXTERN_ATTRIB int shim_i2c_writeBlock( unsigned char reg_addr,unsigned char length, unsigned char const *data) {
23 return I2c.write( INV6050_addrBis, (uint8_t) reg_addr, (uint8_t) length , (uint8_t *)data ) ; // return 0 on success