#include "conf_usb.h"
#include "usb_host_task.h"
Data Structures | |
struct | cs_feature_unit_t |
struct | host_audio_task_data_t |
Macros | |
#define | Is_host_audio_configured() (audio_connected && !Is_host_suspended()) |
#define | MAX_BMA_CONTROLS 4 |
Define for each 'feature unit' the max numbers of bmControls. More... | |
#define | MAX_FEATURE_UNITS 3 |
Define for each 'feature unit' the max numbers of bmaControls One of them is used by the microphone! More... | |
#define | MUTE_OFF false |
#define | MUTE_ON true |
Functions | |
uint16_t | host_audio_get_max (uint16_t unit, uint16_t channel_number) |
This function returns the 'MAX setting' feature of a particular unit. More... | |
void | host_audio_set_alt_interface (void) |
void | host_audio_set_cur (uint16_t unit, uint16_t channel_number, uint16_t volume) |
This function set the 'current setting' feature of a particular unit. More... | |
void | host_audio_set_cur_mute (uint16_t unit, bool cs_mute) |
This function controls the Mute feature of a particular unit. More... | |
void | host_audio_task (void) |
This function manages the host audio task. More... | |
void | host_audio_task_init (void) |
This function initializes the host audio task. More... | |
void | host_set_sampling_rate (uint16_t endpoint, uint32_t sampling_rate) |
This function selects one of the sampling rate of the streaming interface. More... | |
void | host_sof_action (void) |
host_sof_action More... | |
Variables | |
volatile bool | audio_connected |
host_audio_task_data_t * | host_audio_task_data |
#define Is_host_audio_configured | ( | ) | (audio_connected && !Is_host_suspended()) |
#define MAX_BMA_CONTROLS 4 |
Define for each 'feature unit' the max numbers of bmControls.
#define MAX_FEATURE_UNITS 3 |
Define for each 'feature unit' the max numbers of bmaControls One of them is used by the microphone!
#define MUTE_OFF false |
#define MUTE_ON true |
uint16_t host_audio_get_max | ( | uint16_t | unit, |
uint16_t | channel_number | ||
) |
This function returns the 'MAX setting' feature of a particular unit.
References S_usb_setup_data::bmRequestType, BR_REQUEST_GET_MAX, S_usb_setup_data::bRequest, CS_VOLUME, data_stage, host_transfer_control(), S_usb_setup_data::incomplete_read, LSB, max, MSB, usb_request, S_usb_setup_data::wIndex, S_usb_setup_data::wLength, and S_usb_setup_data::wValue.
Referenced by host_audio_task().
void host_audio_set_alt_interface | ( | void | ) |
References host_set_interface, and host_audio_task_data_t::interf_audio_stream.
Referenced by host_audio_task().
void host_audio_set_cur | ( | uint16_t | unit, |
uint16_t | channel_number, | ||
uint16_t | volume | ||
) |
This function set the 'current setting' feature of a particular unit.
References S_usb_setup_data::bmRequestType, BR_REQUEST_SET_CUR, S_usb_setup_data::bRequest, CS_VOLUME, data_stage, host_transfer_control(), S_usb_setup_data::incomplete_read, LSB, MSB, usb_request, S_usb_setup_data::wIndex, S_usb_setup_data::wLength, and S_usb_setup_data::wValue.
Referenced by host_audio_task().
void host_audio_set_cur_mute | ( | uint16_t | unit, |
bool | cs_mute | ||
) |
This function controls the Mute feature of a particular unit.
References S_usb_setup_data::bmRequestType, BR_REQUEST_SET_CUR, S_usb_setup_data::bRequest, CS_MUTE, data_stage, host_transfer_control(), S_usb_setup_data::incomplete_read, usb_request, S_usb_setup_data::wIndex, S_usb_setup_data::wLength, and S_usb_setup_data::wValue.
Referenced by host_audio_task().
void host_audio_task | ( | void | ) |
This function manages the host audio task.
References AUDIO_CLASS, audio_connected, audio_new_device_connected, AUDIOSTREAMING_SUBCLASS, cs_feature_unit_t::bmaControls, host_audio_task_data_t::g_cs_feature, host_audio_task_data_t::g_cs_num_features_unit, host_audio_task_data_t::g_n_bits_per_sample, host_audio_task_data_t::g_n_channels, host_audio_task_data_t::g_sample_freq, Get_class, Get_ep_pipe, Get_interface_number, Get_nb_ep, Get_nb_supported_interface, Get_subclass, Host_ack_in_received, Host_ack_nak_received, host_audio_get_max(), host_audio_set_alt_interface(), host_audio_set_cur(), host_audio_set_cur_mute(), Host_enable_continuous_in_mode, Host_enable_sof_interrupt, Host_free_in, Host_get_pipe_endpoint_number, host_set_sampling_rate(), Host_unfreeze_pipe, i, host_audio_task_data_t::interf_audio_stream, interf_audio_stream, Is_ep_in, Is_host_in_received, Is_host_nak_received, Is_host_ready, Is_host_stall, j, max, mmi_activity_display(), mmi_display(), MSK_EP_DIR, cs_feature_unit_t::n_bmaControls, PIPE_AUDIO_IN, pipe_audio_in, cs_feature_unit_t::unit, USB_STREAM_HOST, usb_stream_init(), usb_stream_input(), usb_stream_resync(), vTaskDelayUntil(), and xTaskGetTickCount().
Referenced by host_audio_task_init(), and main().
void host_audio_task_init | ( | void | ) |
This function initializes the host audio task.
References host_audio_task(), NULL, player_init(), sof_cnt, and xTaskCreate.
Referenced by main().
void host_set_sampling_rate | ( | uint16_t | endpoint, |
uint32_t | sampling_rate | ||
) |
This function selects one of the sampling rate of the streaming interface.
References S_usb_setup_data::bmRequestType, S_usb_setup_data::bRequest, data_stage, DEVICE_DESCRIPTOR, host_transfer_control(), S_usb_setup_data::incomplete_read, MSB1, MSB2, MSB3, usb_request, S_usb_setup_data::wIndex, S_usb_setup_data::wLength, and S_usb_setup_data::wValue.
Referenced by host_audio_task().
host_audio_task_data_t* host_audio_task_data |
Referenced by host_user_check_class().