esp-open-rtos/include/espressif/spi_flash.h
Alex Stewart 1da996ee10 First batch of opensdk additions
Replacements for:
    libmain/misc.o
    libmain/os_cpu_a.o
    libmain/spi_flash.o
    libmain/timers.o
    libmain/uart.o
    libmain/xtensa_context.o
2015-10-10 22:14:08 -07:00

36 lines
828 B
C

/*
* copyright (c) Espressif System 2010
*
*/
#ifndef __SPI_FLASH_H__
#define __SPI_FLASH_H__
#include "flashchip.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
SPI_FLASH_RESULT_OK,
SPI_FLASH_RESULT_ERR,
SPI_FLASH_RESULT_TIMEOUT
} sdk_SpiFlashOpResult;
#define SPI_FLASH_SEC_SIZE 4096
uint32_t sdk_spi_flash_get_id(void);
sdk_SpiFlashOpResult sdk_spi_flash_read_status(uint32_t *status);
sdk_SpiFlashOpResult sdk_spi_flash_write_status(uint32_t status_value);
sdk_SpiFlashOpResult sdk_spi_flash_erase_sector(uint16_t sec);
sdk_SpiFlashOpResult sdk_spi_flash_write(uint32_t des_addr, uint32_t *src_addr, uint32_t size);
sdk_SpiFlashOpResult sdk_spi_flash_read(uint32_t src_addr, uint32_t *des_addr, uint32_t size);
extern sdk_flashchip_t sdk_flashchip;
#ifdef __cplusplus
}
#endif
#endif