#include "rtdevice.h"
#define CAN_DEV_NAME "can1"
{
return RT_EOK;
}
static void can_rx_thread(void *parameter)
{
int i;
#ifdef RT_CAN_USING_HDR
{
{0x555, 0, 0, 0, 0x7ff, 7,}
};
#endif
while (1)
{
rxmsg.hdr = -1;
for (i = 0; i < 8; i++)
{
}
}
}
int can_sample(int argc, char *argv[])
{
char can_name[RT_NAME_MAX];
if (argc == 2)
{
rt_strncpy(can_name, argv[1], RT_NAME_MAX);
}
else
{
rt_strncpy(can_name, CAN_DEV_NAME, RT_NAME_MAX);
}
if (!can_dev)
{
return -RT_ERROR;
}
{
}
else
{
}
if (size == 0)
{
}
return res;
}
#define RT_CAN_FILTER_ITEM_INIT(id, ide, rtr, mode, mask)
#define RT_CAN_FILTER_STD_INIT(id)
#define RT_CAN_CMD_SET_FILTER
rt_err_t rt_device_set_rx_indicate(rt_device_t dev, rt_err_t(*rx_ind)(rt_device_t dev, rt_size_t size))
#define RT_DEVICE_FLAG_INT_RX
rt_err_t rt_device_control(rt_device_t dev, int cmd, void *arg)
rt_ssize_t rt_device_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size)
rt_ssize_t rt_device_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size)
rt_device_t rt_device_find(const char *name)
struct rt_device * rt_device_t
rt_err_t rt_device_open(rt_device_t dev, rt_uint16_t oflag)
#define RT_DEVICE_FLAG_INT_TX
#define RT_WAITING_FOREVER
rt_err_t rt_thread_startup(rt_thread_t thread)
This function will start a thread and put it to system ready queue.
rt_thread_t rt_thread_create(const char *name, void(*entry)(void *parameter), void *parameter, rt_uint32_t stack_size, rt_uint8_t priority, rt_uint32_t tick)
This function will create a thread object and allocate thread object memory. and stack.
struct rt_thread * rt_thread_t
#define MSH_CMD_EXPORT(...)
rt_err_t rt_sem_init(rt_sem_t sem, const char *name, rt_uint32_t value, rt_uint8_t flag)
This function will initialize a static semaphore object.
rt_err_t rt_sem_take(rt_sem_t sem, rt_int32_t time)
rt_err_t rt_sem_release(rt_sem_t sem)
This function will release a semaphore. If there is thread suspended on the semaphore,...
struct rt_can_filter_item * items