libraries/mbed/targets/cmsis/TARGET_STM/TARGET_NUCLEO_F103RB/stm32f10x_can.c
/**
  * @brief  Clears the CANx's interrupt pending bits.
  * @param  CANx:    where x can be 1 or 2 to to select the CAN peripheral.
  * @param  CAN_IT: specifies the interrupt pending bit to clear.
  *                  -  CAN_IT_TME                     
  *                  -  CAN_IT_FF0               
  *                  -  CAN_IT_FOV0                     
  *                  -  CAN_IT_FF1               
  *                  -  CAN_IT_FOV1              
  *                  -  CAN_IT_WKU  
  *                  -  CAN_IT_SLK  
  *                  -  CAN_IT_EWG    
  *                  -  CAN_IT_EPV    
  *                  -  CAN_IT_BOF    
  *                  -  CAN_IT_LEC    
  *                  -  CAN_IT_ERR 
  * @retval None.
  */
@brief  Clears the CANx's interrupt pending bits.
@param  CANx:    where x can be 1 or 2 to to select the CAN peripheral.
@param  CAN_IT: specifies the interrupt pending bit to clear.
@brief Clears the CANx ' s interrupt pending bits . @param CANx : where x can be 1 or 2 to to select the CAN peripheral . @param CAN_IT : specifies the interrupt pending bit to clear .
void CAN_ClearITPendingBit(CAN_TypeDef* CANx, uint32_t CAN_IT)
{
  assert_param(IS_CAN_ALL_PERIPH(CANx));
  assert_param(IS_CAN_CLEAR_IT(CAN_IT));
  switch (CAN_IT)
  {
      case CAN_IT_TME:
	      CANx->TSR = CAN_TSR_RQCP0|CAN_TSR_RQCP1|CAN_TSR_RQCP2;  
	      break;
      case CAN_IT_FF0:
	      CANx->RF0R = CAN_RF0R_FULL0; 
	      break;
      case CAN_IT_FOV0:
	      CANx->RF0R = CAN_RF0R_FOVR0; 
	      break;
      case CAN_IT_FF1:
	      CANx->RF1R = CAN_RF1R_FULL1;  
	      break;
      case CAN_IT_FOV1:
	      CANx->RF1R = CAN_RF1R_FOVR1; 
	      break;
      case CAN_IT_WKU:
	      CANx->MSR = CAN_MSR_WKUI;  
	      break;
      case CAN_IT_SLK:
	      CANx->MSR = CAN_MSR_SLAKI;   
	      break;
      case CAN_IT_EWG:
	      CANx->MSR = CAN_MSR_ERRI;
	      break;
      case CAN_IT_EPV:
	      CANx->MSR = CAN_MSR_ERRI; 
	      break;
      case CAN_IT_BOF:
	      CANx->MSR = CAN_MSR_ERRI; 
	      break;
      case CAN_IT_LEC:
	      CANx->ESR = RESET; 
	      CANx->MSR = CAN_MSR_ERRI; 
	      break;
      case CAN_IT_ERR:
	      CANx->ESR = RESET; 
	      CANx->MSR = CAN_MSR_ERRI; 
	      break;
      default :
	      break;
   }
}
void CAN_ClearITPendingBit ( CAN_TypeDef * CANx , uint32_t CAN_IT ) { assert_param ( IS_CAN_ALL_PERIPH ( CANx ) ) ; assert_param ( IS_CAN_CLEAR_IT ( CAN_IT ) ) ; switch ( CAN_IT ) { case CAN_IT_TME : CANx -> TSR = CAN_TSR_RQCP0 | CAN_TSR_RQCP1 | CAN_TSR_RQCP2 ; break ; case CAN_IT_FF0 : CANx -> RF0R = CAN_RF0R_FULL0 ; break ; case CAN_IT_FOV0 : CANx -> RF0R = CAN_RF0R_FOVR0 ; break ; case CAN_IT_FF1 : CANx -> RF1R = CAN_RF1R_FULL1 ; break ; case CAN_IT_FOV1 : CANx -> RF1R = CAN_RF1R_FOVR1 ; break ; case CAN_IT_WKU : CANx -> MSR = CAN_MSR_WKUI ; break ; case CAN_IT_SLK : CANx -> MSR = CAN_MSR_SLAKI ; break ; case CAN_IT_EWG : CANx -> MSR = CAN_MSR_ERRI ; break ; case CAN_IT_EPV : CANx -> MSR = CAN_MSR_ERRI ; break ; case CAN_IT_BOF : CANx -> MSR = CAN_MSR_ERRI ; break ; case CAN_IT_LEC : CANx -> ESR = RESET ; CANx -> MSR = CAN_MSR_ERRI ; break ; case CAN_IT_ERR : CANx -> ESR = RESET ; CANx -> MSR = CAN_MSR_ERRI ; break ; default : break ; } }
@brief  Clears the CANx's interrupt pending bits.
@brief Clears the CANx ' s interrupt pending bits .
/* Check the parameters */ /* Clear CAN_TSR_RQCPx (rc_w1)*/ /* Clear CAN_RF0R_FULL0 (rc_w1)*/ /* Clear CAN_RF0R_FOVR0 (rc_w1)*/ /* Clear CAN_RF1R_FULL1 (rc_w1)*/ /* Clear CAN_RF1R_FOVR1 (rc_w1)*/ /* Clear CAN_MSR_WKUI (rc_w1)*/ /* Clear CAN_MSR_SLAKI (rc_w1)*/ /* Clear CAN_MSR_ERRI (rc_w1) */ /* Note : the corresponding Flag is cleared by hardware depending 
                        of the CAN Bus status*/ /* Clear CAN_MSR_ERRI (rc_w1) */ /* Note : the corresponding Flag is cleared by hardware depending 
                        of the CAN Bus status*/ /* Clear CAN_MSR_ERRI (rc_w1) */ /* Note : the corresponding Flag is cleared by hardware depending 
                        of the CAN Bus status*/ /*  Clear LEC bits */ /* Clear CAN_MSR_ERRI (rc_w1) */ /*Clear LEC bits */ /* Clear CAN_MSR_ERRI (rc_w1) */ /* Note : BOFF, EPVF and EWGF Flags are cleared by hardware depending 
                  of the CAN Bus status*/