adafruit_pioasm

Simple assembler to convert pioasm to bytes

  • Author(s): Scott Shawcroft

class adafruit_pioasm.Program(text_program: str, *, build_debuginfo: bool = False)

Encapsulates a program’s instruction stream and configuration flags

Example:

program = adafruit_pioasm.Program(...)
state_machine = rp2pio.StateMachine(program.assembled, ..., **program.pio_kwargs)

Converts pioasm text to encoded instruction bytes

assembled: array

The assembled PIO program instructions

classmethod from_file(filename: str, **kwargs) Program

Assemble a PIO program in a file

pio_kwargs: dict[str, Any]

Settings from assembler directives to pass to the StateMachine constructor

print_c_program(name: str, qualifier: str = 'const') None

Print the program into a C program snippet

public_labels: dict[str, int]

The offset of any labels declared public

adafruit_pioasm.assemble(program_text: str) array

Converts pioasm text to encoded instruction bytes

In new code, prefer to use the Program class so that the extra arguments such as the details about side-set pins can be easily passsed to the StateMachine constructor.

adafruit_pioasm.mov_splitter(string, maxsplit=0)

Split string by the occurrences of pattern.

adafruit_pioasm.splitter(string, maxsplit=0)

Split string by the occurrences of pattern.