/** * @brief This function generates I2C start timing. * @param None * @return None */ void I2cStart(void* I2cMasterHandle) { SetSDA(I2cMasterHandle); SetSCL(I2cMasterHandle); SetOutputSCL(I2cMasterHandle); SetOutputSDA(I2cMasterHandle); ClrSDA(I2cMasterHandle); ClrSCL(I2cMasterHandle); }
/** * @brief This function generates I2C stop timing. * @param None * @return None */ void I2cStop(void* I2cMasterHandle) { SetOutputSCL(I2cMasterHandle); SetOutputSDA(I2cMasterHandle); ClrSDA(I2cMasterHandle); SetSCL(I2cMasterHandle); SetSDA(I2cMasterHandle); SetInputSDA(I2cMasterHandle); }
// send STOP signal. VOID I2C_Stop(BYTE I2cDevice) { // DBG(("I2C_Stop()\n")); SetOutputSCL(I2cDevice); SetOutputSDA(I2cDevice); ClrSDA(I2cDevice); KtIICDelay(); SetSCL(I2cDevice); SetSDA(I2cDevice); SetInputSDA(I2cDevice); }
// send START signal. VOID I2C_Start(BYTE I2cDevice) { SetSDA(I2cDevice); SetSCL(I2cDevice); SetOutputSCL(I2cDevice); SetOutputSDA(I2cDevice); SetSDA(I2cDevice); SetSCL(I2cDevice); KtIICDelay(); ClrSDA(I2cDevice); ClrSCL(I2cDevice); }