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

@@ -25,7 +25,7 @@
*/


#if defined(__IMXRT1052__) || defined(__IMXRT1062__)
#if defined(__IMXRT1062__)
#include <Arduino.h>
#include "input_i2s2.h"
#include "output_i2s2.h"
@@ -48,7 +48,7 @@ void AudioInputI2S2::begin(void)
// TODO: should we set & clear the I2S_RCSR_SR bit here?
AudioOutputI2S2::config_i2s();

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

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

+ 2
- 4
output_i2s2.cpp View File

@@ -23,7 +23,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#if defined(__IMXRT1052__) || defined(__IMXRT1062__)
#if defined(__IMXRT1062__)
#include <Arduino.h>
#include "output_i2s2.h"
#include "memcpy_audio.h"
@@ -209,11 +209,9 @@ void AudioOutputI2S2::config_i2s(void)
if (I2S2_TCSR & I2S_TCSR_TE) 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_PIN3_CONFIG = 2; //2:TX_SYNC
// CORE_PIN2_CONFIG = 2; //2:TX_DATA0
// CORE_PIN33_CONFIG = 2; //2:RX_DATA0

int rsync = 1;
int tsync = 0;

Loading…
Cancel
Save