#include <stdio.h>
#include "usart.h"
#include "conf_usb.h"
#include "board.h"
#include "controller.h"
#include "usb_drv.h"
#include "usb_descriptors.h"
#include "usb_standard_request.h"
#include "device_audio_task.h"
#include "usb_stream_player.h"
#include "audio_example.h"
#include "et024006dhu.h"
#include "cycle_counter.h"
#include "debug.h"
#include "avr32_logo.h"
Data Structures | |
struct | microphone_st |
Holds the pointers on a ping-pong audio buffer. More... | |
Macros | |
#define | FONT_HEIGHT 14 |
#define | START_Y_DEMO_TEXT 33 |
#define | TIMER_MMI 1000 |
#define | TIMER_STARTUP 100 |
Functions | |
void | adc_sample_sent_cb (void) |
void | adc_underflow_cb (void) |
void | device_audio_disable_microphone (void) |
void | device_audio_enable_microphone (void) |
void | device_audio_task (void) |
Entry point of the device Audio task management. More... | |
void | device_audio_task_init (void) |
This function initializes the hardware/software resources required for device Audio task. More... | |
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... | |
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... | |
void | usb_sof_action (void) |
usb_sof_action More... | |
Variables | |
uint8_t * | __bss_start |
uint8_t * | _data |
uint8_t * | _edata |
uint8_t * | _estack |
uint8_t * | _stack |
static bool | b_microphone_pause =false |
Control the microphone autoreload interruption. More... | |
static bool | b_microphone_started =false |
Indicate if the microphone background interrupt is started or not. More... | |
device_audio_task_data_t * | device_audio_task_data = NULL |
uint8_t * | end |
static uint8_t | mic_buf_id = 0 |
Holds the current microphone id to be sent to the USB. More... | |
static uint8_t | mic_frame_id = 0 |
Holds the packet id that will make a perfect 44.1 KHz for the microphone output on the USB. More... | |
struct microphone_st | microphone [2] |
static uint32_t | mmi_state =0 |
bool | mute |
Public : (bit) mute mute is set to true when ACTIVE mute is set to false otherwise /. More... | |
void * | sample_buffer1 [2] |
static uint16_t | sof_cnt |
t_cpu_time | timer |
int16_t | volume |
Public : (int16_t) volume volume represents the current volume of audio stream /. More... | |
#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().
void adc_sample_sent_cb | ( | void | ) |
void adc_underflow_cb | ( | void | ) |
References b_microphone_started.
void device_audio_disable_microphone | ( | void | ) |
References b_microphone_pause.
Referenced by audio_speaker_set_sample_freq().
void device_audio_enable_microphone | ( | void | ) |
References b_microphone_pause.
Referenced by audio_speaker_set_sample_freq().
void device_audio_task | ( | void | ) |
Entry point of the device Audio task management.
References audio_mixer_dacs_input, b_microphone_started, buffer, EP_AUDIO_IN, EP_AUDIO_OUT, EP_SIZE_IN, i, Is_device_enumerated, is_joystick_pressed(), Is_usb_out_received, Is_usb_write_enabled, mic_buf_id, mic_frame_id, microphone, mmi_activity_display(), mmi_display(), mmi_state, mute, NULL, sample_sound, SAMPLE_SOUND_LEN, microphone_st::size, Usb_ack_in_ready_send, Usb_ack_out_received_free, Usb_reset_endpoint_fifo_access, USB_STREAM_DEVICE, usb_stream_input(), usb_stream_resync(), Usb_write_endpoint_data, vTaskDelayUntil(), and xTaskGetTickCount().
Referenced by device_audio_task_init(), and main().
void device_audio_task_init | ( | void | ) |
This function initializes the hardware/software resources required for device Audio task.
References b_microphone_pause, b_microphone_started, microphone_st::buffer, device_audio_task(), Is_usb_device, microphone, NULL, player_init(), microphone_st::size, sof_cnt, SPEAKER_FREQUENCY, Usb_enable_sof_interrupt, usb_stream_init(), and xTaskCreate.
Referenced by main().
|
static |
This function displays a box on the LCD.
References et024006_DrawFilledRect(), et024006_DrawHorizLine(), and et024006_DrawVertLine().
Referenced by mmi_activity_display().
|
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(), and WHITE.
Referenced by device_audio_task(), and mmi_display().
|
static |
This function displays the MMI interface and some static informations.
References __bss_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, SPEAKER_FREQUENCY, sprintf(), START_Y_DEMO_TEXT, TIMER_STARTUP, tmp, and WHITE.
Referenced by device_audio_task().
uint8_t* __bss_start |
Referenced by mmi_display().
uint8_t* _data |
Referenced by mmi_display().
uint8_t* _edata |
Referenced by mmi_display().
uint8_t* _estack |
Referenced by mmi_display().
uint8_t* _stack |
Referenced by configure_memory_area(), and mmi_display().
Control the microphone autoreload interruption.
We need to sometimes prevent the IRL from reloading automatically in the case that you want to flush the entire codec. This may happen if you receive a SET_XXXXXX command from the USB.
Referenced by adc_sample_sent_cb(), device_audio_disable_microphone(), device_audio_enable_microphone(), and device_audio_task_init().
Indicate if the microphone background interrupt is started or not.
Referenced by adc_sample_sent_cb(), adc_underflow_cb(), device_audio_task(), and device_audio_task_init().
device_audio_task_data_t* device_audio_task_data = NULL |
uint8_t* end |
Referenced by config_file_get_value(), e_sensor_cmd_get_value(), membag_free(), mmi_display(), and sys_alloc().
|
static |
Holds the current microphone id to be sent to the USB.
Referenced by adc_sample_sent_cb(), and device_audio_task().
|
static |
Holds the packet id that will make a perfect 44.1 KHz for the microphone output on the USB.
The packets are sent each ms. The packet size is an integer number of 16-bits sample. So, we can not 44.1 sample each ms. We will send most of the time 44 samples, than 45 samples.
Referenced by adc_sample_sent_cb(), and device_audio_task().
struct microphone_st microphone[2] |
Referenced by adc_sample_sent_cb(), device_audio_task(), and device_audio_task_init().
|
static |
Referenced by device_audio_task(), and mmi_display().
bool mute |
Public : (bit) mute mute is set to true when ACTIVE mute is set to false otherwise /.
Referenced by adc_sample_sent_cb(), device_audio_task(), and ms3_dac_is_volume_muted().
void* sample_buffer1[2] |
|
static |
Referenced by device_audio_task_init(), and usb_sof_action().
t_cpu_time timer |
Referenced by cpu_delay_cy(), cpu_delay_ms(), cpu_delay_us(), and main().
int16_t volume |
Public : (int16_t) volume volume represents the current volume of audio stream /.
Referenced by aic23b_dac_decrease_volume(), aic23b_dac_get_average_headphone_volume(), aic23b_dac_increase_volume(), audio_mixer_dacs_get_volume_direct(), ms3_dac_decrease_volume(), ms3_dac_increase_volume(), ms3_dac_set_volume(), signal_source_init(), signal_source_set_volume(), state_machine_idle(), state_machine_source(), tpa6130_dac_decrease_volume(), tpa6130_dac_increase_volume(), tpa6130_dac_mute(), tpa6130_set_volume(), and volume_usb_to_appli().