Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5091

SDK • Difference between sm_config_set_out_pins() and pio_sm_set_out_pins()

$
0
0
These two functions look very similar:

Code:

sm_config_set_out_pins()

Code:

pio_sm_set_out_pins()

Code:

static inline void sm_config_set_out_pins(pio_sm_config *c, uint out_base, uint out_count) {    valid_params_if(PIO, out_base < 32);    valid_params_if(PIO, out_count <= 32);    c->pinctrl = (c->pinctrl & ~(PIO_SM0_PINCTRL_OUT_BASE_BITS | PIO_SM0_PINCTRL_OUT_COUNT_BITS)) |                 (out_base << PIO_SM0_PINCTRL_OUT_BASE_LSB) |                 (out_count << PIO_SM0_PINCTRL_OUT_COUNT_LSB);}

Code:

static inline void pio_sm_set_out_pins(PIO pio, uint sm, uint out_base, uint out_count) {    check_pio_param(pio);    check_sm_param(sm);    valid_params_if(PIO, out_base < 32);    valid_params_if(PIO, out_count <= 32);    pio->sm[sm].pinctrl = (pio->sm[sm].pinctrl & ~(PIO_SM0_PINCTRL_OUT_BASE_BITS | PIO_SM0_PINCTRL_OUT_COUNT_BITS)) |                 (out_base << PIO_SM0_PINCTRL_OUT_BASE_LSB) |                 (out_count << PIO_SM0_PINCTRL_OUT_COUNT_LSB);}
What's the difference? Why not just use pio_sm_set_out_pins()?

Statistics: Posted by LemonPi — Thu Dec 21, 2023 9:28 pm



Viewing all articles
Browse latest Browse all 5091

Trending Articles