Modules | |
| MP3PLAYER_mp3_variables | |
| MP3PLAYER_fft_variables | |
| MP3PLAYER_audio_buffer | |
Data Structures | |
| struct | AUDIO_OUT_BufferTypeDef |
| class | Mp3Player |
| Mp3Player Object. More... | |
Functions | |
| void | BSP_AUDIO_OUT_TransferComplete_CallBack (uint32_t Instance) |
| Manages the full Transfer complete event. More... | |
| void | BSP_AUDIO_OUT_HalfTransfer_CallBack (uint32_t Instance) |
| Manages the DMA Half Transfer complete event. More... | |
| void | BSP_AUDIO_OUT_Error_CallBack (uint32_t Instance) |
| Manages the DMA FIFO error event. More... | |
| Mp3Player::Mp3Player () | |
| Construct a new Mp 3 Player object. More... | |
| void | Mp3Player::initPlay () |
| Initialize playing. More... | |
| void | Mp3Player::resume () |
| Mp3 resume play. More... | |
| void | Mp3Player::bufferProcess () |
| Buffer Process - Refill Filebuffer by extractiong from TCP Ringbuffer. More... | |
| void | Mp3Player::audioProcess () |
| Decode 2304 Bytes in one step once indicated through. DMA interrupts that they have been consumed (= played out) More... | |
| void | Mp3Player::insertTcpBuffer (uint8_t *data, uint32_t btw) |
| This function is used to close the tcp connection with server. More... | |
| void | Mp3Player::extractTcpBuffer (uint8_t *data, uint32_t btr) |
| This function is used to close the tcp connection with server. More... | |
| void | Mp3Player::deleteTcpBuffer (void) |
| Delete TCP Buffer. More... | |
| void | Mp3Player::drawFTT (int32_t inx, int32_t *x, int32_t *ly, int32_t ll, int32_t *ry, int32_t rr, int32_t height, int32_t FFTGraph) |
| This function generate the parameters to be able to draw a FFT graph. More... | |
| void | Mp3Player::drawVuMeter (float *angle_L, float *angle_R) |
| This function generate the parameters to be able to draw a volume unit meter graph. More... | |
| void | Mp3Player::getEtherAndBuffer (void) |
| It handles the LwIP process and the buffer process. More... | |
| void | Mp3Player::drawSpectrum (void) |
| Draw Spectrum, i.e. FFT graph as computed here Note correct scaling only for 48 kHz sampling frequency! More... | |
Variables | |
| uint32_t | fftSize = 1024 |
| uint32_t | ifftFlag = 0 |
| uint32_t | doBitReverse = 1 |
| uint32_t | fftix |
| uint8_t | lock_FFT_tansfer |
| int | unFramesDecoded |
| int | XTAL_Hour |
| int | XTAL_Min |
| int | XTAL_Sec |
| int | currentVolume |
| uint8_t | initialaudiovolume |
| static int | bytes_left |
| static unsigned char * | read_ptr |
| volatile unsigned int | br |
| volatile unsigned int | btr |
| volatile int | offset |
| volatile int | err |
| char | str [120] |
| int | extractsum |
| volatile uint32_t | TCP_insert_idx |
| volatile uint32_t | TCP_extract_idx |
| uint8_t | TCP_Buffer [TCPBUFF_MAXITEMS] |
| int | TCP_buff_start |
| int | totalsum |
| struct netif | gnetif |
| uint8_t | file_read_buffer [FILE_READ_BUFFER_SIZE] |
| volatile int | items |
| float | memoryVU_L |
| float | memoryVU_R |
| Mp3Player * | mp3PlayerInstance |
MP3 Variables | |
| MP3FrameInfo | mp3FrameInfo |
| HMP3Decoder | hMP3Decoder |
| int | MP3errorcount |
| int | MP3errorreason |
| int | DMAError |
FFT Variables | |
| int16_t | FFTBuffer [AUDIO_BUFFER_SIZE/2] |
| float32_t | FFT_inputstruct_Left [2048] |
| float32_t | FFTOutputMagLeft [1024] |
| float32_t | FFT_inputstruct_Right [2048] |
| float32_t | FFTOutputMagRight [1024] |
The Audio Buffer | |
| enum | BUFFER_StateTypeDef { BUFFER_OFFSET_NONE = 0, BUFFER_OFFSET_HALF, BUFFER_OFFSET_FULL } |
| ALIGN_32BYTES (static AUDIO_OUT_BufferTypeDef BufferCtl __attribute__((section(".tcpBuffer")))) | |
| enum BUFFER_StateTypeDef |
| ALIGN_32BYTES | ( | static AUDIO_OUT_BufferTypeDef BufferCtl | __attribute__(section(".tcpBuffer")) | ) |
needs to be static, otherwise optimizer will interfere!!
| void Mp3Player::audioProcess | ( | ) |
Decode 2304 Bytes in one step once indicated through. DMA interrupts that they have been consumed (= played out)
Audio_Process -> Decode 2304 Bytes in one step once indicated through.
References AUDIO_BUFFER_SIZE, BUFFER_OFFSET_FULL, BUFFER_OFFSET_HALF, BUFFER_OFFSET_NONE, bytes_left, currentVolume, doBitReverse, err, FFT_inputstruct_Left, FFT_inputstruct_Right, FFTBuffer, FFTOutputMagLeft, FFTOutputMagRight, fftSize, hMP3Decoder, ifftFlag, MP3errorcount, MP3errorreason, mp3FrameInfo, offset, read_ptr, unFramesDecoded, XTAL_Hour, XTAL_Min, and XTAL_Sec.
| void BSP_AUDIO_OUT_Error_CallBack | ( | uint32_t | Instance | ) |
Manages the DMA FIFO error event.
| None |
| None |
| void BSP_AUDIO_OUT_HalfTransfer_CallBack | ( | uint32_t | Instance | ) |
Manages the DMA Half Transfer complete event.
| None |
| None |
References AUDIO_BUFFER_SIZE, Mp3Player::audioProcess(), BUFFER_OFFSET_HALF, and mp3PlayerInstance.
| void BSP_AUDIO_OUT_TransferComplete_CallBack | ( | uint32_t | Instance | ) |
Manages the full Transfer complete event.
| None |
| None |
References AUDIO_BUFFER_SIZE, Mp3Player::audioProcess(), BUFFER_OFFSET_FULL, and mp3PlayerInstance.
| void Mp3Player::bufferProcess | ( | ) |
Buffer Process - Refill Filebuffer by extractiong from TCP Ringbuffer.
References btr, bytes_left, extractsum, file_read_buffer, FILE_READ_BUFFER_SIZE, read_ptr, and totalsum.
| void Mp3Player::drawFTT | ( | int32_t | inx, |
| int32_t * | x, | ||
| int32_t * | ly, | ||
| int32_t | ll, | ||
| int32_t * | ry, | ||
| int32_t | rr, | ||
| int32_t | height, | ||
| int32_t | FFTGraph | ||
| ) |
This function generate the parameters to be able to draw a FFT graph.
| inx | |
| x | |
| ly | |
| ll | |
| ry | |
| rr | |
| height | |
| FFTGraph |
References FFTBuffer.
Draw Spectrum, i.e. FFT graph as computed here Note correct scaling only for 48 kHz sampling frequency!
| void Mp3Player::drawVuMeter | ( | float * | angle_L, |
| float * | angle_R | ||
| ) |
This function generate the parameters to be able to draw a volume unit meter graph.
| angle_L | |
| angle_R |
References FFTBuffer, memoryVU_L, and memoryVU_R.
| void Mp3Player::extractTcpBuffer | ( | uint8_t * | data, |
| uint32_t | btr | ||
| ) |
This function is used to close the tcp connection with server.
| data | pointer to data to be copied |
| btr | bytes to read |
| None |
References btr, data, items, TCP_Buffer, TCP_extract_idx, and TCPBUFF_MAXITEMS.
It handles the LwIP process and the buffer process.
References MX_LWIP_Process(), and TCP_buff_start.
| void Mp3Player::initPlay | ( | ) |
Initialize playing.
References AUDIO_BUFFER_SIZE, br, btr, BUFFER_OFFSET_NONE, bytes_left, err, extractsum, file_read_buffer, FILE_READ_BUFFER_SIZE, hMP3Decoder, initialaudiovolume, mp3FrameInfo, offset, read_ptr, totalsum, and unFramesDecoded.
| void Mp3Player::insertTcpBuffer | ( | uint8_t * | data, |
| uint32_t | btw | ||
| ) |
This function is used to close the tcp connection with server.
| data | pointer to data to be copied |
| btw | bytes to write |
| None |
References data, items, TCP_Buffer, TCP_insert_idx, and TCPBUFF_MAXITEMS.
| Mp3Player::Mp3Player | ( | ) |
| void Mp3Player::resume | ( | ) |
Mp3 resume play.
References AUDIO_BUFFER_SIZE, BUFFER_OFFSET_NONE, bytes_left, file_read_buffer, FILE_READ_BUFFER_SIZE, and read_ptr.
| volatile unsigned int br |
| volatile unsigned int btr |
|
static |
| int currentVolume |
| int DMAError |
| uint32_t doBitReverse = 1 |
| volatile int err |
| int extractsum |
| float32_t FFT_inputstruct_Left[2048] |
| float32_t FFT_inputstruct_Right[2048] |
| int16_t FFTBuffer[AUDIO_BUFFER_SIZE/2] |
| uint32_t fftix |
| float32_t FFTOutputMagLeft[1024] |
| float32_t FFTOutputMagRight[1024] |
| uint32_t fftSize = 1024 |
| uint8_t file_read_buffer[FILE_READ_BUFFER_SIZE] |
| struct netif gnetif |
| HMP3Decoder hMP3Decoder |
| uint32_t ifftFlag = 0 |
| uint8_t initialaudiovolume |
| volatile int items |
| uint8_t lock_FFT_tansfer |
| float memoryVU_L |
| float memoryVU_R |
VUMeter Variables
| int MP3errorcount |
| int MP3errorreason |
| MP3FrameInfo mp3FrameInfo |
from mp3player.c
| volatile int offset |
|
static |
| char str[120] |
| int TCP_buff_start |
State Variable for starting and pausing the buffering
| uint8_t TCP_Buffer[TCPBUFF_MAXITEMS] |
| volatile uint32_t TCP_extract_idx |
| volatile uint32_t TCP_insert_idx |
| int totalsum |
| int unFramesDecoded |
| int XTAL_Hour |
| int XTAL_Min |
| int XTAL_Sec |