4242//| protocol may be refered to as 8080-I Series Parallel Interface in datasheets. It doesn't handle
4343//| display initialization."""
4444//|
45- //| def __init__(self, *, data0: microcontroller.Pin, command: microcontroller.Pin, chip_select: microcontroller.Pin, write: microcontroller.Pin, read: microcontroller.Pin, reset: microcontroller.Pin, frequency: int = 30_000_000) -> None:
45+ //| def __init__(self, *, data0: microcontroller.Pin, command: microcontroller.Pin, chip_select: microcontroller.Pin, write: microcontroller.Pin, read: Optional[ microcontroller.Pin] , reset: Optional[ microcontroller.Pin] = None , frequency: int = 30_000_000) -> None:
4646//| """Create a ParallelBus object associated with the given pins. The bus is inferred from data0
4747//| by implying the next 7 additional pins on a given GPIO port.
4848//|
5656//| :param microcontroller.Pin command: Data or command pin
5757//| :param microcontroller.Pin chip_select: Chip select pin
5858//| :param microcontroller.Pin write: Write pin
59- //| :param microcontroller.Pin read: Read pin
60- //| :param microcontroller.Pin reset: Reset pin
59+ //| :param microcontroller.Pin read: Read pin, optional
60+ //| :param microcontroller.Pin reset: Reset pin, optional
6161//| :param int frequency: The communication frequency in Hz for the display on the bus"""
6262//| ...
6363//|
@@ -69,8 +69,8 @@ STATIC mp_obj_t paralleldisplay_parallelbus_make_new(const mp_obj_type_t *type,
6969 { MP_QSTR_command , MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED },
7070 { MP_QSTR_chip_select , MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED },
7171 { MP_QSTR_write , MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED },
72- { MP_QSTR_read , MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED },
73- { MP_QSTR_reset , MP_ARG_OBJ | MP_ARG_KW_ONLY | MP_ARG_REQUIRED },
72+ { MP_QSTR_read , MP_ARG_OBJ | MP_ARG_KW_ONLY , {. u_obj = mp_const_none } },
73+ { MP_QSTR_reset , MP_ARG_OBJ | MP_ARG_KW_ONLY , {. u_obj = mp_const_none } },
7474 { MP_QSTR_frequency , MP_ARG_INT | MP_ARG_KW_ONLY , {.u_int = 30000000 } },
7575 };
7676 mp_arg_val_t args [MP_ARRAY_SIZE (allowed_args )];
@@ -79,8 +79,8 @@ STATIC mp_obj_t paralleldisplay_parallelbus_make_new(const mp_obj_type_t *type,
7979 const mcu_pin_obj_t * command = validate_obj_is_free_pin (args [ARG_command ].u_obj );
8080 const mcu_pin_obj_t * chip_select = validate_obj_is_free_pin (args [ARG_chip_select ].u_obj );
8181 const mcu_pin_obj_t * write = validate_obj_is_free_pin (args [ARG_write ].u_obj );
82- const mcu_pin_obj_t * read = validate_obj_is_free_pin (args [ARG_read ].u_obj );
83- const mcu_pin_obj_t * reset = validate_obj_is_free_pin (args [ARG_reset ].u_obj );
82+ const mcu_pin_obj_t * read = validate_obj_is_free_pin_or_none (args [ARG_read ].u_obj );
83+ const mcu_pin_obj_t * reset = validate_obj_is_free_pin_or_none (args [ARG_reset ].u_obj );
8484
8585 paralleldisplay_parallelbus_obj_t * self = & allocate_display_bus_or_raise ()-> parallel_bus ;
8686 self -> base .type = & paralleldisplay_parallelbus_type ;
0 commit comments