Repository navigation
Rename SPI-NOR flash functions after datasheet commands and opcodes - #61
Open
AlexLanzano wants to merge 1 commit into
Open
AlexLanzano wants to merge 1 commit into
AlexLanzano wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are identified for the SPI-NOR API renaming.
No open issues 🎉
What changed in this PR
Renames wolfHAL’s SPI-NOR flash API to expose datasheet command names and opcodes, making it easier to select functions for a device’s flash vtable. Flash operation logic remains unchanged.
Changes:
- Renames command functions and addressing-mode prefixes across declarations and definitions.
- Adds
Flashto driver types, symbols, configuration macros, and the header guard; removes two unused command constants. - Updates the W25Q64 peripheral configuration and documentation example to use the renamed API.
| File | Description |
|---|---|
wolfHAL/flash/spi_nor_flash.h |
Renames public declarations and documents the command-based naming scheme. |
src/flash/spi_nor_flash.c |
Updates definitions, singleton macros, and the default vtable; removes unused constants. |
docs/adding_a_peripheral.md |
Updates the example’s driver and configuration type names. |
boards/peripheral/flash/spi_nor_w25q64.c |
Migrates the W25Q64 configuration to the renamed API. |
Review effort: Balanced
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.
Summary
Renames the SPI-NOR flash driver API so a board's vtable can be built by matching the part's datasheet command table. Functions follow
whal_SpiNor_Flash_[Mode_]Command_XXh, whereCommandis the datasheet command name andXXhis the opcode sent on the bus.Changes
Addr4(dedicated 4-byte opcodes),Addr4Mode(after B7h) andExtAddr(extended address register, C5h) replace the3b/4b/4bMode/4bExRegtags; 3-byte functions have no mode segmentFlashsegment:whal_SpiNor_Flash_Cfg/_Dev/_Driver,WHAL_CFG_SPI_NOR_FLASH_SINGLE_INSTANCE/_DEV, guardWHAL_SPI_NOR_FLASH_HCMD_WRITE_DISABLEandCMD_READ_EARremovedadding_a_peripheral.mdupdatedwhal_SpiNor3b_ReadFastwhal_SpiNor_Flash_FastRead_0Bhwhal_SpiNor4b_Erase64kwhal_SpiNor_Flash_Addr4_BlockErase64k_DChwhal_SpiNor4bMode_Writewhal_SpiNor_Flash_Addr4Mode_PageProgram_02hwhal_SpiNor4bExReg_Readwhal_SpiNor_Flash_ExtAddr_ReadData_03hwhal_SpiNor_EraseChipwhal_SpiNor_Flash_ChipErase_C7hwhal_SpiNor4bMode_Initwhal_SpiNor_Flash_Addr4Mode_InitTesting
make BOARD=stm32wb55xx_nucleo PERIPHERALS=spi_nor_w25q64 TESTS=flashbuilds cleanly with-Werror🤖 Generated with Claude Code