These are not statements and shouldn't be terminated by semicolons; in
newer versions of Clang separating these by semicolons results in a
build error.
We can also further simplify `remove_volatile_cast` by using the comma
operator and avoiding the reliance on non-standard GNU extensions.
This is to match upstream declaration and avoid conflicting declaration
error. This declaration will be removed after the next Clang update
since LLVM libc now implements localtime_r but we keep the declaration
for now to allow soft transition for SDK users.
* Add empty 'check_gpio_param' to host GPIO
All the approriate gpio_xxx functions now call check_gpio_param. This
provides an easy way for a project to add simple range checking by
defining a final version of check_gpio_param, which whatever error
mechanism it chooses if an invalid value is passed.
Refs #2736
* Declare all host GPIO functions weak
This allows them to be easily overridden by user code for testing
purposes.
Refs #2736
* Mark all parameters in host GPIO unused
This prevents lots of compiler warnings if the default warning level
is increased.
Refs #2736
* Add missing functions/types to host GPIO
Some RP2350 GPIO_FUNC_ enums don't match the values defined in the
rp2350 hardware header but the actual values shouldn't matter if only
the enums are used (i.e. no magic numbers).
Refs #2736
Fixes#2678
The FreeRTOS, Poll, and Threadsafe async_context implementations have
execute_sync functions that's set as a member of their
async_context_type_t struct for use by the user-visible async_context
API. These implementation functions should not be accessible
by user code which chouls only use async_context_execute_sync and
not the low-lever async_context_{freertos,poll,threadsafe}_execute_sync
implementation.
Make these private functions static like the other low-level functions
in the async_context_type_t struct.
* Add Raspberry Pi 500 board support
- W25X10CL flash configuration for DSPI mode
- USB standalone operation support
- Complete GPIO pin documentation with keyboard matrix mapping
- Debug UART configuration on GP16
- Hardware-specific boot and power management settings
Tested with TinyUSB MIDI example - successful enumeration and operation.
* Correct Pi 500 board support: RP2040 chip, proper naming
- Rename to raspberry_pi_pi500_rp2040.h for clarity
- Correct chip type from RP2350 to RP2040
- Remove pico2.h inheritance, use self-contained definitions
- Add comprehensive GPIO pin mapping documentation
- Include critical power management warning
- Configure W25X10CL flash support for RP2040
* PICO_RP2040_B0_SUPPORTED can be changed to 0, since all Pi 500s are using RP2040 B2.
* Update Raspberry Pi 500 board support for minimal original intent.
- Fix mistake done in pico.h PICO_RP2040_B0_SUPPORTED 0 => 1
- Disable B0 support in pi500_rp2040
- Fix flash size 1M-Bit not 1Mb
- Add Matrix pin definition
* Fix flash size.
Add warning on GP19
Remove GP17
* Adding UART TX GP16
* Add Caps led as default led
---------
Co-authored-by: Jerome Hordies <jerome.hordies.ext@luminus.be>
The pico-sdk and RP2040 hardware provide a few facilities that improve performance by moving runtime code and data into SRAM:
1. "pico/platform/sections.h" currently provides the "__not_in_flash", "__not_in_flash_func", and "__time_critical_func" macros for placing runtime code and data into SRAM by assigning them linker section names in the source code.
2. The pico-sdk CMake scripts allow any of four binary types to be selected with similarly named project properties for the RP2040: "default", "blocked_ram", "copy_to_ram", or "no_flash"
3. The RP2040's eXecute-In-Place (XIP) cache has its own connection to the main AHB bus and provides SRAM speeds on cache hits when retrieving runtime code and data from flash
But this regime isn't perfect. The 16kB of XIP cache and its connection to the main AHB bus go mostly unused for PICO_COPY_TO_RAM and PICO_NO_FLASH binary type builds, leaving some performance opportunities unrealized in their implementations.
The RP2040's eXecute-In-Place (XIP) cache can be disabled by clearing its CTRL.EN bit which allows its 16kB of memory to be used as SRAM directly.
These changes are aiming to update the pico-sdk to support the following:
1. Use the "__time_critical_func" macro to place runtime code into XIP RAM for PICO_COPY_TO_RAM and PICO_NO_FLASH binary type builds
2. Add a couple new "copy_to_ram_using_xip_ram" and "no_flash_using_xip_ram" binary type builds for the RP2040
3. Add a new "PICO_USE_XIP_CACHE_AS_RAM" CMake property to enable the XIP cache's use as RAM for time critical instructions in PICO_COPY_TO_RAM and PICO_NO_FLASH binary type builds
4. Add a couple new CMake functions "pico_sections_not_in_flash(TARGET [list_of_sources])" and "pico_sections_time_critical(TARGET [list_of_sources])" that target selected source files or a whole CMake build target's list of source files for placement into RAM and/or XIP RAM
I believe I've achieved these 4 goals, but note: I've only tested them manually with CMake based builds on the RP2040 hardware that I have. Though I have made an effort to fail fast when configuration properties are incompatible, and I've also made an effort to stay compatible with the preexisting section names and the preexisting linker scripts.
Since ARM hosts have builtins listed in hardware/sync.h, these builtins
should be clobbered. Newer versions of LLVM/Clang emit an error when
clobbering these builtins, so this switches the overrides to use the
same patterns as pico_atomic to clobber the builtins.
The sideset_bit_count in pio_encode_sideset_opt is unsigned, so any comparison
"sideset_bit_count >= 0" will always be true. GCC with pedantic warnings
will complain when this happens.
Remove the unneeded >=0 portion of the parameter validity check.
Fixes#2607
* Update docs, and add methods for new RP2350 dma_transfer modes
Update docs, and add methods for handling reversed/double-increment DMA
* Apply suggestions from code review
Co-authored-by: Andrew Scheller <andrew.scheller@raspberrypi.com>
* more review fixes
* add typedefs and rename dma_channel_config to be consistent
* Apply suggestions from code review
Co-authored-by: Andrew Scheller <andrew.scheller@raspberrypi.com>
* Apply suggestions from code review
Co-authored-by: Andrew Scheller <andrew.scheller@raspberrypi.com>
---------
Co-authored-by: Andrew Scheller <andrew.scheller@raspberrypi.com>