piolib: add Pico SDK 2 PIO API

Open
#159 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
c
Domain
embedded-iot

Research direction

Start in piolib.h and compare its PIO API with the Pico C/C++ SDK 2 APIs used by pioasm-generated code from pico-sdk-tools 2.0.0 or newer. Review the linked c_sdk_output.cpp reference and the linked sideset and consecutive-pins changes. Done means the requested compatible functions and updates are available in piolib.h.

Written by the indexing model from the issue text.

Description

piolib.h is missing the new functions and updates/fixes from Pico C/C++ SDK 2, like (probably not all make sense [but might be convenient for portable code], and probably some are missing, but at least the ones used by pioasm-generated code using pico-sdk-tools ≥ v2.0.0 should be available):

sm_config_set_out_pin_base
sm_config_set_out_pin_count
sm_config_set_set_pin_base
sm_config_set_set_pin_count
sm_config_set_in_pin_base
sm_config_set_in_pin_count
sm_config_set_sideset_pin_base
sm_config_set_clkdiv_int_frac8
pio_enable_sm_mask_in_sync
pio_sm_get_pc
pio_sm_is_exec_stalled
pio_sm_set_wrap
pio_sm_set_out_pins
pio_sm_set_set_pins
pio_sm_set_in_pins
pio_sm_set_sideset_pins
pio_sm_set_jmp_pin
pio_sm_set_clkdiv_int_frac8
pio_sm_set_pins64
pio_sm_set_pins_with_mask64
pio_claim_free_sm_and_add_program
pio_claim_free_sm_and_add_program_for_gpio_range
pio_remove_program_and_unclaim_sm
pio_get_irq_num
pio_get_tx_fifo_not_full_interrupt_source
pio_get_rx_fifo_not_empty_interrupt_source
pio_set_gpio_base
pio_get_gpio_base
pio_get_funcsel
pio_get_instance
pio_get_dreq
pio_encode_sideset_opt
pio_sm_set_consecutive_pins

Dominant language
C
Stars
346
Forks
98
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raspberrypi/utils

All issues in raspberrypi/utils

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.