orcus
|
Audio. More...
#include <stdint.h>
Functions | |
uint16_t | ac97GetReg (uint8_t reg) |
Read register value from AC97 codec. More... | |
void | ac97SetReg (uint8_t reg, uint16_t value) |
Set register value in AC97 codec. More... | |
void | ac97Start () |
Start AC97 codec. More... | |
void | ac97Stop () |
Stop AC97 codec. More... | |
bool | audioHeadphonesConnected () |
Check if headphones are connected (F100 only). More... | |
void | audioInit (int dmaChannel) |
Initialise audio subsystem. More... | |
void | audioMuteHeadphones () |
Mute headphones. More... | |
void | audioMuteSpeakers () |
Mute speakers. More... | |
void | audioPlaySample (uint16_t bytes, void *data) |
Play a PCM sample. More... | |
bool | audioSamplePlaying () |
Check if a sample is currently playing. More... | |
void | audioSetSampleRate (uint16_t khz) |
Set sample rate for AC97 codec. More... | |
void | audioSetVolume (uint8_t left, uint8_t right) |
Set volume. More... | |
void | audioUnmuteHeadphones () |
Unmute headphones. More... | |
void | audioUnmuteSpeakers () |
Unmute speakers. More... | |
uint16_t ac97GetReg | ( | uint8_t | reg | ) |
Read register value from AC97 codec
reg | Register to read |
void ac97SetReg | ( | uint8_t | reg, |
uint16_t | value | ||
) |
Set register value in AC97 codec.
reg | Register to set |
value | Value to set |
void ac97Start | ( | ) |
Start AC97 codec, will restart codec if it was previously started.
void ac97Stop | ( | ) |
Stop AC97 codec.
bool audioHeadphonesConnected | ( | ) |
Check if headphones are connected. This works on the F100 only, the F200 physically switches the DAC output between the speakers and headphones when you insert the jack.
void audioInit | ( | int | dmaChannel | ) |
Initialise auto subsystem.
dmaChannel | DMA channel to use for audio (0 - 15, recommend 0 - 3) |
void audioMuteHeadphones | ( | ) |
Mute headphones.
void audioMuteSpeakers | ( | ) |
Mute speakers.
void audioPlaySample | ( | uint16_t | bytes, |
void * | data | ||
) |
Play a PCM sample. Non-blocking, see if the sample has finished playing with audioSamplePlaying().
bytes | Number of bytes in sample (max 0xFFFF) |
data | Pointer to sample data |
bool audioSamplePlaying | ( | ) |
Check if a sample is currently playing.
void audioSetSampleRate | ( | uint16_t | khz | ) |
Set sample rate for AC97 codec.
khz | Sample rate to set |
void audioSetVolume | ( | uint8_t | left, |
uint8_t | right | ||
) |
Set volume.
@warn You may not wish to allow the volume to reach 31, with headphones connected this could do damage to somebody's hearing!
left | Volume level for left channel (0 [lowest] - 31 [highest]) |
right | Volume level for right channel (0 [lowest] - 31 [highest]) |
void audioUnmuteHeadphones | ( | ) |
Unmute headphones.
void audioUnmuteSpeakers | ( | ) |
Unmute speakers.