Raspberry Pi Pico C/C++ SDK
Colophon
Legal disclaimer notice
Table of contents
Chapter 1. About the SDK
1.1. Introduction
1.2. Anatomy of a SDK Application
Chapter 2. SDK architecture
2.1. The Build System
2.2. Every Library is an INTERFACE
2.3. SDK Library Structure
2.3.1. Higher-level Libraries
2.3.2. Runtime Support (pico_runtime, pico_standard_link)
2.3.3. Hardware Support Libraries
2.3.4. Hardware Structs Library
2.3.5. Hardware Registers Library
2.3.6. TinyUSB Port
2.4. Directory Structure
2.4.1. Locations of Files
2.5. Conventions for Library Functions
2.5.1. Function Naming Conventions
2.5.2. Return Codes and Error Handling
2.5.3. Use of Inline Functions
2.5.4. Builder Pattern for Hardware Configuration APIs
2.6. Customisation and Configuration Using Preprocessor variables
2.6.1. Preprocessor Variables via Board Configuration File
2.6.2. Preprocessor Variables Per Binary or Library via CMake
2.7. SDK Runtime
2.7.1. Standard Input/Output (stdio) Support
2.7.2. Floating-point Support
2.7.3. Hardware Divider
2.8. Multi-core support
2.9. Using C++
2.10. Next Steps
Chapter 3. Using programmable I/O (PIO)
3.1. What is Programmable I/O (PIO)?
3.1.1. Background
3.1.2. I/O Using dedicated hardware on your PC
3.1.3. I/O Using dedicated hardware on your Raspberry Pi or microcontroller
3.1.4. I/O Using software control of GPIOs ("bit-banging")
3.1.5. Programmable I/O Hardware using FPGAs and CPLDs
3.1.6. Programmable I/O Hardware using PIO
3.2. Getting started with PIO
3.2.1. A First PIO Application
3.2.2. A Real Example: WS2812 LEDs
3.2.3. PIO and DMA (A Logic Analyser)
3.2.4. Further examples
3.3. Using PIOASM, the PIO Assembler
3.3.1. Usage
3.3.2. Directives
3.3.3. Values
3.3.4. Expressions
3.3.5. Comments
3.3.6. Labels
3.3.7. Instructions
3.3.8. Pseudoinstructions
3.3.9. Output pass through
3.3.10. Language generators
3.4. PIO Instruction Set Reference
3.4.1. Summary
3.4.2. JMP
3.4.3. WAIT
3.4.4. IN
3.4.5. OUT
3.4.6. PUSH
3.4.7. PULL
3.4.8. MOV
3.4.9. IRQ
3.4.10. SET
Chapter 4. Library documentation
4.1. Hardware APIs
4.1.1. hardware_adc
4.1.2. hardware_base
4.1.3. hardware_claim
4.1.4. hardware_clocks
4.1.5. hardware_divider
4.1.6. hardware_dma
4.1.7. channel_config
4.1.8. hardware_exception
4.1.9. hardware_flash
4.1.10. hardware_gpio
4.1.11. hardware_i2c
4.1.12. hardware_interp
4.1.13. interp_config
4.1.14. hardware_irq
4.1.15. hardware_pio
4.1.16. sm_config
4.1.17. pio_instructions
4.1.18. hardware_pll
4.1.19. hardware_pwm
4.1.20. hardware_resets
4.1.21. hardware_rtc
4.1.22. hardware_spi
4.1.23. hardware_sync
4.1.24. hardware_timer
4.1.25. hardware_uart
4.1.26. hardware_vreg
4.1.27. hardware_watchdog
4.1.28. hardware_xosc
4.2. High Level APIs
4.2.1. pico_multicore
4.2.2. fifo
4.2.3. lockout
4.2.4. pico_stdlib
4.2.5. pico_sync
4.2.6. critical_section
4.2.7. lock_core
4.2.8. mutex
4.2.9. sem
4.2.10. pico_time
4.2.11. timestamp
4.2.12. sleep
4.2.13. alarm
4.2.14. repeating_timer
4.2.15. pico_unique_id
4.2.16. pico_util
4.2.17. datetime
4.2.18. pheap
4.2.19. queue
4.3. Third-party Libraries
4.3.1. tinyusb_device
4.3.2. tinyusb_host
4.4. Networking Libraries
4.4.1. pico_lwip
4.4.2. pico_cyw43_arch
4.4.3. cyw43_driver
4.4.4. cyw43_ll
4.5. Runtime Infrastructure
4.5.1. boot_stage2
4.5.2. pico_base
4.5.3. pico_binary_info
4.5.4. pico_bit_ops
4.5.5. pico_bootrom
4.5.6. pico_bootsel_via_double_reset
4.5.7. pico_cxx_options
4.5.8. pico_divider
4.5.9. pico_double
4.5.10. pico_float
4.5.11. pico_int64_ops
4.5.12. pico_malloc
4.5.13. pico_mem_ops
4.5.14. pico_platform
4.5.15. pico_printf
4.5.16. pico_runtime
4.5.17. pico_stdio
4.5.18. pico_stdio_semihosting
4.5.19. pico_stdio_uart
4.5.20. pico_stdio_usb
4.5.21. pico_standard_link
4.6. External API Headers
4.6.1. boot_picoboot
4.6.2. boot_uf2
4.7. pico_usb_reset_interface
Appendix A: App Notes
Attaching a 7 segment LED via GPIO
Wiring information
List of Files
Bill of Materials
DHT-11, DHT-22, and AM2302 Sensors
Wiring information
List of Files
Bill of Materials
Attaching a 16x2 LCD via TTL
Wiring information
List of Files
Bill of Materials
Attaching a microphone using the ADC
Wiring information
List of Files
Bill of Materials
Attaching a BME280 temperature/humidity/pressure sensor via SPI
Wiring information
List of Files
Bill of Materials
Attaching a MPU9250 accelerometer/gyroscope via SPI
Wiring information
List of Files
Bill of Materials
Attaching a MPU6050 accelerometer/gyroscope via I2C
Wiring information
List of Files
Bill of Materials
Attaching a 16x2 LCD via I2C
Wiring information
List of Files
Bill of Materials
Attaching a BMP280 temp/pressure sensor via I2C
Wiring information
List of Files
Bill of Materials
Attaching a LIS3DH Nano Accelerometer via i2c.
Wiring information
List of Files
Bill of Materials
Attaching a MCP9808 digital temperature sensor via I2C
Wiring information
List of Files
Bill of Materials
Attaching a MMA8451 3-axis digital accelerometer via I2C
Wiring information
List of Files
Bill of Materials
Attaching an MPL3115A2 altimeter via I2C
Wiring information
List of Files
Bill of Materials
Attaching an OLED display via I2C
Wiring information
List of Files
Bill of Materials
Attaching a PA1010D Mini GPS module via I2C
Wiring information
List of Files
Bill of Materials
Attaching a PCF8523 Real Time Clock via I2C
Wiring information
List of Files
Bill of Materials
Appendix B: SDK configuration
Configuration Parameters
Appendix C: CMake build configuration
Configuration Parameters
Control of binary type produced (advanced)
Appendix D: Board configuration
Board Configuration
The Configuration files
Building applications with a custom board configuration
Available configuration parameters
Appendix E: Building the SDK API documentation
Appendix F: SDK release history
Release 1.0.0 (20/Jan/2021)
Release 1.0.1 (01/Feb/2021)
Boot Stage 2
Release 1.1.0 (05/Mar/2021)
Backwards incompatibility
Release 1.1.1 (01/Apr/2021)
Release 1.1.2 (07/Apr/2021)
Release 1.2.0 (03/Jun/2021)
New/improved Board headers
Updated TinyUSB to 0.10.1
Added CMSIS core headers
API improvements
General code improvements
SVD
pioasm
RTOS interoperability
CMake build changes
Boot Stage 2
Release 1.3.0 (02/Nov/2021)
Updated TinyUSB to 0.12.0
New Board Support
Updated SVD, hardware_regs, hardware_structs
Behavioural Changes
Other Notable Improvements
CMake build
pioasm
elf2uf2
Release 1.3.1 (18/May/2022)
New Board Support
Notable Library Changes/Improvements
Build
pioasm
elf2uf2
Release 1.4.0 (30/Jun/2022)
New Board Support
Wireless Support
Notable Library Changes/Improvements
Build
Appendix G: Documentation release history