Lines Matching refs:can_dev
68 static rt_device_t can_dev = RT_NULL; variable
74 if (can_dev == RT_NULL || can_mutex == RT_NULL) { \
97 res = rt_device_control(can_dev, RT_CAN_CMD_SET_FILTER, &cfg); in _set_default_filter()
115 rt_device_read(can_dev, 0, &rxmsg, sizeof(rxmsg)); in can_rx_thread()
124 size = rt_device_write(can_dev, 0, &rxmsg, sizeof(rxmsg)); in can_rx_thread()
142 result = rt_device_control(can_dev, RT_CAN_CMD_SET_BAUD, (void *)baud); in _msh_cmd_set_baud()
187 result = rt_device_control(can_dev, RT_CAN_CMD_SET_BITTIMING, &cfg); in _msh_cmd_set_timing()
208 result = rt_device_control(can_dev, RT_CAN_CMD_SET_BAUD_FD, (void *)baudfd); in _msh_cmd_set_baudfd()
256 size = rt_device_write(can_dev, 0, &msg, sizeof(msg)); in _msh_cmd_send_msg()
324 if (can_dev != RT_NULL) in can_sample()
326 rt_device_close(can_dev); in can_sample()
329 can_dev = rt_device_find(can_name); in can_sample()
330 if (can_dev == RT_NULL) in can_sample()
343 res = rt_device_open(can_dev, RT_DEVICE_FLAG_INT_TX | RT_DEVICE_FLAG_INT_RX); in can_sample()
345 res = rt_device_control(can_dev, RT_CAN_CMD_SET_BAUD, (void *)CAN500kBaud); in can_sample()
348 res = rt_device_control(can_dev, RT_CAN_CMD_SET_MODE, (void *)RT_CAN_MODE_NORMAL); in can_sample()
353 res = rt_device_control(can_dev, RT_CAN_CMD_SET_CANFD, (void *)CAN_FRAME_ISO_FD); in can_sample()
355 res = rt_device_control(can_dev, RT_CAN_CMD_SET_BAUD_FD, (void *)CANFD_DATA_BAUD_4M); in can_sample()
360 rt_device_set_rx_indicate(can_dev, can_rx_call); in can_sample()