Documentation ¶
Index ¶
- Constants
- func EncodeDelay(cycles uint16) uint16
- func EncodeIRQ(relative bool, irq uint16) uint16
- func EncodeIRQClear(relative bool, irq uint16) uint16
- func EncodeIRQSet(relative bool, irq uint16) uint16
- func EncodeIn(src SrcDest, value uint16) uint16
- func EncodeInstrAndArgs(instr uint16, arg1 uint16, arg2 uint16) uint16
- func EncodeInstrAndSrcDest(instr uint16, dest SrcDest, value uint16) uint16
- func EncodeJmp(addr uint16) uint16
- func EncodeMov(dest SrcDest, src SrcDest) uint16
- func EncodeMovNot(dest SrcDest, src SrcDest) uint16
- func EncodeMovReverse(dest SrcDest, src SrcDest) uint16
- func EncodeNOP() uint16
- func EncodeOut(dest SrcDest, value uint16) uint16
- func EncodePull(ifEmpty bool, block bool) uint16
- func EncodePush(ifFull bool, block bool) uint16
- func EncodeSet(dest SrcDest, value uint16) uint16
- func EncodeSetSetOpt(bitCount uint16, value uint16) uint16
- func EncodeSideSet(bitCount uint16, value uint16) uint16
- func EncodeWaitGPIO(polarity bool, pin uint16) uint16
- func EncodeWaitIRQ(polarity bool, relative bool, irq uint16) uint16
- func EncodeWaitPin(polarity bool, pin uint16) uint16
- func MajorInstrBits(instr uint16) uint16
- type FifoJoin
- type SrcDest
- type StateMachineConfig
- func (cfg *StateMachineConfig) SetClkDivIntFrac(div uint16, frac uint8)
- func (cfg *StateMachineConfig) SetFIFOJoin(join FifoJoin)
- func (cfg *StateMachineConfig) SetInShift(shiftRight bool, autoPush bool, pushThreshold uint16)
- func (cfg *StateMachineConfig) SetOutShift(shiftRight bool, autoPush bool, pushThreshold uint16)
- func (cfg *StateMachineConfig) SetSetPins(base machine.Pin, count uint8)
- func (cfg *StateMachineConfig) SetSideSet(bitCount uint8, optional bool, pindirs bool)
- func (cfg *StateMachineConfig) SetWrap(wrapTarget uint8, wrap uint8)
Constants ¶
const ( INSTR_BITS_JMP = 0x0000 INSTR_BITS_WAIT = 0x2000 INSTR_BITS_IN = 0x4000 INSTR_BITS_OUT = 0x6000 INSTR_BITS_PUSH = 0x8000 INSTR_BITS_PULL = 0x8080 INSTR_BITS_MOV = 0xa000 INSTR_BITS_IRQ = 0xc000 INSTR_BITS_SET = 0xe000 // Bit mask for instruction code INSTR_BITS_Msk = 0xe000 )
This file contains the primitives for creating instructions dynamically
Variables ¶
This section is empty.
Functions ¶
func EncodeDelay ¶
func EncodeIRQClear ¶
func EncodeIRQSet ¶
func EncodeInstrAndSrcDest ¶
func EncodeMovNot ¶
func EncodeMovReverse ¶
func EncodePull ¶
func EncodePush ¶
func EncodeSetSetOpt ¶
func EncodeSideSet ¶
func EncodeWaitGPIO ¶
func EncodeWaitPin ¶
func MajorInstrBits ¶
Types ¶
type StateMachineConfig ¶
StateMachineConfig holds the configuration for a PIO state machine.
This type is used by code generated by pioasm, in the RP2040 c-sdk - any changes should be backwards compatible.
func DefaultStateMachineConfig ¶
func DefaultStateMachineConfig() StateMachineConfig
DefaultStateMachineConfig returns the default configuration for a PIO state machine.
The default configuration here, mirrors the state from pio_get_default_sm_config in the c-sdk.
This function is used by code generated by pioasm, in the RP2040 c-sdk - any changes should be backwards compatible.
func (*StateMachineConfig) SetClkDivIntFrac ¶
func (cfg *StateMachineConfig) SetClkDivIntFrac(div uint16, frac uint8)
SetClkDivIntFrac sets the clock divider for the state machine from a whole and fractional part.
func (*StateMachineConfig) SetFIFOJoin ¶
func (cfg *StateMachineConfig) SetFIFOJoin(join FifoJoin)
static inline void sm_config_set_fifo_join(pio_sm_config *c, enum pio_fifo_join join) { valid_params_if(PIO, join == PIO_FIFO_JOIN_NONE || join == PIO_FIFO_JOIN_TX || join == PIO_FIFO_JOIN_RX); c->shiftctrl = (c->shiftctrl & (uint)~(PIO_SM0_SHIFTCTRL_FJOIN_TX_BITS | PIO_SM0_SHIFTCTRL_FJOIN_RX_BITS)) | (((uint)join) << PIO_SM0_SHIFTCTRL_FJOIN_TX_LSB); }
func (*StateMachineConfig) SetInShift ¶
func (cfg *StateMachineConfig) SetInShift(shiftRight bool, autoPush bool, pushThreshold uint16)
SetInShift sets the 'in' shifting parameters in a state machine configuration
func (*StateMachineConfig) SetOutShift ¶
func (cfg *StateMachineConfig) SetOutShift(shiftRight bool, autoPush bool, pushThreshold uint16)
SetOutShift sets the 'out' shifting parameters in a state machine configuration
func (*StateMachineConfig) SetSetPins ¶
func (cfg *StateMachineConfig) SetSetPins(base machine.Pin, count uint8)
SetSetPins sets the pins a PIO 'set' instruction modifies
func (*StateMachineConfig) SetSideSet ¶
func (cfg *StateMachineConfig) SetSideSet(bitCount uint8, optional bool, pindirs bool)
SetSideSet sets the sideset parameters in a state machine configuration
This function is used by code generated by pioasm, in the RP2040 c-sdk - any changes should be backwards compatible.
func (*StateMachineConfig) SetWrap ¶
func (cfg *StateMachineConfig) SetWrap(wrapTarget uint8, wrap uint8)
SetWrap sets the wrapping configuration for the state machine
This function is used by code generated by pioasm, in the RP2040 c-sdk - any changes should be backwards compatible.