forked from stm/stm32-mw-usb-device
Release v2.6.0
This commit is contained in:
@@ -50,6 +50,14 @@ extern "C" {
|
||||
#define USBD_MAX_NUM_INTERFACES 1U
|
||||
#endif /* USBD_AUDIO_FREQ */
|
||||
|
||||
#ifndef AUDIO_HS_BINTERVAL
|
||||
#define AUDIO_HS_BINTERVAL 0x01U
|
||||
#endif /* AUDIO_HS_BINTERVAL */
|
||||
|
||||
#ifndef AUDIO_FS_BINTERVAL
|
||||
#define AUDIO_FS_BINTERVAL 0x01U
|
||||
#endif /* AUDIO_FS_BINTERVAL */
|
||||
|
||||
#define AUDIO_OUT_EP 0x01U
|
||||
#define USB_AUDIO_CONFIG_DESC_SIZ 0x6DU
|
||||
#define AUDIO_INTERFACE_DESC_SIZE 0x09U
|
||||
@@ -91,6 +99,9 @@ extern "C" {
|
||||
|
||||
#define AUDIO_OUT_STREAMING_CTRL 0x02U
|
||||
|
||||
#define AUDIO_OUT_TC 0x01U
|
||||
#define AUDIO_IN_TC 0x02U
|
||||
|
||||
|
||||
#define AUDIO_OUT_PACKET (uint16_t)(((USBD_AUDIO_FREQ * 2U * 2U) / 1000U))
|
||||
#define AUDIO_DEFAULT_VOLUME 70U
|
||||
@@ -116,8 +127,7 @@ typedef enum
|
||||
AUDIO_OFFSET_HALF,
|
||||
AUDIO_OFFSET_FULL,
|
||||
AUDIO_OFFSET_UNKNOWN,
|
||||
}
|
||||
AUDIO_OffsetTypeDef;
|
||||
} AUDIO_OffsetTypeDef;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
@@ -132,32 +142,29 @@ typedef struct
|
||||
uint8_t data[USB_MAX_EP0_SIZE];
|
||||
uint8_t len;
|
||||
uint8_t unit;
|
||||
}
|
||||
USBD_AUDIO_ControlTypeDef;
|
||||
|
||||
} USBD_AUDIO_ControlTypeDef;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t alt_setting;
|
||||
uint8_t buffer[AUDIO_TOTAL_BUF_SIZE];
|
||||
AUDIO_OffsetTypeDef offset;
|
||||
uint8_t rd_enable;
|
||||
uint16_t rd_ptr;
|
||||
uint16_t wr_ptr;
|
||||
uint32_t alt_setting;
|
||||
uint8_t buffer[AUDIO_TOTAL_BUF_SIZE];
|
||||
AUDIO_OffsetTypeDef offset;
|
||||
uint8_t rd_enable;
|
||||
uint16_t rd_ptr;
|
||||
uint16_t wr_ptr;
|
||||
USBD_AUDIO_ControlTypeDef control;
|
||||
}
|
||||
USBD_AUDIO_HandleTypeDef;
|
||||
} USBD_AUDIO_HandleTypeDef;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int8_t (*Init)(uint32_t AudioFreq, uint32_t Volume, uint32_t options);
|
||||
int8_t (*Init)(uint32_t AudioFreq, uint32_t Volume, uint32_t options);
|
||||
int8_t (*DeInit)(uint32_t options);
|
||||
int8_t (*AudioCmd)(uint8_t *pbuf, uint32_t size, uint8_t cmd);
|
||||
int8_t (*VolumeCtl)(uint8_t vol);
|
||||
int8_t (*MuteCtl)(uint8_t cmd);
|
||||
int8_t (*PeriodicTC)(uint8_t cmd);
|
||||
int8_t (*PeriodicTC)(uint8_t *pbuf, uint32_t size, uint8_t cmd);
|
||||
int8_t (*GetState)(void);
|
||||
} USBD_AUDIO_ItfTypeDef;
|
||||
/**
|
||||
@@ -178,8 +185,8 @@ typedef struct
|
||||
* @{
|
||||
*/
|
||||
|
||||
extern USBD_ClassTypeDef USBD_AUDIO;
|
||||
#define USBD_AUDIO_CLASS &USBD_AUDIO
|
||||
extern USBD_ClassTypeDef USBD_AUDIO;
|
||||
#define USBD_AUDIO_CLASS &USBD_AUDIO
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
@@ -187,10 +194,10 @@ extern USBD_ClassTypeDef USBD_AUDIO;
|
||||
/** @defgroup USB_CORE_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
uint8_t USBD_AUDIO_RegisterInterface(USBD_HandleTypeDef *pdev,
|
||||
USBD_AUDIO_ItfTypeDef *fops);
|
||||
uint8_t USBD_AUDIO_RegisterInterface(USBD_HandleTypeDef *pdev,
|
||||
USBD_AUDIO_ItfTypeDef *fops);
|
||||
|
||||
void USBD_AUDIO_Sync(USBD_HandleTypeDef *pdev, AUDIO_OffsetTypeDef offset);
|
||||
void USBD_AUDIO_Sync(USBD_HandleTypeDef *pdev, AUDIO_OffsetTypeDef offset);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user