![]() |
ARMEBS4
revision-26.06.2015
|
![]() |
Enumerations | |
enum | note_e |
Functions | |
status_e | Audio_Init (uint32_t fs, uint32_t sample_size) |
Audio initialization. More... | |
status_e | Audio_PlaySin (uint16_t freq, uint16_t duration) |
Play a sine sound at a given frequency. More... | |
status_e | Audio_SetVolumeSpeaker (uint8_t volume) |
Set the volume for speaker output. More... | |
status_e | Audio_SetVolumeHeadphone (uint8_t volume) |
Set the volume for headphone output. More... | |
status_e | Audio_Record (int16_t *dataBuf, uint32_t length) |
Record a sound (polling mode) More... | |
status_e | Audio_Play (const int16_t *dataBuf, uint32_t length) |
Play a sound (polling mode) More... | |
status_e | Audio_DMA_Play (const void *data, uint32_t length, void(*done)(const void *)) |
Play a sound (DMA version) More... | |
status_e | Audio_DMA_Play_Status (void) |
Is Audio_DMA_Play finished? More... | |
status_e | Audio_Stream_Play_Init (uint32_t length, void *buffer0, void *buffer1, void(*done)(const void *)) |
Audio stream play initialization. More... | |
status_e | Audio_Stream_Play (const void *data) |
Audio stream play buffer. More... | |
status_e | Audio_Stream_Play_Pause (void) |
Audio stream play pause. More... | |
status_e | Audio_Stream_Play_Stop (void) |
Audio stream playing stop. More... | |
status_e | Audio_Stream_Play_Status (void) |
Is Audio_Stream_Play ready for the next buffer? More... | |
status_e | Audio_Stream_Record_Init (uint32_t length, void *buffer0, void *buffer1, void(*done)(const void *)) |
Audio stream record initialization. More... | |
status_e | Audio_Stream_Record_Stop (void) |
Audio stream record stop. More... | |
status_e | AudioSTM32_Play (const int16_t *dataBuf, uint32_t length) |
Play a sound (polling mode) More... | |
status_e | AudioSTM32_Stream_Play_Init (uint32_t length, void *buffer0, void *buffer1, void(*done)(const void *)) |
Audio stream initialization. More... | |
status_e | AudioSTM32_Stream_Play (const void *data) |
Audio stream play buffer. More... | |
status_e | AudioSTM32_Stream_Play_Stop (void) |
Audio stream stop. More... | |
status_e | AudioSTM32_Stream_Play_Status (void) |
Is AudioSTM32_Stream_Play ready for the next buffer? More... | |
== Full-duplex notes == Full duplex is possible usint Audio_Stream_* function.
status_e Audio_Init | ( | uint32_t | fs, |
uint32_t | sample_size | ||
) |
Audio initialization.
fs | the sampling frequency (96000,48000,44100,32000,16000,8000) |
sample_size | (32,24 or 16 bit) |
Definition at line 140 of file audio.c.
References Audio_SetVolumeHeadphone(), Audio_SetVolumeSpeaker(), ERROR_BAD_PARAM, NO_ERROR, and setup.
status_e Audio_PlaySin | ( | uint16_t | freq, |
uint16_t | duration | ||
) |
Play a sine sound at a given frequency.
freq | Frequency of sine. |
duration | duration in milliseconds |
Definition at line 184 of file audio.c.
References gen_sine_wave_float(), init_sine_wave_float(), NO_ERROR, setup, time_elapsed(), and time_set_timeout_ms().
status_e Audio_SetVolumeSpeaker | ( | uint8_t | volume | ) |
Set the volume for speaker output.
volume | Volume to set (0 is mute, 255 is max) |
Definition at line 240 of file audio.c.
Referenced by Audio_Init().
status_e Audio_SetVolumeHeadphone | ( | uint8_t | volume | ) |
Set the volume for headphone output.
volume | Volume to set (0 is mute, 255 is max) * |
Definition at line 245 of file audio.c.
Referenced by Audio_Init().
status_e Audio_Record | ( | int16_t * | dataBuf, |
uint32_t | length | ||
) |
status_e Audio_Play | ( | const int16_t * | dataBuf, |
uint32_t | length | ||
) |
Play a sound (polling mode)
dataBuf | Data buffer of sound to record |
length | byte length of the buffer |
Definition at line 230 of file audio.c.
References AudioSTM32_Play().
status_e Audio_DMA_Play | ( | const void * | data, |
uint32_t | length, | ||
void(*)(const void *) | done | ||
) |
Play a sound (DMA version)
data | the buffer |
length | byte length of the buffer |
done_handler | Function to be called when the sound has finished (will be called from interrupt context), can be NULL. |
Definition at line 45 of file audio_dma.c.
References Audio_Stream_Play_Init(), and NO_ERROR.
status_e Audio_DMA_Play_Status | ( | void | ) |
Is Audio_DMA_Play finished?
Definition at line 60 of file audio_dma.c.
References ERROR_AGAIN, and NO_ERROR.
status_e Audio_Stream_Play_Init | ( | uint32_t | length, |
void * | buffer0, | ||
void * | buffer1, | ||
void(*)(const void *) | done | ||
) |
Audio stream play initialization.
length | byte length of each buffer |
buffer0 | the first buffer to be played |
buffer1 | the second buffer to be played |
done | the handler called after a buffer has been played. Called in interrupt context. can be NULL if not used |
The DMA will play alternatively buffer0 and buffer1.
The stream will be Paused after this function
Definition at line 97 of file audio.c.
References AudioSTM32_Stream_Play_Init().
Referenced by Audio_DMA_Play().
status_e Audio_Stream_Play | ( | const void * | data | ) |
Audio stream play buffer.
data | buffer to be played |
Definition at line 117 of file audio.c.
References AudioSTM32_Stream_Play().
status_e Audio_Stream_Play_Pause | ( | void | ) |
Audio stream play pause.
This function will in fact fill the output buffers with zeroes, effectively muting the output.
status_e Audio_Stream_Play_Stop | ( | void | ) |
Audio stream playing stop.
Definition at line 102 of file audio.c.
References AudioSTM32_Stream_Play_Stop().
status_e Audio_Stream_Play_Status | ( | void | ) |
Is Audio_Stream_Play ready for the next buffer?
Definition at line 107 of file audio.c.
References AudioSTM32_Stream_Play_Status().
status_e Audio_Stream_Record_Init | ( | uint32_t | length, |
void * | buffer0, | ||
void * | buffer1, | ||
void(*)(const void *) | done | ||
) |
Audio stream record initialization.
length | byte length of each buffer |
buffer0 | the first buffer to be played |
buffer1 | the second buffer to be played |
done | handler called with the data recorded. Called in interrupt context |
The DMA will record alternatively into buffer0 and buffer1.
status_e Audio_Stream_Record_Stop | ( | void | ) |
status_e AudioSTM32_Play | ( | const int16_t * | dataBuf, |
uint32_t | length | ||
) |
Play a sound (polling mode)
dataBuf | Data buffer of sound to record |
length | byte length of the buffer |
Definition at line 523 of file audio_stm32.c.
References NO_ERROR.
Referenced by Audio_Play().
status_e AudioSTM32_Stream_Play_Init | ( | uint32_t | length, |
void * | buffer0, | ||
void * | buffer1, | ||
void(*)(const void *) | done | ||
) |
Audio stream initialization.
length | byte length of each buffer |
buffer0 | the first buffer to be played |
buffer1 | the second buffer to be played |
The DMA will play alternatively buffer0 and buffer1.
Definition at line 403 of file audio_stm32.c.
References dma_xfer_t::data, dma_play_xfer, dma_xfer_t::done, ERROR_BAD_ALIGN, ERROR_BAD_PARAM, ERROR_BAD_STATE, memset(), and NO_ERROR.
Referenced by Audio_Stream_Play_Init().
status_e AudioSTM32_Stream_Play | ( | const void * | data | ) |
Audio stream play buffer.
data | buffer to be played |
Definition at line 479 of file audio_stm32.c.
References AudioSTM32_Stream_Play_Status(), dma_play_xfer, ERROR_AGAIN, memcpy(), and NO_ERROR.
Referenced by Audio_Stream_Play().
status_e AudioSTM32_Stream_Play_Stop | ( | void | ) |
Audio stream stop.
Definition at line 462 of file audio_stm32.c.
References NO_ERROR.
Referenced by Audio_Stream_Play_Stop().
status_e AudioSTM32_Stream_Play_Status | ( | void | ) |
Is AudioSTM32_Stream_Play ready for the next buffer?
Definition at line 469 of file audio_stm32.c.
References dma_play_xfer, ERROR_AGAIN, and NO_ERROR.
Referenced by Audio_Stream_Play_Status(), and AudioSTM32_Stream_Play().