The FIQ_Handler function outputs the audio data from the
host to the speaker. the function is implemented as a fast interrupt
request function that runs every 31.25 μs. It scales the audio data
according to the volume and mute settings before writing the value to
the speaker’s register. The function also calculates the loudness
over 32 ms and outputs this using the LEDs.
Modify this function to suit the application product hardware.
The FIQ_Handler function is part of the Application layer
of the RL-USB Software Stack.
Note
The function starts to write (DataRun=1) to the speaker
register when at least half the buffer (DataBuf) contains data. The
function stops writing (DataRun=0) to the speaker register when no
data are available in the buffer.
#include <demo.h>
void FIQ_Handler (void) {
…
val = DataBuf[DataOut]; // Get the audio data sent by the host
…
val *= volume; // Adjust the data according to the volume
…
if (Mute) {
val = 0x8000; // Change the data to mute value
}
DACR = val & 0xFFC0; // Write the data to the speaker register
…
}
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers of your data.