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.

40 lines
963B

  1. #ifndef USBaudio_h_
  2. #define USBaudio_h_
  3. #include "usb_desc.h"
  4. #ifdef AUDIO_INTERFACE
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. extern uint16_t usb_audio_receive_buffer[];
  9. extern uint16_t usb_audio_transmit_buffer[];
  10. extern void usb_audio_receive_callback(unsigned int len);
  11. extern unsigned int usb_audio_transmit_callback(void);
  12. extern uint32_t usb_audio_sync_feedback;
  13. #ifdef __cplusplus
  14. }
  15. #include "AudioStream.h"
  16. class AudioInputUSB : public AudioStream
  17. {
  18. public:
  19. AudioInputUSB(void) : AudioStream(0, NULL) { begin(); }
  20. virtual void update(void);
  21. void begin(void);
  22. friend void usb_audio_receive_callback(unsigned int len);
  23. private:
  24. static bool update_responsibility;
  25. static audio_block_t *incoming_left;
  26. static audio_block_t *incoming_right;
  27. static audio_block_t *ready_left;
  28. static audio_block_t *ready_right;
  29. static uint16_t incoming_count;
  30. static uint8_t underflow_flag;
  31. };
  32. #endif // __cplusplus
  33. #endif // AUDIO_INTERFACE
  34. #endif // USBaudio_h_