Line data Source code
1 1 : /*
2 : * Copyright (c) 2020 Google LLC
3 : *
4 : * SPDX-License-Identifier: Apache-2.0
5 : */
6 :
7 : /**
8 : * @file
9 : * @brief Public APIs for the CDC ACM class driver
10 : */
11 :
12 : #ifndef ZEPHYR_INCLUDE_DRIVERS_UART_CDC_ACM_H_
13 : #define ZEPHYR_INCLUDE_DRIVERS_UART_CDC_ACM_H_
14 :
15 : #include <errno.h>
16 :
17 : #include <zephyr/device.h>
18 :
19 : #ifdef __cplusplus
20 : extern "C" {
21 : #endif /* __cplusplus */
22 :
23 : /**
24 : * @typedef cdc_dte_rate_callback_t
25 : * @brief A function that is called when the USB host changes the baud
26 : * rate.
27 : *
28 : * @param dev Device struct for the CDC ACM device.
29 : * @param rate New USB baud rate
30 : */
31 1 : typedef void (*cdc_dte_rate_callback_t)(const struct device *dev,
32 : uint32_t rate);
33 :
34 : /**
35 : * @brief Set the callback for dwDTERate SetLineCoding requests.
36 : *
37 : * @deprecated Use @ref usbd_api and @ref USBD_MSG_CDC_ACM_LINE_CODING instead.
38 : *
39 : * The callback is invoked when the USB host changes the baud rate.
40 : *
41 : * @note This function is available only when
42 : * CONFIG_CDC_ACM_DTE_RATE_CALLBACK_SUPPORT is enabled.
43 : *
44 : * @param dev CDC ACM device structure.
45 : * @param callback Event handler.
46 : *
47 : * @return 0 on success.
48 : */
49 1 : __deprecated int cdc_acm_dte_rate_callback_set(const struct device *dev,
50 : cdc_dte_rate_callback_t callback);
51 :
52 : #ifdef __cplusplus
53 : }
54 : #endif /* __cplusplus */
55 :
56 : #endif /* ZEPHYR_INCLUDE_DRIVERS_UART_CDC_ACM_H_ */
|