#include "conf_usb.h"
#include "debug.h"
#include "board.h"
#include "usb_drv.h"
#include "usb_host_enum.h"
#include "usb_host_task.h"
#include "usb_audio.h"
#include "host_audio_task.h"
#include <stdio.h>
#include "usb_stream_player.h"
#include "et024006dhu.h"
#include "cycle_counter.h"
#include "avr32_logo.h"
#include "audio_example.h"
Macros | |
#define | FONT_HEIGHT 14 |
#define | START_Y_DEMO_TEXT 33 |
#define | TIMER_MMI 1000 |
#define | TIMER_STARTUP 100 |
Functions | |
static void | display_box (uint32_t x, uint32_t y, uint32_t size_x, uint32_t size_y, uint16_t color, uint16_t edge_color) |
This function displays a box on the LCD. More... | |
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 cur) |
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_audio_task_shutdown (void) |
This function shuts the host audio task down. 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... | |
static void | mmi_activity_display (bool init, uint32_t fifo_cnt) |
This function displays the a bargraph indicating the state of the audio buffers and the PPM deviation between the incoming USB audio sampling frequency and the output DAC sampling frequency. More... | |
static void | mmi_display (void) |
This function displays the MMI interface and some static informations. More... | |
Variables | |
uint8_t * | __bss_start |
uint8_t * | __heap_end__ |
uint8_t * | __heap_start__ |
uint8_t * | _data |
uint8_t * | _edata |
uint8_t * | _estack |
uint8_t * | _stack |
volatile bool | audio_connected = false |
volatile uint8_t | audio_cpt_sof |
volatile bool | audio_new_device_connected = false |
uint8_t * | end |
host_audio_task_data_t * | host_audio_task_data = NULL |
uint8_t | interf_audio_stream |
static uint32_t | mmi_state =0 |
uint8_t | pipe_audio_in |
static uint16_t | sof_cnt |
t_cpu_time | timer |
#define FONT_HEIGHT 14 |
Referenced by mmi_activity_display(), and mmi_display().
#define START_Y_DEMO_TEXT 33 |
Referenced by mmi_activity_display(), and mmi_display().
#define TIMER_MMI 1000 |
Referenced by mmi_activity_display().
#define TIMER_STARTUP 100 |
Referenced by mmi_display().
|
static |
This function displays a box on the LCD.
References et024006_DrawFilledRect(), et024006_DrawHorizLine(), and et024006_DrawVertLine().
Referenced by mmi_activity_display().
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 | cur | ||
) |
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_audio_task_shutdown | ( | void | ) |
This function shuts the host audio task down.
References NULL, and player_shutdown().
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().
|
static |
This function displays the a bargraph indicating the state of the audio buffers and the PPM deviation between the incoming USB audio sampling frequency and the output DAC sampling frequency.
References BLACK, BLUE, BLUE_LEV, cpu_is_timeout(), cpu_ms_2_cy(), cpu_set_timeout(), display_box(), et024006_DrawFilledRect(), et024006_PrintString(), FCPU_HZ, FONT8x8, FONT_HEIGHT, get_heap_curr_used_size(), get_heap_free_size(), get_heap_total_used_size(), i, sprintf(), START_Y_DEMO_TEXT, TIMER_MMI, tmp, USB_STREAM_BUFFER_NUMBER, usb_stream_ppm_get(), val, and WHITE.
Referenced by host_audio_task(), and mmi_display().
|
static |
This function displays the MMI interface and some static informations.
References __bss_start, __heap_end__, __heap_start__, _data, _edata, _estack, _stack, AUDIO_DEMO_STRING, avr32_logo, AVR32_LOGO_HEIGHT, AVR32_LOGO_WIDTH, BLACK, BLUE, cpu_is_timeout(), cpu_ms_2_cy(), cpu_set_timeout(), cpu_stop_timeout(), end, et024006_DrawFilledRect(), ET024006_HEIGHT, et024006_PrintString(), et024006_PutPixmap(), ET024006_WIDTH, FCPU_HZ, FONT8x16, FONT8x8, FONT_HEIGHT, mmi_activity_display(), mmi_state, NULL, sprintf(), START_Y_DEMO_TEXT, TIMER_STARTUP, tmp, and WHITE.
Referenced by host_audio_task().
uint8_t* __bss_start |
uint8_t* __heap_end__ |
uint8_t* __heap_start__ |
uint8_t* _data |
uint8_t* _edata |
uint8_t* _estack |
uint8_t* _stack |
volatile uint8_t audio_cpt_sof |
uint8_t* end |
host_audio_task_data_t* host_audio_task_data = NULL |
Referenced by host_user_check_class().
uint8_t interf_audio_stream |
Referenced by host_audio_task().
|
static |
Referenced by mmi_display().
|
static |
Referenced by host_audio_task_init(), and host_sof_action().
t_cpu_time timer |