usbd_audio.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /**
  2. * @file usbd_audio.h
  3. * @brief
  4. *
  5. * Copyright (c) 2022 sakumisu
  6. *
  7. * Licensed to the Apache Software Foundation (ASF) under one or more
  8. * contributor license agreements. See the NOTICE file distributed with
  9. * this work for additional information regarding copyright ownership. The
  10. * ASF licenses this file to you under the Apache License, Version 2.0 (the
  11. * "License"); you may not use this file except in compliance with the
  12. * License. You may obtain a copy of the License at
  13. *
  14. * http://www.apache.org/licenses/LICENSE-2.0
  15. *
  16. * Unless required by applicable law or agreed to in writing, software
  17. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  18. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  19. * License for the specific language governing permissions and limitations
  20. * under the License.
  21. *
  22. */
  23. #ifndef _USBD_AUDIO_H_
  24. #define _USBD_AUDIO_H_
  25. #include "usb_audio.h"
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. void usbd_audio_add_interface(usbd_class_t *devclass, usbd_interface_t *intf);
  30. void usbd_audio_open(uint8_t intf);
  31. void usbd_audio_close(uint8_t intf);
  32. void usbd_audio_add_entity(uint8_t entity_id, uint16_t bDescriptorSubtype);
  33. void usbd_audio_set_volume(uint8_t entity_id, uint8_t ch, float dB);
  34. void usbd_audio_set_mute(uint8_t entity_id, uint8_t ch, uint8_t enable);
  35. void usbd_audio_set_sampling_freq(uint8_t entity_id, uint8_t ep_ch, uint32_t sampling_freq);
  36. void usbd_audio_get_sampling_freq_table(uint8_t entity_id, uint8_t **sampling_freq_table);
  37. void usbd_audio_set_pitch(uint8_t ep, bool enable);
  38. void usbd_audio_sof_callback(void);
  39. #ifdef __cplusplus
  40. }
  41. #endif
  42. #endif /* _USB_AUDIO_H_ */