Directives
Directives are used to control the assembly process of a PIO program. They do not correspond to any machine code, but they can affect the generated machine code in various ways, such as defining labels, setting the origin of the program, or specifying the PIO version.
Function Notation
In the Method-Chain PIO Assembler, directives are represented as member functions of the Program class. In C++'s formal syntax, they should be described as follows:
For more pragmatic notations, this page uses the following syntax to represent the directives:
List of Directives
Below is a list of directives available in the method-chain PIO assember.
.end
Marks the end of the PIO program. This directive does finalization work such as resolving labels and calculating the size of the program.
.pub
Retrives the relative address of the current instruction and stores it in relAddr. This can be used to implement position-independent code.
.pio_version
Specifies the PIO version to target. This infomration is used to check if the instructions used in the program are compatible with the specified PIO version.
.side_set
.side_set() directive can be used with the following modifiers:
.opt(): Makes.side()modifier optional. If not specified, all the instruction must have the.side()modifier..pindirs(): The value specified by.side()modifier sets the direction of the pin, not the value on the pin.
.wrap_target
Marks the beginning of a wrap block. A wrap block is a section of code that will be repeated indefinitely. The end of the wrap block is marked by the .wrap() directive.