/* Reset CAN hardware (reset message objects and clear interrupts).  */
void CANx_HW_Reset(uint8_t x)
/* Reset CAN hardware (reset message objects and clear interrupts).  */
void CANx_HW_Reset(uint8_t x)
{
    while ((ptr_CAN->IF1_CMDREQ & IF_CMDREQ_BUSY_Msk) != 0U);
    ptr_CAN->IF1_CMDMSK_W = IF_CMDMSK_ARB_Msk | IF_CMDMSK_WR_RD_Msk;
    ptr_CAN->IF1_ARB2     = 0U;
    ptr_CAN->IF1_CMDREQ   = obj + 1U;
    while ((ptr_CAN->IF1_CMDREQ & IF_CMDREQ_BUSY_Msk) != 0U);
    ptr_CAN->IF1_CMDMSK_R = IF_CMDMSK_CLRINTPND_Msk;
    ptr_CAN->IF1_CMDREQ   = obj + 1U;
    while ((ptr_CAN->IF1_CMDREQ & IF_CMDREQ_BUSY_Msk) != 0U);
    can_obj_cfg[x][obj]    = ARM_CAN_OBJ_INACTIVE;
  }
  ptr_CAN->STAT = 0U;
}