|
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,
|
|
116 | 118 | //| :param int initial_sideset_pin_direction: the initial output direction for sideset pins starting at first_sideset_pin
|
117 | 119 | //| :param bool sideset_enable: True when the top sideset bit is to enable. This should be used with the ".side_set # opt" directive
|
118 | 120 | //| :param ~microcontroller.Pin jmp_pin: the pin which determines the branch taken by JMP PIN instructions
|
| 121 | +//| :param ~digitalio.Pull jmp_pin_pull: The pull value for the jmp pin, default is no pull. |
119 | 122 | //| :param bool exclusive_pin_use: When True, do not share any pins with other state machines. Pins are never shared with other peripherals
|
120 | 123 | //| :param bool auto_pull: When True, automatically load data from the tx FIFO into the
|
121 | 124 | //| output shift register (OSR) when an OUT instruction shifts more than pull_threshold bits
|
@@ -157,7 +160,7 @@ STATIC mp_obj_t rp2pio_statemachine_make_new(const mp_obj_type_t *type, size_t n
|
157 | 160 | ARG_first_set_pin, ARG_set_pin_count, ARG_initial_set_pin_state, ARG_initial_set_pin_direction,
|
158 | 161 | ARG_first_sideset_pin, ARG_sideset_pin_count, ARG_initial_sideset_pin_state, ARG_initial_sideset_pin_direction,
|
159 | 162 | ARG_sideset_enable,
|
160 |
| - ARG_jmp_pin, |
| 163 | + ARG_jmp_pin, ARG_jmp_pin_pull, |
161 | 164 | ARG_exclusive_pin_use,
|
162 | 165 | ARG_auto_pull, ARG_pull_threshold, ARG_out_shift_right,
|
163 | 166 | ARG_wait_for_txstall,
|
@@ -193,6 +196,7 @@ STATIC mp_obj_t rp2pio_statemachine_make_new(const mp_obj_type_t *type, size_t n
|
193 | 196 | { MP_QSTR_sideset_enable, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} },
|
194 | 197 |
|
195 | 198 | { MP_QSTR_jmp_pin, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} },
|
| 199 | + { MP_QSTR_jmp_pin_pull, MP_ARG_KW_ONLY | MP_ARG_OBJ, {.u_obj = mp_const_none} }, |
196 | 200 |
|
197 | 201 | { MP_QSTR_exclusive_pin_use, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = true} },
|
198 | 202 | { MP_QSTR_auto_pull, MP_ARG_KW_ONLY | MP_ARG_BOOL, {.u_bool = false} },
|
@@ -242,6 +246,7 @@ STATIC mp_obj_t rp2pio_statemachine_make_new(const mp_obj_type_t *type, size_t n
|
242 | 246 | }
|
243 | 247 |
|
244 | 248 | const mcu_pin_obj_t *jmp_pin = validate_obj_is_pin_or_none(args[ARG_jmp_pin].u_obj);
|
| 249 | + digitalio_pull_t jmp_pin_pull = validate_pull(args[ARG_jmp_pin_pull].u_rom_obj, MP_QSTR_jmp_pull); |
245 | 250 |
|
246 | 251 | mp_int_t pull_threshold = args[ARG_pull_threshold].u_int;
|
247 | 252 | mp_int_t push_threshold = args[ARG_push_threshold].u_int;
|
@@ -278,7 +283,7 @@ STATIC mp_obj_t rp2pio_statemachine_make_new(const mp_obj_type_t *type, size_t n
|
278 | 283 | 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,
|
279 | 284 | 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,
|
280 | 285 | args[ARG_sideset_enable].u_bool,
|
281 |
| - jmp_pin, |
| 286 | + jmp_pin, jmp_pin_pull, |
282 | 287 | 0,
|
283 | 288 | args[ARG_exclusive_pin_use].u_bool,
|
284 | 289 | args[ARG_auto_pull].u_bool, pull_threshold, args[ARG_out_shift_right].u_bool,
|
|
0 commit comments