Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
raspberrypipico:pico_pio [2021/03/13 19:28] admin [wait()] |
raspberrypipico:pico_pio [2021/03/13 21:35] admin [nop()] |
||
---|---|---|---|
Line 152: | Line 152: | ||
| | ||
- | ====wait()==== | + | ====wait(option)==== |
**wait(// | **wait(// | ||
It will waits until the specified GPIO has the specified polarity.\\ | It will waits until the specified GPIO has the specified polarity.\\ | ||
Line 164: | Line 164: | ||
It will wait for an irg to be set.\\ | It will wait for an irg to be set.\\ | ||
- polarity (1 clears the interrupt flag, 0 won' | - polarity (1 clears the interrupt flag, 0 won' | ||
- | - num (number of interrupt, with rel the relative interrupt numbers could be used)\\ | + | - num (interrupt |
+ | | ||
- | ====in(source, | + | ====in(source, |
The IN instructor shifts data from the source into the input shift register (ISR).\\ | The IN instructor shifts data from the source into the input shift register (ISR).\\ | ||
**source: | **source: | ||
Line 175: | Line 176: | ||
- status (from special register could e.g. indicate FIFO empty or full)\\ | - status (from special register could e.g. indicate FIFO empty or full)\\ | ||
- osr (from output shift registers)\\ | - osr (from output shift registers)\\ | ||
- | **bitcount:**\\ | + | **bits:**\\ |
- 0-31 bits\\ | - 0-31 bits\\ | ||
- | ====out(destination, | + | ====out(destination, |
The OUT instructor shifts data from the output shift register (OSR) to the destination.\\ | The OUT instructor shifts data from the output shift register (OSR) to the destination.\\ | ||
**destination: | **destination: | ||
Line 188: | Line 189: | ||
- pc (shifts an instruction into the program counter)\\ | - pc (shifts an instruction into the program counter)\\ | ||
- isr (into the input shift registers)\\ | - isr (into the input shift registers)\\ | ||
- | **bitcount:**\\ | + | **bits:**\\ |
- 0-31 bits\\ | - 0-31 bits\\ | ||
Line 234: | Line 235: | ||
mov(osr, x) #copy the x scratch register to the output shift register | mov(osr, x) #copy the x scratch register to the output shift register | ||
- | ====irq(option, | + | ====irq(option, |
The IRQ instruction sets or clears an interrupt flag.\\ | The IRQ instruction sets or clears an interrupt flag.\\ | ||
**option**\\ | **option**\\ | ||
Line 240: | Line 241: | ||
- wait (wait until the flag is zero before setting it)\\ | - wait (wait until the flag is zero before setting it)\\ | ||
- clear (clears the flag)\\ | - clear (clears the flag)\\ | ||
- | **irq_num**, number of the interrupt 0-7\\ | + | **num** number of the interrupt 0-7\\ |
- | **rel** relative IRQ number, can set different IRQ per StateMachine, | + | **rel** relative IRQ number\\ |
In the StateMachine | In the StateMachine | ||
| | ||
Line 278: | Line 279: | ||
| | ||
====nop()==== | ====nop()==== | ||
- | The NOP instruction stands for no operations. | + | The NOP instruction stands for no operations. |
- | nop (31) #delay 31 cycles | + | nop () [31] #delay 31 cycles |
====wrap()==== | ====wrap()==== |