usbd_cdc_ecm.h 878 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Copyright (c) 2022, sakumisu
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #ifndef USBD_CDC_ECM_H
  7. #define USBD_CDC_ECM_H
  8. #include "usb_cdc.h"
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. /* Init cdc ecm interface driver */
  13. struct usbd_interface *usbd_cdc_ecm_init_intf(struct usbd_interface *intf, const uint8_t int_ep, const uint8_t out_ep, const uint8_t in_ep);
  14. void usbd_cdc_ecm_set_connect(bool connect, uint32_t speed[2]);
  15. void usbd_cdc_ecm_data_recv_done(uint32_t len);
  16. void usbd_cdc_ecm_data_send_done(uint32_t len);
  17. int usbd_cdc_ecm_start_write(uint8_t *buf, uint32_t len);
  18. int usbd_cdc_ecm_start_read(uint8_t *buf, uint32_t len);
  19. #ifdef CONFIG_USBDEV_CDC_ECM_USING_LWIP
  20. #include "lwip/netif.h"
  21. #include "lwip/pbuf.h"
  22. struct pbuf *usbd_cdc_ecm_eth_rx(void);
  23. int usbd_cdc_ecm_eth_tx(struct pbuf *p);
  24. #endif
  25. #ifdef __cplusplus
  26. }
  27. #endif
  28. #endif /* USBD_CDC_ECM_H */