Quote Originally Posted by DD4WH View Post
Blackaddr, thanks a lot for your detailed explanation!
However, I have not understood where to change the setting of I2S drive strength . . . can that be changed on-the-fly after initialization of the I2S lines? Probably not. So I searched for the files where the I2S is initialized for T4. Is it here ??? Strange that totally different pins are initialized in configI2S (pin 5: MCLK, pin 4: BCLK, pin 3: TX):
Luckily, it can be changed on the fly! To explain a little, the output driver (PAD register) settings are done on a per-pin basis rather than 'function' basis. Each pin can be configured for several different functions such as ADC, I2C, SPI, etc. via the MUX register for the pin. Changing a pins function does not change the output driver pad for you. You as a software developer must do that yourself. At the moment, it looks like the Teensy code never touches the output pad settings for any pins, for any function. In most cases, the default pad configuration is probably fine, but not optimal.

This is why you can change the output driver settings for any pin at any time without worrying about what function it's configured for. I think it's reasonable to assume the Teensy code might start configuring the output pads in the various object begin() functions, but as of today the pad registers are never touched.

So, the registers I indicated in the above post for I2S and I2C correspond to the pins I'm using for those functions. Since the Teensy library never touches their pad configuration, I can configure them myself at any time, but it's probably good practice to wait until after begin() is called if you want to override the library's behavior whatever that is.