| 전자부품 데이터시트 검색엔진 |
|
UM0459 데이터시트(PDF) 20 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
UM0459 데이터시트(HTML) 20 Page - STMicroelectronics |
|
20 / 29 page ![]() Controller area network (CAN) routines UM0459 20/29 Example: This example illustrates how to send a standard ID data frame containing 4 data bytes. { canmsg CanMsg = { CAN_STD_ID, 0x111, 4, {0x10, 0x20, 0x40, 0x80} }; /*CAN1 Sends a standard ID data frame containing 4 data values*/ CAN_SendMessage(CAN1, 0, &CanMsg); } 2.2.14 CAN_UpdateMsgObj function 2.2.15 CAN_TransmitRequest function Table 18. CAN_UpdateMsgObj function description Function name CAN_UpdateMsgObj Prototype ErrorStatus CAN_SendMessage(CAN_TypeDef* CAN, u16 msgobj, canmsg* pCanMsg); Behavior description Updates the CAN message object with pCanMsg fields. Input parameter 1 CAN: Pointer to a CAN1 or CAN2 CAN_TypeDef structure. Input parameter 2 msgobj: message object number, from 0 to 31. Input parameter 3 pCanMsg: Pointer to the canmsg structure that contains the data to transmit: ID type, ID value, data length, data values. Output parameter None Return value An ErrorStatus enumeration value: – SUCCESS: IF found to treat the message and the pCanMsg id corresponds to the message idType configuration – ERROR: IF not found to treat the message or if the pCanMsg id does not correspond to the message idType configuration Required preconditions The message object must have been set up properly. Called functions CAN_GetFreeIF Table 19. CAN_TransmitRequest function description Function name CAN_TransmitRequest Prototype ErrorStatus CAN_TransmitRequest(CAN_TypeDef* CAN, u16 msgobj); Behavior description Starts the transmission of a message object. A data frame is transmitted if the message object is configured in transmission mode. A remote frame is transmitted if the message object is configured in reception mode. Input parameter 1 CAN: Pointer to a CAN1 or CAN2 CAN_TypeDef structure. Input parameter 2 msgobj: message object number, from 0 to 31. Output parameter None Return value An ErrorStatus enumeration value: – SUCCESS: IF found to treat the message – ERROR: IF not found to treat the message Required preconditions The message object must have been set up properly. Called functions CAN_GetFreeIF |
|
|
링크 URL |
| ALLDATASHEET 가 귀하에 도움이 되셨나요? [ DONATE ] |
Alldatasheet는? | 광고문의 | 운영자에게 연락하기 | 개인정보취급방침 | 링크 투 데이터시트 | 링크교환 | 제조사별 검색 All Rights Reserved©Alldatasheet.com |
| 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 |