Raspberry Pi Pico C/C++ SDK

Raspberry Pi Pico C/C++ SDK

Raspberry Pi Pico C/C++ SDK Colophon Copyright © 2020 Raspberry Pi (Trading) Ltd. The documentation of the RP2040 microcontroller is licensed under a Creative Commons Attribution-NoDerivatives 4.0 International (CC BY-ND). build-date: 2021-09-30 build-version: 000dcb1-clean About the SDK Throughout the text "the SDK" refers to our Raspberry Pi Pico SDK. More details about the SDK can be found throughout this book. Source code included in the documentation is Copyright © 2020 Raspberry Pi (Trading) Ltd. and licensed under the 3-Clause BSD license. Legal Disclaimer Notice TECHNICAL AND RELIABILITY DATA FOR RASPBERRY PI PRODUCTS (INCLUDING DATASHEETS) AS MODIFIED FROM TIME TO TIME (“RESOURCES”) ARE PROVIDED BY RASPBERRY PI (TRADING) LTD (“RPTL) "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW IN NO EVENT SHALL RPTL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE RESOURCES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. RPTL reserves the right to make any enhancements, improvements, corrections or any other modifications to the RESOURCES or any products described in them at any time and without further notice. The RESOURCES are intended for skilled users with suitable levels of design knowledge. Users are solely responsible for their selection and use of the RESOURCES and any application of the products described in them. User agrees to indemnify and hold RPTL harmless against all liabilities, costs, damages or other losses arising out of their use of the RESOURCES. RPTL grants users permission to use the RESOURCES solely in conjunction with the Raspberry Pi products. All other use of the RESOURCES is prohibited. No licence is granted to any other RPTL or other third party intellectual property right. HIGH RISK ACTIVITIES. Raspberry Pi products are not designed, manufactured or intended for use in hazardous environments requiring fail safe performance, such as in the operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, weapons systems or safety-critical applications (including life support systems and other medical devices), in which the failure of the products could lead directly to death, personal injury or severe physical or environmental damage (“High Risk Activities”). RPTL specifically disclaims any express or implied warranty of fitness for High Risk Activities and accepts no liability for use or inclusions of Raspberry Pi products in High Risk Activities. Raspberry Pi products are provided subject to RPTL’s Standard Terms. RPTL’s provision of the RESOURCES does not expand or otherwise modify RPTL’s Standard Terms including but not limited to the disclaimers and warranties expressed in them. Legal Disclaimer Notice 1 Raspberry Pi Pico C/C++ SDK Table of Contents Colophon . 1 Legal Disclaimer Notice. 1 1. About the SDK. 6 1.1. Introduction . 6 1.2. Anatomy of a SDK Application . 6 2. SDK Architecture . 9 2.1. The Build System. 9 2.2. Every Library is an INTERFACE . 10 2.3. SDK Library Structure . 11 2.3.1. Higher-level Libraries. 11 2.3.2. Runtime Support (pico_runtime, pico_standard_link) . 11 2.3.3. Hardware Support Libraries . 12 2.3.4. Hardware Structs Library . 13 2.3.5. Hardware Registers Library . 14 2.3.6. TinyUSB Port. 15 2.4. Directory Structure . 15 2.4.1. Locations of Files. 16 2.5. Conventions for Library Functions . 17 2.5.1. Function Naming Conventions. 17 2.5.2. Return Codes and Error Handling. 18 2.5.3. Use of Inline Functions . 18 2.5.4. Builder Pattern for Hardware Configuration APIs . 19 2.6. Customisation and Configuration Using Preprocessor variables . 20 2.6.1. Preprocessor Variables via Board Configuration File . 20 2.6.2. Preprocessor Variables Per Binary or Library via CMake . 20 2.7. SDK Runtime . 21 2.7.1. Standard Input/Output (stdio) Support . 21 2.7.2. Floating-point Support. 22 2.7.3. Hardware Divider . 25 2.8. Multi-core support. 26 2.9. Using C++. 27 2.10. Next Steps . 27 3. Using Programmable I/O (PIO). 28 3.1. What is Programmable I/O (PIO)?. 28 3.1.1. Background. 28 3.1.2. I/O Using dedicated hardware on your PC . 28 3.1.3. I/O Using dedicated hardware on your Raspberry Pi or microcontroller. 28 3.1.4. I/O Using software control of GPIOs ("bit-banging") . 29 3.1.5. Programmable I/O Hardware using FPGAs and CPLDs . 30 3.1.6. Programmable I/O Hardware using PIO . 30 3.2. Getting started with PIO . 31 3.2.1. A First PIO Application . 31 3.2.2. A Real Example: WS2812 LEDs . ..

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    301 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us