https://forum.pjrc.com/threads/33485-Why-is-Wire-end%28%29-not-implemented?p=99540&viewfull=1#post99540main
void TwoWire::setClock(uint32_t frequency) | void TwoWire::setClock(uint32_t frequency) | ||||
{ | { | ||||
if (!(SIM_SCGC4 & SIM_SCGC4_I2C0)) return; | |||||
#if F_BUS == 60000000 | #if F_BUS == 60000000 | ||||
if (frequency < 400000) { | if (frequency < 400000) { | ||||
I2C0_F = 0x2C; // 104 kHz | I2C0_F = 0x2C; // 104 kHz | ||||
void TwoWire::end() | void TwoWire::end() | ||||
{ | { | ||||
if (!(SIM_SCGC4 & SIM_SCGC4_I2C0)) return; | |||||
NVIC_DISABLE_IRQ(IRQ_I2C0); | NVIC_DISABLE_IRQ(IRQ_I2C0); | ||||
I2C0_C1 = 0; | I2C0_C1 = 0; | ||||
CORE_PIN18_CONFIG = 0; | CORE_PIN18_CONFIG = 0; |