-
Notifications
You must be signed in to change notification settings - Fork 4
[spi_nor, boards, tests, docs] Add SPI-NOR flash driver. Add W25Q64 peripheral. #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| #include "spi_nor_w25q64.h" | ||
| #include <wolfHAL/flash/spi_nor.h> | ||
| #include "board.h" | ||
|
|
||
| /* | ||
| * Winbond W25Q64 — 64 Mbit (8 MB) SPI-NOR Flash | ||
| * | ||
| * - Page size: 256 bytes | ||
| * - Sector size: 4 KB (smallest erasable unit) | ||
| * - Capacity: 8,388,608 bytes (8 MB) | ||
| * - SPI modes 0 and 3, up to 104 MHz (standard read up to 50 MHz) | ||
| */ | ||
|
|
||
| #define W25Q64_PAGE_SZ 256 | ||
| #define W25Q64_CAPACITY (8 * 1024 * 1024) /* 8 MB */ | ||
|
|
||
| static whal_Spi_ComCfg g_w25q64ComCfg = { | ||
| .freq = 25000000, /* 25 MHz */ | ||
| .mode = WHAL_SPI_MODE_0, | ||
| .wordSz = 8, | ||
| .dataLines = 1, | ||
| }; | ||
|
|
||
| whal_Flash g_whalSpiNorW25q64 = { | ||
| .driver = &whal_SpiNor_Driver, | ||
| .cfg = &(whal_SpiNor_Cfg) { | ||
| .spiDev = &g_whalSpi, | ||
| .spiComCfg = &g_w25q64ComCfg, | ||
| .gpioDev = &g_whalGpio, | ||
| .csPin = SPI_CS_PIN, | ||
| .timeout = &g_whalTimeout, | ||
| .pageSz = W25Q64_PAGE_SZ, | ||
| .capacity = W25Q64_CAPACITY, | ||
| }, | ||
AlexLanzano marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #ifndef BOARD_SPI_NOR_W25Q64_H | ||
| #define BOARD_SPI_NOR_W25Q64_H | ||
|
|
||
| #include <wolfHAL/wolfHAL.h> | ||
| #include <wolfHAL/flash/flash.h> | ||
| #include <wolfHAL/flash/spi_nor.h> | ||
|
|
||
| extern whal_Flash g_whalSpiNorW25q64; | ||
|
|
||
| #endif /* BOARD_SPI_NOR_W25Q64_H */ |
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.