keil_examples/CANACT/can.c
/******************************************************************************
** Function name:		CAN_SetACCF
**
** Descriptions:		Set acceptance filter and SRAM associated with	
**
** parameters:			ACMF mode
** Returned value:		None
**
** 
******************************************************************************/
Function name:         CAN_SetACCF
Descriptions:          Set acceptance filter and SRAM associated with

ACMF mode
Returned value:                None
Function name : CAN_SetACCF Descriptions : Set acceptance filter and SRAM associated with ACMF mode Returned value : None
void CAN_SetACCF( uint32_t ACCFMode )
{
  switch ( ACCFMode )
  {
	case ACCF_OFF:
	  LPC_CANAF->AFMR = ACCFMode;
	  LPC_CAN1->MOD = LPC_CAN2->MOD = 1;	
	  LPC_CAN1->IER = LPC_CAN2->IER = 0;	
	  LPC_CAN1->GSR = LPC_CAN2->GSR = 0;	
	break;
	case ACCF_BYPASS:
	  LPC_CANAF->AFMR = ACCFMode;
	break;
	case ACCF_ON:
	case ACCF_FULLCAN:
	  LPC_CANAF->AFMR = ACCF_OFF;
	  CAN_SetACCF_Lookup();
	  LPC_CANAF->AFMR = ACCFMode;
	break;
	default:
	break;
  }
  return;
}
void CAN_SetACCF ( uint32_t ACCFMode ) { switch ( ACCFMode ) { case ACCF_OFF : LPC_CANAF -> AFMR = ACCFMode ; LPC_CAN1 -> MOD = LPC_CAN2 -> MOD = 1 ; LPC_CAN1 -> IER = LPC_CAN2 -> IER = 0 ; LPC_CAN1 -> GSR = LPC_CAN2 -> GSR = 0 ; break ; case ACCF_BYPASS : LPC_CANAF -> AFMR = ACCFMode ; break ; case ACCF_ON : case ACCF_FULLCAN : LPC_CANAF -> AFMR = ACCF_OFF ; CAN_SetACCF_Lookup ( ) ; LPC_CANAF -> AFMR = ACCFMode ; break ; default : break ; } return ; }
Function name:         CAN_SetACCF
Descriptions:          Set acceptance filter and SRAM associated with
Function name : CAN_SetACCF Descriptions : Set acceptance filter and SRAM associated with
// Reset CAN // Disable Receive Interrupt // Reset error counter when CANxMOD is in reset