diff options
Diffstat (limited to 'src/common/includes/Audio')
| -rw-r--r-- | src/common/includes/Audio/audio.h | 58 | ||||
| -rw-r--r-- | src/common/includes/Audio/audio_in.h | 40 | ||||
| -rw-r--r-- | src/common/includes/Audio/cw.h | 53 | ||||
| -rw-r--r-- | src/common/includes/Audio/tone.h | 53 |
4 files changed, 0 insertions, 204 deletions
diff --git a/src/common/includes/Audio/audio.h b/src/common/includes/Audio/audio.h deleted file mode 100644 index d48cbe5..0000000 --- a/src/common/includes/Audio/audio.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef __AUDIO_H__ -#define __AUDIO_H__ - -#include <stdint.h> -#include <stdbool.h> - -typedef void AudioCallbackFunction(void *context,int buffer); - -// Variables used by both glutt-o-logique and simulator -extern AudioCallbackFunction *callback_function; -extern void *callback_context; -extern int16_t *next_buffer_samples; -extern int next_buffer_length; -extern int buffer_number; -extern bool dma_running; - -void audio_initialize_platform(int plln, int pllr, int i2sdiv, int i2sodd, int rate); -void audio_start_dma_and_request_buffers(void); -void audio_stop_dma(void); - -#define Audio8000HzSettings 256,5,12,1,8000 -#define Audio16000HzSettings 213,2,13,0,16000 -#define Audio32000HzSettings 213,2,6,1,32000 -#define Audio48000HzSettings 258,3,3,1,48000 -#define Audio96000HzSettings 344,2,3,1,96000 -#define Audio22050HzSettings 429,4,9,1,22050 -#define Audio44100HzSettings 271,2,6,0,44100 -#define AudioVGAHSyncSettings 419,2,13,0,31475 // 31475.3606. Actual VGA timer is 31472.4616. - -#define AUDIO_BUF_LEN 4096 - - -// Initialize and power up audio hardware. Use the above defines for the parameters. -// Can probably only be called once. -void audio_initialize(int plln, int pllr, int i2sdiv, int i2sodd, int rate); - -// Power up and down the audio hardware. -void audio_put_codec_in_reset(void); -void audio_reinit_codec(void); - -// Set audio volume in steps of 0.5 dB. 0xff is +12 dB. -void audio_set_volume(int volume); - -// Start and stop audio playback using DMA. -// Callback is optional, and called whenever a new buffer is needed. -void audio_play_with_callback(AudioCallbackFunction *callback,void *context); - -// Provide a new buffer to the audio DMA. Output is double buffered, so -// at least two buffers must be maintained by the program. It is not allowed -// to overwrite the previously provided buffer until after the next callback -// invocation. -// Buffers must reside in DMA1-accessible memory, that is, the 128k RAM bank, -// or flash. -bool audio_provide_buffer_without_blocking(void *samples,int numsamples); - -void DMA1_Stream7_IRQHandler(void); - -#endif diff --git a/src/common/includes/Audio/audio_in.h b/src/common/includes/Audio/audio_in.h deleted file mode 100644 index 97a0f29..0000000 --- a/src/common/includes/Audio/audio_in.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2019 Matthias P. Braendli, Maximilien Cuony - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. -*/ - -#pragma once - -#include <stdio.h> -#include "FreeRTOS.h" - -#define AUDIO_IN_RATE 16000 -#define AUDIO_IN_BUF_LEN 1600 - -void audio_in_initialize(void); - -/* Enable or disable the audio input */ -void audio_in_enable(int enable); - -/* The audio input layer must call tone_detect_push_sample() to - * send the samples - */ diff --git a/src/common/includes/Audio/cw.h b/src/common/includes/Audio/cw.h deleted file mode 100644 index 39be9c5..0000000 --- a/src/common/includes/Audio/cw.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2015 Matthias P. Braendli - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. -*/ - -#ifndef __CW_H_ -#define __CW_H_ - -#include <stdint.h> -#include <stddef.h> - -// Setup the CW generator to create audio samples at the given -// samplerate. -void cw_psk31_init(unsigned int samplerate); - -// Append new CW or PSK31 text to transmit -// CW/PSK31 audio centre frequency in Hz -// if dit_duration == 0, message is sent in PSK31 -// otherwise it is sent in CW, with dit_duration in ms -// returns 0 on failure, 1 on success -int cw_psk31_push_message(const char* text, int frequency, int dit_duration); - -// Write the waveform into the buffer (stereo), both for cw and psk31 -size_t cw_psk31_fill_buffer(int16_t *buf, size_t bufsize); - -// Return 1 if the CW or PSK31 generator is running -int cw_psk31_busy(void); - -void cw_message_sent(const char*); - -size_t cw_symbol(uint8_t, uint8_t *, size_t); - -#endif // __CW_H_ - diff --git a/src/common/includes/Audio/tone.h b/src/common/includes/Audio/tone.h deleted file mode 100644 index ba05304..0000000 --- a/src/common/includes/Audio/tone.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2019 Matthias P. Braendli, Maximilien Cuony - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. -*/ - -#ifndef __TONE_H_ -#define __TONE_H_ - -#include <stdio.h> -#include "Audio/audio_in.h" - -#define TONE_BUFFER_LEN AUDIO_IN_BUF_LEN - -void tone_init(void); - -void tone_detector_enable(int enable); - -/* Return 1 when 1750 detected, 0 otherwise */ -int tone_1750_status(void); - -/* Return 1 if 1750 is currently detected, and has been already for at - * least 5s */ -int tone_1750_for_5_seconds(void); - -/* The FAX status is 1 if the recently decoded DTMF is the 0-7-* sequence. */ -int tone_fax_status(void); - -/* Must be called by task to do the analysis */ -void tone_do_analysis(void); - -/* Push a sample from the ADC ISR or Pulseaudio task */ -void tone_detect_push_sample(const uint16_t sample, int is_irq); - -#endif |
