[stm32*, pic32, drivers] Add single instnace device struct to each driver#42
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends wolfHAL’s “single-instance” device model by defining per-driver singleton device structs across multiple STM32/PIC32 drivers (UART/SPI/I2C/DMA/Flash/Block/Sensor), and updates the Getting Started documentation to explain the device-configuration knobs. It also removes an empty sensor test stub and an empty IPC test case.
Changes:
- Add
WHAL_CFG_*_SINGLE_INSTANCE-guarded singleton device definitions (*_Dev) to many driver translation units. - Update
docs/getting_started.mdto more fully document pointer-based vs single-instance and direct-mapping vs vtable dispatch. - Remove unused/empty tests (
tests/sensor/test_sensor.c,Test_Ipc_InitNull) and their invocation.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 20 comments.
Show a summary per file
| File | Description |
|---|---|
| wolfHAL/uart/stm32wb_uart.h | Extends preprocessor gating to account for additional STM32 direct-mapping flags. |
| src/uart/stm32wb_uart.c | Adds singleton whal_Stm32wb_Uart_Dev definition for single-instance builds and extends WBA conditionals. |
| src/uart/stm32wb_uart_dma.c | Adds singleton whal_Stm32wb_UartDma_Dev for DMA UART single-instance builds. |
| src/uart/stm32wba_uart_dma.c | Adds singleton whal_Stm32wba_UartDma_Dev for WBA DMA UART single-instance builds. |
| src/uart/stm32f0_uart.c | Adds singleton whal_Stm32f0_Uart_Dev for F0/F3 single-instance builds. |
| src/uart/stm32f4_uart.c | Adds singleton whal_Stm32f4_Uart_Dev for F4/L1 single-instance builds. |
| src/uart/pic32cz_uart.c | Adds singleton whal_Pic32cz_Uart_Dev for PIC32CZ single-instance builds. |
| src/spi/stm32wb_spi.c | Adds singleton whal_Stm32wb_Spi_Dev for WB/C0/F0/F3 SPI single-instance builds. |
| src/spi/stm32h5_spi.c | Adds singleton whal_Stm32h5_Spi_Dev for H5/N6/WBA SPI single-instance builds. |
| src/spi/stm32f4_spi.c | Adds singleton whal_Stm32f4_Spi_Dev for F4/L1 SPI single-instance builds. |
| src/i2c/stm32wb_i2c.c | Adds singleton whal_Stm32wb_I2c_Dev for WB/F0/F3/N6 I2C single-instance builds. |
| src/i2c/stm32l1_i2c.c | Adds singleton whal_Stm32l1_I2c_Dev for L1 I2C single-instance builds. |
| src/dma/stm32wb_dma.c | Adds singleton whal_Stm32wb_Dma_Dev for WB DMA single-instance builds. |
| src/dma/stm32wba_gpdma.c | Adds singleton whal_Stm32wba_Gpdma_Dev for WBA/N6 GPDMA single-instance builds. |
| src/flash/spi_nor_flash.c | Adds singleton whal_SpiNor_Dev for SPI NOR single-instance builds. |
| src/block/sdhc_spi_block.c | Adds singleton whal_SdhcSpi_Dev for SDHC-over-SPI block single-instance builds. |
| src/sensor/imu/bmi270_sensor.c | Adds singleton whal_Bmi270_Dev for BMI270 single-instance builds. |
| docs/getting_started.md | Major expansion/clarification of the device model and build knobs; includes some examples that need alignment with actual code. |
| tests/ipc/test_ipc.c | Removes an empty IPC test case. |
| tests/main.c | Removes sensor test suite declaration/invocation. |
| tests/sensor/test_sensor.c | Deletes an empty sensor test stub. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
49b8cd6 to
0044081
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.