示例#1
0
文件: BCL.c 项目: wires/BCL
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;
}
示例#2
0
文件: BCL.c 项目: wires/BCL
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 
 }              
示例#4
0
void UserInterruptHandler(void)
{
    #if defined(SENSOR_PORT_UART) && defined(SENSOR_PORT_LCD)
        if( PIR3bits.SSP2IF )
        {
            PIR3bits.SSP2IF = 0;
            I2CTask();
            DELAY_ms(5);
        }
    #endif
}
示例#5
0
文件: BCL.c 项目: wires/BCL
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;
}