Zephyr API Documentation  3.6.99
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
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
14extern "C" {
15#endif
16
17DECLARE_FAKE_VALUE_FUNC(int, fake_can_start, const struct device *);
18
19DECLARE_FAKE_VALUE_FUNC(int, fake_can_stop, const struct device *);
20
21DECLARE_FAKE_VALUE_FUNC(int, fake_can_set_timing, const struct device *, const struct can_timing *);
22
23DECLARE_FAKE_VALUE_FUNC(int, fake_can_set_timing_data, const struct device *,
24 const struct can_timing *);
25
26DECLARE_FAKE_VALUE_FUNC(int, fake_can_get_capabilities, const struct device *, can_mode_t *);
27
28DECLARE_FAKE_VALUE_FUNC(int, fake_can_set_mode, const struct device *, can_mode_t);
29
30DECLARE_FAKE_VALUE_FUNC(int, fake_can_send, const struct device *, const struct can_frame *,
32
33DECLARE_FAKE_VALUE_FUNC(int, fake_can_add_rx_filter, const struct device *, can_rx_callback_t,
34 void *, const struct can_filter *);
35
36DECLARE_FAKE_VOID_FUNC(fake_can_remove_rx_filter, const struct device *, int);
37
38DECLARE_FAKE_VALUE_FUNC(int, fake_can_recover, const struct device *, k_timeout_t);
39
40DECLARE_FAKE_VALUE_FUNC(int, fake_can_get_state, const struct device *, enum can_state *,
41 struct can_bus_err_cnt *);
42
43DECLARE_FAKE_VOID_FUNC(fake_can_set_state_change_callback, const struct device *,
45
46DECLARE_FAKE_VALUE_FUNC(int, fake_can_get_max_filters, const struct device *, bool);
47
48DECLARE_FAKE_VALUE_FUNC(int, fake_can_get_core_clock, const struct device *, uint32_t *);
49
50#ifdef __cplusplus
51}
52#endif
53
54#endif /* ZEPHYR_INCLUDE_DRIVERS_CAN_CAN_FAKE_H_ */
Controller Area Network (CAN) driver API.
#define DECLARE_FAKE_VOID_FUNC(...)
Definition: fff.h:8691
#define DECLARE_FAKE_VALUE_FUNC(...)
Definition: fff.h:8684
void(* can_state_change_callback_t)(const struct device *dev, enum can_state state, struct can_bus_err_cnt err_cnt, void *user_data)
Defines the state change callback handler function signature.
Definition: can.h:312
uint32_t can_mode_t
Provides a type to hold CAN controller configuration flags.
Definition: can.h:125
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:301
void(* can_tx_callback_t)(const struct device *dev, int error, void *user_data)
Defines the application callback handler function signature.
Definition: can.h:292
can_state
Defines the state of the CAN controller.
Definition: can.h:130
__UINT32_TYPE__ uint32_t
Definition: stdint.h:90
CAN controller error counters.
Definition: can.h:232
CAN filter structure.
Definition: can.h:218
CAN frame structure.
Definition: can.h:172
CAN bus timing structure.
Definition: can.h:271
Runtime device structure (in ROM) per driver instance.
Definition: device.h:399
Kernel timeout type.
Definition: sys_clock.h:65