2019-03-19 00:19:35 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2019 Alexander Wachter
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ZEPHYR_DRIVERS_CAN_LOOPBACK_CAN_H_
|
|
|
|
#define ZEPHYR_DRIVERS_CAN_LOOPBACK_CAN_H_
|
|
|
|
|
2019-06-26 03:53:46 +08:00
|
|
|
#include <drivers/can.h>
|
2019-03-19 00:19:35 +08:00
|
|
|
|
2020-05-29 03:23:02 +08:00
|
|
|
#define DEV_DATA(dev) ((struct can_loopback_data *const)(dev)->data)
|
2019-03-19 00:19:35 +08:00
|
|
|
#define DEV_CFG(dev) \
|
2020-05-29 02:44:16 +08:00
|
|
|
((const struct can_loopback_config *const)(dev)->config)
|
2019-03-19 00:19:35 +08:00
|
|
|
|
|
|
|
struct can_loopback_filter {
|
|
|
|
can_rx_callback_t rx_cb;
|
|
|
|
void *cb_arg;
|
|
|
|
struct zcan_filter filter;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct can_loopback_data {
|
|
|
|
struct can_loopback_filter filters[CONFIG_CAN_MAX_FILTER];
|
|
|
|
struct k_mutex mtx;
|
|
|
|
bool loopback;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct can_loopback_config {
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /*ZEPHYR_DRIVERS_CAN_LOOPBACK_CAN_H_*/
|