This file manages the USB device Audio task.
Definition in file device_audio_task.c.
#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"
Go to the source code of this file.
Data Structures | |
struct | microphone_st |
Holds the pointers on a ping-pong audio buffer. More... | |
Defines | |
#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. | |
void | device_audio_task_init (void) |
This function initializes the hardware/software resources required for device Audio task. | |
static void | display_box (U32 x, U32 y, U32 size_x, U32 size_y, U16 color, U16 edge_color) |
This function displays a box on the LCD. | |
static void | mmi_activity_display (Bool init, U32 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. | |
static void | mmi_display (void) |
This function displays the MMI interface and some static informations. | |
void | usb_sof_action (void) |
usb_sof_action | |
Variables | |
U8 * | __bss_start |
U8 * | _data |
U8 * | _edata |
U8 * | _estack |
U8 * | _stack |
static Bool | b_microphone_pause = FALSE |
Control the microphone autoreload interruption. | |
static Bool | b_microphone_started = FALSE |
Indicate if the microphone background interrupt is started or not. | |
device_audio_task_data_t * | device_audio_task_data = NULL |
U8 * | end |
static U8 | mic_buf_id = 0 |
Holds the current microphone id to be sent to the USB. | |
static U8 | mic_frame_id = 0 |
Holds the packet id that will make a perfect 44.1 KHz for the microphone output on the USB. | |
struct microphone_st | microphone [2] |
static U32 | mmi_state = 0 |
Bool | mute |
Public : (bit) mute mute is set to TRUE when ACTIVE mute is set to FALSE otherwise /. | |
void * | sample_buffer1 [2] |
static U16 | sof_cnt |
t_cpu_time | timer |
S16 | volume |
Public : (S16) volume volume represents the current volume of audio stream /. |
#define FONT_HEIGHT 14 |
Definition at line 90 of file device_audio_task.c.
Referenced by mmi_activity_display(), and mmi_display().
#define START_Y_DEMO_TEXT 33 |
Definition at line 88 of file device_audio_task.c.
Referenced by mmi_activity_display(), and mmi_display().
#define TIMER_MMI 1000 |
Referenced by mmi_activity_display().
#define TIMER_STARTUP 100 |
Definition at line 87 of file device_audio_task.c.
Referenced by device_hid_task_init(), and mmi_display().
void adc_sample_sent_cb | ( | void | ) |
Definition at line 540 of file device_audio_task.c.
References b_microphone_pause, b_microphone_started, microphone_st::buffer, EP_AUDIO_IN, mic_buf_id, mic_frame_id, microphone, mute, and microphone_st::size.
00541 { 00542 U32 i; 00543 U8 old_mic_buf_id=mic_buf_id; 00544 00545 if (!b_microphone_pause && Is_usb_write_enabled(EP_AUDIO_IN) && audio_mixer_dacs_input(NULL, 0) ) // Endpoint buffer free ? 00546 { 00547 mic_frame_id++; 00548 if( mic_frame_id>=10 ) 00549 { 00550 mic_frame_id=0; 00551 microphone[mic_buf_id].size = 45; 00552 } 00553 else 00554 microphone[mic_buf_id].size = 44; 00555 00556 Usb_reset_endpoint_fifo_access(EP_AUDIO_IN); 00557 if(!mute) 00558 { 00559 for(i = 0; i < microphone[old_mic_buf_id].size; i++) 00560 { 00561 Usb_write_endpoint_data(EP_AUDIO_IN, 8, LSB(microphone[old_mic_buf_id].buffer[2 * i])); 00562 Usb_write_endpoint_data(EP_AUDIO_IN, 8, MSB(microphone[old_mic_buf_id].buffer[2 * i])); 00563 } 00564 } 00565 else 00566 { 00567 for(i = 0; i < 2*microphone[old_mic_buf_id].size; i++) 00568 { 00569 Usb_write_endpoint_data(EP_AUDIO_IN, 8, 0); 00570 } 00571 } 00572 Usb_ack_in_ready_send(EP_AUDIO_IN); 00573 00574 audio_mixer_dacs_input(microphone[mic_buf_id].buffer, 45/*microphone[mic_buf_id].size*/); 00575 // Let's switch to the next buffer. 00576 mic_buf_id^=1; 00577 } 00578 else 00579 b_microphone_started=FALSE; 00580 }
void adc_underflow_cb | ( | void | ) |
Definition at line 535 of file device_audio_task.c.
References b_microphone_started.
00536 { 00537 b_microphone_started=FALSE; 00538 }
void device_audio_disable_microphone | ( | void | ) |
Definition at line 582 of file device_audio_task.c.
References b_microphone_pause.
Referenced by audio_speaker_set_sample_freq().
00583 { 00584 b_microphone_pause=TRUE; 00585 }
void device_audio_enable_microphone | ( | void | ) |
Definition at line 587 of file device_audio_task.c.
References b_microphone_pause.
Referenced by audio_speaker_set_sample_freq().
00588 { 00589 b_microphone_pause=FALSE; 00590 }
void device_audio_task | ( | void | ) |
Entry point of the device Audio task management.
Definition at line 431 of file device_audio_task.c.
References b_microphone_started, microphone_st::buffer, EP_AUDIO_IN, EP_AUDIO_OUT, EP_SIZE_IN, is_joystick_pressed(), mic_buf_id, mic_frame_id, microphone, mmi_activity_display(), mmi_display(), mmi_state, mute, sample_sound, SAMPLE_SOUND_LEN, and microphone_st::size.
Referenced by device_audio_task_init(), and main().
00433 { 00434 #if( BOARD!=EVK1105) || (DEFAULT_DACS!=AUDIO_MIXER_DAC_AIC23B) 00435 U32 i; 00436 #endif 00437 U32 fifo_cnt; 00438 int stream_status; 00439 00440 #ifdef FREERTOS_USED 00441 portTickType xLastWakeTime; 00442 xLastWakeTime = xTaskGetTickCount(); 00443 LED_On(LED0); 00444 00445 while (TRUE) 00446 { 00447 vTaskDelayUntil(&xLastWakeTime, configTSK_USB_DAUDIO_PERIOD); 00448 00449 // First, check the device enumeration state 00450 if (!Is_device_enumerated()) { mmi_state=0; continue; } 00451 #else 00452 // First, check the device enumeration state 00453 if (!Is_device_enumerated()) { mmi_state=0; return; } 00454 #endif // FREERTOS_USED 00455 00456 mmi_display(); 00457 00458 #if( BOARD!=EVK1105) || (DEFAULT_DACS!=AUDIO_MIXER_DAC_AIC23B) 00459 // Microphone emulation 00460 // 00461 if ( is_joystick_pressed() ) 00462 { 00463 if (Is_usb_write_enabled(EP_AUDIO_IN)) // Endpoint buffer free ? 00464 { 00465 Usb_reset_endpoint_fifo_access(EP_AUDIO_IN); 00466 for( i=0 ; i<EP_SIZE_IN ; i++ ) // Fill endpoint with sample raw 00467 { 00468 if(mute==FALSE) 00469 { 00470 U8 sample; 00471 sample = sample_sound[dat_sample_index++]; 00472 LED_Set_Intensity(LED0, sample); 00473 Usb_write_endpoint_data(EP_AUDIO_IN, 8, sample); 00474 if (dat_sample_index >= SAMPLE_SOUND_LEN) 00475 { dat_sample_index=0; } 00476 } 00477 else 00478 { 00479 LED_Set_Intensity(LED0, 0); 00480 Usb_write_endpoint_data(EP_AUDIO_IN, 8, 0x00); 00481 } 00482 } 00483 Usb_ack_in_ready_send(EP_AUDIO_IN); 00484 } 00485 } 00486 #else 00487 // Handle input stream from microphone 00488 if( !b_microphone_started && (Is_usb_write_enabled(EP_AUDIO_IN)) && audio_mixer_dacs_input(NULL, 0) ) 00489 { 00490 // Start ADC conversion. This will launch the IRL in background... 00491 mic_buf_id = 0; 00492 mic_frame_id=2; 00493 microphone[mic_buf_id].size=45; 00494 audio_mixer_dacs_input(microphone[0].buffer, 45 /*microphone[mic_buf_id].size*/); 00495 audio_mixer_dacs_input(microphone[1].buffer, 45 /*microphone[mic_buf_id].size*/); 00496 b_microphone_started=TRUE; 00497 } 00498 #endif 00499 00500 00501 00502 // Handle incoming audio samples 00503 // 00504 if((Is_usb_out_received(EP_AUDIO_OUT) ) 00505 /*&& (Is_usb_stall(EP_AUDIO_OUT)==FALSE)*/) 00506 { 00507 stream_status = usb_stream_input(USB_STREAM_DEVICE, EP_AUDIO_OUT, &fifo_cnt); 00508 Usb_ack_out_received_free(EP_AUDIO_OUT); 00509 mmi_activity_display(FALSE, fifo_cnt); 00510 } 00511 #if USB_RESYNC_AUDIO_STREAM && (USB_RESYNC_AUDIO_STREAM==ENABLED) 00512 usb_stream_resync(); 00513 #endif 00514 00515 #ifdef FREERTOS_USED 00516 } 00517 #endif 00518 }
void device_audio_task_init | ( | void | ) |
This function initializes the hardware/software resources required for device Audio task.
Definition at line 154 of file device_audio_task.c.
References b_microphone_pause, b_microphone_started, microphone_st::buffer, device_audio_task(), microphone, microphone_st::size, sof_cnt, and SPEAKER_FREQUENCY.
Referenced by main().
00155 { 00156 sof_cnt =0; 00157 #if (BOARD!=EVK1105) 00158 dat_sample_index =0; 00159 #endif 00160 00161 #ifndef FREERTOS_USED 00162 #if USB_HOST_FEATURE == ENABLED 00163 // If both device and host features are enabled, check if device mode is engaged 00164 // (accessing the USB registers of a non-engaged mode, even with load operations, 00165 // may corrupt USB FIFO data). 00166 if (Is_usb_device()) 00167 #endif // USB_HOST_FEATURE == ENABLED 00168 Usb_enable_sof_interrupt(); 00169 #endif // FREERTOS_USED 00170 00171 player_init(); 00172 00173 if (!device_audio_task_data) 00174 device_audio_task_data = calloc(1, sizeof(*device_audio_task_data)); 00175 00176 #if (BOARD==EVK1105) && (DEFAULT_DACS==AUDIO_MIXER_DAC_AIC23B) 00177 // Allocate memory for the microphone audio samples. 00178 // Receiving stereo samples from the ADC. 00179 // For a 48KHz, needs 196 bytes. Let's use a little more. 00180 microphone[0].buffer= (U16*)malloc(200); 00181 microphone[0].size = 0; 00182 microphone[1].buffer= (U16*)malloc(200); 00183 microphone[1].size = 0; 00184 b_microphone_started=FALSE; 00185 b_microphone_pause=FALSE; 00186 #endif 00187 00188 usb_stream_init( 00189 SPEAKER_FREQUENCY 00190 , 2 00191 , 16 00192 , FALSE 00193 ); 00194 00195 #ifdef FREERTOS_USED 00196 xTaskCreate(device_audio_task, 00197 configTSK_USB_DAUDIO_NAME, 00198 configTSK_USB_DAUDIO_STACK_SIZE, 00199 NULL, 00200 configTSK_USB_DAUDIO_PRIORITY, 00201 NULL); 00202 00203 #endif // FREERTOS_USED 00204 }
static void display_box | ( | U32 | x, | |
U32 | y, | |||
U32 | size_x, | |||
U32 | size_y, | |||
U16 | color, | |||
U16 | edge_color | |||
) | [static] |
This function displays a box on the LCD.
Definition at line 222 of file device_audio_task.c.
Referenced by mmi_activity_display().
00223 { 00224 et024006_DrawFilledRect(x, y, size_x, size_y, color); 00225 et024006_DrawHorizLine(x, y, size_x, edge_color); 00226 et024006_DrawVertLine(x+size_x-1, y, size_y, edge_color); 00227 et024006_DrawHorizLine(x, y+size_y-1, size_x, edge_color); 00228 et024006_DrawVertLine(x, y, size_y, edge_color); 00229 }
static void mmi_activity_display | ( | Bool | init, | |
U32 | 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.
Definition at line 319 of file device_audio_task.c.
References display_box(), FCPU_HZ, FONT_HEIGHT, START_Y_DEMO_TEXT, TIMER_MMI, and USB_STREAM_BUFFER_NUMBER.
Referenced by device_audio_task(), and mmi_display().
00320 { 00321 static char tmp[20]; 00322 static S32 ppm; 00323 #define TIMER_MMI 1000 // Unit is in ms. 00324 static t_cpu_time mmi_timer; 00325 static U32 old_fcpu_hz = 0; 00326 static U32 mmi_activity_state=0; 00327 static U32 i; 00328 00329 if( init ) 00330 { 00331 // Display PPM window 00332 et024006_PrintString("PPM", (const unsigned char *)&FONT8x8, 22, 70+4, BLUE, -1); 00333 display_box(50, 70, 40, 16, WHITE, BLACK); 00334 00335 et024006_PrintString("HID", (const unsigned char *)&FONT8x8, 122, 70+4, BLUE, -1); 00336 display_box(150, 70, 40, 16, WHITE, BLACK); 00337 00338 et024006_PrintString("CPU", (const unsigned char *)&FONT8x8, 222, 70+4, BLUE, -1); 00339 display_box(250, 70, 40, 16, WHITE, BLACK); 00340 00341 et024006_PrintString("Buffers", (const unsigned char *)&FONT8x8, 0, 50+4, BLUE, -1); 00342 display_box(50, 50, 195, 16, WHITE, BLACK); 00343 cpu_set_timeout( cpu_ms_2_cy(TIMER_MMI, FCPU_HZ), &mmi_timer ); 00344 goto mmi_end; 00345 } 00346 00347 if( !cpu_is_timeout(&mmi_timer) ) 00348 goto mmi_end; 00349 00350 switch( mmi_activity_state ) 00351 { 00352 case 0: 00353 i = 0; 00354 mmi_activity_state = 1; 00355 // no break here 00356 00357 case 1: 00358 if( i>=USB_STREAM_BUFFER_NUMBER ) 00359 { 00360 mmi_activity_state = 10; 00361 break; 00362 } 00363 if( i<fifo_cnt ) 00364 et024006_DrawFilledRect(50+3 + i*(10+2), 50+3, 10, 10, BLUE_LEV(15) ); 00365 else 00366 et024006_DrawFilledRect(50+3 + i*(10+2), 50+3, 10, 10, WHITE ); 00367 i++; 00368 break; 00369 00370 case 10: 00371 ppm = usb_stream_ppm_get(); 00372 sprintf( tmp, "%4ld", ppm ); 00373 et024006_PrintString(tmp, (const unsigned char *)&FONT8x8, 50+4, 70+4, BLUE, WHITE); 00374 mmi_activity_state = 20; 00375 break; 00376 00377 case 20: 00378 if( old_fcpu_hz==FCPU_HZ ) 00379 { 00380 mmi_activity_state = 30; 00381 break; 00382 } 00383 else 00384 mmi_activity_state = 21; 00385 // No break here 00386 00387 case 21: 00388 old_fcpu_hz=FCPU_HZ; 00389 sprintf( tmp, "%ld", (U32)FCPU_HZ/1000000); 00390 et024006_PrintString(tmp, (const unsigned char *)&FONT8x8, 250+4, 70+4, BLUE, WHITE); 00391 mmi_activity_state = 30; 00392 break; 00393 00394 #if (defined __GNUC__) 00395 case 30: 00396 sprintf( tmp, "%ld", get_heap_total_used_size() ); 00397 et024006_PrintString(tmp, (const unsigned char *)&FONT8x8, 230, START_Y_DEMO_TEXT+13*FONT_HEIGHT, BLUE, WHITE); 00398 mmi_activity_state = 31; 00399 break; 00400 00401 case 31: 00402 sprintf( tmp, "%ld", get_heap_curr_used_size() ); 00403 et024006_PrintString(tmp, (const unsigned char *)&FONT8x8, 230, START_Y_DEMO_TEXT+14*FONT_HEIGHT, BLUE, WHITE); 00404 // No break here 00405 #elif (defined __ICCAVR32__) 00406 case 30: 00407 sprintf( tmp, "%ld", get_heap_free_size() ); 00408 et024006_PrintString(tmp, (const unsigned char *)&FONT8x8, 230, START_Y_DEMO_TEXT+14*FONT_HEIGHT, BLUE, WHITE); 00409 // No break here 00410 00411 #endif 00412 00413 default: 00414 // Rearm timer 00415 cpu_set_timeout( cpu_ms_2_cy(TIMER_MMI, FCPU_HZ), &mmi_timer ); 00416 mmi_activity_state = 0; 00417 break; 00418 } 00419 00420 mmi_end: 00421 return; 00422 }
static void mmi_display | ( | void | ) | [static] |
This function displays the MMI interface and some static informations.
Definition at line 235 of file device_audio_task.c.
References __bss_start, _data, _edata, _estack, _stack, AUDIO_DEMO_STRING, avr32_logo, AVR32_LOGO_HEIGHT, AVR32_LOGO_WIDTH, end, FCPU_HZ, FONT_HEIGHT, mmi_activity_display(), mmi_state, START_Y_DEMO_TEXT, timer, and TIMER_STARTUP.
Referenced by device_audio_task().
00236 { 00237 #if (defined __GNUC__) 00238 char tmp[64]; 00239 #endif 00240 if( mmi_state!=11 ) 00241 { 00242 if( mmi_state==0 ) 00243 { 00244 cpu_set_timeout( cpu_ms_2_cy(TIMER_STARTUP, FCPU_HZ), &timer ); 00245 mmi_state++; 00246 } 00247 else if( cpu_is_timeout(&timer) ) 00248 { 00249 switch( mmi_state++ ) 00250 { 00251 case 1: 00252 LED_On( LED0 ); 00253 cpu_set_timeout( cpu_ms_2_cy(TIMER_STARTUP, FCPU_HZ), &timer ); 00254 00255 // Clear the display 00256 et024006_DrawFilledRect(0, 0, ET024006_WIDTH, ET024006_HEIGHT, WHITE ); 00257 00258 // Display a logo. 00259 et024006_PutPixmap(avr32_logo, AVR32_LOGO_WIDTH, 0, 0 00260 ,(ET024006_WIDTH - AVR32_LOGO_WIDTH)/2 00261 ,(ET024006_HEIGHT - AVR32_LOGO_HEIGHT)/2, AVR32_LOGO_WIDTH, AVR32_LOGO_HEIGHT); 00262 et024006_PrintString(AUDIO_DEMO_STRING , (const unsigned char *)&FONT8x16, 30, 5, BLACK, -1); 00263 #if(defined USB_RESYNC_METHOD) 00264 #if (USB_RESYNC_METHOD == USB_RESYNC_METHOD_EXT_CLOCK_SYNTHESIZER) 00265 et024006_PrintString("32/44.1/48 KHz, HID, CS2200" , (const unsigned char *)&FONT8x8, 50, START_Y_DEMO_TEXT+0*FONT_HEIGHT, BLUE, -1); 00266 #elif (USB_RESYNC_METHOD == USB_RESYNC_METHOD_SOFT_ADAPTIF_SRC) 00267 et024006_PrintString("44.1 KHz, HID, adaptif SRC", (const unsigned char *)&FONT8x8, 50, START_Y_DEMO_TEXT+0*FONT_HEIGHT, BLUE, -1); 00268 #elif (USB_RESYNC_METHOD == USB_RESYNC_METHOD_SOFT_ADD_DEL_SAMPLES) 00269 et024006_PrintString("44.1 KHz, HID, Add/remove sample", (const unsigned char *)&FONT8x8, 50, START_Y_DEMO_TEXT+0*FONT_HEIGHT, BLUE, -1); 00270 #else 00271 #error Unknown synchronization method. 00272 #endif 00273 #endif 00274 00275 // Display bargraph window. 00276 mmi_activity_display(TRUE, (U32)NULL); 00277 00278 #if (defined __GNUC__) 00279 sprintf( tmp, "RAM (DATA): %ld bytes", (U32)&_edata-(U32)&_data); 00280 et024006_PrintString(tmp, (const unsigned char *)&FONT8x8, 50, START_Y_DEMO_TEXT+10*FONT_HEIGHT, BLUE, -1); 00281 00282 sprintf( tmp, "RAM (BSS): %ld bytes", (U32)&end-(U32)&__bss_start); 00283 et024006_PrintString(tmp, (const unsigned char *)&FONT8x8, 50, START_Y_DEMO_TEXT+11*FONT_HEIGHT, BLUE, -1); 00284 00285 sprintf( tmp, "RAM (STACK): %ld bytes", (U32)&_estack-(U32)&_stack); 00286 et024006_PrintString(tmp, (const unsigned char *)&FONT8x8, 50, START_Y_DEMO_TEXT+12*FONT_HEIGHT, BLUE, -1); 00287 #endif 00288 #if (defined __GNUC__) 00289 et024006_PrintString("RAM (total used HEAP): bytes", (const unsigned char *)&FONT8x8, 50, START_Y_DEMO_TEXT+13*FONT_HEIGHT, BLUE, WHITE); 00290 et024006_PrintString("RAM (curr used HEAP): bytes", (const unsigned char *)&FONT8x8, 50, START_Y_DEMO_TEXT+14*FONT_HEIGHT, BLUE, WHITE); 00291 #elif (defined __ICCAVR32__) 00292 et024006_PrintString("RAM (free HEAP): bytes", (const unsigned char *)&FONT8x8, 50, START_Y_DEMO_TEXT+14*FONT_HEIGHT, BLUE, WHITE); 00293 #endif 00294 break; 00295 00296 case 2: cpu_set_timeout( cpu_ms_2_cy(TIMER_STARTUP, FCPU_HZ), &timer ); LED_On( LED1 ); break; 00297 case 3: cpu_set_timeout( cpu_ms_2_cy(TIMER_STARTUP, FCPU_HZ), &timer ); LED_On( LED2 ); break; 00298 case 4: cpu_set_timeout( cpu_ms_2_cy(TIMER_STARTUP, FCPU_HZ), &timer ); LED_On( LED3 ); break; 00299 case 5: cpu_set_timeout( cpu_ms_2_cy(TIMER_STARTUP, FCPU_HZ), &timer ); LED_Off( LED0 ); break; 00300 case 6: cpu_set_timeout( cpu_ms_2_cy(TIMER_STARTUP, FCPU_HZ), &timer ); LED_Off( LED1 ); break; 00301 case 7: cpu_set_timeout( cpu_ms_2_cy(TIMER_STARTUP, FCPU_HZ), &timer ); LED_Off( LED2 ); break; 00302 case 8: 00303 LED_Off( LED3 ); 00304 cpu_stop_timeout(&timer); 00305 break; 00306 00307 default: 00308 break; 00309 } 00310 } 00311 } 00312 }
U8* __bss_start |
Referenced by mmi_display().
U8* _data |
Referenced by mmi_display().
U8* _edata |
Referenced by mmi_display().
U8* _estack |
Referenced by mmi_display().
U8* _stack |
Referenced by mmi_display().
Bool b_microphone_pause = FALSE [static] |
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.
Definition at line 135 of file device_audio_task.c.
Referenced by adc_sample_sent_cb(), device_audio_disable_microphone(), device_audio_enable_microphone(), and device_audio_task_init().
Bool b_microphone_started = FALSE [static] |
Indicate if the microphone background interrupt is started or not.
Definition at line 128 of file device_audio_task.c.
Referenced by adc_sample_sent_cb(), adc_underflow_cb(), device_audio_task(), and device_audio_task_init().
Definition at line 91 of file device_audio_task.c.
U8* end |
Referenced by mmi_display().
U8 mic_buf_id = 0 [static] |
Holds the current microphone id to be sent to the USB.
Definition at line 139 of file device_audio_task.c.
Referenced by adc_sample_sent_cb(), and device_audio_task().
U8 mic_frame_id = 0 [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.
Definition at line 145 of file device_audio_task.c.
Referenced by adc_sample_sent_cb(), and device_audio_task().
struct microphone_st microphone[2] |
Definition at line 124 of file device_audio_task.c.
Referenced by adc_sample_sent_cb(), device_audio_task(), and device_audio_task_init().
U32 mmi_state = 0 [static] |
Definition at line 94 of file device_audio_task.c.
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 /.
Definition at line 104 of file device_audio_task.c.
Referenced by adc_sample_sent_cb(), and device_audio_task().
void* sample_buffer1[2] |
Definition at line 146 of file device_audio_task.c.
U16 sof_cnt [static] |
Definition at line 93 of file device_audio_task.c.
Referenced by device_audio_task_init(), and usb_sof_action().
t_cpu_time timer |
S16 volume |
Public : (S16) volume volume represents the current volume of audio stream /.
Definition at line 110 of file device_audio_task.c.
Referenced by volume_usb_to_appli().