1 /* 2 * Copyright (c) 2022 Vestas Wind Systems A/S 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef ZEPHYR_INCLUDE_DRIVERS_CAN_CAN_FAKE_H_ 8 #define ZEPHYR_INCLUDE_DRIVERS_CAN_CAN_FAKE_H_ 9 10 #include <zephyr/drivers/can.h> 11 #include <zephyr/fff.h> 12 13 #ifdef __cplusplus 14 extern "C" { 15 #endif 16 17 DECLARE_FAKE_VALUE_FUNC(int, fake_can_start, const struct device *); 18 19 DECLARE_FAKE_VALUE_FUNC(int, fake_can_stop, const struct device *); 20 21 DECLARE_FAKE_VALUE_FUNC(int, fake_can_set_timing, const struct device *, const struct can_timing *); 22 23 DECLARE_FAKE_VALUE_FUNC(int, fake_can_set_timing_data, const struct device *, 24 const struct can_timing *); 25 26 DECLARE_FAKE_VALUE_FUNC(int, fake_can_get_capabilities, const struct device *, can_mode_t *); 27 28 DECLARE_FAKE_VALUE_FUNC(int, fake_can_set_mode, const struct device *, can_mode_t); 29 30 DECLARE_FAKE_VALUE_FUNC(int, fake_can_send, const struct device *, const struct can_frame *, 31 k_timeout_t, can_tx_callback_t, void *); 32 33 DECLARE_FAKE_VALUE_FUNC(int, fake_can_add_rx_filter, const struct device *, can_rx_callback_t, 34 void *, const struct can_filter *); 35 36 DECLARE_FAKE_VOID_FUNC(fake_can_remove_rx_filter, const struct device *, int); 37 38 DECLARE_FAKE_VALUE_FUNC(int, fake_can_recover, const struct device *, k_timeout_t); 39 40 DECLARE_FAKE_VALUE_FUNC(int, fake_can_get_state, const struct device *, enum can_state *, 41 struct can_bus_err_cnt *); 42 43 DECLARE_FAKE_VOID_FUNC(fake_can_set_state_change_callback, const struct device *, 44 can_state_change_callback_t, void *); 45 46 DECLARE_FAKE_VALUE_FUNC(int, fake_can_get_max_filters, const struct device *, bool); 47 48 #ifdef __cplusplus 49 } 50 #endif 51 52 #endif /* ZEPHYR_INCLUDE_DRIVERS_CAN_CAN_FAKE_H_ */ 53