Two CS42448 chips interfacing with I2S and I2S1

Status
Not open for further replies.

Neal

Well-known member
I want to separately interface two separate CS42448 chips to one Teensy 4.1. But before I try this I want to ask if an assumption I am making is valid.

Assuming nothing else is connected to the Teensy 4.1 my assumption is I can use I2S (Teensy pins 21, 23, 7, 8, 20) for the first CS42448, and that I can use I2S1 (Teensy pins 4, 33, 2, 5, 3) for the second CS42448. The audio library objects I would be using for this are tdm1/tdm2 for the first CS42448 and tdm2_1/tdm2_2 for the second CS42448.

Two questions:
1. Are my above assumptions correct?
2. Is there an example that someone can point me to that uses some of the functions in the Audio Library control_cs42448.cpp/control_cs42448.h routines?

I know there are other efforts to use a single TDM with two CS42448s, but I would like to know if my brute force interfacing plan makes sense.

Thanks in advance for the sanity check.
 
It should work to connect them to different I2S.

When you open the .h file, you will also see the available functions:
https://github.com/PaulStoffregen/Audio/blob/master/control_cs42448.h#L36
Code:
class AudioControlCS42448 : public AudioControl
{
public:
    AudioControlCS42448(void) : i2c_addr([COLOR=#000000]0x48[/COLOR]), muted(true) { }
    [COLOR=#ff0000][B]void setAddress(uint8_t addr) [/B][/COLOR]{
        i2c_addr = 0x48 | (addr & 3);
    }
    bool enable(void);
    bool disable(void) {
        return false;
    }
    bool volume(float level) {
        return volumeInteger(volumebyte(level));
    }
    bool inputLevel(float level) {
        return inputLevelInteger(inputlevelbyte(level));
    }
    bool inputSelect(int n) {
        return (n == 0) ? true : false;
    }
    bool volume(int channel, float level) {
        if (channel < 1 || channel > 8) return false;
        return volumeInteger(channel, volumebyte(level)); 
    }
    bool inputLevel(int channel, float level) {
        if (channel < 1 || channel > 6) return false;
        return inputLevelInteger(channel, inputlevelbyte(level));
    }
private:
[...]

I had almost overseen that it allows to set the I2C address.
 
Yes I saw the function that allows multiple I2C addresses. I was hoping to also find an example sketch that uses some of the control_cs42448 functionality and possibly and example that interfaces with the input_tdm and output_tdm audio library elements.

Thanks for your confirmation that you think it should work.
 
Status
Not open for further replies.
Back
Top