欢迎访问ic37.com |
会员登录 免费注册
发布采购

AN2961 参数 Datasheet PDF下载

AN2961图片预览
型号: AN2961
PDF下载: 下载PDF文件 查看货源
内容描述: []
分类和应用:
文件页数/大小: 50 页 / 706 K
品牌: FREESCALE [ Freescale ]
 浏览型号AN2961的Datasheet PDF文件第12页浏览型号AN2961的Datasheet PDF文件第13页浏览型号AN2961的Datasheet PDF文件第14页浏览型号AN2961的Datasheet PDF文件第15页浏览型号AN2961的Datasheet PDF文件第17页浏览型号AN2961的Datasheet PDF文件第18页浏览型号AN2961的Datasheet PDF文件第19页浏览型号AN2961的Datasheet PDF文件第20页  
Using the Driver  
9.3.3  
ID Repeat Message Format  
Sending messages using ID repeat format is simple. Fill the transmit buffer and, when the driver is not  
busy, invoke the Echo_SendIDRepeat service with the desired number of IDs to be repeated as a parameter.  
9.4  
Receiving Messages  
For receiving messages, the driver is flexible enough to accommodate a number of buffers defined in the  
header file. The scheme employed provides a globally accessible pointer for the next full receive data  
buffer.  
The pointer is updated after calling Echo_DriverStatus(). If a message is available in the buffers, the status  
bit MsgReadyis set and the pointer echoNextMessage is updated. If that message has a checksum error, the  
Checksumstatus bit is also set. If no messages are waiting, echoNextMessage is undefined and the status  
bit MsgReadyis cleared.  
Internally, there is a temporary receive buffer that the Echo driver uses for partially received messages and  
associated processing. This is copied to a free buffer when the reception is complete. If no free buffers  
exist, the message will be discarded and the Overrunstatus bit is set.  
When the application has finished using the buffer at echoNextMessage, it must clear the buffer full bit to  
return it to the pool before the next message will be released to it. If the buffer full bit is not cleared,  
subsequent calls to Echo_DriverStatus()will not update the echoNextMessagepointer.  
Background  
Rx Buffer  
Foreground  
Rx Buffers  
copy  
FreePtr  
NextPtr  
Figure 10. Receive Buffering  
9.4.1  
Timeouts  
If the length is corrupted or part of a message is lost, the driver can remain in a waiting state for the next  
byte of a message to arrive. Consequently, parts of future messages can be mistakenly read as part of this  
message. To avoid this, the timer provides a timeout mechanism while receiving.  
The timeout is measured in bit-times and must clearly be greater than 8 bits (to allow a full byte to arrive  
and be transferred out of Echo onto the SPI). This is defined in the driver header file:  
ECHO_RX_TIMEOUT_BITS.  
If a timeout occurs, both the Timeoutand Errorstatus bits are set.  
Software Drivers for MC33696, Rev. 1  
16  
Freescale Semiconductor  
 复制成功!