数据搜索系统,热门电子元器件搜索
  Chinese  ▼
ALLDATASHEETCN.COM

X  

AN1105 数据表(PDF) 31 Page - STMicroelectronics

部件名 AN1105
功能描述  ST7 pCAN PERIPHERAL DRIVER
PDF  100 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
制造商  STMICROELECTRONICS [STMicroelectronics]
网页  http://www.st.com
标志 STMICROELECTRONICS - STMicroelectronics

AN1105 数据表(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


数据表 下载

Go To PDF Page


链接网址



ALLDATASHEET是否为您带来帮助?  [ DONATE ] 

关于 Alldatasheet   |   广告服务   |   联系我们   |   隐私政策   |   数据表链接    |   链接交换   |   制造商名单
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