What do I have to fill in in the
#include “????“ or #include <???>
without a detailed file system search?
Let's say I want to include support for pwm, pwm.h.
The simple
#include “hardware\pwm.h”
doesn't work—red line. When I check what's available there, I findWe can remove the first option from consideration, but there are three options for Pico2 (rp2_common and rp2350) and two options for Pico (rp0240).
On closer inspection, one include calls the next, so it's best to use the first one of the include chain (if you can figure it out).
The 3 + 2 include “distribution” of includes applies to numerous other includes.
More difficult for sync.h : 3 independent optionsWhich one should you use? None of them calls another include, each one is “complete” on its own, so are they all equal?
The second question is: How can you set it up so that the code is hardware-independent and in a way that I can control the Hardware dependencies via makefile ?
I'm not sure if I'm right, but my gut feeling told me that I can specify a complete path like this:This was accepted, but is probably wrong: I'm working with Pico, but the include refers to Pico2, and the path is way too detailed.
For example, resets.h is found without any problems, simply by
#include “hardware/resets.h”
How to mange it for all the other SDK - includes?
Might be, something could be managed by cmake entries like set(PICO_SDK_PATH) ?
And, just as important, how to keep the source code portable - without point to a dedicated HW like in
•src\rp2_common or\ (Pico 2)
•rp2040\hardware_structs\ (Pico)
?
for all the other SDK - Components e.g. SPI; IIC, PWD; ADC, GPIO, DMA, .......?
Cheers,
Martin
#include “????“ or #include <???>
without a detailed file system search?
Let's say I want to include support for pwm, pwm.h.
The simple
#include “hardware\pwm.h”
doesn't work—red line. When I check what's available there, I find
Code:
(.pico-sdk\sdk\2.2.0\lib\btstack\port\samv71-xplained-atwilc3000\ASF\sam\utils\cmsis\samv71\include\component\pwm.h]).pico-sdk\sdk\2.2.0\src\rp2_common\hardware_pwm\include\hardware\pwm.h.pico-sdk\sdk\2.2.0\src\rp2350\hardware_structs\include\hardware\structs\pwm.h.pico-sdk\sdk\2.2.0\src\rp2350\hardware_regs\include\hardware\regs\pwm.h.pico-sdk\sdk\2.2.0\src\rp2040\hardware_structs\include\hardware\structs\pwm.h.pico-sdk\sdk\2.2.0\src\rp2040\hardware_regs\include\hardware\regs\pwm.hOn closer inspection, one include calls the next, so it's best to use the first one of the include chain (if you can figure it out).
The 3 + 2 include “distribution” of includes applies to numerous other includes.
More difficult for sync.h : 3 independent options
Code:
.pico-sdk\sdk\2.2.0\src\rp2_common\hardware_sync\include\hardware\sync.h.pico-sdk\sdk\2.2.0\src\host\hardware_sync\include\hardware\sync.h.pico-sdk\sdk\2.2.0\src\common\pico_sync\include\pico\sync.hThe second question is: How can you set it up so that the code is hardware-independent and in a way that I can control the Hardware dependencies via makefile ?
I'm not sure if I'm right, but my gut feeling told me that I can specify a complete path like this:
Code:
#include “C:\Users\martin\.pico-sdk\sdk/2.2.0\src\rp2_common\hardware_sync\include\hardware\sync.h”For example, resets.h is found without any problems, simply by
#include “hardware/resets.h”
How to mange it for all the other SDK - includes?
Might be, something could be managed by cmake entries like set(PICO_SDK_PATH) ?
And, just as important, how to keep the source code portable - without point to a dedicated HW like in
•src\rp2_common or\ (Pico 2)
•rp2040\hardware_structs\ (Pico)
?
for all the other SDK - Components e.g. SPI; IIC, PWD; ADC, GPIO, DMA, .......?
Cheers,
Martin
Statistics: Posted by MartinHill — Mon Feb 09, 2026 7:17 pm — Replies 1 — Views 41