mimxrt/machine_i2c: Add hardware-based machine.I2C to machine module.

It uses non-blocking transfer of data.  Advantage over SoftI2C:
- Higher data rate up to ~3 MHZ.
- Full protocol support.
This commit is contained in:
robert-hh
2021-06-19 22:09:40 +02:00
committed by Damien George
parent 06277a9169
commit 98c5703027
11 changed files with 313 additions and 1 deletions

View File

@@ -42,3 +42,17 @@
#define DMA_REQ_SRC_TX { 0, kDmaRequestMuxLPSPI1Tx, kDmaRequestMuxLPSPI2Tx, \
kDmaRequestMuxLPSPI3Tx, kDmaRequestMuxLPSPI4Tx }
// Define mapping hardware I2C # to logical I2C #
// SDA/SCL HW-I2C Logical I2C
// 17/16 LPI2C3 -> 0
// 18/19 LPI2C1 -> 1
// 25/24 LPI2C4 -> 2
#define MICROPY_HW_I2C_INDEX { 1, 3, 4 }
#define IOMUX_TABLE_I2C \
{ IOMUXC_GPIO_AD_B1_00_LPI2C1_SCL }, { IOMUXC_GPIO_AD_B1_01_LPI2C1_SDA }, \
{ 0 }, { 0 }, \
{ IOMUXC_GPIO_AD_B1_07_LPI2C3_SCL }, { IOMUXC_GPIO_AD_B1_06_LPI2C3_SDA }, \
{ IOMUXC_GPIO_AD_B0_12_LPI2C4_SCL }, { IOMUXC_GPIO_AD_B0_13_LPI2C4_SDA },