Exemplo n.º 1
1
void USART3_8_IRQHandler(void)
{
  if (__HAL_GET_PENDING_IT(HAL_ITLINE_USART3)!= RESET)
  {
    HAL_UART_IRQHandler(&UartHandle[USART3_INDEX]);
  }
  if (__HAL_GET_PENDING_IT(HAL_ITLINE_USART4)!= RESET)
  {
     HAL_UART_IRQHandler(&UartHandle[USART4_INDEX]);
  }
  if (__HAL_GET_PENDING_IT(HAL_ITLINE_USART5)!= RESET)
  {
     HAL_UART_IRQHandler(&UartHandle[USART5_INDEX]);
  }
  if (__HAL_GET_PENDING_IT(HAL_ITLINE_USART6)!= RESET)
  {
     HAL_UART_IRQHandler(&UartHandle[USART6_INDEX]);
  }
  if (__HAL_GET_PENDING_IT(HAL_ITLINE_USART7)!= RESET)
  {
     HAL_UART_IRQHandler(&UartHandle[USART7_INDEX]);
  }
  if (__HAL_GET_PENDING_IT(HAL_ITLINE_USART8)!= RESET)
  {
     HAL_UART_IRQHandler(&UartHandle[USART8_INDEX]);
  }
}
Exemplo n.º 2
0
/**
* @brief This function handles USART3 global interrupt.
*/
void USART3_IRQHandler(void)
{
  /* USER CODE BEGIN USART3_IRQn 0 */

  /* USER CODE END USART3_IRQn 0 */
  HAL_UART_IRQHandler(&huart3);
  /* USER CODE BEGIN USART3_IRQn 1 */

  /* USER CODE END USART3_IRQn 1 */
}
Exemplo n.º 3
0
/**
* @brief This function handles UART4 global interrupt.
*/
void UART4_IRQHandler(void)
{
  /* USER CODE BEGIN UART4_IRQn 0 */

  /* USER CODE END UART4_IRQn 0 */
  HAL_UART_IRQHandler(&huart4);
  /* USER CODE BEGIN UART4_IRQn 1 */

  /* USER CODE END UART4_IRQn 1 */
}
/**
* @brief This function handles UART4 global interrupt.
*/
void UART4_IRQHandler(void)
{
  /* USER CODE BEGIN UART4_IRQn 0 */
  SEGGER_SYSVIEW_RecordEnterISR();
  HAL_GPS_UART_IRQHandler(&huart4);
  /* USER CODE END UART4_IRQn 0 */
  HAL_UART_IRQHandler(&huart4);
  /* USER CODE BEGIN UART4_IRQn 1 */
  SEGGER_SYSVIEW_RecordEnterISR();
  /* USER CODE END UART4_IRQn 1 */
}
/**
* @brief This function handles USART2 global interrupt.
*/
void USART2_IRQHandler(void)
{
  /* USER CODE BEGIN USART2_IRQn 0 */
  SEGGER_SYSVIEW_RecordEnterISR();
  HAL_ADCS_UART_IRQHandler(&huart2);
  /* USER CODE END USART2_IRQn 0 */
  HAL_UART_IRQHandler(&huart2);
  /* USER CODE BEGIN USART2_IRQn 1 */
  SEGGER_SYSVIEW_RecordEnterISR();
  /* USER CODE END USART2_IRQn 1 */
}
Exemplo n.º 6
0
/**
* @brief This function handles USART6 global interrupt.
*/
void USART6_IRQHandler(void)
{
  /* USER CODE BEGIN USART6_IRQn 0 */

  /* USER CODE END USART6_IRQn 0 */
  HAL_NVIC_ClearPendingIRQ(USART6_IRQn);
  HAL_UART_IRQHandler(&huart6);
  /* USER CODE BEGIN USART6_IRQn 1 */

  /* USER CODE END USART6_IRQn 1 */
}
Exemplo n.º 7
0
void USART1_IRQHandler(void)
{
	portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
	
  HAL_UART_IRQHandler(&huart1);
	
	/* If lHigherPriorityTaskWoken is now equal to pdTRUE, then a context
	switch should be performed before the interrupt exists.  That ensures the
	unblocked (higher priority) task is returned to immediately. */
	portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );
	
}
Exemplo n.º 8
0
void UART4_IRQHandler(void)
{
 HAL_UART_IRQHandler(&huart4);
 
     HAL_UART_Receive_IT( &huart4 , string , 154);  
   
     if( (string[0] == 'm') && (string[152] == 'n') ){
      HAL_GPIO_WritePin( GPIOD , GPIO_PIN_13 , GPIO_PIN_SET );
      HAL_GPIO_WritePin( GPIOD , GPIO_PIN_14 , GPIO_PIN_RESET );
      HAL_GPIO_WritePin( GPIOD , GPIO_PIN_12 , GPIO_PIN_RESET );
    }else if( (string[0] == 'M') && (string[152] == 'N') ){
      HAL_GPIO_WritePin( GPIOD , GPIO_PIN_14 , GPIO_PIN_SET );
      HAL_GPIO_WritePin( GPIOD , GPIO_PIN_13 , GPIO_PIN_RESET );
      HAL_GPIO_WritePin( GPIOD , GPIO_PIN_12 , GPIO_PIN_RESET );
    }else{
      HAL_GPIO_WritePin( GPIOD , GPIO_PIN_12 , GPIO_PIN_SET );
      HAL_GPIO_WritePin( GPIOD , GPIO_PIN_13 , GPIO_PIN_RESET );
      HAL_GPIO_WritePin( GPIOD , GPIO_PIN_14 , GPIO_PIN_RESET );
    }
 HAL_UART_IRQHandler(&huart4);
}
/**
* @brief This function handles USART1 global interrupt.
*/
void USART1_IRQHandler(void)
{

  trace_puts("Run into USART1_IRQHandler!");
  /* USER CODE BEGIN USART1_IRQn 0 */

  /* USER CODE END USART1_IRQn 0 */
  HAL_UART_IRQHandler(&huart1);
  /* USER CODE BEGIN USART1_IRQn 1 */

  /* USER CODE END USART1_IRQn 1 */
}
Exemplo n.º 10
0
/**
  * @brief  This function handles UART3_8 interrupt request.  
  * @param  None
  * @retval None
  * @Note   This function is redefined in "main.h" and related to DMA 
  *         used for USART data transmission     
  */  
void USART3_8_IRQHandler(void)
{
  uint32_t pendingIT = SYSCFG->IT_LINE_SR[USART3_8_IRQn];
  
  if((pendingIT & SYSCFG_ITLINE29_SR_USART3_GLB)!= RESET)
  {
    HAL_UART_IRQHandler(&UartHandle[USART3_INDEX]);
  }
  if((pendingIT & SYSCFG_ITLINE29_SR_USART4_GLB)!= RESET)
  {
    HAL_UART_IRQHandler(&UartHandle[USART4_INDEX]);
  }
  if((pendingIT & SYSCFG_ITLINE29_SR_USART5_GLB)!= RESET)
  {
    HAL_UART_IRQHandler(&UartHandle[USART5_INDEX]);
  }
  if((pendingIT & SYSCFG_ITLINE29_SR_USART6_GLB)!= RESET)
  {
    HAL_UART_IRQHandler(&UartHandle[USART6_INDEX]);
  }
  if((pendingIT & SYSCFG_ITLINE29_SR_USART7_GLB)!= RESET)
  {
    HAL_UART_IRQHandler(&UartHandle[USART7_INDEX]);
  }
  if((pendingIT & SYSCFG_ITLINE29_SR_USART8_GLB)!= RESET)
  {
    HAL_UART_IRQHandler(&UartHandle[USART8_INDEX]);
  }
}
Exemplo n.º 11
0
/**
* @brief This function handles USART3 to USART8 global interrupts / USART3 wake-up interrupt through EXTI line 28.
*/
void USART3_8_IRQHandler(void)
{
	portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
	
#if (HO01R1 || HO02R0 || HO01R2 || HO02R1 || PO01R0 || PO02R0 || HO01R3 || HO02R2)
	HAL_UART_IRQHandler(&huart3);
#endif
#if (HO01R1 || HO02R0 || HO01R2 || HO02R1 || PO01R0 || PO02R0 || HO01R3 || HO02R2)
	HAL_UART_IRQHandler(&huart4);
#endif
#if (HO01R1 || HO02R0 || HO01R2 || HO02R1 || PO01R0 || PO02R0)
	HAL_UART_IRQHandler(&huart5);
#endif
#if (HO01R2 || HO02R1)
	HAL_UART_IRQHandler(&huart6);
#endif
#if (HO01R1 || HO02R0 || HO01R3 || HO02R2)
	HAL_UART_IRQHandler(&huart7);
#endif
#if (HO01R1 || HO02R0 || PO01R0 || PO02R0 || HO01R3 || HO02R2)
	HAL_UART_IRQHandler(&huart8);
#endif
	
	/* If lHigherPriorityTaskWoken is now equal to pdTRUE, then a context
	switch should be performed before the interrupt exists.  That ensures the
	unblocked (higher priority) task is returned to immediately. */
	portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );
	
}
/**
* @brief This function handles USART1 global interrupt.
*/
void USART1_IRQHandler(void)
{
  /* USER CODE BEGIN USART1_IRQn 0 */

  /* USER CODE END USART1_IRQn 0 */
  HAL_UART_IRQHandler(&huart1);
  /* USER CODE BEGIN USART1_IRQn 1 */
HAL_GPIO_WritePin( GPIOG, GPIO_PIN_13, GPIO_PIN_SET);
	for(uint32_t i=0;i<100000;i++){}
HAL_GPIO_WritePin( GPIOG, GPIO_PIN_13, GPIO_PIN_RESET);
//	 HAL_UART_Receive_IT(&huart1, receiveBuffer, 1);
  /* USER CODE END USART1_IRQn 1 */
}
Exemplo n.º 13
0
/**
  * @brief  This function handles UART interrupt request.
  * @param  None
  * @retval None
  */
void USART1_IRQHandler(void)
{
  /* Check if it's a RX interrupt */
  uint32_t tmp_flag = 0, tmp_it_source = 0;
  tmp_flag = __HAL_UART_GET_FLAG(&UART_Handle, UART_FLAG_RXNE);
  tmp_it_source = __HAL_UART_GET_IT_SOURCE(&UART_Handle, UART_IT_RXNE);
  if ((tmp_flag != RESET) && (tmp_it_source != RESET))
  {
    UART1_DataReceivedHandler();
  }
  /* Otherwise call the HAL IRQ handler */
  else
    HAL_UART_IRQHandler(&UART_Handle);
}
Exemplo n.º 14
0
/**
* @brief This function handles USART2 global interrupt.
*/
void USART2_IRQHandler(void)
{
  /* USER CODE BEGIN USART2_IRQn 0 */
#if 1
    if(__HAL_UART_GET_FLAG(&huart2, UART_FLAG_IDLE) && __HAL_UART_GET_IT_SOURCE(&huart2, UART_IT_IDLE))
    {
        __HAL_UART_CLEAR_IDLEFLAG(&huart2);
        ESP8266_RecvCallback(RECV_IDLE);
    }
#else
  /* USER CODE END USART2_IRQn 0 */
  HAL_UART_IRQHandler(&huart2);
  /* USER CODE BEGIN USART2_IRQn 1 */
#endif
  /* USER CODE END USART2_IRQn 1 */
}
Exemplo n.º 15
0
/**
* @brief This function handles USART1 global interrupt / USART1 wake-up interrupt through EXTI line 25.
*/
void USART1_IRQHandler(void)
{
  /* USER CODE BEGIN USART1_IRQn 0 */
  if(__HAL_UART_GET_IT_SOURCE(&huart1, UART_IT_RXNE)!= RESET) 
	{
		prvvUARTRxISR();
	}
	if(__HAL_UART_GET_IT_SOURCE(&huart1, UART_IT_TXE)!= RESET) 
	{
		prvvUARTTxReadyISR();
	}
  /* USER CODE END USART1_IRQn 0 */
  HAL_UART_IRQHandler(&huart1);
  /* USER CODE BEGIN USART1_IRQn 1 */

  /* USER CODE END USART1_IRQn 1 */
}
Exemplo n.º 16
0
//void TIM4_IRQHandler( void )
//void I2C1_EV_IRQHandler( void )
//void I2C1_ER_IRQHandler( void )
//void I2C2_EV_IRQHandler( void )
//void I2C2_ER_IRQHandler( void )
//void SPI1_IRQHandler( void )
//void SPI2_IRQHandler( void )
void USART1_IRQHandler( void )
{
#if defined(KS_HW_UART_HAL_LIBRARY)
  HAL_UART_IRQHandler(hSerial.handle);

#else
  if (__HAL_UART_GET_IT_SOURCE(hSerial.handle, UART_IT_TXE) != RESET) {
    __HAL_UART_GET_IT_SOURCE(hSerial.handle, UART_IT_TXE);
    HAL_UART_TxCpltCallback(hSerial.handle);
  }
  if (__HAL_UART_GET_IT_SOURCE(hSerial.handle, UART_IT_RXNE) != RESET) {
    __HAL_UART_GET_IT_SOURCE(hSerial.handle, UART_IT_RXNE);
    HAL_UART_RxCpltCallback(hSerial.handle);
  }

#endif
}
/**
* @brief This function handles USART1 global interrupt.
*/
void USART1_IRQHandler(void)
{
  /* USER CODE BEGIN USART1_IRQn 0 */
	uint32_t tmp1, tmp2;
  tmp1 = __HAL_UART_GET_FLAG(&huart1, UART_FLAG_IDLE);
  tmp2 = __HAL_UART_GET_IT_SOURCE(&huart1, UART_IT_IDLE);

  if((tmp1 != RESET) && (tmp2 != RESET))
  {
		__HAL_UART_DISABLE_IT(&huart1, UART_IT_IDLE);
    __HAL_UART_CLEAR_IDLEFLAG(&huart1);
    My_HAL_UART_IdleCallback(&huart1);
  }

  /* USER CODE END USART1_IRQn 0 */
  HAL_UART_IRQHandler(&huart1);
  /* USER CODE BEGIN USART1_IRQn 1 */

  /* USER CODE END USART1_IRQn 1 */
}
Exemplo n.º 18
0
/**
* @brief This function handles USART2 global interrupt.
*/
void USART2_IRQHandler(void)
{
  /* USER CODE BEGIN USART2_IRQn 0 */
	uint32_t tmp_flag = 0;
	
	tmp_flag = __HAL_UART_GET_FLAG(&huart2,UART_FLAG_IDLE);
	if((tmp_flag != RESET))
  {
		__HAL_UART_CLEAR_IDLEFLAG(&huart2);
		huart2.Instance->ISR;           //读取寄存器,清理相应标志位
		huart2.Instance->TDR; 			     //读取寄存器,清理相应标志位
		HAL_UART_DMAStop(&huart2);
		dma_state = HAL_UART_Receive_DMA(&huart2,uart2_recv_buf,BUFFER_SIZE);
	}
  /* USER CODE END USART2_IRQn 0 */
  HAL_UART_IRQHandler(&huart2);
  /* USER CODE BEGIN USART2_IRQn 1 */

  /* USER CODE END USART2_IRQn 1 */
}
Exemplo n.º 19
0
/**
 * The asynchronous TX and RX handler.
 *
 * @param obj The serial object
 * @return Returns event flags if a TX/RX transfer termination condition was met or 0 otherwise
 */
int serial_irq_handler_asynch(serial_t *obj)
{
    struct serial_s *obj_s = SERIAL_S(obj);
    UART_HandleTypeDef *huart = &uart_handlers[obj_s->index];
    
    volatile int return_event = 0;
    uint8_t *buf = (uint8_t*)(obj->rx_buff.buffer);
    uint8_t i = 0;
    
    // TX PART:
    if (__HAL_UART_GET_FLAG(huart, UART_FLAG_TC) != RESET) {
        if (__HAL_UART_GET_IT_SOURCE(huart, UART_IT_TC) != RESET) {
            // Return event SERIAL_EVENT_TX_COMPLETE if requested
            if ((obj_s->events & SERIAL_EVENT_TX_COMPLETE ) != 0) {
                return_event |= (SERIAL_EVENT_TX_COMPLETE & obj_s->events);
            }
        }
    }
    
    // Handle error events
    if (__HAL_UART_GET_FLAG(huart, UART_FLAG_PE) != RESET) {
        if (__HAL_UART_GET_IT_SOURCE(huart, USART_IT_ERR) != RESET) {
            return_event |= (SERIAL_EVENT_RX_PARITY_ERROR & obj_s->events);
        }
    }
    
    if (__HAL_UART_GET_FLAG(huart, UART_FLAG_FE) != RESET) {
        if (__HAL_UART_GET_IT_SOURCE(huart, USART_IT_ERR) != RESET) {
            return_event |= (SERIAL_EVENT_RX_FRAMING_ERROR & obj_s->events);
        }
    }
    
    if (__HAL_UART_GET_FLAG(huart, UART_FLAG_ORE) != RESET) {
        if (__HAL_UART_GET_IT_SOURCE(huart, USART_IT_ERR) != RESET) {
            return_event |= (SERIAL_EVENT_RX_OVERRUN_ERROR & obj_s->events);
        }
    }
    
    HAL_UART_IRQHandler(huart);
    
    // Abort if an error occurs
    if (return_event & SERIAL_EVENT_RX_PARITY_ERROR ||
            return_event & SERIAL_EVENT_RX_FRAMING_ERROR ||
            return_event & SERIAL_EVENT_RX_OVERRUN_ERROR) {
        return return_event;
    }
    
    //RX PART
    if (huart->RxXferSize != 0) {
        obj->rx_buff.pos = huart->RxXferSize - huart->RxXferCount;
    }
    if ((huart->RxXferCount == 0) && (obj->rx_buff.pos >= (obj->rx_buff.length - 1))) {
        return_event |= (SERIAL_EVENT_RX_COMPLETE & obj_s->events);
    }
    
    // Check if char_match is present
    if (obj_s->events & SERIAL_EVENT_RX_CHARACTER_MATCH) {
        if (buf != NULL) {
            for (i = 0; i < obj->rx_buff.pos; i++) {
                if (buf[i] == obj->char_match) {
                    obj->rx_buff.pos = i;
                    return_event |= (SERIAL_EVENT_RX_CHARACTER_MATCH & obj_s->events);
                    serial_rx_abort_asynch(obj);
                    break;
                }
            }
        }
    }
    
    return return_event;  
}
Exemplo n.º 20
0
void Uart::IRQ()
{

	 HAL_UART_IRQHandler(& m_huart);
	//__HAL_UART_CLEAR_FLAG(& m_huart,UART_FLAG_RXNE);
}
Exemplo n.º 21
0
void USART2_IRQHandler(void)
{
	HAL_UART_IRQHandler(&Serial2);
}
Exemplo n.º 22
0
void USART3_IRQHandler(void)
{
	HAL_UART_IRQHandler(&Serial3);
}
Exemplo n.º 23
0
void USART2_IRQHandler(void) {

	HAL_UART_IRQHandler(&UartHandle_DBG);
}
Exemplo n.º 24
0
/**
  * @brief  This function handles UART2 interrupt request.  
  * @param  None
  * @retval None
  * @Note   This function is redefined in "main.h" and related to DMA 
  *         used for USART data transmission     
  */
void USART2_IRQHandler(void)
{
  HAL_UART_IRQHandler(&UartHandle[USART2_INDEX]);
}
Exemplo n.º 25
0
/** @brief USART3  RX / TX / ERROR interrupt */
extern "C" void USART3_IRQHandler(void)
{
  HAL_UART_IRQHandler(&uart::huart);
}
Exemplo n.º 26
0
void USARTx_PRINT_IRQHandler(void)
{
   HAL_UART_IRQHandler(UartMsgHandle);
}
Exemplo n.º 27
0
/** The asynchronous TX and RX handler.
 *
 * @param obj The serial object
 * @return Returns event flags if a TX/RX transfer termination condition was met or 0 otherwise
 */
int serial_irq_handler_asynch(serial_t *obj)
{
    volatile int return_event = 0;
    uint8_t *buf = (uint8_t*)obj->rx_buff.buffer;
    uint8_t i = 0;

  // Irq handler is common to Tx and Rx
    UartHandle.Instance = (USART_TypeDef *)(SERIAL_OBJ(uart));
#if DEVICE_SERIAL_ASYNCH_DMA
    if ((UartHandle.Instance->CR3 & USART_CR3_DMAT) !=0) {
        // call dma tx interrupt
        HAL_DMA_IRQHandler(UartHandle.hdmatx);
    }
    if ((UartHandle.Instance->CR3 & USART_CR3_DMAR) !=0) {
        // call dma rx interrupt
        HAL_DMA_IRQHandler(UartHandle.hdmarx);
    }
#endif
    HAL_UART_IRQHandler(&UartHandle);
  // TX PART:
    if (__HAL_UART_GET_FLAG(&UartHandle, UART_FLAG_TC) != RESET) {
        __HAL_UART_CLEAR_FLAG(&UartHandle, UART_FLAG_TC);
        // return event SERIAL_EVENT_TX_COMPLETE if requested
        if ((SERIAL_OBJ(events) & SERIAL_EVENT_TX_COMPLETE ) != 0){
            return_event |= SERIAL_EVENT_TX_COMPLETE & obj->serial.events;
        }
    }
    // handle error events:
    if (__HAL_UART_GET_FLAG(&UartHandle, HAL_UART_ERROR_PE)) {
        __HAL_UART_CLEAR_FLAG(&UartHandle, HAL_UART_ERROR_PE);
        return_event |= SERIAL_EVENT_RX_PARITY_ERROR & obj->serial.events;
    }
    if (__HAL_UART_GET_FLAG(&UartHandle, HAL_UART_ERROR_NE)||(UartHandle.ErrorCode & HAL_UART_ERROR_NE)!=0) {
      __HAL_UART_CLEAR_FLAG(&UartHandle, HAL_UART_ERROR_NE);
      // not supported by mbed
    }
    if (__HAL_UART_GET_FLAG(&UartHandle, HAL_UART_ERROR_FE)||(UartHandle.ErrorCode & HAL_UART_ERROR_FE)!=0) {
      __HAL_UART_CLEAR_FLAG(&UartHandle, HAL_UART_ERROR_FE);
        return_event |= SERIAL_EVENT_RX_FRAMING_ERROR & obj->serial.events;
    }
    if (__HAL_UART_GET_FLAG(&UartHandle, HAL_UART_ERROR_ORE)||(UartHandle.ErrorCode & HAL_UART_ERROR_ORE)!=0) {
      __HAL_UART_CLEAR_FLAG(&UartHandle, HAL_UART_ERROR_ORE);
        return_event |= SERIAL_EVENT_RX_OVERRUN_ERROR & obj->serial.events;
    }

    //RX PART
    // increment rx_buff.pos
    if (UartHandle.RxXferSize !=0) { 
        obj->rx_buff.pos = UartHandle.RxXferSize - UartHandle.RxXferCount;
    }
    if ((UartHandle.RxXferCount==0)&&(obj->rx_buff.pos >= (obj->rx_buff.length - 1))) {
        return_event |= SERIAL_EVENT_RX_COMPLETE & obj->serial.events;
    }
    // Chek if Char_match is present
    if (SERIAL_OBJ(events) & SERIAL_EVENT_RX_CHARACTER_MATCH) {
      if (buf != NULL){
        while((buf[i] != obj->char_match)&&(i<UartHandle.RxXferSize)){//for (i=0;i<UartHandle.RxXferSize;i++){
          i++;//if (buf[i] == obj->char_match{
          //}
        }
        if (i<UartHandle.RxXferSize){
            obj->rx_buff.pos = i;
            return_event |= SERIAL_EVENT_RX_CHARACTER_MATCH & obj->serial.events;
        }
      }
    }
    return return_event;  
}
Exemplo n.º 28
0
void USART1_IRQHandler(void)
{
	HAL_UART_IRQHandler(&Serial1);
}
Exemplo n.º 29
0
/**
  * @brief  This function handles UART interrupt request.  
  * @param  None
  * @retval None
  */
void USARTx_IRQHandler(void)
{
  HAL_UART_IRQHandler(&UartHandle);
}
Exemplo n.º 30
0
//======================================================================================
void USART6_IRQHandler(void){
	
	HAL_UART_IRQHandler(&USART6_handle);
}