Zephyr API Documentation 4.5.0-rc1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
can_fake.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022 Vestas Wind Systems A/S
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
12
13#ifndef ZEPHYR_INCLUDE_DRIVERS_CAN_CAN_FAKE_H_
14#define ZEPHYR_INCLUDE_DRIVERS_CAN_CAN_FAKE_H_
15
16#include <zephyr/drivers/can.h>
17#include <zephyr/fff.h>
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
38
40DECLARE_FAKE_VALUE_FUNC(int, fake_can_start, const struct device *);
41
43DECLARE_FAKE_VALUE_FUNC(int, fake_can_stop, const struct device *);
44
46DECLARE_FAKE_VALUE_FUNC(int, fake_can_set_timing, const struct device *, const struct can_timing *);
47
49DECLARE_FAKE_VALUE_FUNC(int, fake_can_set_timing_data, const struct device *,
50 const struct can_timing *);
51
53DECLARE_FAKE_VALUE_FUNC(int, fake_can_get_capabilities, const struct device *, can_mode_t *);
54
56DECLARE_FAKE_VALUE_FUNC(int, fake_can_set_mode, const struct device *, can_mode_t);
57
59DECLARE_FAKE_VALUE_FUNC(int, fake_can_send, const struct device *, const struct can_frame *,
61
63DECLARE_FAKE_VALUE_FUNC(int, fake_can_add_rx_filter, const struct device *, can_rx_callback_t,
64 void *, const struct can_filter *);
65
67DECLARE_FAKE_VOID_FUNC(fake_can_remove_rx_filter, const struct device *, int);
68
70DECLARE_FAKE_VALUE_FUNC(int, fake_can_recover, const struct device *, k_timeout_t);
71
73DECLARE_FAKE_VALUE_FUNC(int, fake_can_get_state, const struct device *, enum can_state *,
74 struct can_bus_err_cnt *);
75
77DECLARE_FAKE_VALUE_FUNC(int, fake_can_state_change_callbacks_enabled, const struct device *, bool);
78
80DECLARE_FAKE_VALUE_FUNC(int, fake_can_get_max_filters, const struct device *, bool);
81
83DECLARE_FAKE_VALUE_FUNC(int, fake_can_get_core_clock, const struct device *, uint32_t *);
84
88
89#ifdef __cplusplus
90}
91#endif
92
93#endif /* ZEPHYR_INCLUDE_DRIVERS_CAN_CAN_FAKE_H_ */
Header file for Controller Area Network (CAN) controller driver API.
uint32_t can_mode_t
Provides a type to hold CAN controller configuration flags.
Definition can.h:122
void(* can_rx_callback_t)(const struct device *dev, struct can_frame *frame, void *user_data)
Defines the application callback handler function signature for receiving.
Definition can.h:298
void(* can_tx_callback_t)(const struct device *dev, int error, void *user_data)
Defines the application callback handler function signature.
Definition can.h:289
can_state
Defines the state of the CAN controller.
Definition can.h:127
int fake_can_state_change_callbacks_enabled(const struct device *, bool)
Fake implementation of the can_driver_api::state_change_callbacks_enabled driver operation.
int fake_can_set_timing_data(const struct device *, const struct can_timing *)
Fake implementation of the can_driver_api::set_timing_data driver operation.
int fake_can_stop(const struct device *)
Fake implementation of the can_driver_api::stop driver operation.
int fake_can_get_state(const struct device *, enum can_state *, struct can_bus_err_cnt *)
Fake implementation of the can_driver_api::get_state driver operation.
int fake_can_set_mode(const struct device *, can_mode_t)
Fake implementation of the can_driver_api::set_mode driver operation.
int fake_can_start(const struct device *)
Fake implementation of the can_driver_api::start driver operation.
int fake_can_set_timing(const struct device *, const struct can_timing *)
Fake implementation of the can_driver_api::set_timing driver operation.
int fake_can_get_max_filters(const struct device *, bool)
Fake implementation of the can_driver_api::get_max_filters driver operation.
int fake_can_get_capabilities(const struct device *, can_mode_t *)
Fake implementation of the can_driver_api::get_capabilities driver operation.
int fake_can_get_core_clock(const struct device *, uint32_t *)
Fake implementation of the can_driver_api::get_core_clock driver operation.
int fake_can_recover(const struct device *, k_timeout_t)
Fake implementation of the can_driver_api::recover driver operation.
void fake_can_remove_rx_filter(const struct device *, int)
Fake implementation of the can_driver_api::remove_rx_filter driver operation.
int fake_can_send(const struct device *, const struct can_frame *, k_timeout_t, can_tx_callback_t, void *)
Fake implementation of the can_driver_api::send driver operation.
int fake_can_add_rx_filter(const struct device *, can_rx_callback_t, void *, const struct can_filter *)
Fake implementation of the can_driver_api::add_rx_filter driver operation.
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
CAN controller error counters.
Definition can.h:229
CAN filter structure.
Definition can.h:215
CAN frame structure.
Definition can.h:169
CAN bus timing structure.
Definition can.h:268
Runtime device structure (in ROM) per driver instance.
Definition device.h:543
Kernel timeout type.
Definition clock.h:65