|
|
@ -49,16 +49,16 @@ typedef struct _machine_hard_i2c_obj_t { |
|
|
|
|
|
|
|
STATIC const machine_hard_i2c_obj_t machine_hard_i2c_obj[MICROPY_HW_MAX_I2C] = { |
|
|
|
#if defined(MICROPY_HW_I2C1_SCL) |
|
|
|
[0] = {{&machine_hard_i2c_type}, I2C1, MICROPY_HW_I2C1_SCL, MICROPY_HW_I2C1_SDA}, |
|
|
|
[0] = {{&machine_i2c_type}, I2C1, MICROPY_HW_I2C1_SCL, MICROPY_HW_I2C1_SDA}, |
|
|
|
#endif |
|
|
|
#if defined(MICROPY_HW_I2C2_SCL) |
|
|
|
[1] = {{&machine_hard_i2c_type}, I2C2, MICROPY_HW_I2C2_SCL, MICROPY_HW_I2C2_SDA}, |
|
|
|
[1] = {{&machine_i2c_type}, I2C2, MICROPY_HW_I2C2_SCL, MICROPY_HW_I2C2_SDA}, |
|
|
|
#endif |
|
|
|
#if defined(MICROPY_HW_I2C3_SCL) |
|
|
|
[2] = {{&machine_hard_i2c_type}, I2C3, MICROPY_HW_I2C3_SCL, MICROPY_HW_I2C3_SDA}, |
|
|
|
[2] = {{&machine_i2c_type}, I2C3, MICROPY_HW_I2C3_SCL, MICROPY_HW_I2C3_SDA}, |
|
|
|
#endif |
|
|
|
#if defined(MICROPY_HW_I2C4_SCL) |
|
|
|
[3] = {{&machine_hard_i2c_type}, I2C4, MICROPY_HW_I2C4_SCL, MICROPY_HW_I2C4_SDA}, |
|
|
|
[3] = {{&machine_i2c_type}, I2C4, MICROPY_HW_I2C4_SCL, MICROPY_HW_I2C4_SDA}, |
|
|
|
#endif |
|
|
|
}; |
|
|
|
|
|
|
@ -140,16 +140,16 @@ typedef mp_machine_soft_i2c_obj_t machine_hard_i2c_obj_t; |
|
|
|
|
|
|
|
STATIC machine_hard_i2c_obj_t machine_hard_i2c_obj[MICROPY_HW_MAX_I2C] = { |
|
|
|
#if defined(MICROPY_HW_I2C1_SCL) |
|
|
|
[0] = {{&machine_hard_i2c_type}, 1, I2C_POLL_DEFAULT_TIMEOUT_US, MICROPY_HW_I2C1_SCL, MICROPY_HW_I2C1_SDA}, |
|
|
|
[0] = {{&machine_i2c_type}, 1, I2C_POLL_DEFAULT_TIMEOUT_US, MICROPY_HW_I2C1_SCL, MICROPY_HW_I2C1_SDA}, |
|
|
|
#endif |
|
|
|
#if defined(MICROPY_HW_I2C2_SCL) |
|
|
|
[1] = {{&machine_hard_i2c_type}, 1, I2C_POLL_DEFAULT_TIMEOUT_US, MICROPY_HW_I2C2_SCL, MICROPY_HW_I2C2_SDA}, |
|
|
|
[1] = {{&machine_i2c_type}, 1, I2C_POLL_DEFAULT_TIMEOUT_US, MICROPY_HW_I2C2_SCL, MICROPY_HW_I2C2_SDA}, |
|
|
|
#endif |
|
|
|
#if defined(MICROPY_HW_I2C3_SCL) |
|
|
|
[2] = {{&machine_hard_i2c_type}, 1, I2C_POLL_DEFAULT_TIMEOUT_US, MICROPY_HW_I2C3_SCL, MICROPY_HW_I2C3_SDA}, |
|
|
|
[2] = {{&machine_i2c_type}, 1, I2C_POLL_DEFAULT_TIMEOUT_US, MICROPY_HW_I2C3_SCL, MICROPY_HW_I2C3_SDA}, |
|
|
|
#endif |
|
|
|
#if defined(MICROPY_HW_I2C4_SCL) |
|
|
|
[3] = {{&machine_hard_i2c_type}, 1, I2C_POLL_DEFAULT_TIMEOUT_US, MICROPY_HW_I2C4_SCL, MICROPY_HW_I2C4_SDA}, |
|
|
|
[3] = {{&machine_i2c_type}, 1, I2C_POLL_DEFAULT_TIMEOUT_US, MICROPY_HW_I2C4_SCL, MICROPY_HW_I2C4_SDA}, |
|
|
|
#endif |
|
|
|
}; |
|
|
|
|
|
|
@ -237,7 +237,7 @@ STATIC const mp_machine_i2c_p_t machine_hard_i2c_p = { |
|
|
|
}; |
|
|
|
|
|
|
|
MP_DEFINE_CONST_OBJ_TYPE( |
|
|
|
machine_hard_i2c_type, |
|
|
|
machine_i2c_type, |
|
|
|
MP_QSTR_I2C, |
|
|
|
MP_TYPE_FLAG_NONE, |
|
|
|
make_new, machine_hard_i2c_make_new, |
|
|
|