| 1 |
#include "storage.h" |
| 2 |
|
| 3 |
// External SPI flash uses standard SPI interface |
| 4 |
|
| 5 |
static const mp_soft_spi_obj_t soft_spi_bus = { |
| 6 |
.delay_half = MICROPY_HW_SOFTSPI_MIN_DELAY, |
| 7 |
.polarity = 0, |
| 8 |
.phase = 0, |
| 9 |
.sck = MICROPY_HW_SPIFLASH_SCK, |
| 10 |
.mosi = MICROPY_HW_SPIFLASH_MOSI, |
| 11 |
.miso = MICROPY_HW_SPIFLASH_MISO, |
| 12 |
}; |
| 13 |
|
| 14 |
static mp_spiflash_cache_t spi_bdev_cache; |
| 15 |
|
| 16 |
const mp_spiflash_config_t spiflash_config = { |
| 17 |
.bus_kind = MP_SPIFLASH_BUS_SPI, |
| 18 |
.bus.u_spi.cs = MICROPY_HW_SPIFLASH_CS, |
| 19 |
.bus.u_spi.data = (void *)&soft_spi_bus, |
| 20 |
.bus.u_spi.proto = &mp_soft_spi_proto, |
| 21 |
.cache = &spi_bdev_cache, |
| 22 |
}; |
| 23 |
|
| 24 |
spi_bdev_t spi_bdev; |