Skip to content

[stm32*, pic32, drivers] Add single instnace device struct to each driver#42

Merged
AlexLanzano merged 1 commit into
wolfSSL:mainfrom
AlexLanzano:single-instance
May 18, 2026
Merged

[stm32*, pic32, drivers] Add single instnace device struct to each driver#42
AlexLanzano merged 1 commit into
wolfSSL:mainfrom
AlexLanzano:single-instance

Conversation

@AlexLanzano
Copy link
Copy Markdown
Member

No description provided.

@AlexLanzano AlexLanzano self-assigned this May 18, 2026
Copilot AI review requested due to automatic review settings May 18, 2026 20:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.md to 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.

Comment thread docs/getting_started.md
Comment thread docs/getting_started.md Outdated
Comment thread docs/getting_started.md Outdated
Comment thread docs/getting_started.md Outdated
Comment thread src/uart/stm32wb_uart.c
Comment thread src/flash/spi_nor_flash.c
Comment thread src/dma/stm32wba_gpdma.c
Comment thread src/dma/stm32wb_dma.c
Comment thread src/block/sdhc_spi_block.c
Comment thread src/sensor/imu/bmi270_sensor.c
@AlexLanzano AlexLanzano force-pushed the single-instance branch 2 times, most recently from 49b8cd6 to 0044081 Compare May 18, 2026 21:08
@AlexLanzano AlexLanzano requested a review from Copilot May 18, 2026 21:09
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 36 out of 36 changed files in this pull request and generated 2 comments.

Comment thread src/uart/stm32wb_uart.c
Comment thread docs/getting_started.md
@AlexLanzano AlexLanzano merged commit 57c3de1 into wolfSSL:main May 18, 2026
49 of 50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants