mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 01:05:54 +08:00
Add loopback support to STM32 CAN driver; Add apps/examples/can loopback test
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4213 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
+3
-2
@@ -88,14 +88,15 @@
|
||||
|
||||
/* CAN message support */
|
||||
|
||||
#define CAN_MAXDATALEN 8
|
||||
#define CAN_MAXDATALEN 8
|
||||
#define CAN_MAXMSGID 0x07ff
|
||||
|
||||
#define CAN_ID(hdr) ((uint16_t)(hdr) >> 5)
|
||||
#define CAN_RTR(hdr) (((hdr) & 0x0010) != 0)
|
||||
#define CAN_DLC(hdr) ((hdr) & 0x0f)
|
||||
#define CAN_MSGLEN(hdr) (sizeof(struct can_msg_s) - (CAN_MAXDATALEN - CAN_DLC(hdr)))
|
||||
|
||||
#define CAN_MSG(id, rtr, dlc) ((uint16_t)id << 5 | (uint16_t)rtr << 4 | (uint16_t)dlc)
|
||||
#define CAN_HDR(id, rtr, dlc) ((uint16_t)id << 5 | (uint16_t)rtr << 4 | (uint16_t)dlc)
|
||||
|
||||
/* Built-in ioctl commands
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user