AN1105 STMicroelectronics, AN1105 Datasheet - Page 44

no-image

AN1105

Manufacturer Part Number
AN1105
Description
ST7 PCAN PERIPHERAL DRIVER
Manufacturer
STMicroelectronics
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
AN1105W-12-RR
Quantity:
13 804
Part Number:
AN1105W-22-RR
Manufacturer:
SANYO
Quantity:
8 570
Part Number:
AN1105W-TR
Manufacturer:
PANASONIC
Quantity:
27 995
Part Number:
AN1105W-TR
Manufacturer:
STANLEY
Quantity:
20 000
ST7 pCAN PERIPHERAL DRIVER
typedef enum {CAN_FILTER_MATCH,CAN_FILTER_NO_MATCH}CAN_Filter_Status;
Return values of the software filtering routine.
typedef enum {ITERR,ITRECEPT,ITTRANSMIT,ITSCIF}IT_Type;
Return values of the routine that determines which IT has to be processed first.
typedef enum
{CAN_CLEAN_FATAL,CAN_CLEAN_SUCCESS,CAN_CLEAN_FAILURE}CAN_Clean_Error;
Return values of the Cleaning function.
3.2.1.4 Status Counter
static u8 status_counter=0;
This is a variable used by the Sleep function to determine the state of the reception and trans-
mission registers. It is updated the following way:
– +1, when a reception IT is taken into account
– -1, when a reception buffer is released
– +1, when a message is put into the transmission queue
– -1, when a message is sent (in the IT function)
When the CAN_Sleep function is called, a simple test of this variable lets the driver know if
there are still pending jobs and if the Sleep operation must be cancelled.
3.2.2 Internal Routines
3.2.2.1 Static CAN_Filter_Status CAN_Filter(u16 ident_code)
Performs a classical dichotomy algorithm and compares the value given as parameter with the
contents of the i_filters array
44/100
INPUT
OUTPUT
DESCRIPTION
COMMENTS
CAN message identifier
Error status
Tests matching of IDs of received messages and software filters.
Possible returned status: CAN_FILTER_MATCH and CAN_FILTER_NO_MATCH
Called by CAN_Receive
Compiled only if FILTERS_ENABLED is set.
Priority is given here to SPEED, that’s why the code may look strange.
.

Related parts for AN1105