Contiki-NG
|
Implementation of a generic external SPI flash driver. More...
#include "contiki.h"
#include "dev/storage/ext-flash/ext-flash.h"
#include "dev/spi.h"
#include "gpio-hal.h"
#include "sys/log.h"
#include <stdint.h>
#include <stdbool.h>
Go to the source code of this file.
Functions | |
static const spi_device_t * | get_spi_conf (const spi_device_t *conf) |
Get spi configuration, return default configuration if NULL. | |
static bool | select_on_bus (const spi_device_t *flash_spi_configuration) |
Clear external flash CSN line. | |
static void | deselect (const spi_device_t *flash_spi_configuration) |
Set external flash CSN line. | |
static bool | wait_ready (const spi_device_t *flash_spi_configuration) |
Wait till previous erase/program operation completes. More... | |
static uint8_t | verify_part (const spi_device_t *flash_spi_configuration) |
Verify the flash part. More... | |
static bool | power_down (const spi_device_t *flash_spi_configuration) |
Put the device in power save mode. More... | |
static bool | power_standby (const spi_device_t *flash_spi_configuration) |
Take device out of power save mode and prepare it for normal operation. More... | |
static bool | write_enable (const spi_device_t *flash_spi_configuration) |
Enable write. More... | |
bool | ext_flash_open (const spi_device_t *conf) |
Initialize storage driver. More... | |
bool | ext_flash_close (const spi_device_t *conf) |
Close the storage driver. More... | |
bool | ext_flash_read (const spi_device_t *conf, uint32_t offset, uint32_t length, uint8_t *buf) |
Read storage content. More... | |
bool | ext_flash_write (const spi_device_t *conf, uint32_t offset, uint32_t length, const uint8_t *buf) |
Write to storage sectors. More... | |
bool | ext_flash_erase (const spi_device_t *conf, uint32_t offset, uint32_t length) |
Erase storage sectors corresponding to the range. More... | |
bool | ext_flash_init (const spi_device_t *conf) |
Initialise the external flash. More... | |
Implementation of a generic external SPI flash driver.
Definition in file ext-flash.c.