int sendI2CCommand(I2CData data,I2CDevice device) { BCLMarkFunc(__PRETTY_FUNCTION__,__FUNCTION__); I2CCommand command; command.data = data; command.device = device; command.mode = kI2CModeSend; data = I2CTask(command); return 0; }
I2CData getI2CData(I2CData data,I2CDevice device) { BCLMarkFunc(__PRETTY_FUNCTION__,__FUNCTION__); I2CCommand command; command.data = data; command.device = device; command.mode = kI2CModeRecieve; data = I2CTask(command); return data; }
void UserInterruptHandler(void) { #if defined(EIGHT_BIT_WIRELESS_BOARD) && defined(SENSOR_PORT_UART) && defined(SENSOR_PORT_LCD) if( PIR3bits.SSP2IF ) { PIR3bits.SSP2IF = 0; I2CTask(); DelayMs(5); } #endif }
void UserInterruptHandler(void) { #if defined(SENSOR_PORT_UART) && defined(SENSOR_PORT_LCD) if( PIR3bits.SSP2IF ) { PIR3bits.SSP2IF = 0; I2CTask(); DELAY_ms(5); } #endif }
int moveWithSpeed(int leftSpeed,int rightSpeed) { BCLMarkFunc(__PRETTY_FUNCTION__,__FUNCTION__); I2CData data; data = makeI2CDataFromSpeed(leftSpeed, rightSpeed); I2CDevice device; device.I2C_ID = kMotorBoardID; I2CCommand command; command.data = data; command.device = device; command.mode = kI2CModeSend; I2CTask(command); return 0; }