summaryrefslogtreecommitdiff
path: root/controller/fw/src/spi_flash.h
diff options
context:
space:
mode:
authorjaseg <git-bigdata-wsl-arch@jaseg.de>2020-03-11 13:57:22 +0100
committerjaseg <git-bigdata-wsl-arch@jaseg.de>2020-03-11 13:57:22 +0100
commit0af1a534e2930da77ebbab6481adcd17069581ef (patch)
tree6b8c1399fbf69d75c296f2b5060549e63553fa75 /controller/fw/src/spi_flash.h
parent0cd07d397fb5a5e7710af66cb1e9e0b61705c94a (diff)
downloadmaster-thesis-0af1a534e2930da77ebbab6481adcd17069581ef.tar.gz
master-thesis-0af1a534e2930da77ebbab6481adcd17069581ef.tar.bz2
master-thesis-0af1a534e2930da77ebbab6481adcd17069581ef.zip
Start with integration of everything
Diffstat (limited to 'controller/fw/src/spi_flash.h')
-rw-r--r--controller/fw/src/spi_flash.h6
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);