Start with integration of everything
This commit is contained in:
parent
0cd07d397f
commit
0af1a534e2
22 changed files with 2298 additions and 145 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue