diff options
author | Damien George <damien@micropython.org> | 2023-11-24 14:43:40 +1100 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2023-11-30 16:11:11 +1100 |
commit | 14432b5da022e32c035c47c7f6c44b5e97d16c89 (patch) | |
tree | 3d3fc33ddcedfb943a6c5a3b3d6f74942cfafc48 /extmod/modmachine.h | |
parent | 7b2f13fb69d95980c8e517d1944bc1e9d7ed5489 (diff) |
extmod/modmachine: Make I2C/SPI defns available when soft impl enabled.
Signed-off-by: Damien George <damien@micropython.org>
Diffstat (limited to 'extmod/modmachine.h')
-rw-r--r-- | extmod/modmachine.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/extmod/modmachine.h b/extmod/modmachine.h index 0744ef788..488aef4af 100644 --- a/extmod/modmachine.h +++ b/extmod/modmachine.h @@ -114,7 +114,7 @@ } \ } while (0) -#if MICROPY_PY_MACHINE_I2C +#if MICROPY_PY_MACHINE_I2C || MICROPY_PY_MACHINE_SOFTI2C #define MP_MACHINE_I2C_FLAG_READ (0x01) // if not set then it's a write #define MP_MACHINE_I2C_FLAG_STOP (0x02) @@ -139,7 +139,7 @@ typedef struct _machine_mem_obj_t { unsigned elem_size; // in bytes } machine_mem_obj_t; -#if MICROPY_PY_MACHINE_I2C +#if MICROPY_PY_MACHINE_I2C || MICROPY_PY_MACHINE_SOFTI2C typedef struct _mp_machine_i2c_buf_t { size_t len; @@ -175,7 +175,7 @@ typedef struct _mp_machine_soft_i2c_obj_t { #endif -#if MICROPY_PY_MACHINE_SPI +#if MICROPY_PY_MACHINE_SPI || MICROPY_PY_MACHINE_SOFTSPI // SPI protocol. typedef struct _mp_machine_spi_p_t { @@ -215,16 +215,20 @@ extern const mp_obj_type_t machine_timer_type; extern const mp_obj_type_t machine_uart_type; extern const mp_obj_type_t machine_wdt_type; -#if MICROPY_PY_MACHINE_I2C +#if MICROPY_PY_MACHINE_SOFTI2C extern const mp_obj_type_t mp_machine_soft_i2c_type; +#endif +#if MICROPY_PY_MACHINE_I2C || MICROPY_PY_MACHINE_SOFTI2C extern const mp_obj_dict_t mp_machine_i2c_locals_dict; #endif -#if MICROPY_PY_MACHINE_SPI +#if MICROPY_PY_MACHINE_SOFTSPI extern const mp_obj_type_t mp_machine_soft_spi_type; -extern const mp_obj_dict_t mp_machine_spi_locals_dict; extern const mp_machine_spi_p_t mp_machine_soft_spi_p; #endif +#if MICROPY_PY_MACHINE_SPI || MICROPY_PY_MACHINE_SOFTSPI +extern const mp_obj_dict_t mp_machine_spi_locals_dict; +#endif #if defined(MICROPY_MACHINE_MEM_GET_READ_ADDR) uintptr_t MICROPY_MACHINE_MEM_GET_READ_ADDR(mp_obj_t addr_o, uint align); |