micropython/ports/stm32/boards/MIKROE_QUAIL/bdev.c
Lorenzo Cappelletti 8f0e304e65 stm32/boards: Add new board MikroElektronika Quail, and F427 support.
Quail (https://www.mikroe.com/quail, PID: MIKROE-1793) is based on an
STM32F427VI CPU, featuring 2048 kB of Flash memory and 192 kB of RAM.  An
on-board Cypress S25FL164K adds 8 MB of SPI Flash.

Quail has 4 mikroBUS(TM) sockets for Mikroe click(TM) board connectivity,
along with 24 screw terminals for connecting additional electronics and two
USB ports (one for programming, the other for external mass storage).

4 UARTs, 2 SPIs and 1 I2C bus are available for communication.

Signed-off-by: Lorenzo Cappelletti <lorenzo.cappelletti@gmail.com>
2021-11-19 16:33:13 +11:00

29 lines
623 B
C

#include "py/obj.h"
#include "storage.h"
#include "spi.h"
#if !MICROPY_HW_ENABLE_INTERNAL_FLASH_STORAGE
STATIC const spi_proto_cfg_t spi_bus = {
.spi = &spi_obj[2], // SPI3 hardware peripheral
.baudrate = 25000000,
.polarity = 0,
.phase = 0,
.bits = 8,
.firstbit = SPI_FIRSTBIT_MSB,
};
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 *)&spi_bus,
.bus.u_spi.proto = &spi_proto,
.cache = &spi_bdev_cache,
};
spi_bdev_t spi_bdev;
#endif