summaryrefslogtreecommitdiff
path: root/controller/fw/spi_flash.h
diff options
context:
space:
mode:
authorjaseg <git-bigdata-wsl-arch@jaseg.de>2020-02-25 18:05:14 +0100
committerjaseg <git-bigdata-wsl-arch@jaseg.de>2020-02-25 18:05:14 +0100
commit2964bda23c98b81b6853f542e98fb3d55dafa14c (patch)
tree2b753fec04ae5967c10d08b27bf141a56e3d42e0 /controller/fw/spi_flash.h
parent031380141d9d000ceab505845ed2b723cb597774 (diff)
downloadmaster-thesis-2964bda23c98b81b6853f542e98fb3d55dafa14c.tar.gz
master-thesis-2964bda23c98b81b6853f542e98fb3d55dafa14c.tar.bz2
master-thesis-2964bda23c98b81b6853f542e98fb3d55dafa14c.zip
Add beginnings of a SPI flash driver
Diffstat (limited to 'controller/fw/spi_flash.h')
-rw-r--r--controller/fw/spi_flash.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/controller/fw/spi_flash.h b/controller/fw/spi_flash.h
new file mode 100644
index 0000000..933d8c9
--- /dev/null
+++ b/controller/fw/spi_flash.h
@@ -0,0 +1,23 @@
+#ifndef __SPI_FLASH_H__
+#define __SPI_FLASH_H__
+
+#include <stdbool.h>
+#include <stdint.h>
+
+struct spi_mem_id {
+ size_t size;
+ uint8_t mfg_id;
+ uint8_t type;
+};
+
+struct spi_flash_if {
+ struct spi_mem_id id;
+ uint32_t spi_base;
+ void (*cs)(bool val);
+};
+
+int spif_init(struct spi_mem_id *mem_data);
+void spif_deep_power_down(struct spi_flash_if *spif);
+void spif_wakeup(struct spi_flash_if *spif);
+
+#endif /* __SPI_FLASH_H__ */