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>
This commit is contained in:
Damien George
2025-06-23 12:58:49 +10:00
parent 6fd069e8a5
commit 9b97a30943

View File

@@ -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) },