Permalink
Browse files

Reverted to "3.8" PRU code, with re-mapped interrupt and McASP interf…

…ace clock intialization. Also required changing some stuff in I2c_Codec.cpp to revert to the DSP mode used in 3.8.
  • Loading branch information...
giuliomoro committed Oct 4, 2017
1 parent 2a797d0 commit 48cf220cf1347d6e4f1fb4a0ee3153e72d75ff52
Showing with 401 additions and 958 deletions.
  1. +12 −3 core/I2c_Codec.cpp
  2. +389 −955 pru_rtaudio.p
View
@@ -14,6 +14,7 @@
#include "../include/I2c_Codec.h"
#define TLV320_DSP_MODE
I2c_Codec::I2c_Codec()
: running(false), dacVolumeHalfDbs(0), adcVolumeHalfDbs(0), hpVolumeHalfDbs(0)
{}
@@ -71,9 +72,17 @@ int I2c_Codec::startAudio(int dual_rate)
}
if(writeRegister(0x08, 0xC0)) // Audio serial control register A: BLCK, WCLK outputs
return 1;
if(writeRegister(0x09, 0x00)) // Audio serial control register B: I2S mode, word len 16 bits
return 1;
if(writeRegister(0x0A, 0x01)) // Audio serial control register C: 1 bit offset
#ifdef TLV320_DSP_MODE // to use with old PRU code
if(writeRegister(0x09, 0x40)) // Audio serial control register B: DSP mode, word len 16 bits
#else
if(writeRegister(0x09, 0x00)) // Audio serial control register B: I2S mode, word len 16 bits
#endif
return 1;
#ifdef TLV320_DSP_MODE // to use with old PRU code
if(writeRegister(0x0A, 0x00)) // Audio serial control register C: 0 bit offset
#else
if(writeRegister(0x0A, 0x01)) // Audio serial control register C: 1 bit offset
#endif
return 1;
if(writeRegister(0x0D, 0x00)) // Headset / button press register A: disabled
return 1;
Oops, something went wrong.

0 comments on commit 48cf220

Please sign in to comment.