|
64 | 64 | //| initial_set_pin_direction: int = 0x1F,
|
65 | 65 | //| first_sideset_pin: Optional[microcontroller.Pin] = None,
|
66 | 66 | //| sideset_pin_count: int = 1,
|
| 67 | +//| sideset_pindirs: bool = False, |
67 | 68 | //| initial_sideset_pin_state: int = 0,
|
68 | 69 | //| initial_sideset_pin_direction: int = 0x1F,
|
69 | 70 | //| sideset_enable: bool = False,
|
|
133 | 134 | //| :param int in_pin_count: the count of consecutive pins to use with IN starting at first_in_pin
|
134 | 135 | //| :param int set_pin_count: the count of consecutive pins to use with SET starting at first_set_pin
|
135 | 136 | //| :param int sideset_pin_count: the count of consecutive pins to use with a side set starting at first_sideset_pin. Does not include sideset enable
|
| 137 | +//| :param bool sideset_pindirs: `True` to indicate that the side set values should be applied to the PINDIRs and not the PINs |
136 | 138 | //| :param int pio_version: The version of the PIO peripheral required by the program. The constructor will raise an error if the actual hardware is not compatible with this program version.
|
137 | 139 | //| :param bool auto_push: When True, automatically save data from input shift register
|
138 | 140 | //| (ISR) into the rx FIFO when an IN instruction shifts more than push_threshold bits
|
@@ -173,7 +175,8 @@ static mp_obj_t rp2pio_statemachine_make_new(const mp_obj_type_t *type, size_t n
|
173 | 175 | ARG_first_in_pin, ARG_in_pin_count,
|
174 | 176 | ARG_pull_in_pin_up, ARG_pull_in_pin_down,
|
175 | 177 | ARG_first_set_pin, ARG_set_pin_count, ARG_initial_set_pin_state, ARG_initial_set_pin_direction,
|
176 |
| - ARG_first_sideset_pin, ARG_sideset_pin_count, ARG_initial_sideset_pin_state, ARG_initial_sideset_pin_direction, |
| 178 | + ARG_first_sideset_pin, ARG_sideset_pin_count, ARG_sideset_pindirs, |
| 179 | + ARG_initial_sideset_pin_state, ARG_initial_sideset_pin_direction, |
177 | 180 | ARG_sideset_enable,
|
178 | 181 | ARG_jmp_pin, ARG_jmp_pin_pull,
|
179 | 182 | ARG_exclusive_pin_use,
|
@@ -211,6 +214,7 @@ static mp_obj_t rp2pio_statemachine_make_new(const mp_obj_type_t *type, size_t n
|
211 | 214 |
|
212 | 215 | { MP_QSTR_first_sideset_pin, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} },
|
213 | 216 | { MP_QSTR_sideset_pin_count, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 1} },
|
| 217 | + { MP_QSTR_sideset_pindirs, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} }, |
214 | 218 | { MP_QSTR_initial_sideset_pin_state, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0} },
|
215 | 219 | { MP_QSTR_initial_sideset_pin_direction, MP_ARG_KW_ONLY | MP_ARG_INT, {.u_int = 0x1f} },
|
216 | 220 |
|
@@ -329,7 +333,8 @@ static mp_obj_t rp2pio_statemachine_make_new(const mp_obj_type_t *type, size_t n
|
329 | 333 | first_out_pin, out_pin_count, args[ARG_initial_out_pin_state].u_int, args[ARG_initial_out_pin_direction].u_int,
|
330 | 334 | first_in_pin, in_pin_count, args[ARG_pull_in_pin_up].u_int, args[ARG_pull_in_pin_down].u_int,
|
331 | 335 | first_set_pin, set_pin_count, args[ARG_initial_set_pin_state].u_int, args[ARG_initial_set_pin_direction].u_int,
|
332 |
| - first_sideset_pin, sideset_pin_count, args[ARG_initial_sideset_pin_state].u_int, args[ARG_initial_sideset_pin_direction].u_int, |
| 336 | + first_sideset_pin, sideset_pin_count, args[ARG_sideset_pindirs].u_bool, |
| 337 | + args[ARG_initial_sideset_pin_state].u_int, args[ARG_initial_sideset_pin_direction].u_int, |
333 | 338 | args[ARG_sideset_enable].u_bool,
|
334 | 339 | jmp_pin, jmp_pin_pull,
|
335 | 340 | 0,
|
|
0 commit comments