518
Chapter 14
FCAN Interface Function
Preliminary User’s Manual U15839EE1V0UM00
Example for C routine:
int CAN_ModuleInit (unsigned char
module_no,
unsigned short brp_value,
unsigned short sync_value)
{
can_module_type *can_mod_ptr;
// define ptr
can_mod_ptr = &can_module[module_no];
// load ptr
can_mod_ptr->CxCTRL
= 0x00FE;
// clear CxCTRL
// except INIT
can_mod_ptr->CxDEF
= 0x00FF;
// clear CxDEF
can_mod_ptr->CxIE
= 0x00FF;
// clear CxIE
can_mod_ptr->CxBRP
= brp_value;
// set CxBRP
can_mod_ptr->CxSYNC
= sync_value;
// set CxSYNC
can_mod_ptr->mask0_low
= 0x0000;
// clear mask0
can_mod_ptr->mask0_high
= 0x0000;
can_mod_ptr->mask1_low
= 0x0000;
// clear mask1
can_mod_ptr->mask1_high
= 0x0000;
can_mod_ptr->mask2_low
= 0x0000;
// clear mask2
can_mod_ptr->mask2_high
= 0x0000;
can_mod_ptr->mask3_low
= 0x0000;
// clear mask3
can_mod_ptr->CxCTRL
= 0x0001;
// clear INIT flag
return 0;
}
Summary of Contents for mPD703128
Page 6: ...6 Preliminary User s Manual U15839EE1V0UM00 ...
Page 20: ...20 Preliminary User s Manual U15839EE1V0UM00 ...
Page 32: ...32 Preliminary User s Manual U15839EE1V0UM00 MEMO ...
Page 154: ...154 Preliminary User s Manual U15839EE1V0UM00 MEMO ...
Page 238: ...238 Preliminary User s Manual U15839EE1V0UM00 MEMO ...
Page 356: ...356 Preliminary User s Manual U15839EE1V0UM00 MEMO ...
Page 522: ...522 Preliminary User s Manual U15839EE1V0UM00 MEMO ...
Page 600: ...600 Preliminary User s Manual U15839EE1V0UM00 MEMO ...
Page 610: ...610 Preliminary User s Manual U15839EE1V0UM00 ...
Page 612: ......