|
79 | 79 | //| initial_sideset_pin_state: int = 0,
|
80 | 80 | //| initial_sideset_pin_direction: int = 0x1f,
|
81 | 81 | //| sideset_enable: bool = False,
|
| 82 | +//| jmp_pin: Optional[microcontroller.Pin] = None, |
| 83 | +//| jmp_pin_pull: Optional[digitalio.Pull] = None, |
82 | 84 | //| exclusive_pin_use: bool = True,
|
83 | 85 | //| auto_pull: bool = False,
|
84 | 86 | //| pull_threshold: int = 32,
|
|
113 | 115 | //| :param int initial_sideset_pin_direction: the initial output direction for sideset pins starting at first_sideset_pin
|
114 | 116 | //| :param bool sideset_enable: True when the top sideset bit is to enable. This should be used with the ".side_set # opt" directive
|
115 | 117 | //| :param ~microcontroller.Pin jmp_pin: the pin which determines the branch taken by JMP PIN instructions
|
| 118 | +//| :param ~digitalio.Pull jmp_pin_pull: The pull value for the jmp pin, default is no pull. |
116 | 119 | //| :param bool exclusive_pin_use: When True, do not share any pins with other state machines. Pins are never shared with other peripherals
|
117 | 120 | //| :param bool auto_pull: When True, automatically load data from the tx FIFO into the
|
118 | 121 | //| output shift register (OSR) when an OUT instruction shifts more than pull_threshold bits
|
@@ -150,7 +153,7 @@ STATIC mp_obj_t rp2pio_statemachine_make_new(const mp_obj_type_t *type, size_t n
|
150 | 153 | ARG_first_set_pin, ARG_set_pin_count, ARG_initial_set_pin_state, ARG_initial_set_pin_direction,
|
151 | 154 | ARG_first_sideset_pin, ARG_sideset_pin_count, ARG_initial_sideset_pin_state, ARG_initial_sideset_pin_direction,
|
152 | 155 | ARG_sideset_enable,
|
153 |
| - ARG_jmp_pin, |
| 156 | + ARG_jmp_pin, ARG_jmp_pin_pull, |
154 | 157 | ARG_exclusive_pin_use,
|
155 | 158 | ARG_auto_pull, ARG_pull_threshold, ARG_out_shift_right,
|
156 | 159 | ARG_wait_for_txstall,
|
@@ -184,6 +187,7 @@ STATIC mp_obj_t rp2pio_statemachine_make_new(const mp_obj_type_t *type, size_t n
|
184 | 187 | { MP_QSTR_sideset_enable, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} },
|
185 | 188 |
|
186 | 189 | { MP_QSTR_jmp_pin, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} },
|
| 190 | + { MP_QSTR_jmp_pin_pull, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, |
187 | 191 |
|
188 | 192 | { MP_QSTR_exclusive_pin_use, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = true} },
|
189 | 193 | { MP_QSTR_auto_pull, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} },
|
@@ -230,6 +234,7 @@ STATIC mp_obj_t rp2pio_statemachine_make_new(const mp_obj_type_t *type, size_t n
|
230 | 234 | }
|
231 | 235 |
|
232 | 236 | const mcu_pin_obj_t *jmp_pin = validate_obj_is_pin_or_none(args[ARG_jmp_pin].u_obj);
|
| 237 | + digitalio_pull_t jmp_pin_pull = validate_pull(args[ARG_jmp_pin_pull].u_rom_obj, MP_QSTR_jmp_pull); |
233 | 238 |
|
234 | 239 | mp_int_t pull_threshold = args[ARG_pull_threshold].u_int;
|
235 | 240 | mp_int_t push_threshold = args[ARG_push_threshold].u_int;
|
@@ -263,7 +268,7 @@ STATIC mp_obj_t rp2pio_statemachine_make_new(const mp_obj_type_t *type, size_t n
|
263 | 268 | first_set_pin, args[ARG_set_pin_count].u_int, args[ARG_initial_set_pin_state].u_int, args[ARG_initial_set_pin_direction].u_int,
|
264 | 269 | first_sideset_pin, args[ARG_sideset_pin_count].u_int, args[ARG_initial_sideset_pin_state].u_int, args[ARG_initial_sideset_pin_direction].u_int,
|
265 | 270 | args[ARG_sideset_enable].u_bool,
|
266 |
| - jmp_pin, |
| 271 | + jmp_pin, jmp_pin_pull, |
267 | 272 | 0,
|
268 | 273 | args[ARG_exclusive_pin_use].u_bool,
|
269 | 274 | args[ARG_auto_pull].u_bool, pull_threshold, args[ARG_out_shift_right].u_bool,
|
|
0 commit comments