diff options
author | Damien George <damien.p.george@gmail.com> | 2018-08-14 22:05:20 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2018-08-14 22:10:43 +1000 |
commit | 056e0b6293d140b5e03d8cc237796c52a2a6ddbb (patch) | |
tree | 90e1a83bc5a9894148acfb0549b1e0d34d3ab022 /tests/micropython/native_try.py | |
parent | 01ce2e1682c574925808e1b25ae7d80a4678c335 (diff) |
stm32/spi: Add implementation of low-level SPI protocol.
Can be used, for example, to configure external SPI flash using a hardware
SPI interface (code to be put in a board's bdev.c file):
STATIC const spi_proto_cfg_t hard_spi_bus = {
.spi = &spi_obj[5],
.baudrate = 10000000,
.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 = pin_A0,
.bus.u_spi.data = (void*)&hard_spi_bus,
.bus.u_spi.proto = &spi_proto,
.cache = &spi_bdev_cache,
};
spi_bdev_t spi_bdev;
Diffstat (limited to 'tests/micropython/native_try.py')
0 files changed, 0 insertions, 0 deletions