예제 #1
0
파일: i2c.c 프로젝트: hmchen1/ChibiOS
/**
 * @brief   Deactivates the I2C peripheral.
 *
 * @param[in] i2cp      pointer to the @p I2CDriver object
 *
 * @api
 */
void i2cStop(I2CDriver *i2cp) {

  osalDbgCheck(i2cp != NULL);
  osalDbgAssert((i2cp->state == I2C_STOP) || (i2cp->state == I2C_READY) ||
                (i2cp->state == I2C_LOCKED), "invalid state");

  osalSysLock();
  i2c_lld_stop(i2cp);
  i2cp->state = I2C_STOP;
  osalSysUnlock();
}
예제 #2
0
파일: i2c.c 프로젝트: mcu786/Quad-Rotor
/**
 * @brief   Deactivates the I2C peripheral.
 *
 * @param[in] i2cp      pointer to the @p I2CDriver object
 *
 * @api
 */
void i2cStop(I2CDriver *i2cp) {

    chDbgCheck(i2cp != NULL, "i2cStop");

    chSysLock();
    chDbgAssert((i2cp->id_state == I2C_STOP) || (i2cp->id_state == I2C_READY),
                "i2cStop(), #1",
                "invalid state");
    i2c_lld_stop(i2cp);
    i2cp->id_state = I2C_STOP;
    chSysUnlock();
}