libraries/mbed/targets/cmsis/TARGET_STM/TARGET_NUCLEO_F103RB/stm32f10x_can.c
/**
  * @brief  Returns the CANx's last error code (LEC).
  * @param  CANx:          where x can be 1 or 2 to to select the CAN peripheral.  
  * @retval CAN_ErrorCode: specifies the Error code : 
  *                        - CAN_ERRORCODE_NoErr            No Error  
  *                        - CAN_ERRORCODE_StuffErr         Stuff Error
  *                        - CAN_ERRORCODE_FormErr          Form Error
  *                        - CAN_ERRORCODE_ACKErr           Acknowledgment Error
  *                        - CAN_ERRORCODE_BitRecessiveErr  Bit Recessive Error
  *                        - CAN_ERRORCODE_BitDominantErr   Bit Dominant Error
  *                        - CAN_ERRORCODE_CRCErr           CRC Error
  *                        - CAN_ERRORCODE_SoftwareSetErr   Software Set Error  
  */
@brief  Returns the CANx's last error code (LEC).
@param  CANx:          where x can be 1 or 2 to to select the CAN peripheral.
@brief Returns the CANx ' s last error code ( LEC ) . @param CANx : where x can be 1 or 2 to to select the CAN peripheral .
uint8_t CAN_GetLastErrorCode(CAN_TypeDef* CANx)
{
  uint8_t errorcode=0;
  assert_param(IS_CAN_ALL_PERIPH(CANx));
  errorcode = (((uint8_t)CANx->ESR) & (uint8_t)CAN_ESR_LEC);
  return errorcode;
}
uint8_t CAN_GetLastErrorCode ( CAN_TypeDef * CANx ) { uint8_t errorcode = 0 ; assert_param ( IS_CAN_ALL_PERIPH ( CANx ) ) ; errorcode = ( ( ( uint8_t ) CANx -> ESR ) & ( uint8_t ) CAN_ESR_LEC ) ; return errorcode ; }
@brief  Returns the CANx's last error code (LEC).
@brief Returns the CANx ' s last error code ( LEC ) .
/* Check the parameters */ /* Get the error code*/ /* Return the error code*/