Teensy 4.1 core updated for C++20
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

59 rindas
1.4KB

  1. #pragma once
  2. #include "imxrt.h"
  3. #if !defined(USB_DISABLED)
  4. typedef struct transfer_struct transfer_t;
  5. struct transfer_struct {
  6. uint32_t next;
  7. volatile uint32_t status;
  8. uint32_t pointer0;
  9. uint32_t pointer1;
  10. uint32_t pointer2;
  11. uint32_t pointer3;
  12. uint32_t pointer4;
  13. uint32_t callback_param;
  14. };
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. void usb_init(void);
  19. void usb_init_serialnumber(void);
  20. void usb_config_rx(uint32_t ep, uint32_t packet_size, int do_zlp, void (*cb)(transfer_t *));
  21. void usb_config_tx(uint32_t ep, uint32_t packet_size, int do_zlp, void (*cb)(transfer_t *));
  22. void usb_config_rx_iso(uint32_t ep, uint32_t packet_size, int mult, void (*cb)(transfer_t *));
  23. void usb_config_tx_iso(uint32_t ep, uint32_t packet_size, int mult, void (*cb)(transfer_t *));
  24. void usb_prepare_transfer(transfer_t *transfer, const void *data, uint32_t len, uint32_t param);
  25. void usb_transmit(int endpoint_number, transfer_t *transfer);
  26. void usb_receive(int endpoint_number, transfer_t *transfer);
  27. uint32_t usb_transfer_status(const transfer_t *transfer);
  28. void usb_start_sof_interrupts(int interface);
  29. void usb_stop_sof_interrupts(int interface);
  30. extern void (*usb_timer0_callback)(void);
  31. extern void (*usb_timer1_callback)(void);
  32. #ifdef __cplusplus
  33. }
  34. #endif
  35. #else // !defined(USB_DISABLED)
  36. #ifdef __cplusplus
  37. extern "C" {
  38. #endif
  39. void usb_init(void);
  40. #ifdef __cplusplus
  41. }
  42. #endif
  43. #endif // !defined(USB_DISABLED)