bool AudioInputI2SQuad::update_responsibility = false; | bool AudioInputI2SQuad::update_responsibility = false; | ||||
DMAChannel AudioInputI2SQuad::dma(false); | DMAChannel AudioInputI2SQuad::dma(false); | ||||
#if defined(__MK20DX256__) | |||||
#if defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__) | |||||
void AudioInputI2SQuad::begin(void) | void AudioInputI2SQuad::begin(void) | ||||
{ | { |
* SOFTWARE. | * SOFTWARE. | ||||
*/ | */ | ||||
#if defined(__MK20DX128__) || defined(__MK20DX256__) | |||||
#if defined(__MK20DX128__) || defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__) | |||||
.cpu cortex-m4 | .cpu cortex-m4 | ||||
.syntax unified | .syntax unified |
#include "output_dac.h" | #include "output_dac.h" | ||||
#include "utility/pdb.h" | #include "utility/pdb.h" | ||||
#if defined(__MK20DX256__) | |||||
#if defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__) | |||||
DMAMEM static uint16_t dac_buffer[AUDIO_BLOCK_SAMPLES*2]; | DMAMEM static uint16_t dac_buffer[AUDIO_BLOCK_SAMPLES*2]; | ||||
audio_block_t * AudioOutputAnalog::block_left_1st = NULL; | audio_block_t * AudioOutputAnalog::block_left_1st = NULL; |
#elif F_CPU == 168000000 | #elif F_CPU == 168000000 | ||||
#define MCLK_MULT 8 | #define MCLK_MULT 8 | ||||
#define MCLK_DIV 119 | #define MCLK_DIV 119 | ||||
#elif F_CPU == 180000000 | |||||
#define MCLK_MULT 16 | |||||
#define MCLK_DIV 255 | |||||
#elif F_CPU == 192000000 | |||||
#define MCLK_MULT 1 | |||||
#define MCLK_DIV 17 | |||||
#elif F_CPU == 16000000 | #elif F_CPU == 16000000 | ||||
#define MCLK_MULT 12 | #define MCLK_MULT 12 | ||||
#define MCLK_DIV 17 | #define MCLK_DIV 17 |
#include "output_i2s_quad.h" | #include "output_i2s_quad.h" | ||||
#include "memcpy_audio.h" | #include "memcpy_audio.h" | ||||
#if defined(__MK20DX256__) | |||||
#if defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__) | |||||
audio_block_t * AudioOutputI2SQuad::block_ch1_1st = NULL; | audio_block_t * AudioOutputI2SQuad::block_ch1_1st = NULL; | ||||
audio_block_t * AudioOutputI2SQuad::block_ch2_1st = NULL; | audio_block_t * AudioOutputI2SQuad::block_ch2_1st = NULL; | ||||
#elif F_CPU == 168000000 | #elif F_CPU == 168000000 | ||||
#define MCLK_MULT 8 | #define MCLK_MULT 8 | ||||
#define MCLK_DIV 119 | #define MCLK_DIV 119 | ||||
#elif F_CPU == 180000000 | |||||
#define MCLK_MULT 16 | |||||
#define MCLK_DIV 255 | |||||
#elif F_CPU == 192000000 | |||||
#define MCLK_MULT 1 | |||||
#define MCLK_DIV 17 | |||||
#elif F_CPU == 16000000 | #elif F_CPU == 16000000 | ||||
#define MCLK_MULT 12 | #define MCLK_MULT 12 | ||||
#define MCLK_DIV 17 | #define MCLK_DIV 17 |
#elif F_CPU == 168000000 | #elif F_CPU == 168000000 | ||||
#define MCLK_MULT 8 | #define MCLK_MULT 8 | ||||
#define MCLK_DIV 119 | #define MCLK_DIV 119 | ||||
#elif F_CPU == 180000000 | |||||
#define MCLK_MULT 16 | |||||
#define MCLK_DIV 255 | |||||
#elif F_CPU == 192000000 | |||||
#define MCLK_MULT 1 | |||||
#define MCLK_DIV 17 | |||||
#elif F_CPU == 16000000 | #elif F_CPU == 16000000 | ||||
#define MCLK_MULT 12 | #define MCLK_MULT 12 | ||||
#define MCLK_DIV 17 | #define MCLK_DIV 17 |