Skip to content

Commit 5a12687

Browse files
committed
StateMachine: docs: parameters usually supplied by **pio_kwargs
1 parent 2796fe8 commit 5a12687

File tree

1 file changed

+25
-20
lines changed

1 file changed

+25
-20
lines changed

ports/raspberrypi/bindings/rp2pio/StateMachine.c

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -86,64 +86,69 @@
8686
//| ) -> None:
8787
//| """Construct a StateMachine object on the given pins with the given program.
8888
//|
89+
//| The following parameters are usually supplied directly:
90+
//|
8991
//| :param ReadableBuffer program: the program to run with the state machine
9092
//| :param int frequency: the target clock frequency of the state machine. Actual may be less. Use 0 for system clock speed.
9193
//| :param ReadableBuffer init: a program to run once at start up. This is run after program
9294
//| 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.
9495
//| :param ReadableBuffer may_exec: Instructions that may be executed via `StateMachine.run` calls.
9596
//| Some elements of the `StateMachine`'s configuration are inferred from the instructions used;
9697
//| for instance, if there is no ``in`` or ``push`` instruction, then the `StateMachine` is configured without a receive FIFO.
9798
//| In this case, passing a ``may_exec`` program containing an ``in`` instruction such as ``in x``, a receive FIFO will be configured.
9899
//| :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
100100
//| :param int initial_out_pin_state: the initial output value for out pins starting at first_out_pin
101101
//| :param int initial_out_pin_direction: the initial output direction for out pins starting at first_out_pin
102102
//| :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
104103
//| :param int pull_in_pin_up: a 1-bit in this mask sets pull up on the corresponding in pin
105104
//| :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.
106105
//| :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
108106
//| :param int initial_set_pin_state: the initial output value for set pins starting at first_set_pin
109107
//| :param int initial_set_pin_direction: the initial output direction for set pins starting at first_set_pin
110108
//| :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
112109
//| :param int initial_sideset_pin_state: the initial output value for sideset pins starting at first_sideset_pin
113110
//| :param int initial_sideset_pin_direction: the initial output direction for sideset pins starting at first_sideset_pin
114111
//| :param bool sideset_enable: True when the top sideset bit is to enable. This should be used with the ".side_set # opt" directive
115112
//| :param ~microcontroller.Pin jmp_pin: the pin which determines the branch taken by JMP PIN instructions
116113
//| :param ~digitalio.Pull jmp_pin_pull: The pull value for the jmp pin, default is no pull.
117114
//| :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).
124115
//| :param bool wait_for_txstall: When True, writing data out will block until the TX FIFO and OSR are empty
125116
//| and an instruction is stalled waiting for more data. When False, data writes won't
126117
//| wait for the OSR to empty (only the TX FIFO) so make sure you give enough time before
127118
//| 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).
134119
//| :param bool user_interruptible: When True (the default),
135120
//| `write()`, `readinto()`, and `write_readinto()` can be interrupted by a ctrl-C.
136121
//| This is useful when developing a PIO program: if there is an error in the program
137122
//| that causes an infinite loop, you will be able to interrupt the loop.
138123
//| However, if you are writing to a device that can get into a bad state if a read or write
139124
//| 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).
140148
//| :param int wrap_target: The target instruction number of automatic wrap. Defaults to the first instruction of the program.
141149
//| :param int wrap: The instruction after which to wrap to the ``wrap``
142150
//| instruction. As a special case, -1 (the default) indicates the
143151
//| 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.
147152
//| :param FifoType fifo_type: How the program accessess the FIFOs. PIO version 0 only supports a subset of values.
148153
//| :param MovStatusType mov_status_type: What condition the ``mov status`` instruction checks. PIO version 0 only supports a subset of values.
149154
//| :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

Comments
 (0)