Пример #1
0
/**
* @brief This function handles I2C1 error interrupt.
*/
void I2C1_ER_IRQHandler(void)
{
  /* USER CODE BEGIN I2C1_ER_IRQn 0 */
Write7SegIT(66);
  /* USER CODE END I2C1_ER_IRQn 0 */
  HAL_I2C_ER_IRQHandler(&hi2c1);
  /* USER CODE BEGIN I2C1_ER_IRQn 1 */

  /* USER CODE END I2C1_ER_IRQn 1 */
}
Пример #2
0
/**
* @brief This function handles I2C3 error interrupt.
*/
void I2C3_ER_IRQHandler(void)
{
  /* USER CODE BEGIN I2C3_ER_IRQn 0 */

  /* USER CODE END I2C3_ER_IRQn 0 */
  HAL_I2C_ER_IRQHandler(&hi2c3);
  /* USER CODE BEGIN I2C3_ER_IRQn 1 */

  /* USER CODE END I2C3_ER_IRQn 1 */
}
Пример #3
0
/**
* @brief This function handles I2C3 error interrupt.
*/
void I2C3_ER_IRQHandler(void)
{
  /* USER CODE BEGIN I2C3_ER_IRQn 0 */

  /* USER CODE END I2C3_ER_IRQn 0 */
  HAL_NVIC_ClearPendingIRQ(I2C3_ER_IRQn);
  HAL_I2C_ER_IRQHandler(&hi2c3);
  /* USER CODE BEGIN I2C3_ER_IRQn 1 */

  /* USER CODE END I2C3_ER_IRQn 1 */
}
Пример #4
0
/**
* @brief This function handles I2C2 global interrupt.
*/
void I2C2_IRQHandler(void)
{
  /* USER CODE BEGIN I2C2_IRQn 0 */

  /* USER CODE END I2C2_IRQn 0 */
  if (hi2c2.Instance->ISR & (I2C_FLAG_BERR | I2C_FLAG_ARLO | I2C_FLAG_OVR)) {
    HAL_I2C_ER_IRQHandler(&hi2c2);
  } else {
    HAL_I2C_EV_IRQHandler(&hi2c2);
  }
  /* USER CODE BEGIN I2C2_IRQn 1 */

  /* USER CODE END I2C2_IRQn 1 */
}
Пример #5
0
/**
  * @brief  This function handles I2C error interrupt request.
  * @param  None
  * @retval None
  * @Note   This function is redefined in "main.h" and related to I2C error
  */
void I2Cx_ER_IRQHandler(void)
{
  HAL_I2C_ER_IRQHandler(& I2cHandle);
}
Пример #6
0
void i2c_er_irq_handler(mp_uint_t i2c_id) {
    I2C_HandleTypeDef *hi2c;

    switch (i2c_id) {
        #if defined(MICROPY_HW_I2C1_SCL)
        case 1:
            hi2c = &I2CHandle1;
            break;
        #endif
        #if defined(MICROPY_HW_I2C2_SCL)
        case 2:
            hi2c = &I2CHandle2;
            break;
        #endif
        #if defined(MICROPY_HW_I2C3_SCL)
        case 3:
            hi2c = &I2CHandle3;
            break;
        #endif
        #if defined(MICROPY_HW_I2C4_SCL)
        case 4:
            hi2c = &I2CHandle4;
            break;
        #endif
        default:
            return;
    }

    #if defined(MCU_SERIES_F4)

    uint32_t sr1 = hi2c->Instance->SR1;

    // I2C Bus error
    if (sr1 & I2C_FLAG_BERR) {
        hi2c->ErrorCode |= HAL_I2C_ERROR_BERR;
        __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_BERR);
    }

    // I2C Arbitration Loss error
    if (sr1 & I2C_FLAG_ARLO) {
        hi2c->ErrorCode |= HAL_I2C_ERROR_ARLO;
        __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_ARLO);
    }

    // I2C Acknowledge failure
    if (sr1 & I2C_FLAG_AF) {
        hi2c->ErrorCode |= HAL_I2C_ERROR_AF;
        SET_BIT(hi2c->Instance->CR1,I2C_CR1_STOP);
        __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_AF);
    }

    // I2C Over-Run/Under-Run
    if (sr1 & I2C_FLAG_OVR) {
        hi2c->ErrorCode |= HAL_I2C_ERROR_OVR;
        __HAL_I2C_CLEAR_FLAG(hi2c, I2C_FLAG_OVR);
    }

    #else

    // if not an F4 MCU, use the HAL's IRQ handler
    HAL_I2C_ER_IRQHandler(hi2c);

    #endif
}
Пример #7
0
void I2C2_ER_IRQHandler(void)
{
    HAL_I2C_ER_IRQHandler(&i2cHandle[I2CDEV_2].Handle);
}
Пример #8
0
/**
* @brief This function handles I2C1 error interrupt.
*/
void I2C1_ER_IRQHandler(void)
{
  HAL_NVIC_ClearPendingIRQ(I2C1_ER_IRQn);
  HAL_I2C_ER_IRQHandler(&hi2c1);
}
Пример #9
0
void I2C1_Handler(void) {
	//Call Hal_I2C_EventHandler
	HAL_I2C_EV_IRQHandler(&hnd);  //Eventhandler - Dieser kümmert sich automatisch um das erzeugen von Startconditions, ACKs, NACKs, Stopbits und Stopcondition
	HAL_I2C_ER_IRQHandler(&hnd);  //Errorhandler
}
Пример #10
0
void I2C4_ER_IRQHandler(void)
{
    HAL_I2C_ER_IRQHandler(&i2cDevice[I2CDEV_4].handle);
}
Пример #11
0
/**
* @brief This function handles I2C1 error interrupt.
*/
void I2C1_ER_IRQHandler(void)
{
  HAL_I2C_ER_IRQHandler(&hi2c1_at24c16);
}
Пример #12
0
/**
  * @brief  This function handles I2C error interrupt request.
  * @param  None
  * @retval None
  * @Note   This function is redefined in "main.h" and related to I2C error
  */
void I2Cx_ER_IRQHandler(void)
{
  HAL_I2C_ER_IRQHandler(&handleIIC);
}
Пример #13
0
static irq_return_t i2c_er_irq_handler(unsigned int irq_nr, void *data) {
	I2C_HandleTypeDef *I2cHandle = (I2C_HandleTypeDef *) data;
	HAL_I2C_ER_IRQHandler(I2cHandle);
	return IRQ_HANDLED;
}