23 lines
444 B
C
23 lines
444 B
C
#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__ */
|