RT-Thread RTOS 1.2.0
An open source embedded real-time operating system
载入中...
搜索中...
未找到
dev_can.h 文件参考
#include <rtthread.h>
+ dev_can.h 的引用(Include)关系图:

浏览该文件的源代码.

结构体

struct  rt_can_filter_item
 
struct  rt_can_filter_config
 
struct  rt_can_bit_timing
 
struct  rt_can_bit_timing_config
 
struct  can_configure
 
struct  rt_can_status
 
struct  rt_can_status_ind_type
 
struct  rt_can_device
 
struct  rt_can_msg
 
struct  rt_can_msg_list
 
struct  rt_can_rx_fifo
 
struct  rt_can_sndbxinx_list
 
struct  rt_can_tx_fifo
 
struct  rt_can_ops
 

宏定义

#define RT_CANMSG_BOX_SZ   16
 
#define RT_CANSND_BOX_NUM   1
 
#define RT_CAN_MODE_NORMAL   0
 
#define RT_CAN_MODE_LISTEN   1
 
#define RT_CAN_MODE_LOOPBACK   2
 
#define RT_CAN_MODE_LOOPBACKANLISTEN   3
 
#define RT_CAN_MODE_PRIV   0x01
 
#define RT_CAN_MODE_NOPRIV   0x00
 
#define CAN_RX_FIFO0   (0x00000000U)
 
#define CAN_RX_FIFO1   (0x00000001U)
 
#define RT_CAN_FILTER_ITEM_INIT(id, ide, rtr, mode, mask)
 
#define RT_CAN_FILTER_STD_INIT(id)
 
#define RT_CAN_FILTER_EXT_INIT(id)
 
#define RT_CAN_STD_RMT_FILTER_INIT(id)
 
#define RT_CAN_EXT_RMT_FILTER_INIT(id)
 
#define RT_CAN_STD_RMT_DATA_FILTER_INIT(id)
 
#define RT_CAN_EXT_RMT_DATA_FILTER_INIT(id)
 
#define CANDEFAULTCONFIG
 
#define RT_CAN_CMD_SET_FILTER   0x13
 
#define RT_CAN_CMD_SET_BAUD   0x14
 
#define RT_CAN_CMD_SET_MODE   0x15
 
#define RT_CAN_CMD_SET_PRIV   0x16
 
#define RT_CAN_CMD_GET_STATUS   0x17
 
#define RT_CAN_CMD_SET_STATUS_IND   0x18
 
#define RT_CAN_CMD_SET_BUS_HOOK   0x19
 
#define RT_CAN_CMD_SET_CANFD   0x1A
 
#define RT_CAN_CMD_SET_BAUD_FD   0x1B
 
#define RT_CAN_CMD_SET_BITTIMING   0x1C
 
#define RT_CAN_CMD_START   0x1D
 
#define RT_DEVICE_CAN_INT_ERR   0x1000
 
#define RT_CAN_STDID   0
 
#define RT_CAN_EXTID   1
 
#define RT_CAN_DTR   0
 
#define RT_CAN_RTR   1
 
#define RT_CAN_SND_RESULT_OK   0
 
#define RT_CAN_SND_RESULT_ERR   1
 
#define RT_CAN_SND_RESULT_WAIT   2
 
#define RT_CAN_EVENT_RX_IND   0x01 /* Rx indication */
 
#define RT_CAN_EVENT_TX_DONE   0x02 /* Tx complete */
 
#define RT_CAN_EVENT_TX_FAIL   0x03 /* Tx fail */
 
#define RT_CAN_EVENT_RX_TIMEOUT   0x05 /* Rx timeout */
 
#define RT_CAN_EVENT_RXOF_IND   0x06 /* Rx overflow */
 

类型定义

typedef rt_err_t(* rt_canstatus_ind) (struct rt_can_device *, void *)
 
typedef struct rt_can_status_ind_typert_can_status_ind_type_t
 
typedef void(* rt_can_bus_hook) (struct rt_can_device *)
 
typedef struct rt_can_devicert_can_t
 
typedef struct rt_can_statusrt_can_status_t
 
typedef struct rt_can_msgrt_can_msg_t
 

枚举

enum  CAN_DLC {
  CAN_MSG_0BYTE = 0 , CAN_MSG_1BYTE , CAN_MSG_2BYTES , CAN_MSG_3BYTES ,
  CAN_MSG_4BYTES , CAN_MSG_5BYTES , CAN_MSG_6BYTES , CAN_MSG_7BYTES ,
  CAN_MSG_8BYTES , CAN_MSG_12BYTES , CAN_MSG_16BYTES , CAN_MSG_20BYTES ,
  CAN_MSG_24BYTES , CAN_MSG_32BYTES , CAN_MSG_48BYTES , CAN_MSG_64BYTES
}
 
enum  CANBAUD {
  CAN1MBaud = 1000UL * 1000 , CAN800kBaud = 1000UL * 800 , CAN500kBaud = 1000UL * 500 , CAN250kBaud = 1000UL * 250 ,
  CAN125kBaud = 1000UL * 125 , CAN100kBaud = 1000UL * 100 , CAN50kBaud = 1000UL * 50 , CAN20kBaud = 1000UL * 20 ,
  CAN10kBaud = 1000UL * 10
}
 
enum  RT_CAN_STATUS_MODE { NORMAL = 0 , ERRWARNING = 1 , ERRPASSIVE = 2 , BUSOFF = 4 }
 
enum  RT_CAN_BUS_ERR {
  RT_CAN_BUS_NO_ERR = 0 , RT_CAN_BUS_BIT_PAD_ERR = 1 , RT_CAN_BUS_FORMAT_ERR = 2 , RT_CAN_BUS_ACK_ERR = 3 ,
  RT_CAN_BUS_IMPLICIT_BIT_ERR = 4 , RT_CAN_BUS_EXPLICIT_BIT_ERR = 5 , RT_CAN_BUS_CRC_ERR = 6
}
 

函数

rt_err_t rt_hw_can_register (struct rt_can_device *can, const char *name, const struct rt_can_ops *ops, void *data)
 
void rt_hw_can_isr (struct rt_can_device *can, int event)
 

宏定义说明

◆ RT_CANMSG_BOX_SZ

#define RT_CANMSG_BOX_SZ   16

在文件 dev_can.h19 行定义.

◆ RT_CANSND_BOX_NUM

#define RT_CANSND_BOX_NUM   1

在文件 dev_can.h22 行定义.

◆ RT_CAN_MODE_NORMAL

#define RT_CAN_MODE_NORMAL   0

在文件 dev_can.h58 行定义.

◆ RT_CAN_MODE_LISTEN

#define RT_CAN_MODE_LISTEN   1

在文件 dev_can.h59 行定义.

◆ RT_CAN_MODE_LOOPBACK

#define RT_CAN_MODE_LOOPBACK   2

在文件 dev_can.h60 行定义.

◆ RT_CAN_MODE_LOOPBACKANLISTEN

#define RT_CAN_MODE_LOOPBACKANLISTEN   3

在文件 dev_can.h61 行定义.

◆ RT_CAN_MODE_PRIV

#define RT_CAN_MODE_PRIV   0x01

在文件 dev_can.h63 行定义.

◆ RT_CAN_MODE_NOPRIV

#define RT_CAN_MODE_NOPRIV   0x00

在文件 dev_can.h64 行定义.

枚举类型说明

◆ CAN_DLC

enum CAN_DLC
枚举值
CAN_MSG_0BYTE 
CAN_MSG_1BYTE  
CAN_MSG_2BYTES  
CAN_MSG_3BYTES  
CAN_MSG_4BYTES  
CAN_MSG_5BYTES  
CAN_MSG_6BYTES  
CAN_MSG_7BYTES  
CAN_MSG_8BYTES  
CAN_MSG_12BYTES  
CAN_MSG_16BYTES  
CAN_MSG_20BYTES  
CAN_MSG_24BYTES  
CAN_MSG_32BYTES  
CAN_MSG_48BYTES  
CAN_MSG_64BYTES  

在文件 dev_can.h25 行定义.

26{
27 CAN_MSG_0BYTE = 0,
43};
@ CAN_MSG_24BYTES
@ CAN_MSG_6BYTES
@ CAN_MSG_32BYTES
@ CAN_MSG_64BYTES
@ CAN_MSG_3BYTES
@ CAN_MSG_48BYTES
@ CAN_MSG_4BYTES
@ CAN_MSG_16BYTES
@ CAN_MSG_0BYTE
@ CAN_MSG_5BYTES
@ CAN_MSG_7BYTES
@ CAN_MSG_1BYTE
@ CAN_MSG_20BYTES
@ CAN_MSG_8BYTES
@ CAN_MSG_2BYTES
@ CAN_MSG_12BYTES

◆ CANBAUD

enum CANBAUD
枚举值
CAN1MBaud 1000UL * 1000 
CAN800kBaud 1000UL * 800 
CAN500kBaud 1000UL * 500 
CAN250kBaud 1000UL * 250 
CAN125kBaud 1000UL * 125 
CAN100kBaud 1000UL * 100 
CAN50kBaud 1000UL * 50 
CAN20kBaud 1000UL * 20 
CAN10kBaud 1000UL * 10 

在文件 dev_can.h45 行定义.

46{
47 CAN1MBaud = 1000UL * 1000,/* 1 MBit/sec */
48 CAN800kBaud = 1000UL * 800, /* 800 kBit/sec */
49 CAN500kBaud = 1000UL * 500, /* 500 kBit/sec */
50 CAN250kBaud = 1000UL * 250, /* 250 kBit/sec */
51 CAN125kBaud = 1000UL * 125, /* 125 kBit/sec */
52 CAN100kBaud = 1000UL * 100, /* 100 kBit/sec */
53 CAN50kBaud = 1000UL * 50, /* 50 kBit/sec */
54 CAN20kBaud = 1000UL * 20, /* 20 kBit/sec */
55 CAN10kBaud = 1000UL * 10 /* 10 kBit/sec */
56};
@ CAN100kBaud
@ CAN125kBaud
@ CAN500kBaud
@ CAN800kBaud
@ CAN50kBaud
@ CAN20kBaud
@ CAN1MBaud
@ CAN250kBaud
@ CAN10kBaud