Ejemplo n.º 1
0
/**
 * @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();
}
Ejemplo n.º 2
0
/**
 * @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();
}