Browse Source

Each object includes only required headers

dds
PaulStoffregen 10 years ago
parent
commit
c274463185
23 changed files with 24 additions and 82 deletions
  1. +2
    -4
      analyze_fft256.cpp
  2. +0
    -1
      analyze_fft256.h
  3. +1
    -3
      analyze_print.cpp
  4. +1
    -4
      analyze_tonedetect.cpp
  5. +1
    -4
      control_sgtl5000.cpp
  6. +1
    -4
      control_wm8731.cpp
  7. +1
    -4
      effect_chorus.cpp
  8. +1
    -5
      effect_fade.cpp
  9. +1
    -5
      effect_flange.cpp
  10. +1
    -3
      filter_biquad.cpp
  11. +1
    -5
      filter_fir.cpp
  12. +1
    -0
      filter_fir.h
  13. +1
    -2
      input_adc.cpp
  14. +2
    -3
      input_i2s.cpp
  15. +1
    -4
      mixer.cpp
  16. +1
    -4
      output_dac.cpp
  17. +1
    -6
      output_i2s.cpp
  18. +1
    -4
      output_pwm.cpp
  19. +1
    -3
      play_memory.cpp
  20. +1
    -4
      play_sd_raw.cpp
  21. +1
    -5
      play_sd_wav.cpp
  22. +1
    -2
      synth_tonesweep.cpp
  23. +1
    -3
      synth_waveform.cpp

+ 2
- 4
analyze_fft256.cpp View File

#include "Audio.h"
#include "analyze_fft256.h"
#include "arm_math.h" #include "arm_math.h"
#include "utility/dspinst.h"




// TODO: this should be a class member, so more than one FFT can be used
static arm_cfft_radix4_instance_q15 fft_inst; static arm_cfft_radix4_instance_q15 fft_inst;


void AudioAnalyzeFFT256::init(void) void AudioAnalyzeFFT256::init(void)

+ 0
- 1
analyze_fft256.h View File

#define analyze_fft256_h_ #define analyze_fft256_h_


#include "AudioStream.h" #include "AudioStream.h"
#include "arm_math.h"


// windows.c // windows.c
extern "C" { extern "C" {

+ 1
- 3
analyze_print.cpp View File

#include "Audio.h"

#include "analyze_print.h"


// TODO: this needs some sort of trigger or delay or other options to make // TODO: this needs some sort of trigger or delay or other options to make
// actually useful for watching interesting parts of data, without spewing // actually useful for watching interesting parts of data, without spewing
// tremendous and endless data to the Arduino Serial Monitor // tremendous and endless data to the Arduino Serial Monitor



void AudioPrint::update(void) void AudioPrint::update(void)
{ {
audio_block_t *block; audio_block_t *block;

+ 1
- 4
analyze_tonedetect.cpp View File

#include "Audio.h"
#include "arm_math.h"
#include "analyze_tonedetect.h"
#include "utility/dspinst.h" #include "utility/dspinst.h"




static inline int32_t multiply_32x32_rshift30(int32_t a, int32_t b) __attribute__((always_inline)); static inline int32_t multiply_32x32_rshift30(int32_t a, int32_t b) __attribute__((always_inline));
static inline int32_t multiply_32x32_rshift30(int32_t a, int32_t b) static inline int32_t multiply_32x32_rshift30(int32_t a, int32_t b)
{ {

+ 1
- 4
control_sgtl5000.cpp View File

#include "Audio.h"
#include "arm_math.h"


#include "control_sgtl5000.h"
#include "Wire.h" #include "Wire.h"


#define CHIP_ID 0x0000 #define CHIP_ID 0x0000

+ 1
- 4
control_wm8731.cpp View File

#include "Audio.h"
#include "arm_math.h"


#include "control_wm8731.h"
#include "Wire.h" #include "Wire.h"


#define WM8731_I2C_ADDR 0x1A #define WM8731_I2C_ADDR 0x1A

+ 1
- 4
effect_chorus.cpp View File

#include "Audio.h"
#include "arm_math.h"
#include "utility/dspinst.h"

#include "effect_chorus.h"


/******************************************************************/ /******************************************************************/



+ 1
- 5
effect_fade.cpp View File

#include "Audio.h"
#include "arm_math.h"
#include "effect_fade.h"
#include "utility/dspinst.h" #include "utility/dspinst.h"




extern "C" { extern "C" {
extern const int16_t fader_table[256]; extern const int16_t fader_table[256];
}; };



void AudioEffectFade::update(void) void AudioEffectFade::update(void)
{ {
audio_block_t *block; audio_block_t *block;

+ 1
- 5
effect_flange.cpp View File

#include "Audio.h"
#include "effect_flange.h"
#include "arm_math.h" #include "arm_math.h"
#include "utility/dspinst.h"





/******************************************************************/ /******************************************************************/
// A u d i o E f f e c t F l a n g e // A u d i o E f f e c t F l a n g e

+ 1
- 3
filter_biquad.cpp View File

#include "Audio.h"
#include "arm_math.h"
#include "filter_biquad.h"
#include "utility/dspinst.h" #include "utility/dspinst.h"



void AudioFilterBiquad::update(void) void AudioFilterBiquad::update(void)
{ {
audio_block_t *block; audio_block_t *block;

+ 1
- 5
filter_fir.cpp View File

#include "Audio.h"
#include "arm_math.h"
#include "utility/dspinst.h"


#include "filter_fir.h"


void AudioFilterFIR::begin(short *cp,int n_coeffs) void AudioFilterFIR::begin(short *cp,int n_coeffs)
{ {

+ 1
- 0
filter_fir.h View File

#define filter_fir_h_ #define filter_fir_h_


#include "AudioStream.h" #include "AudioStream.h"
#include "arm_math.h"


// Maximum number of coefficients in a FIR filter // Maximum number of coefficients in a FIR filter
// The audio breaks up with 128 coefficients so a // The audio breaks up with 128 coefficients so a

+ 1
- 2
input_adc.cpp View File

#include "Audio.h"
#include "input_adc.h"
#include "utility/pdb.h" #include "utility/pdb.h"



DMAMEM static uint16_t analog_rx_buffer[AUDIO_BLOCK_SAMPLES]; DMAMEM static uint16_t analog_rx_buffer[AUDIO_BLOCK_SAMPLES];
audio_block_t * AudioInputAnalog::block_left = NULL; audio_block_t * AudioInputAnalog::block_left = NULL;
uint16_t AudioInputAnalog::block_offset = 0; uint16_t AudioInputAnalog::block_offset = 0;

+ 2
- 3
input_i2s.cpp View File

#include "Audio.h"
#include "arm_math.h"

#include "input_i2s.h"
#include "output_i2s.h"


DMAMEM static uint32_t i2s_rx_buffer[AUDIO_BLOCK_SAMPLES]; DMAMEM static uint32_t i2s_rx_buffer[AUDIO_BLOCK_SAMPLES];
audio_block_t * AudioInputI2S::block_left = NULL; audio_block_t * AudioInputI2S::block_left = NULL;

+ 1
- 4
mixer.cpp View File

#include "Audio.h"
#include "arm_math.h"
#include "mixer.h"
#include "utility/dspinst.h" #include "utility/dspinst.h"




void applyGain(int16_t *data, int32_t mult) void applyGain(int16_t *data, int32_t mult)
{ {
uint32_t *p = (uint32_t *)data; uint32_t *p = (uint32_t *)data;

+ 1
- 4
output_dac.cpp View File

#include "Audio.h"
#include "output_dac.h"
#include "utility/pdb.h" #include "utility/pdb.h"


// #define PDB_CONFIG (PDB_SC_TRGSEL(15) | PDB_SC_PDBEN | PDB_SC_CONT)
// #define PDB_PERIOD 1087 // 48e6 / 44100

#if defined(__MK20DX256__) #if defined(__MK20DX256__)


DMAMEM static uint16_t dac_buffer[AUDIO_BLOCK_SAMPLES*2]; DMAMEM static uint16_t dac_buffer[AUDIO_BLOCK_SAMPLES*2];

+ 1
- 6
output_i2s.cpp View File

#include "Audio.h"
#include "arm_math.h"

#include "output_i2s.h"


// MCLK needs to be 48e6 / 1088 * 256 = 11.29411765 MHz -> 44.117647 kHz sample rate // MCLK needs to be 48e6 / 1088 * 256 = 11.29411765 MHz -> 44.117647 kHz sample rate
// Possible to create using fractional divider for all USB-compatible Kinetis: // Possible to create using fractional divider for all USB-compatible Kinetis:
// clock, which has audio band jitter from the PLL // clock, which has audio band jitter from the PLL





audio_block_t * AudioOutputI2S::block_left_1st = NULL; audio_block_t * AudioOutputI2S::block_left_1st = NULL;
audio_block_t * AudioOutputI2S::block_right_1st = NULL; audio_block_t * AudioOutputI2S::block_right_1st = NULL;
audio_block_t * AudioOutputI2S::block_left_2nd = NULL; audio_block_t * AudioOutputI2S::block_left_2nd = NULL;
} }






void dma_ch0_isr(void) void dma_ch0_isr(void)
{ {
const int16_t *src, *end; const int16_t *src, *end;

+ 1
- 4
output_pwm.cpp View File

#include "Audio.h"
#include "arm_math.h"


#include "output_pwm.h"


audio_block_t * AudioOutputPWM::block_1st = NULL; audio_block_t * AudioOutputPWM::block_1st = NULL;
audio_block_t * AudioOutputPWM::block_2nd = NULL; audio_block_t * AudioOutputPWM::block_2nd = NULL;

+ 1
- 3
play_memory.cpp View File

#include "Audio.h"
#include "arm_math.h"
#include "play_memory.h"
#include "utility/dspinst.h" #include "utility/dspinst.h"





void AudioPlayMemory::play(const unsigned int *data) void AudioPlayMemory::play(const unsigned int *data)
{ {
uint32_t format; uint32_t format;

+ 1
- 4
play_sd_raw.cpp View File

#include "Audio.h"
#include "arm_math.h"
#include "utility/dspinst.h"

#include "play_sd_raw.h"




void AudioPlaySDcardRAW::begin(void) void AudioPlaySDcardRAW::begin(void)

+ 1
- 5
play_sd_wav.cpp View File

#include "Audio.h"
#include "arm_math.h"
#include "utility/dspinst.h"


#include "play_sd_wav.h"


#define STATE_DIRECT_8BIT_MONO 0 // playing mono at native sample rate #define STATE_DIRECT_8BIT_MONO 0 // playing mono at native sample rate
#define STATE_DIRECT_8BIT_STEREO 1 // playing stereo at native sample rate #define STATE_DIRECT_8BIT_STEREO 1 // playing stereo at native sample rate

+ 1
- 2
synth_tonesweep.cpp View File

#include "Audio.h"
#include "synth_tonesweep.h"
#include "arm_math.h" #include "arm_math.h"
#include "utility/dspinst.h"




// TODO: this object should be renamed to AudioSynthToneSweep // TODO: this object should be renamed to AudioSynthToneSweep

+ 1
- 3
synth_waveform.cpp View File

#include "Audio.h"
#include "synth_waveform.h"
#include "arm_math.h" #include "arm_math.h"
#include "utility/dspinst.h" #include "utility/dspinst.h"






#ifdef ORIGINAL_AUDIOSYNTHWAVEFORM #ifdef ORIGINAL_AUDIOSYNTHWAVEFORM
/******************************************************************/ /******************************************************************/
// PAH - add ramp-up and ramp-down to the onset of the wave // PAH - add ramp-up and ramp-down to the onset of the wave

Loading…
Cancel
Save