diff options
Diffstat (limited to 'controller/fw/src/spi_flash.h')
-rw-r--r-- | controller/fw/src/spi_flash.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/controller/fw/src/spi_flash.h b/controller/fw/src/spi_flash.h index e647c6a..2be8933 100644 --- a/controller/fw/src/spi_flash.h +++ b/controller/fw/src/spi_flash.h @@ -4,6 +4,8 @@ #include <stdbool.h> #include <unistd.h> +#include <stm32f407xx.h> + struct spi_mem_id { size_t size; uint8_t mfg_id; @@ -12,12 +14,12 @@ struct spi_mem_id { struct spi_flash_if { struct spi_mem_id id; - uint32_t spi_base; + volatile SPI_TypeDef *spi; size_t page_size; void (*cs)(bool val); }; -void spif_init(struct spi_flash_if *spif, size_t page_size, uint32_t spi_base, void (*cs)(bool val)); +void spif_init(struct spi_flash_if *spif, size_t page_size, SPI_TypeDef *spi, void (*cs)(bool val)); void spif_write(struct spi_flash_if *spif, size_t addr, size_t len, const char* data); void spif_read(struct spi_flash_if *spif, size_t addr, size_t len, char* data); |