Usercanint - ICP DAS USA mPAC-7186EXD-CAN User Manual

Table of Contents

Advertisement

3.1.21

UserCANInt

Description:
This function is created by users and is used to program the CAN
interrupt service routine by users. The parameter CANINT is passed
automatically when the interrupt functions are triggered. It indicates
what kinds of CAN controller interrupt are active. Therefore, users only
need to design their interrupt routine according to dealing with different
interrupt functions. If it is not used, please reverse this function in the
users' .C file for avoiding the complier error. The following figure is the
general concept of the function UserCANInt.
pr ogr am r unni ng
sequence
When i nt errupt s are
triggered, the interrupt
routine w ill be inplem ented
...
C A N _C onfig(& C onfigInfo);
...
...
C A N _R estore();
m ain program
Syntax:
void UserCANInt(char CANInt)
Parameter:
 CANInt:
parameter to users to indicate what interrupt is triggered. For the
meanings of CANInt parameters, please refer to the following table.
CANIntMode Value (Hex)
0x01
0x02
0x04
0x08
I-7188XBD-CAN/μPAC-7186EXD-CAN user manual (ver.1.0.3, May/09/2014)
...
U serC A N Int(C A N Int);
...
interrupt routine
U se sw itch function or other
m ethods to design the action
based on different types of
interrupt.
The interrupt service routine will bypass the CANInt
Receive a message successfully
Transmit a message successfully
The types of interrupt
function are passed into the
function U serInterrupt
void U serC A N Int(char C A N Int)
{
...
sw itch (C A N Int)
{
...
}
...
}
user-defined function
Meaning
Error warring
Data Overrun
45

Advertisement

Table of Contents
loading

This manual is also suitable for:

I-7188xbd-can

Table of Contents