drv_flashfs.h
Go to the documentation of this file.
1 /*
2  drv_flashfs.h : Flash memory function prototypes for STM32F103
3 
4  Adapted from https://github.com/cleanflight/cleanflight/blob/master/src/main/io/flashfs.c
5 
6  This file is part of BreezySTM32.
7 
8  BreezySTM32 is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 3 of the License, or
11  (at your option) any later version.
12 
13  BreezySTM32 is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with BreezySTM32. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #pragma once
23 
24 #include <stdint.h>
25 
26 #include "drv_flash.h"
27 
28 #define FLASHFS_WRITE_BUFFER_SIZE 128
29 #define FLASHFS_WRITE_BUFFER_USABLE (FLASHFS_WRITE_BUFFER_SIZE - 1)
30 
31 // Automatically trigger a flush when this much data is in the buffer
32 #define FLASHFS_WRITE_BUFFER_AUTO_FLUSH_LEN 64
33 
35 void flashfsEraseRange(uint32_t start, uint32_t end);
36 uint32_t flashfsGetSize();
37 uint32_t flashfsGetOffset();
39 uint32_t flashfsGetWriteBufferSize();
42 void flashfsSeekAbs(uint32_t offset);
43 void flashfsSeekRel(int32_t offset);
44 void flashfsWriteByte(uint8_t byte);
45 void flashfsWrite(const uint8_t * data, unsigned int len, bool sync);
46 int flashfsReadAbs(uint32_t offset, uint8_t *data, unsigned int len);
47 bool flashfsFlushAsync();
48 void flashfsFlushSync();
49 void flashfsInit();
50 bool flashfsIsReady();
51 bool flashfsIsEOF();
void flashfsWrite(const uint8_t *data, unsigned int len, bool sync)
Definition: drv_flashfs.c:385
void flashfsFlushSync()
Definition: drv_flashfs.c:333
bool flashfsIsEOF()
Definition: drv_flashfs.c:558
int flashfsIdentifyStartOfFreeSpace()
Definition: drv_flashfs.c:489
int flashfsReadAbs(uint32_t offset, uint8_t *data, unsigned int len)
Definition: drv_flashfs.c:468
uint32_t flashfsGetWriteBufferFreeSpace()
Definition: drv_flashfs.c:140
void flashfsEraseRange(uint32_t start, uint32_t end)
Definition: drv_flashfs.c:85
uint32_t flashfsGetOffset()
Definition: drv_flashfs.c:275
void flashfsWriteByte(uint8_t byte)
Definition: drv_flashfs.c:366
void flashfsInit()
Definition: drv_flashfs.c:565
bool flashfsIsReady()
Definition: drv_flashfs.c:111
bool flashfsFlushAsync()
Definition: drv_flashfs.c:310
uint32_t flashfsGetWriteBufferSize()
Definition: drv_flashfs.c:132
void flashfsEraseCompletely()
Definition: drv_flashfs.c:72
void flashfsSeekAbs(uint32_t offset)
Definition: drv_flashfs.c:349
const flashGeometry_t * flashfsGetGeometry()
Definition: drv_flashfs.c:145
uint32_t flashfsGetSize()
Definition: drv_flashfs.c:116
void flashfsSeekRel(int32_t offset)
Definition: drv_flashfs.c:356


rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Wed Jul 3 2019 19:59:24