516
Chapter 14
FCAN Interface Function
Preliminary User’s Manual U15839EE1V0UM00
Example for C routine:
int CAN_GlobalInit (void)
{
unsigned char i;
// if GOM flag is already set
if(CGST & 0x01)
{
// disable all CAN modules
for(i=0; i <= CAN_MODULES; i++)
CAN_ModuleStop(i);
// clear GOM flag
CGST = 0x0001;
}
CGST
= 0x00FF;
// clear all flags of CGST
CGIE
= 0x00FF;
// disable global interrupts
CGCS
= 0x0000;
// define internal clock
CGTSC
= 0x0000;
// clear CAN global time system counter
CGTEN
= 0x0000;
// disable all timer events
// clear all message buffers
for (i=0; i<CAN_MESSAGES; i++)
CAN_ClearMessage(i);
// set GOM bit
CGST = 0x0100;
return 0;
}
Содержание mPD703128
Страница 6: ...6 Preliminary User s Manual U15839EE1V0UM00 ...
Страница 20: ...20 Preliminary User s Manual U15839EE1V0UM00 ...
Страница 32: ...32 Preliminary User s Manual U15839EE1V0UM00 MEMO ...
Страница 154: ...154 Preliminary User s Manual U15839EE1V0UM00 MEMO ...
Страница 238: ...238 Preliminary User s Manual U15839EE1V0UM00 MEMO ...
Страница 356: ...356 Preliminary User s Manual U15839EE1V0UM00 MEMO ...
Страница 522: ...522 Preliminary User s Manual U15839EE1V0UM00 MEMO ...
Страница 600: ...600 Preliminary User s Manual U15839EE1V0UM00 MEMO ...
Страница 610: ...610 Preliminary User s Manual U15839EE1V0UM00 ...
Страница 612: ......