Moteur de recherche de fiches techniques de composants électroniques
  French  ▼
ALLDATASHEET.FR

X  

AN1105 Fiches technique(PDF) 31 Page - STMicroelectronics

No de pièce AN1105
Description  ST7 pCAN PERIPHERAL DRIVER
PDF  100 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Fabricant  STMICROELECTRONICS [STMicroelectronics]
Site Internet  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN1105 Fiches technique(HTML) 31 Page - STMicroelectronics

Back Button AN1105 Datasheet HTML 27Page - STMicroelectronics AN1105 Datasheet HTML 28Page - STMicroelectronics AN1105 Datasheet HTML 29Page - STMicroelectronics AN1105 Datasheet HTML 30Page - STMicroelectronics AN1105 Datasheet HTML 31Page - STMicroelectronics AN1105 Datasheet HTML 32Page - STMicroelectronics AN1105 Datasheet HTML 33Page - STMicroelectronics AN1105 Datasheet HTML 34Page - STMicroelectronics AN1105 Datasheet HTML 35Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 31 / 100 page
background image
31/100
ST7 pCAN PERIPHERAL DRIVER
We have then to write our code. Look at the last lines of can_custom.h. There is a set of #de-
fine options. As we want to be notified neither of status changes, nor of errors, we will leave
them as comments. Please see Section 2.1.5.5 "Can_custom.c File" for more details about
notification functions.
We must then open can_custom.c, and learn how to use the notification functions that are al-
ways compiled.
If your application uses the watchdog timer, you have to write on top of the file:
#include “wdg.h”
to be able to use the refresh function in this module.
The CAN_Request_Buffer function
To retrieve data stored in the ST7 buffers after reception, the application must pass a software
buffer when requested. The following prototype is given in the code:
CAN_Buffer* CAN_Request_Buffer(u16 ident_of_message)
{
//The application must here return a pointer to a physical structure CAN_Buffer
}
This routine is called each time a message has been successfully filtered and is ready to be
used. The parameter passed (i.e. the ID of the recovered message) may help you manage
your buffer(s) more easily.
You then have to create a buffer that will be used to save all data messages.
At the top of the file, add:
////////////////////////////////////////
//VARIABLES/////////////////////////////
////////////////////////////////////////
CAN_Buffer reception_buffer;
And then in the function body:
CAN_Buffer* CAN_Request_Buffer(u16 ident_of_message)
{
reception_buffer.buffer_rw=CTRUE;
return &reception_buffer;
}
The two first lines are used as a safety device: the driver will then be sure that the buffer is not
currently in use and the data in that buffer can be overwritten. In your programs, use these
fields as keys to know whether the data in a buffer can be accessed and whether it has already
been processed.
Note 1: There is only ONE buffer here that will be used to save all the receive messages. This is only an



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100


Fiches technique Télécharger

Go To PDF Page


Lien URL



ALLDATASHEET vous a-t-il été utile ?  [ DONATE ] 

À propos de Alldatasheet   |   Publicité   |   Contactez-nous   |   Politique de confidentialité   |   Lien vers la fiche technique    |   Echange de liens   |   Fabricants
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com