F1 and F3 HAL / LL libraries
[betaflight.git] / lib / main / STM32F3 / Middlewares / ST / STM32_USB_Device_Library / Class / AUDIO / Src / usbd_audio_if_template.c
blob7fe5f4e9c763919a4244c6e47adb1220cbee2f90
1 /**
2 ******************************************************************************
3 * @file usbd_cdc_if_template.c
4 * @author MCD Application Team
5 * @version V2.4.2
6 * @date 11-December-2015
7 * @brief Generic media access Layer.
8 ******************************************************************************
9 * @attention
11 * <h2><center>&copy; COPYRIGHT 2015 STMicroelectronics</center></h2>
13 * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
14 * You may not use this file except in compliance with the License.
15 * You may obtain a copy of the License at:
17 * http://www.st.com/software_license_agreement_liberty_v2
19 * Unless required by applicable law or agreed to in writing, software
20 * distributed under the License is distributed on an "AS IS" BASIS,
21 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 * See the License for the specific language governing permissions and
23 * limitations under the License.
25 ******************************************************************************
26 */
28 /* Includes ------------------------------------------------------------------*/
29 #include "usbd_audio_if_template.h"
31 /** @addtogroup STM32_USB_DEVICE_LIBRARY
32 * @{
36 /** @defgroup USBD_AUDIO
37 * @brief usbd core module
38 * @{
39 */
41 /** @defgroup USBD_AUDIO_Private_TypesDefinitions
42 * @{
43 */
44 /**
45 * @}
46 */
49 /** @defgroup USBD_AUDIO_Private_Defines
50 * @{
51 */
52 /**
53 * @}
54 */
57 /** @defgroup USBD_AUDIO_Private_Macros
58 * @{
59 */
61 /**
62 * @}
63 */
66 /** @defgroup USBD_AUDIO_Private_FunctionPrototypes
67 * @{
70 static int8_t TEMPLATE_Init (uint32_t AudioFreq, uint32_t Volume, uint32_t options);
71 static int8_t TEMPLATE_DeInit (uint32_t options);
72 static int8_t TEMPLATE_AudioCmd (uint8_t* pbuf, uint32_t size, uint8_t cmd);
73 static int8_t TEMPLATE_VolumeCtl (uint8_t vol);
74 static int8_t TEMPLATE_MuteCtl (uint8_t cmd);
75 static int8_t TEMPLATE_PeriodicTC (uint8_t cmd);
76 static int8_t TEMPLATE_GetState (void);
78 USBD_AUDIO_ItfTypeDef USBD_AUDIO_Template_fops =
80 TEMPLATE_Init,
81 TEMPLATE_DeInit,
82 TEMPLATE_AudioCmd,
83 TEMPLATE_VolumeCtl,
84 TEMPLATE_MuteCtl,
85 TEMPLATE_PeriodicTC,
86 TEMPLATE_GetState,
89 /* Private functions ---------------------------------------------------------*/
91 /**
92 * @brief TEMPLATE_Init
93 * Initializes the AUDIO media low layer
94 * @param None
95 * @retval Result of the operation: USBD_OK if all operations are OK else USBD_FAIL
97 static int8_t TEMPLATE_Init(uint32_t AudioFreq, uint32_t Volume, uint32_t options)
100 Add your initialization code here
102 return (0);
106 * @brief TEMPLATE_DeInit
107 * DeInitializes the AUDIO media low layer
108 * @param None
109 * @retval Result of the operation: USBD_OK if all operations are OK else USBD_FAIL
111 static int8_t TEMPLATE_DeInit(uint32_t options)
114 Add your deinitialization code here
116 return (0);
121 * @brief TEMPLATE_AudioCmd
122 * AUDIO command handler
123 * @param Buf: Buffer of data to be sent
124 * @param size: Number of data to be sent (in bytes)
125 * @param cmd: command opcode
126 * @retval Result of the operation: USBD_OK if all operations are OK else USBD_FAIL
128 static int8_t TEMPLATE_AudioCmd (uint8_t* pbuf, uint32_t size, uint8_t cmd)
131 return (0);
135 * @brief TEMPLATE_VolumeCtl
136 * @param vol: volume level (0..100)
137 * @retval Result of the operation: USBD_OK if all operations are OK else USBD_FAIL
139 static int8_t TEMPLATE_VolumeCtl (uint8_t vol)
142 return (0);
146 * @brief TEMPLATE_MuteCtl
147 * @param cmd: vmute command
148 * @retval Result of the operation: USBD_OK if all operations are OK else USBD_FAIL
150 static int8_t TEMPLATE_MuteCtl (uint8_t cmd)
153 return (0);
157 * @brief TEMPLATE_PeriodicTC
158 * @param cmd
159 * @retval Result of the operation: USBD_OK if all operations are OK else USBD_FAIL
161 static int8_t TEMPLATE_PeriodicTC (uint8_t cmd)
164 return (0);
168 * @brief TEMPLATE_GetState
169 * @param None
170 * @retval Result of the operation: USBD_OK if all operations are OK else USBD_FAIL
172 static int8_t TEMPLATE_GetState (void)
175 return (0);
178 * @}
182 * @}
186 * @}
189 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/