Explorar el Código

Allow implementing Wire objects in sketch

main
PaulStoffregen hace 8 años
padre
commit
f78061da69
Se han modificado 1 ficheros con 18 adiciones y 25 borrados
  1. +18
    -25
      WireKinetis.cpp

+ 18
- 25
WireKinetis.cpp Ver fichero

return count; return count;
} }


#ifdef WIRE_IMPLEMENT_WIRE

const TwoWire::I2C_Hardware_t TwoWire::i2c0_hardware = { const TwoWire::I2C_Hardware_t TwoWire::i2c0_hardware = {
SIM_SCGC4, SIM_SCGC4_I2C0, SIM_SCGC4, SIM_SCGC4_I2C0,
#if defined(__MKL26Z64__) || defined(__MK20DX128__) || defined(__MK20DX256__) #if defined(__MKL26Z64__) || defined(__MK20DX128__) || defined(__MK20DX256__)
IRQ_I2C0 IRQ_I2C0
}; };


TwoWire Wire(KINETIS_I2C0, TwoWire::i2c0_hardware);

#endif // WIRE_IMPLEMENT_WIRE


#ifdef WIRE_IMPLEMENT_WIRE1

#if defined(__MKL26Z64__) || defined(__MK20DX256__) || defined(__MK64FX512__) || defined(__MK66FX1M0__)
const TwoWire::I2C_Hardware_t TwoWire::i2c1_hardware = { const TwoWire::I2C_Hardware_t TwoWire::i2c1_hardware = {
SIM_SCGC4, SIM_SCGC4_I2C1, SIM_SCGC4, SIM_SCGC4_I2C1,
#if defined(__MKL26Z64__) #if defined(__MKL26Z64__)
#endif #endif
IRQ_I2C1 IRQ_I2C1
}; };
#endif


TwoWire Wire1(KINETIS_I2C1, TwoWire::i2c1_hardware);

#endif // WIRE_IMPLEMENT_WIRE1


#ifdef WIRE_IMPLEMENT_WIRE2

#if defined(__MK64FX512__) || defined(__MK66FX1M0__)
const TwoWire::I2C_Hardware_t TwoWire::i2c2_hardware = { const TwoWire::I2C_Hardware_t TwoWire::i2c2_hardware = {
SIM_SCGC1, SIM_SCGC1_I2C2, SIM_SCGC1, SIM_SCGC1_I2C2,
#if defined(__MK64FX512__) || defined(__MK66FX1M0__) #if defined(__MK64FX512__) || defined(__MK66FX1M0__)
#endif #endif
IRQ_I2C2 IRQ_I2C2
}; };
#endif


TwoWire Wire2(KINETIS_I2C2, TwoWire::i2c2_hardware);

#endif // WIRE_IMPLEMENT_WIRE2


#ifdef WIRE_IMPLEMENT_WIRE3

#if defined(__MK66FX1M0__)
const TwoWire::I2C_Hardware_t TwoWire::i2c3_hardware = { const TwoWire::I2C_Hardware_t TwoWire::i2c3_hardware = {
SIM_SCGC1, SIM_SCGC1_I2C3, SIM_SCGC1, SIM_SCGC1_I2C3,
#if defined(__MK66FX1M0__) #if defined(__MK66FX1M0__)
#endif #endif
IRQ_I2C3 IRQ_I2C3
}; };
#endif


TwoWire Wire3(KINETIS_I2C3, TwoWire::i2c3_hardware);


#endif // WIRE_IMPLEMENT_WIRE3
#ifdef WIRE_IMPLEMENT_WIRE
TwoWire Wire(KINETIS_I2C0, TwoWire::i2c0_hardware);
#endif
#ifdef WIRE_IMPLEMENT_WIRE1
TwoWire Wire1(KINETIS_I2C1, TwoWire::i2c1_hardware);
#endif
#ifdef WIRE_IMPLEMENT_WIRE2
TwoWire Wire2(KINETIS_I2C2, TwoWire::i2c2_hardware);
#endif
#ifdef WIRE_IMPLEMENT_WIRE3
TwoWire Wire3(KINETIS_I2C3, TwoWire::i2c3_hardware);
#endif




#endif // __arm__ && TEENSYDUINO #endif // __arm__ && TEENSYDUINO

Cargando…
Cancelar
Guardar