mirror of
https://github.com/licsber/micropython.git
synced 2024-09-20 17:10:24 +08:00
39d50d129c
Previous commits removed the ability for one I2C/SPI constructor to construct both software- or hardware-based peripheral instances. Such construction is now split to explicit soft and non-soft types. This commit makes both types available in all ports that previously could create both software and hardware peripherals: machine.I2C and machine.SPI construct hardware instances, while machine.SoftI2C and machine.SoftSPI create software instances. This is a breaking change for use of software-based I2C and SPI. Code that constructed I2C/SPI peripherals in the following way will need to be changed: machine.I2C(-1, ...) -> machine.SoftI2C(...) machine.I2C(scl=scl, sda=sda) -> machine.SoftI2C(scl=scl, sda=sda) machine.SPI(-1, ...) -> machine.SoftSPI(...) machine.SPI(sck=sck, mosi=mosi, miso=miso) -> machine.SoftSPI(sck=sck, mosi=mosi, miso=miso) Code which uses machine.I2C and machine.SPI classes to access hardware peripherals does not need to change. Signed-off-by: Damien George <damien@micropython.org> |
||
---|---|---|
.. | ||
adc.c | ||
adc.h | ||
i2c.c | ||
i2c.h | ||
modmachine.c | ||
modmachine.h | ||
pin.c | ||
pin.h | ||
pwm.c | ||
pwm.h | ||
rtcounter.c | ||
rtcounter.h | ||
spi.c | ||
spi.h | ||
temp.c | ||
temp.h | ||
timer.c | ||
timer.h | ||
uart.c | ||
uart.h |