usb_audio.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef _USB_AUDIO_H
  2. #define _USB_AUDIO_H
  3. typedef struct _uda_t {
  4. #if USB_MIC_EN
  5. epcb_t *isoc_in; //mic endpoint
  6. u8 flag_isocin_int;
  7. u8 flag_isocin_en;
  8. u16 mic_vol;
  9. u8 mic_mute;
  10. #endif
  11. #if USB_SPEAKER_EN
  12. epcb_t *isoc_out; //speaker endpoint
  13. u8 flag_isocout_int;
  14. u8 flag_isocout_en;
  15. u8 spk_vol;
  16. u8 spk_mute;
  17. #endif
  18. } uda_t;
  19. void uda_init(void);
  20. void usb_isoc_ep_reset(void);
  21. void usb_audio_init(void);
  22. void usb_audio_deinit(void);
  23. void usb_audio_process(void);
  24. void uda_set_isocin_flag(u8 val);
  25. uint8_t uda_get_isocin_flag(void);
  26. bool uda_get_mic_mute(void);
  27. bool uda_get_mic_volume(u8 req);
  28. void uda_set_mic_mute(u8 val);
  29. void uda_set_mic_volume(u16 val);
  30. bool uda_mic_check(void);
  31. void uda_mic_buffer_prepare(uint8_t *ibuf, uint32_t size);
  32. void usb_audio_mic_stream(void *ibuf, u32 sample);
  33. bool uda_get_spk_mute(void);
  34. bool uda_get_spk_volume(u8 req);
  35. void uda_set_isocout_flag(u8 val);
  36. uint8_t uda_get_isocout_flag(void);
  37. void uda_set_spk_mute(u8 val);
  38. void uda_set_spk_volume(u16 val);
  39. void usb_audio_speaker_stream(void *obuf, u32 *sample);
  40. #endif // _USB_AUDIO_H