audio.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /**
  2. ******************************************************************************
  3. * @file audio.h
  4. * @author MCD Application Team
  5. * @brief This header file contains the common defines and functions prototypes
  6. * for the Audio driver.
  7. ******************************************************************************
  8. * @attention
  9. *
  10. * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
  11. * All rights reserved.</center></h2>
  12. *
  13. * This software component is licensed by ST under BSD 3-Clause license,
  14. * the "License"; You may not use this file except in compliance with the
  15. * License. You may obtain a copy of the License at:
  16. * opensource.org/licenses/BSD-3-Clause
  17. *
  18. ******************************************************************************
  19. */
  20. /* Define to prevent recursive inclusion -------------------------------------*/
  21. #ifndef __AUDIO_H
  22. #define __AUDIO_H
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. /* Includes ------------------------------------------------------------------*/
  27. #include <stdint.h>
  28. /** @addtogroup BSP
  29. * @{
  30. */
  31. /** @addtogroup Components
  32. * @{
  33. */
  34. /** @addtogroup AUDIO
  35. * @{
  36. */
  37. /** @defgroup AUDIO_Exported_Constants
  38. * @{
  39. */
  40. /* Codec audio Standards */
  41. #define CODEC_STANDARD 0x04
  42. #define I2S_STANDARD I2S_STANDARD_PHILIPS
  43. /**
  44. * @}
  45. */
  46. /** @defgroup AUDIO_Exported_Types
  47. * @{
  48. */
  49. /** @defgroup AUDIO_Driver_structure Audio Driver structure
  50. * @{
  51. */
  52. typedef struct
  53. {
  54. uint32_t (*Init)(uint16_t, uint16_t, uint8_t, uint32_t);
  55. void (*DeInit)(void);
  56. uint32_t (*ReadID)(uint16_t);
  57. uint32_t (*Play)(uint16_t, uint16_t*, uint16_t);
  58. uint32_t (*Pause)(uint16_t);
  59. uint32_t (*Resume)(uint16_t);
  60. uint32_t (*Stop)(uint16_t, uint32_t);
  61. uint32_t (*SetFrequency)(uint16_t, uint32_t);
  62. uint32_t (*SetVolume)(uint16_t, uint8_t);
  63. uint32_t (*SetMute)(uint16_t, uint32_t);
  64. uint32_t (*SetOutputMode)(uint16_t, uint8_t);
  65. uint32_t (*Reset)(uint16_t);
  66. }AUDIO_DrvTypeDef;
  67. /**
  68. * @}
  69. */
  70. /**
  71. * @}
  72. */
  73. /**
  74. * @}
  75. */
  76. /**
  77. * @}
  78. */
  79. /**
  80. * @}
  81. */
  82. #ifdef __cplusplus
  83. }
  84. #endif
  85. #endif /* __AUDIO_H */
  86. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/