mirror of
https://github.com/raspberrypi/pico-sdk.git
synced 2026-01-27 17:37:20 +01:00
Add (and use) 32-bit version of check_pio_pin_mask64
Some checks failed
Bazel presubmit checks / bazel-build-check (macos-latest) (push) Has been cancelled
Bazel presubmit checks / bazel-build-check (ubuntu-latest) (push) Has been cancelled
Bazel presubmit checks / other-bazel-checks (push) Has been cancelled
Check Board Headers / check-board-headers (push) Has been cancelled
Check Configs / check-configs (push) Has been cancelled
CMake / build (push) Has been cancelled
Some checks failed
Bazel presubmit checks / bazel-build-check (macos-latest) (push) Has been cancelled
Bazel presubmit checks / bazel-build-check (ubuntu-latest) (push) Has been cancelled
Bazel presubmit checks / other-bazel-checks (push) Has been cancelled
Check Board Headers / check-board-headers (push) Has been cancelled
Check Configs / check-configs (push) Has been cancelled
CMake / build (push) Has been cancelled
This commit is contained in:
parent
545f092e86
commit
96f5b9442d
2 changed files with 11 additions and 0 deletions
|
|
@ -786,6 +786,13 @@ static inline uint pio_get_gpio_base(PIO pio) {
|
|||
#endif
|
||||
}
|
||||
|
||||
static inline void check_pio_pin_mask(__unused PIO pio, __unused uint sm, __unused uint32_t pinmask) {
|
||||
// check no pins are set in the mask which are incompatible with the pio
|
||||
#if PICO_PIO_USE_GPIO_BASE
|
||||
valid_params_if(HARDWARE_PIO, (pinmask & ~(0xffffffffu << pio_get_gpio_base(pio))) == 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void check_pio_pin_mask64(__unused PIO pio, __unused uint sm, __unused uint64_t pinmask) {
|
||||
// check no pins are set in the mask which are incompatible with the pio
|
||||
#if PICO_PIO_USE_GPIO_BASE
|
||||
|
|
|
|||
|
|
@ -251,6 +251,7 @@ void pio_sm_set_pins_internal(PIO pio, uint sm, uint32_t pins) {
|
|||
|
||||
#ifndef pio_sm_set_pins_internal
|
||||
void pio_sm_set_pins(PIO pio, uint sm, uint32_t pins) {
|
||||
check_pio_pin_mask(pio, sm, pins);
|
||||
#if PICO_PIO_USE_GPIO_BASE
|
||||
pins >>= pio_get_gpio_base(pio);
|
||||
#endif
|
||||
|
|
@ -287,6 +288,7 @@ void pio_sm_set_pins_with_mask_internal(PIO pio, uint sm, uint32_t pin_values, u
|
|||
|
||||
#ifndef pio_sm_set_pins_with_mask_internal
|
||||
void pio_sm_set_pins_with_mask(PIO pio, uint sm, uint32_t pin_values, uint32_t pin_mask) {
|
||||
check_pio_pin_mask(pio, sm, pin_mask);
|
||||
#if PICO_PIO_USE_GPIO_BASE
|
||||
pin_values >>= pio_get_gpio_base(pio);
|
||||
pin_mask >>= pio_get_gpio_base(pio);
|
||||
|
|
@ -324,6 +326,7 @@ void pio_sm_set_pindirs_with_mask_internal(PIO pio, uint sm, uint32_t pindirs, u
|
|||
|
||||
#ifndef pio_sm_set_pindirs_with_mask_internal
|
||||
void pio_sm_set_pindirs_with_mask(PIO pio, uint sm, uint32_t pindirs, uint32_t pin_mask) {
|
||||
check_pio_pin_mask(pio, sm, pin_mask);
|
||||
#if PICO_PIO_USE_GPIO_BASE
|
||||
pindirs >>= pio_get_gpio_base(pio);
|
||||
pin_mask >>= pio_get_gpio_base(pio);
|
||||
|
|
@ -333,6 +336,7 @@ void pio_sm_set_pindirs_with_mask(PIO pio, uint sm, uint32_t pindirs, uint32_t p
|
|||
#endif
|
||||
|
||||
void pio_sm_set_pindirs_with_mask64(PIO pio, uint sm, uint64_t pindirs, uint64_t pin_mask) {
|
||||
check_pio_pin_mask64(pio, sm, pin_mask);
|
||||
#if PICO_PIO_USE_GPIO_BASE
|
||||
pindirs >>= pio_get_gpio_base(pio);
|
||||
pin_mask >>= pio_get_gpio_base(pio);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue