diff options
| author | Damien George <damien@micropython.org> | 2025-06-23 12:58:49 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2025-07-08 10:10:33 +1000 |
| commit | 9b97a30943ebf5fe381c29610d4b5cd1046240d7 (patch) | |
| tree | 0a5dd28d82a7c9c3d265f771e5e1af22530e41b0 | |
| parent | 6fd069e8a5b8139c0a5aaec506d3d83c60285ac4 (diff) | |
zephyr/machine_pin: Add Pin.OPEN_DRAIN constant.
Adding this constant is all that's needed to support open-drain pins.
Signed-off-by: Damien George <damien@micropython.org>
| -rw-r--r-- | ports/zephyr/machine_pin.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ports/zephyr/machine_pin.c b/ports/zephyr/machine_pin.c index 1baee656f..818216ffe 100644 --- a/ports/zephyr/machine_pin.c +++ b/ports/zephyr/machine_pin.c @@ -271,6 +271,7 @@ static const mp_rom_map_elem_t machine_pin_locals_dict_table[] = { // class constants { MP_ROM_QSTR(MP_QSTR_IN), MP_ROM_INT(GPIO_INPUT) }, { MP_ROM_QSTR(MP_QSTR_OUT), MP_ROM_INT(GPIO_OUTPUT | GPIO_INPUT) }, + { MP_ROM_QSTR(MP_QSTR_OPEN_DRAIN), MP_ROM_INT(GPIO_OUTPUT | GPIO_INPUT | GPIO_OPEN_DRAIN) }, { MP_ROM_QSTR(MP_QSTR_PULL_UP), MP_ROM_INT(GPIO_PULL_UP) }, { MP_ROM_QSTR(MP_QSTR_PULL_DOWN), MP_ROM_INT(GPIO_PULL_DOWN) }, { MP_ROM_QSTR(MP_QSTR_IRQ_RISING), MP_ROM_INT(GPIO_INT_EDGE_RISING) }, |
