Exemplo n.º 1
0
void StopAudio()
{
	StopAudioDMA();
	SPI3->CR2&=~SPI_CR2_TXDMAEN; // Disable I2S TX DMA request.
	DisableInterrupt(DMA1_Stream7_IRQn);
	CallbackFunction=NULL;
}
Exemplo n.º 2
0
void PlayAudioWithCallback(AudioCallbackFunction *callback, void *context) {
	StopAudioDMA();

	CallbackFunction = callback;
	CallbackContext = context;
	BufferNumber = 0;

	if (CallbackFunction)
		CallbackFunction(CallbackContext, BufferNumber);
}
Exemplo n.º 3
0
void PlayAudioWithCallback(AudioCallbackFunction *callback) {
	StopAudioDMA();

	NVIC_EnableIRQ(DMA1_Stream7_IRQn);
	NVIC_SetPriority(DMA1_Stream7_IRQn, 4);

	SPI3 ->CR2 |= SPI_CR2_TXDMAEN; // Enable I2S TX DMA request.

	CallbackFunction = callback;
}
Exemplo n.º 4
0
void PlayAudioWithCallback(AudioCallbackFunction *callback, void *context) {
	StopAudioDMA();

	NVIC_EnableIRQ(DMA1_Stream7_IRQn);
	NVIC_SetPriority(DMA1_Stream7_IRQn, 4);

	SPI3 ->CR2 |= SPI_CR2_TXDMAEN; // Enable I2S TX DMA request.

	CallbackFunction = callback;
	CallbackContext = context;
	BufferNumber = 0;

	if (CallbackFunction)
		CallbackFunction(CallbackContext, BufferNumber);
}
Exemplo n.º 5
0
void PlayAudioWithCallback(AudioCallbackFunction *callback,void *context)
{
	StopAudioDMA();

	InstallInterruptHandler(DMA1_Stream7_IRQn,DMACompleteHandler);
	EnableInterrupt(DMA1_Stream7_IRQn);
	SetInterruptPriority(DMA1_Stream7_IRQn,4);

	SPI3->CR2|=SPI_CR2_TXDMAEN; // Enable I2S TX DMA request.

	CallbackFunction=callback;
	CallbackContext=context;
	BufferNumber=0;

	if(CallbackFunction) CallbackFunction(CallbackContext,BufferNumber);
}
Exemplo n.º 6
0
void StopAudio() {

	StopAudioDMA();

	CallbackFunction = NULL;
}