Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
transceiver.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2022 Vestas Wind Systems A/S
3 * Copyright (c) 2025 Renesas Electronics Corporation
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7
8#ifndef ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_LIN_TRANSCEIVER_H
9#define ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_LIN_TRANSCEIVER_H
10
11#ifdef __cplusplus
12extern "C" {
13#endif
14
22
23#include <zephyr/drivers/lin.h>
24#include <zephyr/device.h>
25
34
40
45typedef int (*lin_transceiver_enable_t)(const struct device *dev, uint8_t flags);
46
51typedef int (*lin_transceiver_disable_t)(const struct device *dev);
52
56__subsystem struct lin_transceiver_driver_api {
58 lin_transceiver_enable_t enable;
60 lin_transceiver_disable_t disable;
61};
62
64
81static inline int lin_transceiver_enable(const struct device *dev, uint8_t flags)
82{
83 return DEVICE_API_GET(lin_transceiver, dev)->enable(dev, flags);
84}
85
101static inline int lin_transceiver_disable(const struct device *dev)
102{
103 return DEVICE_API_GET(lin_transceiver, dev)->disable(dev);
104}
105
109
110#ifdef __cplusplus
111}
112#endif
113
114#endif /* ZEPHYR_INCLUDE_ZEPHYR_DRIVERS_LIN_TRANSCEIVER_H */
APIs and macros for the Zephyr device model.
#define DEVICE_API_GET(_class, _dev)
Expands to the pointer of a device's API for a given class.
Definition device.h:1486
static int lin_transceiver_disable(const struct device *dev)
Disable LIN transceiver.
Definition transceiver.h:101
static int lin_transceiver_enable(const struct device *dev, uint8_t flags)
Enable LIN transceiver.
Definition transceiver.h:81
LIN (Local Interconnect Network) driver API.
flags
Definition parser.h:86
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Runtime device structure (in ROM) per driver instance.
Definition device.h:543