|
86 | 86 | //| ) -> None:
|
87 | 87 | //| """Construct a StateMachine object on the given pins with the given program.
|
88 | 88 | //|
|
| 89 | +//| The following parameters are usually supplied directly: |
| 90 | +//| |
89 | 91 | //| :param ReadableBuffer program: the program to run with the state machine
|
90 | 92 | //| :param int frequency: the target clock frequency of the state machine. Actual may be less. Use 0 for system clock speed.
|
91 | 93 | //| :param ReadableBuffer init: a program to run once at start up. This is run after program
|
92 | 94 | //| is started so instructions may be intermingled
|
93 |
| -//| :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. |
94 | 95 | //| :param ReadableBuffer may_exec: Instructions that may be executed via `StateMachine.run` calls.
|
95 | 96 | //| Some elements of the `StateMachine`'s configuration are inferred from the instructions used;
|
96 | 97 | //| for instance, if there is no ``in`` or ``push`` instruction, then the `StateMachine` is configured without a receive FIFO.
|
97 | 98 | //| In this case, passing a ``may_exec`` program containing an ``in`` instruction such as ``in x``, a receive FIFO will be configured.
|
98 | 99 | //| :param ~microcontroller.Pin first_out_pin: the first pin to use with the OUT instruction
|
99 |
| -//| :param int out_pin_count: the count of consecutive pins to use with OUT starting at first_out_pin |
100 | 100 | //| :param int initial_out_pin_state: the initial output value for out pins starting at first_out_pin
|
101 | 101 | //| :param int initial_out_pin_direction: the initial output direction for out pins starting at first_out_pin
|
102 | 102 | //| :param ~microcontroller.Pin first_in_pin: the first pin to use with the IN instruction
|
103 |
| -//| :param int in_pin_count: the count of consecutive pins to use with IN starting at first_in_pin |
104 | 103 | //| :param int pull_in_pin_up: a 1-bit in this mask sets pull up on the corresponding in pin
|
105 | 104 | //| :param int pull_in_pin_down: a 1-bit in this mask sets pull down on the corresponding in pin. Setting both pulls enables a "bus keep" function, i.e. a weak pull to whatever is current high/low state of GPIO.
|
106 | 105 | //| :param ~microcontroller.Pin first_set_pin: the first pin to use with the SET instruction
|
107 |
| -//| :param int set_pin_count: the count of consecutive pins to use with SET starting at first_set_pin |
108 | 106 | //| :param int initial_set_pin_state: the initial output value for set pins starting at first_set_pin
|
109 | 107 | //| :param int initial_set_pin_direction: the initial output direction for set pins starting at first_set_pin
|
110 | 108 | //| :param ~microcontroller.Pin first_sideset_pin: the first pin to use with a side set
|
111 |
| -//| :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 |
112 | 109 | //| :param int initial_sideset_pin_state: the initial output value for sideset pins starting at first_sideset_pin
|
113 | 110 | //| :param int initial_sideset_pin_direction: the initial output direction for sideset pins starting at first_sideset_pin
|
114 | 111 | //| :param bool sideset_enable: True when the top sideset bit is to enable. This should be used with the ".side_set # opt" directive
|
115 | 112 | //| :param ~microcontroller.Pin jmp_pin: the pin which determines the branch taken by JMP PIN instructions
|
116 | 113 | //| :param ~digitalio.Pull jmp_pin_pull: The pull value for the jmp pin, default is no pull.
|
117 | 114 | //| :param bool exclusive_pin_use: When True, do not share any pins with other state machines. Pins are never shared with other peripherals
|
118 |
| -//| :param bool auto_pull: When True, automatically load data from the tx FIFO into the |
119 |
| -//| output shift register (OSR) when an OUT instruction shifts more than pull_threshold bits |
120 |
| -//| :param int pull_threshold: Number of bits to shift before loading a new value into the OSR from the tx FIFO |
121 |
| -//| :param bool out_shift_right: When True, data is shifted out the right side (LSB) of the |
122 |
| -//| OSR. It is shifted out the left (MSB) otherwise. NOTE! This impacts data alignment |
123 |
| -//| when the number of bytes is not a power of two (1, 2 or 4 bytes). |
124 | 115 | //| :param bool wait_for_txstall: When True, writing data out will block until the TX FIFO and OSR are empty
|
125 | 116 | //| and an instruction is stalled waiting for more data. When False, data writes won't
|
126 | 117 | //| wait for the OSR to empty (only the TX FIFO) so make sure you give enough time before
|
127 | 118 | //| deiniting or stopping the state machine.
|
128 |
| -//| :param bool auto_push: When True, automatically save data from input shift register |
129 |
| -//| (ISR) into the rx FIFO when an IN instruction shifts more than push_threshold bits |
130 |
| -//| :param int push_threshold: Number of bits to shift before saving the ISR value to the RX FIFO |
131 |
| -//| :param bool in_shift_right: When True, data is shifted into the right side (LSB) of the |
132 |
| -//| ISR. It is shifted into the left (MSB) otherwise. NOTE! This impacts data alignment |
133 |
| -//| when the number of bytes is not a power of two (1, 2 or 4 bytes). |
134 | 119 | //| :param bool user_interruptible: When True (the default),
|
135 | 120 | //| `write()`, `readinto()`, and `write_readinto()` can be interrupted by a ctrl-C.
|
136 | 121 | //| This is useful when developing a PIO program: if there is an error in the program
|
137 | 122 | //| that causes an infinite loop, you will be able to interrupt the loop.
|
138 | 123 | //| However, if you are writing to a device that can get into a bad state if a read or write
|
139 | 124 | //| is interrupted, you may want to set this to False after your program has been vetted.
|
| 125 | +//| :param int offset: A specific offset in the state machine's program memory where the program must be loaded. |
| 126 | +//| The default value, -1, allows the program to be loaded at any offset. |
| 127 | +//| This is appropriate for most programs. |
| 128 | +//| |
| 129 | +//| The following parameters are usually set via assembler directives and passed using a ``**program.pio_kwargs`` argument but may also be specified directly: |
| 130 | +//| |
| 131 | +//| :param int out_pin_count: the count of consecutive pins to use with OUT starting at first_out_pin |
| 132 | +//| :param int in_pin_count: the count of consecutive pins to use with IN starting at first_in_pin |
| 133 | +//| :param int set_pin_count: the count of consecutive pins to use with SET starting at first_set_pin |
| 134 | +//| :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 |
| 135 | +//| :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. |
| 136 | +//| :param bool auto_push: When True, automatically save data from input shift register |
| 137 | +//| (ISR) into the rx FIFO when an IN instruction shifts more than push_threshold bits |
| 138 | +//| :param int push_threshold: Number of bits to shift before saving the ISR value to the RX FIFO |
| 139 | +//| :param bool in_shift_right: When True, data is shifted into the right side (LSB) of the |
| 140 | +//| ISR. It is shifted into the left (MSB) otherwise. NOTE! This impacts data alignment |
| 141 | +//| when the number of bytes is not a power of two (1, 2 or 4 bytes). |
| 142 | +//| :param bool auto_pull: When True, automatically load data from the tx FIFO into the |
| 143 | +//| output shift register (OSR) when an OUT instruction shifts more than pull_threshold bits |
| 144 | +//| :param int pull_threshold: Number of bits to shift before loading a new value into the OSR from the tx FIFO |
| 145 | +//| :param bool out_shift_right: When True, data is shifted out the right side (LSB) of the |
| 146 | +//| OSR. It is shifted out the left (MSB) otherwise. NOTE! This impacts data alignment |
| 147 | +//| when the number of bytes is not a power of two (1, 2 or 4 bytes). |
140 | 148 | //| :param int wrap_target: The target instruction number of automatic wrap. Defaults to the first instruction of the program.
|
141 | 149 | //| :param int wrap: The instruction after which to wrap to the ``wrap``
|
142 | 150 | //| instruction. As a special case, -1 (the default) indicates the
|
143 | 151 | //| last instruction of the program.
|
144 |
| -//| :param int offset: A specific offset in the state machine's program memory where the program must be loaded. |
145 |
| -//| The default value, -1, allows the program to be loaded at any offset. |
146 |
| -//| This is appropriate for most programs. |
147 | 152 | //| :param FifoType fifo_type: How the program accessess the FIFOs. PIO version 0 only supports a subset of values.
|
148 | 153 | //| :param MovStatusType mov_status_type: What condition the ``mov status`` instruction checks. PIO version 0 only supports a subset of values.
|
149 | 154 | //| :param MovStatusType mov_status_n: The FIFO depth or IRQ the ``mov status`` instruction checks for. For ``mov_status irq`` this includes the encoding of the ``next``/``prev`` selection bits.
|
|
0 commit comments