Zephyr API 3.6.99
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
18
20
21DECLARE_FAKE_VALUE_FUNC(int, fake_can_set_timing, const struct device *, const struct can_timing *);
22
24 const struct can_timing *);
25
27
29
30DECLARE_FAKE_VALUE_FUNC(int, fake_can_send, const struct device *, const struct can_frame *,
32
34 void *, const struct can_filter *);
35
37
39
41 struct can_bus_err_cnt *);
42
45
47
49
50#ifdef __cplusplus
51}
52#endif
53
54#endif /* ZEPHYR_INCLUDE_DRIVERS_CAN_CAN_FAKE_H_ */
int fake_can_set_timing(const struct device *arg0, const struct can_timing *arg1)
int fake_can_add_rx_filter(const struct device *arg0, can_rx_callback_t arg1, void *arg2, const struct can_filter *arg3)
int fake_can_recover(const struct device *arg0, k_timeout_t arg1)
int fake_can_start(const struct device *arg0)
int fake_can_set_timing_data(const struct device *arg0, const struct can_timing *arg1)
int fake_can_send(const struct device *arg0, const struct can_frame *arg1, k_timeout_t arg2, can_tx_callback_t arg3, void *arg4)
int fake_can_set_mode(const struct device *arg0, can_mode_t arg1)
int fake_can_get_state(const struct device *arg0, enum can_state *arg1, struct can_bus_err_cnt *arg2)
void fake_can_remove_rx_filter(const struct device *arg0, int arg1)
int fake_can_get_capabilities(const struct device *arg0, can_mode_t *arg1)
int fake_can_stop(const struct device *arg0)
int fake_can_get_max_filters(const struct device *arg0, bool arg1)
int fake_can_get_core_clock(const struct device *arg0, uint32_t *arg1)
void fake_can_set_state_change_callback(const struct device *arg0, can_state_change_callback_t arg1, void *arg2)
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:403
Kernel timeout type.
Definition sys_clock.h:65