Wirepas SDK
external_flash.h
Go to the documentation of this file.
1/* Copyright 2018 Wirepas Ltd. All Rights Reserved.
2 *
3 * See file LICENSE.txt for full license details.
4 *
5 */
6
7#ifndef EXTERNAL_FLASH_H_
8#define EXTERNAL_FLASH_H_
9
10#include <stddef.h>
11#include <stdint.h>
12#include <stdbool.h>
13
14
16typedef enum
17{
18 EXTFLASH_RES_OK = 0, /* Operation is successful */
19 EXTFLASH_RES_ERROR = 1, /* Error during operation */
20 EXTFLASH_RES_BUSY = 2, /* Flash driver is busy */
21 EXTFLASH_RES_NODRIVER = 3, /* Flash driver not implemented */
22 EXTFLASH_RES_PARAM = 4 /* Invalid parameters */
24
58
59
66
78extFlash_res_e externalFlash_startRead(void * to, const void * from,
79 size_t amount);
91extFlash_res_e externalFlash_startWrite(void * to, const void * from,
92 size_t amount);
93
107 size_t * number_of_sector);
108
114
123
124#endif //EXTERNAL_FLASH_H__
extFlash_res_e externalFlash_startWrite(void *to, const void *from, size_t amount)
Write bytes to flash.
extFlash_res_e externalFlash_init(void)
Initialize the external flash driver.
extFlash_res_e externalFlash_startErase(size_t *sector_base, size_t *number_of_sector)
Erase a sector of flash.
extFlash_res_e
External flash operations result.
@ EXTFLASH_RES_PARAM
@ EXTFLASH_RES_ERROR
@ EXTFLASH_RES_OK
@ EXTFLASH_RES_NODRIVER
@ EXTFLASH_RES_BUSY
uint32_t is_busy_call_time
uint32_t byte_write_time
size_t write_page_size
uint32_t byte_write_call_time
extFlash_res_e externalFlash_getInfo(flash_info_t *info)
Fills a structure with info about flash.
extFlash_res_e externalFlash_startRead(void *to, const void *from, size_t amount)
Read bytes from external flash.
uint32_t page_write_time
size_t write_alignment
bool externalFlash_isBusy(void)
Checks if flash driver is busy.
uint32_t sector_erase_call_time
uint32_t sector_erase_time
uint32_t page_write_call_time
size_t erase_sector_size
Flash memory info definition.