| 1 |
#include "py/obj.h" |
| 2 |
#include "storage.h" |
| 3 |
#include "spi.h" |
| 4 |
|
| 5 |
#if !MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE |
| 6 |
|
| 7 |
static const spi_proto_cfg_t spi_bus = { |
| 8 |
.spi = &spi_obj[2], // SPI3 hardware peripheral |
| 9 |
.baudrate = 25000000, |
| 10 |
.polarity = 0, |
| 11 |
.phase = 0, |
| 12 |
.bits = 8, |
| 13 |
.firstbit = SPI_FIRSTBIT_MSB, |
| 14 |
}; |
| 15 |
|
| 16 |
static mp_spiflash_cache_t spi_bdev_cache; |
| 17 |
|
| 18 |
const mp_spiflash_config_t spiflash_config = { |
| 19 |
.bus_kind = MP_SPIFLASH_BUS_SPI, |
| 20 |
.bus.u_spi.cs = MICROPY_HW_SPIFLASH_CS, |
| 21 |
.bus.u_spi.data = (void *)&spi_bus, |
| 22 |
.bus.u_spi.proto = &spi_proto, |
| 23 |
.cache = &spi_bdev_cache, |
| 24 |
}; |
| 25 |
|
| 26 |
spi_bdev_t spi_bdev; |
| 27 |
|
| 28 |
#endif |