NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
flash_m25p16.h
Go to the documentation of this file.
1 /*
2  * This file is part of Ninjaflight.
3  *
4  * Ninjaflight is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * Ninjaflight is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with Ninjaflight. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #pragma once
19 
20 #include <stdint.h>
21 #include "flash.h"
22 
23 #define M25P16_PAGESIZE 256
24 
25 bool m25p16_init(void);
26 
27 void m25p16_eraseSector(uint32_t address);
28 void m25p16_eraseCompletely(void);
29 
30 void m25p16_pageProgram(uint32_t address, const uint8_t *data, int length);
31 
32 void m25p16_pageProgramBegin(uint32_t address);
33 void m25p16_pageProgramContinue(const uint8_t *data, int length);
34 void m25p16_pageProgramFinish(void);
35 
36 int m25p16_readBytes(uint32_t address, uint8_t *buffer, int length);
37 
38 bool m25p16_isReady(void);
39 bool m25p16_waitForReady(uint32_t timeoutMillis);
40 
void m25p16_pageProgramContinue(const uint8_t *data, int length)
bool m25p16_waitForReady(uint32_t timeoutMillis)
void m25p16_eraseCompletely(void)
bool m25p16_init(void)
void m25p16_pageProgramBegin(uint32_t address)
void m25p16_eraseSector(uint32_t address)
const flashGeometry_t * m25p16_getGeometry(void)
void m25p16_pageProgramFinish(void)
int m25p16_readBytes(uint32_t address, uint8_t *buffer, int length)
void m25p16_pageProgram(uint32_t address, const uint8_t *data, int length)
bool m25p16_isReady(void)
Definition: flash.h:22
uint16_t data
Definition: config.c:91