AN1105 STMicroelectronics, AN1105 Datasheet - Page 15

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
2 CAN DRIVER
To quickly start developing your own CAN applications using the ST7 pCAN peripheral, STMi-
croelectronics provides you with a driver. The source code (can.h and can.c) is given as an ex-
ample, and can therefore be used as provided or be modified to fit specific needs.
There are two customization files which make the driver’s functionality flexible and able to
meet a wide range of needs.
The entire processing is interrupt driven, so no polling is required. The application is notified of
CAN events through function calls from the interrupt routine.
To immediately use the driver, without modifying its structure, see
CAN Driver: A Demo
The following sections will explain the details of the driver architecture and describe all the
functions and data types implemented in the software.
2.1 USER INTERFACE
2.1.1 Files Furnished
The driver consists of five files:
– can.c. Driver function definitions and internal data types. This file may not be modified.
– can.h. Header file of can.c. This file may not be modified.
– can_hr.h. Hardware description (register mapping of the ST7 MCU memory space). This file
– can_custom.c. Frames of customization functions. They are called (some optionally) by the
– can_custom.h. Contains a pre-processor directive list ( #define types) which allows user
2.1.2 Architecture
The cell is statically configured with one transmission buffer and two reception buffers, which
reduces the need for processor responsiveness in reception.
For the same purpose, a 3-message deep transmission FIFO is implemented. It is not acces-
sible by the user, and is automatically managed by the software.
The entire processing is interrupt driven. The user can choose which interrupts are to be taken
into account and which are not, due to the compilation options in can_custom.h. Some inter-
rupts request an immediate answer from the application, e.g. a reception event. To avoid
having the user modify the interrupt routine (in can.c), the routine calls one of the notification
is hardware dependent and must not be modified.
driver to notify the application of events when some user-specific processing is required (for
example on reception of data). This file has to be completed by the user.
customizations to be taken into account at compilation time. This file has to be modified by
the user.
Application".
ST7 pCAN PERIPHERAL DRIVER
Section 2.2 "How to Use the
15/100

Related parts for AN1105