![]() |
LPCOpen Platform
LPCOpen Platform for NXP LPC Microcontrollers
|
Data Structures | |
struct | USB_ClassInfo_Audio_Host_t |
Audio Class Host Mode Configuration and State Structure. More... | |
Functions | |
uint8_t | Audio_Host_ConfigurePipes (USB_ClassInfo_Audio_Host_t *const AudioInterfaceInfo, uint16_t ConfigDescriptorSize, void *DeviceConfigDescriptor) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3) |
Host interface configuration routine, to configure a given Audio host interface instance using the Configuration Descriptor read from an attached USB device. This function automatically updates the given Audio Host instance's state values and configures the pipes required to communicate with the interface if it is found within the device. This should be called once after the stack has enumerated the attached device, while the host state machine is in the Addressed state. | |
uint8_t | Audio_Host_StartStopStreaming (USB_ClassInfo_Audio_Host_t *const AudioInterfaceInfo, const bool EnableStreaming) ATTR_NON_NULL_PTR_ARG(1) |
Starts or stops the audio streaming for the given configured Audio Host interface, allowing for audio samples to be send and/or received. | |
uint8_t | Audio_Host_GetSetEndpointProperty (USB_ClassInfo_Audio_Host_t *const AudioInterfaceInfo, const uint8_t DataPipeIndex, const uint8_t EndpointProperty, const uint8_t EndpointControl, const uint16_t DataLength, void *const Data) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(6) |
Gets or sets the specified property of a streaming audio class endpoint that is bound to a pipe in the given class instance. | |
static void | Audio_Host_USBTask (USB_ClassInfo_Audio_Host_t *const AudioInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1) ATTR_ALWAYS_INLINE |
General management task for a given Audio host class interface, required for the correct operation of the interface. This should be called frequently in the main program loop, before the master USB management task USB_USBTask(). | |
static bool | Audio_Host_IsSampleReceived (USB_ClassInfo_Audio_Host_t *const AudioInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1) ATTR_ALWAYS_INLINE |
Determines if the given audio interface is ready for a sample to be read from it, and selects the streaming IN pipe ready for reading. | |
static bool | Audio_Host_IsReadyForNextSample (USB_ClassInfo_Audio_Host_t *const AudioInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1) ATTR_ALWAYS_INLINE |
Determines if the given audio interface is ready to accept the next sample to be written to it, and selects the streaming OUT pipe ready for writing. | |
static int8_t | Audio_Host_ReadSample8 (USB_ClassInfo_Audio_Host_t *const AudioInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1) ATTR_ALWAYS_INLINE |
Reads the next 8-bit audio sample from the current audio interface. | |
static int16_t | Audio_Host_ReadSample16 (USB_ClassInfo_Audio_Host_t *const AudioInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1) ATTR_ALWAYS_INLINE |
Reads the next 16-bit audio sample from the current audio interface. | |
static int32_t | Audio_Host_ReadSample24 (USB_ClassInfo_Audio_Host_t *const AudioInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1) ATTR_ALWAYS_INLINE |
Reads the next 24-bit audio sample from the current audio interface. | |
static void | Audio_Host_WriteSample8 (USB_ClassInfo_Audio_Host_t *const AudioInterfaceInfo, const int8_t Sample) ATTR_NON_NULL_PTR_ARG(1) ATTR_ALWAYS_INLINE |
Writes the next 8-bit audio sample to the current audio interface. | |
static void | Audio_Host_WriteSample16 (USB_ClassInfo_Audio_Host_t *const AudioInterfaceInfo, const int16_t Sample) ATTR_NON_NULL_PTR_ARG(1) ATTR_ALWAYS_INLINE |
Writes the next 16-bit audio sample to the current audio interface. | |
static void | Audio_Host_WriteSample24 (USB_ClassInfo_Audio_Host_t *const AudioInterfaceInfo, const int32_t Sample) ATTR_NON_NULL_PTR_ARG(1) ATTR_ALWAYS_INLINE |
Writes the next 24-bit audio sample to the current audio interface. | |
The following files must be built with any user project that uses this module:
Host Mode USB Class driver framework interface, for the Audio 1.0 USB Class driver.
Enum for the possible error codes returned by the Audio_Host_ConfigurePipes() function.
Definition at line 108 of file AudioClassHost.h.
uint8_t Audio_Host_ConfigurePipes | ( | USB_ClassInfo_Audio_Host_t *const | AudioInterfaceInfo, |
uint16_t | ConfigDescriptorSize, | ||
void * | DeviceConfigDescriptor | ||
) |
Host interface configuration routine, to configure a given Audio host interface instance using the Configuration Descriptor read from an attached USB device. This function automatically updates the given Audio Host instance's state values and configures the pipes required to communicate with the interface if it is found within the device. This should be called once after the stack has enumerated the attached device, while the host state machine is in the Addressed state.
AudioInterfaceInfo | : Pointer to a structure containing an Audio Class host configuration and state. |
ConfigDescriptorSize | : Length of the attached device's Configuration Descriptor. |
DeviceConfigDescriptor | : Pointer to a buffer containing the attached device's Configuration Descriptor. |
Definition at line 43 of file AudioClassHost.c.
uint8_t Audio_Host_GetSetEndpointProperty | ( | USB_ClassInfo_Audio_Host_t *const | AudioInterfaceInfo, |
const uint8_t | DataPipeIndex, | ||
const uint8_t | EndpointProperty, | ||
const uint8_t | EndpointControl, | ||
const uint16_t | DataLength, | ||
void *const | Data | ||
) |
Gets or sets the specified property of a streaming audio class endpoint that is bound to a pipe in the given class instance.
AudioInterfaceInfo | : Pointer to a structure containing an Audio Class host configuration and state. |
DataPipeIndex | : Index of the data pipe whose bound endpoint is to be altered. |
EndpointProperty | : Property of the endpoint to get or set, a value from Audio_ClassRequests_t. |
EndpointControl | : Parameter of the endpoint to get or set, a value from Audio_EndpointControls_t. |
DataLength | : For SET operations, the length of the parameter data to set. For GET operations, the maximum length of the retrieved data. |
Data | : Pointer to a location where the parameter data is stored for SET operations, or where the retrieved data is to be stored for GET operations. |
Definition at line 216 of file AudioClassHost.c.
|
inlinestatic |
Determines if the given audio interface is ready to accept the next sample to be written to it, and selects the streaming OUT pipe ready for writing.
AudioInterfaceInfo | : Pointer to a structure containing an Audio Class configuration and state. |
true
if the given Audio interface is ready to accept the next sample, false
otherwise. Definition at line 222 of file AudioClassHost.h.
|
inlinestatic |
Determines if the given audio interface is ready for a sample to be read from it, and selects the streaming IN pipe ready for reading.
AudioInterfaceInfo | : Pointer to a structure containing an Audio Class configuration and state. |
true
if the given Audio interface has a sample to be read, false
otherwise. Definition at line 194 of file AudioClassHost.h.
|
inlinestatic |
Reads the next 16-bit audio sample from the current audio interface.
AudioInterfaceInfo | : Pointer to a structure containing an Audio Class configuration and state. |
Definition at line 274 of file AudioClassHost.h.
|
inlinestatic |
Reads the next 24-bit audio sample from the current audio interface.
AudioInterfaceInfo | : Pointer to a structure containing an Audio Class configuration and state. |
Definition at line 303 of file AudioClassHost.h.
|
inlinestatic |
Reads the next 8-bit audio sample from the current audio interface.
AudioInterfaceInfo | : Pointer to a structure containing an Audio Class configuration and state. |
Definition at line 244 of file AudioClassHost.h.
uint8_t Audio_Host_StartStopStreaming | ( | USB_ClassInfo_Audio_Host_t *const | AudioInterfaceInfo, |
const bool | EnableStreaming | ||
) |
Starts or stops the audio streaming for the given configured Audio Host interface, allowing for audio samples to be send and/or received.
AudioInterfaceInfo | : Pointer to a structure containing an Audio Class host configuration and state. |
EnableStreaming | : Boolean true to enable streaming of the specified interface, false to disable |
Definition at line 205 of file AudioClassHost.c.
|
inlinestatic |
General management task for a given Audio host class interface, required for the correct operation of the interface. This should be called frequently in the main program loop, before the master USB management task USB_USBTask().
AudioInterfaceInfo | : Pointer to a structure containing an Audio Class host configuration and state. |
Definition at line 177 of file AudioClassHost.h.
|
inlinestatic |
Writes the next 16-bit audio sample to the current audio interface.
AudioInterfaceInfo | : Pointer to a structure containing an Audio Class configuration and state. |
Sample | : Signed 16-bit audio sample. |
Definition at line 362 of file AudioClassHost.h.
|
inlinestatic |
Writes the next 24-bit audio sample to the current audio interface.
AudioInterfaceInfo | : Pointer to a structure containing an Audio Class configuration and state. |
Sample | : Signed 24-bit audio sample. |
Definition at line 391 of file AudioClassHost.h.
|
inlinestatic |
Writes the next 8-bit audio sample to the current audio interface.
AudioInterfaceInfo | : Pointer to a structure containing an Audio Class configuration and state. |
Sample | : Signed 8-bit audio sample. |
Definition at line 333 of file AudioClassHost.h.