Browse Source

Fix I2S2 on Teensy 4.0

dds
PaulStoffregen 5 years ago
parent
commit
202896c522
2 changed files with 4 additions and 6 deletions
  1. +2
    -2
      input_i2s2.cpp
  2. +2
    -4
      output_i2s2.cpp

+ 2
- 2
input_i2s2.cpp View File

*/ */




#if defined(__IMXRT1052__) || defined(__IMXRT1062__)
#if defined(__IMXRT1062__)
#include <Arduino.h> #include <Arduino.h>
#include "input_i2s2.h" #include "input_i2s2.h"
#include "output_i2s2.h" #include "output_i2s2.h"
// TODO: should we set & clear the I2S_RCSR_SR bit here? // TODO: should we set & clear the I2S_RCSR_SR bit here?
AudioOutputI2S2::config_i2s(); AudioOutputI2S2::config_i2s();


CORE_PIN33_CONFIG = 2; //2:RX_DATA0
CORE_PIN5_CONFIG = 2; //2:RX_DATA0
IOMUXC_SAI2_RX_DATA0_SELECT_INPUT = 0; IOMUXC_SAI2_RX_DATA0_SELECT_INPUT = 0;


dma.TCD->SADDR = (void *)((uint32_t)&I2S2_RDR0+2); dma.TCD->SADDR = (void *)((uint32_t)&I2S2_RDR0+2);

+ 2
- 4
output_i2s2.cpp View File

* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#if defined(__IMXRT1052__) || defined(__IMXRT1062__)
#if defined(__IMXRT1062__)
#include <Arduino.h> #include <Arduino.h>
#include "output_i2s2.h" #include "output_i2s2.h"
#include "memcpy_audio.h" #include "memcpy_audio.h"
if (I2S2_TCSR & I2S_TCSR_TE) return; if (I2S2_TCSR & I2S_TCSR_TE) return;
if (I2S2_RCSR & I2S_RCSR_RE) return; if (I2S2_RCSR & I2S_RCSR_RE) return;


CORE_PIN5_CONFIG = 2; //2:MCLK
CORE_PIN33_CONFIG = 2; //2:MCLK
CORE_PIN4_CONFIG = 2; //2:TX_BCLK CORE_PIN4_CONFIG = 2; //2:TX_BCLK
CORE_PIN3_CONFIG = 2; //2:TX_SYNC CORE_PIN3_CONFIG = 2; //2:TX_SYNC
// CORE_PIN2_CONFIG = 2; //2:TX_DATA0
// CORE_PIN33_CONFIG = 2; //2:RX_DATA0


int rsync = 1; int rsync = 1;
int tsync = 0; int tsync = 0;

Loading…
Cancel
Save