aboutsummaryrefslogtreecommitdiffstats
path: root/src/glutt-o-logique/audio.c
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-09-12 20:51:27 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-09-12 20:51:27 +0200
commit217a756f9287951664cf9b30a732f0d241c032a3 (patch)
tree76cabf94efd861f075f9183344d9f5861c6b8721 /src/glutt-o-logique/audio.c
parenta9d474b0232321535dd03d412728be756b9a142b (diff)
downloadglutte-o-matic-217a756f9287951664cf9b30a732f0d241c032a3.tar.gz
glutte-o-matic-217a756f9287951664cf9b30a732f0d241c032a3.tar.bz2
glutte-o-matic-217a756f9287951664cf9b30a732f0d241c032a3.zip
Remove unused audio functions
Diffstat (limited to 'src/glutt-o-logique/audio.c')
-rw-r--r--src/glutt-o-logique/audio.c28
1 files changed, 1 insertions, 27 deletions
diff --git a/src/glutt-o-logique/audio.c b/src/glutt-o-logique/audio.c
index 767970a..7c0c204 100644
--- a/src/glutt-o-logique/audio.c
+++ b/src/glutt-o-logique/audio.c
@@ -115,6 +115,7 @@ void audio_reinit_codec(void) {
// Power on the codec.
audio_write_register(0x02, 0x9e);
+ // Powering the codec off can be done be writing (0x02, 0x9e)
// Configure codec for fast shutdown.
audio_write_register(0x0a, 0x00); // Disable the analog soft ramp.
@@ -127,33 +128,11 @@ void audio_reinit_codec(void) {
audio_write_register(0x1b, 0x0a);
}
-void audio_on() {
- audio_write_register(0x02, 0x9e);
- SPI3 ->I2SCFGR = SPI_I2SCFGR_I2SMOD | SPI_I2SCFGR_I2SCFG_1
- | SPI_I2SCFGR_I2SE; // Master transmitter, Phillips mode, 16 bit values, clock polarity low, enable.
-}
-
-void audio_off() {
- audio_write_register(0x02, 0x9f);
- SPI3 ->I2SCFGR = 0;
-}
-
void audio_set_volume(int volume) {
audio_write_register(0x20, (volume + 0x19) & 0xff);
audio_write_register(0x21, (volume + 0x19) & 0xff);
}
-void audio_output_sample(int16_t sample) {
- while (!(SPI3 ->SR & SPI_SR_TXE ))
- ;
- SPI3 ->DR = sample;
-}
-
-
-void audio_output_sample_without_blocking(int16_t sample) {
- SPI3 ->DR = sample;
-}
-
void audio_play_with_callback(AudioCallbackFunction *callback, void *context) {
audio_stop_dma();
@@ -177,11 +156,6 @@ void audio_stop() {
callback_function = (AudioCallbackFunction*)0;
}
-void audio_provide_buffer(void *samples, int numsamples) {
- while (!audio_provide_buffer_without_blocking(samples, numsamples))
- __asm__ volatile ("wfi");
-}
-
bool audio_provide_buffer_without_blocking(void *samples, int numsamples) {
if (next_buffer_samples)
return false;