Add missing pio_encode_wait_jmppin function to pio_instructions.h

This commit is contained in:
Andrew Scheller 2025-12-08 15:36:55 +00:00 committed by GitHub
parent a76f2416ba
commit 478d75804c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -310,6 +310,23 @@ static inline uint pio_encode_wait_irq(bool polarity, bool relative, uint irq) {
return _pio_encode_instr_and_args(pio_instr_bits_wait, 2u | (polarity ? 4u : 0u), _pio_encode_irq(relative, irq)); return _pio_encode_instr_and_args(pio_instr_bits_wait, 2u | (polarity ? 4u : 0u), _pio_encode_irq(relative, irq));
} }
#if PICO_PIO_VERSION > 0
/*! \brief Encode a WAIT for jmppin instruction
* \ingroup pio_instructions
*
* This is the equivalent of `WAIT <polarity> JMPPIN + <offset>`
*
* \param polarity true for `WAIT 1`, false for `WAIT 0`
* \param offset The pin offset 0-3 relative to the executing SM's jmp pin mapping
* \return The instruction encoding with 0 delay and no side set value
* \see pio_encode_delay, pio_encode_sideset, pio_encode_sideset_opt
*/
static inline uint pio_encode_wait_jmppin(bool polarity, uint offset) {
valid_params_if(PIO_INSTRUCTIONS, offset <= 4);
return _pio_encode_instr_and_args(pio_instr_bits_wait, 3u | (polarity ? 4u : 0u), offset);
}
#endif
/*! \brief Encode an IN instruction /*! \brief Encode an IN instruction
* \ingroup pio_instructions * \ingroup pio_instructions
* *