@@ -81,7 +81,7 @@ func (asm AssemblerV1) MovReverse(dest MovDest, src MovSrc) instructionV0 {
8181// MovOSRFromRx reads the selected RX FIFO entry into the OSR. The PIO state machine can read the FIFO entries in any order, indexed
8282// either by the Y register, or an immediate Index in the instruction. Requires the SHIFTCTRL_FJOIN_RX_GET configuration field
8383// to be set, otherwise its operation is undefined.
84- // - If IdxI (index by immediate) is set, the RX FIFO’s registers are indexed by the two least-significant bits of the Index
84+ // - If idxByImmediate (index by immediate) is set, the RX FIFO’s registers are indexed by the two least-significant bits of the Index
8585// operand. Otherwise, they are indexed by the two least-significant bits of the Y register. When IdxI is clear, all non-zero
8686// values of Index are reserved encodings, and their operation is undefined.
8787func (asm AssemblerV1 ) MovOSRFromRx (idxByImmediate bool , RxFifoIndex uint8 ) instructionV0 {
@@ -106,5 +106,26 @@ func (asm AssemblerV1) Set(dest SetDest, value uint8) instructionV0 {
106106 return asm .v0 ().Set (dest , value )
107107}
108108
109+ // IRQSet sets the IRQ flag selected by irqIndex.
110+ func (asm AssemblerV1 ) IRQSet (irqIndex uint8 , idxMode IRQIndexMode ) instructionV0 {
111+ return asm .irq (false , false , irqIndex , idxMode )
112+ }
113+
114+ // IRQClear clears the IRQ flag selected by irqIndex argument. See [AssemblerV1.IRQSet].
115+ func (asm AssemblerV1 ) IRQClear (irqIndex uint8 , idxMode IRQIndexMode ) instructionV0 {
116+ return asm .irq (true , false , irqIndex , idxMode )
117+ }
118+
119+ // IRQWait sets the IRQ flag selected by irqIndex and waits for it to be cleared before proceeding.
120+ // If Wait is set, Delay cycles do not begin until after the wait period elapses.
121+ func (asm AssemblerV1 ) IRQWait (irqIndex uint8 , idxMode IRQIndexMode ) instructionV0 {
122+ return asm .irq (false , true , irqIndex , idxMode )
123+ }
124+
125+ func (asm AssemblerV1 ) irq (clear , wait bool , irqIndex uint8 , idxMode IRQIndexMode ) instructionV0 {
126+ instr := _INSTR_BITS_IRQ | uint16 (boolAsU8 (clear ))<< 6 | uint16 (boolAsU8 (wait ))<< 6 | uint16 (idxMode )<< 3 | uint16 (irqIndex & 0b111 )
127+ return asm .v0 ().instr (instr )
128+ }
129+
109130// Nop instruction unchanged from [AssemblerV0.Nop].
110131func (asm AssemblerV1 ) Nop () instructionV0 { return asm .v0 ().Nop () }
0 commit comments