-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,24 @@ | ||
#include "storage.h" | ||
|
||
// External SPI flash uses standard SPI interface | ||
|
||
STATIC const mp_soft_spi_obj_t soft_spi_bus = { | ||
.delay_half = MICROPY_HW_SOFTSPI_MIN_DELAY, | ||
.polarity = 0, | ||
.phase = 0, | ||
.sck = MICROPY_HW_SPIFLASH_SCK, | ||
.mosi = MICROPY_HW_SPIFLASH_MOSI, | ||
.miso = MICROPY_HW_SPIFLASH_MISO, | ||
}; | ||
|
||
STATIC mp_spiflash_cache_t spi_bdev_cache; | ||
|
||
const mp_spiflash_config_t spiflash_config = { | ||
.bus_kind = MP_SPIFLASH_BUS_SPI, | ||
.bus.u_spi.cs = MICROPY_HW_SPIFLASH_CS, | ||
.bus.u_spi.data = (void*)&soft_spi_bus, | ||
.bus.u_spi.proto = &mp_soft_spi_proto, | ||
.cache = &spi_bdev_cache, | ||
}; | ||
|
||
spi_bdev_t spi_bdev; |
This file contains 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,7 @@ | ||
#include "py/mphal.h" | ||
|
||
void Black_F407ZG_board_early_init(void) { | ||
// set SPI flash CS pin high | ||
mp_hal_pin_output(pin_B14); | ||
mp_hal_pin_write(pin_B14, 1); | ||
} |
This file contains 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