audio.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /**
  2. ******************************************************************************
  3. * @file audio.h
  4. * @author MCD Application Team
  5. * @version V4.0.1
  6. * @date 21-July-2015
  7. * @brief This header file contains the common defines and functions prototypes
  8. * for the Audio driver.
  9. ******************************************************************************
  10. * @attention
  11. *
  12. * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
  13. *
  14. * Redistribution and use in source and binary forms, with or without modification,
  15. * are permitted provided that the following conditions are met:
  16. * 1. Redistributions of source code must retain the above copyright notice,
  17. * this list of conditions and the following disclaimer.
  18. * 2. Redistributions in binary form must reproduce the above copyright notice,
  19. * this list of conditions and the following disclaimer in the documentation
  20. * and/or other materials provided with the distribution.
  21. * 3. Neither the name of STMicroelectronics nor the names of its contributors
  22. * may be used to endorse or promote products derived from this software
  23. * without specific prior written permission.
  24. *
  25. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  26. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  27. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  28. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  29. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  30. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  31. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  32. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  33. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  34. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  35. *
  36. ******************************************************************************
  37. */
  38. /* Define to prevent recursive inclusion -------------------------------------*/
  39. #ifndef __AUDIO_H
  40. #define __AUDIO_H
  41. #ifdef __cplusplus
  42. extern "C" {
  43. #endif
  44. /* Includes ------------------------------------------------------------------*/
  45. #include <stdint.h>
  46. /** @addtogroup BSP
  47. * @{
  48. */
  49. /** @addtogroup Components
  50. * @{
  51. */
  52. /** @addtogroup AUDIO
  53. * @{
  54. */
  55. /** @defgroup AUDIO_Exported_Constants
  56. * @{
  57. */
  58. /* Codec audio Standards */
  59. #define CODEC_STANDARD 0x04
  60. #define I2S_STANDARD I2S_STANDARD_PHILIPS
  61. /**
  62. * @}
  63. */
  64. /** @defgroup AUDIO_Exported_Types
  65. * @{
  66. */
  67. /** @defgroup AUDIO_Driver_structure Audio Driver structure
  68. * @{
  69. */
  70. typedef struct
  71. {
  72. uint32_t (*Init)(uint16_t, uint16_t, uint8_t, uint32_t);
  73. void (*DeInit)(void);
  74. uint32_t (*ReadID)(uint16_t);
  75. uint32_t (*Play)(uint16_t, uint16_t*, uint16_t);
  76. uint32_t (*Pause)(uint16_t);
  77. uint32_t (*Resume)(uint16_t);
  78. uint32_t (*Stop)(uint16_t, uint32_t);
  79. uint32_t (*SetFrequency)(uint16_t, uint32_t);
  80. uint32_t (*SetVolume)(uint16_t, uint8_t);
  81. uint32_t (*SetMute)(uint16_t, uint32_t);
  82. uint32_t (*SetOutputMode)(uint16_t, uint8_t);
  83. uint32_t (*Reset)(uint16_t);
  84. }AUDIO_DrvTypeDef;
  85. /**
  86. * @}
  87. */
  88. /**
  89. * @}
  90. */
  91. /**
  92. * @}
  93. */
  94. /**
  95. * @}
  96. */
  97. /**
  98. * @}
  99. */
  100. #ifdef __cplusplus
  101. }
  102. #endif
  103. #endif /* __AUDIO_H */
  104. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/