Microchip® Advanced Software Framework

host_audio_task.c File Reference
#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_thost_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
#define START_Y_DEMO_TEXT   33
#define TIMER_MMI   1000

Referenced by mmi_activity_display().

#define TIMER_STARTUP   100

Referenced by mmi_display().

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 
)
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 
)
void host_audio_set_alt_interface ( void  )
void host_audio_set_cur ( uint16_t  unit,
uint16_t  channel_number,
uint16_t  cur 
)
void host_audio_set_cur_mute ( uint16_t  unit,
bool  cs_mute 
)
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 
)
static void mmi_activity_display ( bool  init,
uint32_t  fifo_cnt 
)
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().

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().

uint32_t mmi_state =0
static

Referenced by mmi_display().

uint16_t sof_cnt
static
t_cpu_time timer