ARMEBS4  revision-26.06.2015
Data Structures | Functions
audio.c File Reference

ARMEBS4 audio. More...

#include "heivs/audio.h"
#include "heivs/audio_stm32.h"
#include "heivs/audio_codec.h"
#include "stm32/stm32f4xx_rcc.h"
#include "stm32/stm32f4xx_spi.h"
#include "stm32/stm32f4xx_dma.h"
#include "stm32/stm32f4xx_misc.h"
#include "heivs/delay.h"
#include "heivs/time.h"
#include <math.h>
#include "heivs/config.h"
Include dependency graph for audio.c:

Go to the source code of this file.

Data Structures

struct  sine_wave_state_t
 

Functions

static void init_sine_wave_float (struct sine_wave_state_t *state, float amplitude, float fs, float frequency, float phase)
 Fast sine wave generator initialization. More...
 
static float gen_sine_wave_float (struct sine_wave_state_t *state)
 Fast sine wave generator. 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_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_Play_Pause (void)
 Audio stream play pause. More...
 
status_e Audio_Stream_Play (const void *data)
 Audio stream play 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 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_Play (const int16_t *src, uint32_t length)
 Play a sound (polling mode) More...
 
status_e Audio_Record (int16_t *dest, uint32_t length)
 Record a sound (polling mode) 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...
 

Detailed Description

ARMEBS4 audio.

Author
marc dot pignat at hevs dot ch & Pascal Sartoretti (sap at hevs dot ch)

Definition in file audio.c.

Function Documentation

static void init_sine_wave_float ( struct sine_wave_state_t state,
float  amplitude,
float  fs,
float  frequency,
float  phase 
)
static

Fast sine wave generator initialization.

Parameters
state,theinternal state of the generator
amplitude,theamplitude of the sine wave
fs,thesampling frequency (in Hz)
frequency,thesine frequency (in Hz)
phase,thestart phase (in radians)
Returns
NO_ERROR for no problem
See also
sine_wave_sample
Warning
: on a TMS320C6211, the amplitude of the sine wave increases slowly

Definition at line 71 of file audio.c.

Referenced by Audio_PlaySin().

Here is the caller graph for this function:

static float gen_sine_wave_float ( struct sine_wave_state_t state)
static

Fast sine wave generator.

Parameters
state,theinternal state of the generator
Returns
the value of the current sample
See also
sine_wave_init

Definition at line 86 of file audio.c.

Referenced by Audio_PlaySin().

Here is the caller graph for this function: