Teensy 4.1 core updated for C++20
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

пре 6 година
пре 5 година
пре 5 година
пре 5 година
пре 5 година
1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #pragma once
  2. #include "imxrt.h"
  3. typedef struct transfer_struct transfer_t;
  4. struct transfer_struct {
  5. uint32_t next;
  6. volatile uint32_t status;
  7. uint32_t pointer0;
  8. uint32_t pointer1;
  9. uint32_t pointer2;
  10. uint32_t pointer3;
  11. uint32_t pointer4;
  12. uint32_t callback_param;
  13. };
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. void usb_init(void);
  18. void usb_init_serialnumber(void);
  19. void usb_config_rx(uint32_t ep, uint32_t packet_size, int do_zlp, void (*cb)(transfer_t *));
  20. void usb_config_tx(uint32_t ep, uint32_t packet_size, int do_zlp, void (*cb)(transfer_t *));
  21. void usb_config_rx_iso(uint32_t ep, uint32_t packet_size, int mult, void (*cb)(transfer_t *));
  22. void usb_config_tx_iso(uint32_t ep, uint32_t packet_size, int mult, void (*cb)(transfer_t *));
  23. void usb_prepare_transfer(transfer_t *transfer, const void *data, uint32_t len, uint32_t param);
  24. void usb_transmit(int endpoint_number, transfer_t *transfer);
  25. void usb_receive(int endpoint_number, transfer_t *transfer);
  26. uint32_t usb_transfer_status(const transfer_t *transfer);
  27. void usb_start_sof_interrupts(int interface);
  28. void usb_stop_sof_interrupts(int interface);
  29. extern void (*usb_timer0_callback)(void);
  30. extern void (*usb_timer1_callback)(void);
  31. #ifdef __cplusplus
  32. }
  33. #endif