I do indeed have a plan regarding the Wire library slave mode... but that plan is basically to prioritize work on Wire after a few of the USB types (especially MIDI), speeding up analogRead, implementing analogWriteFrequency (that's what I'm working on today), and other more urgent stuff.
Are there any published programs that depend upon endTransmission's return code? I can probably look at this sooner, if it's really needed. Unless you can point me to at least one widely published program which actually uses the return value, I'm not going to work on endTransmission until getting into the slave mode stuff.
Like most peripherals in this chip, the I2C is clocked from the bus clock. When you set the CPU to 96 MHz, the bus clock is still 48 MHz. In theory, the PLL and clock dividers could be programmed to generate many different clocks, but Teensyduino doesn't support any others, because they don't work with USB. That's why the Tools > USB Type menu is populated with only 3 choices. The main PLL has to be a multiple of 24 MHz for the USB to work, and the CPU, Bus and Flash clocks have to be power of 2 divisions of the PLL and integer multiples of each other.
Just like the Wire library when used on Arduino, the bit rate is fixed at 100 kHz. At least some programs directly write to the AVR TWBR register, because Wire doesn't provide an API to set the speed. I'm considering adding code to emulate TWBR.
If you look in Wire.cpp, I left some code in there to set other speeds. For example:
Code:
#if F_BUS == 48000000
I2C0_F = 0x27; // 100 kHz
// I2C0_F = 0x85; // 400 kHz
// I2C0_F = 0x0D; // 1 MHz
If you want those other speeds, just uncomment the line you want.