libraries/mbed/targets/cmsis/TARGET_STM/TARGET_NUCLEO_F103RB/stm32f10x_can.c
/**
  * @brief  Returns the CANx Receive Error Counter (REC).
  * @note   In case of an error during reception, this counter is incremented 
  *         by 1 or by 8 depending on the error condition as defined by the CAN 
  *         standard. After every successful reception, the counter is 
  *         decremented by 1 or reset to 120 if its value was higher than 128. 
  *         When the counter value exceeds 127, the CAN controller enters the 
  *         error passive state.  
  * @param  CANx: where x can be 1 or 2 to to select the CAN peripheral.  
  * @retval CAN Receive Error Counter. 
  */
@brief  Returns the CANx Receive Error Counter (REC).
@note   In case of an error during reception, this counter is incremented
by 1 or by 8 depending on the error condition as defined by the CAN
standard. After every successful reception, the counter is
decremented by 1 or reset to 120 if its value was higher than 128.
When the counter value exceeds 127, the CAN controller enters the
error passive state.
@param  CANx: where x can be 1 or 2 to to select the CAN peripheral.
@retval CAN Receive Error Counter.
@brief Returns the CANx Receive Error Counter ( REC ) . @note In case of an error during reception this counter is incremented by 1 or by 8 depending on the error condition as defined by the CAN standard . After every successful reception the counter is decremented by 1 or reset to 120 if its value was higher than 128 . When the counter value exceeds 127 the CAN controller enters the error passive state . @param CANx : where x can be 1 or 2 to to select the CAN peripheral . @retval CAN Receive Error Counter .
uint8_t CAN_GetReceiveErrorCounter(CAN_TypeDef* CANx)
{
  uint8_t counter=0;
  assert_param(IS_CAN_ALL_PERIPH(CANx));
  counter = (uint8_t)((CANx->ESR & CAN_ESR_REC)>> 24);
  return counter;
}
uint8_t CAN_GetReceiveErrorCounter ( CAN_TypeDef * CANx ) { uint8_t counter = 0 ; assert_param ( IS_CAN_ALL_PERIPH ( CANx ) ) ; counter = ( uint8_t ) ( ( CANx -> ESR & CAN_ESR_REC ) >> 24 ) ; return counter ; }
@brief  Returns the CANx Receive Error Counter (REC).
@brief Returns the CANx Receive Error Counter ( REC ) .
/* Check the parameters */ /* Get the Receive Error Counter*/ /* Return the Receive Error Counter*/