EEPROM & Digital Volume I2C driver using generic I2C HAL driver
This commit is contained in:
committed by
Raphael Coeffic
parent
bc6c53681c
commit
df83a82285
@@ -1,67 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) EdgeTX
|
||||
*
|
||||
* Based on code named
|
||||
* opentx - https://github.com/opentx/opentx
|
||||
* th9x - http://code.google.com/p/th9x
|
||||
* er9x - http://code.google.com/p/er9x
|
||||
* gruvin9x - http://code.google.com/p/gruvin9x
|
||||
*
|
||||
* License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*/
|
||||
|
||||
#ifndef _EEPROM_RAW_H_
|
||||
#define _EEPROM_RAW_H_
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdint.h>
|
||||
|
||||
bool eeLoadGeneral(bool allowFixes);
|
||||
void eeDeleteModel( uint8_t id );
|
||||
bool eeCopyModel(uint8_t dst, uint8_t src);
|
||||
void eeSwapModels(uint8_t id1, uint8_t id2);
|
||||
|
||||
#if defined(SDCARD)
|
||||
const char * eeBackupModel(uint8_t i_fileSrc);
|
||||
const char * eeRestoreModel(uint8_t i_fileDst, char *model_name);
|
||||
#endif
|
||||
|
||||
enum EepromWriteState {
|
||||
EEPROM_IDLE = 0,
|
||||
EEPROM_START_WRITE,
|
||||
EEPROM_ERASING_FILE_BLOCK1,
|
||||
EEPROM_ERASING_FILE_BLOCK1_WAIT,
|
||||
EEPROM_ERASE_FILE_BLOCK2,
|
||||
EEPROM_ERASING_FILE_BLOCK2,
|
||||
EEPROM_ERASING_FILE_BLOCK2_WAIT,
|
||||
EEPROM_WRITE_BUFFER,
|
||||
EEPROM_WRITING_BUFFER,
|
||||
EEPROM_WRITING_BUFFER_WAIT,
|
||||
EEPROM_WRITE_NEXT_BUFFER,
|
||||
EEPROM_ERASING_FAT_BLOCK,
|
||||
EEPROM_ERASING_FAT_BLOCK_WAIT,
|
||||
EEPROM_WRITE_NEW_FAT,
|
||||
EEPROM_WRITING_NEW_FAT,
|
||||
EEPROM_WRITING_NEW_FAT_WAIT,
|
||||
EEPROM_END_WRITE
|
||||
};
|
||||
|
||||
extern volatile EepromWriteState eepromWriteState;
|
||||
inline bool eepromIsWriting()
|
||||
{
|
||||
return (eepromWriteState != EEPROM_IDLE);
|
||||
}
|
||||
void eepromWriteProcess();
|
||||
void eepromWriteWait(EepromWriteState state = EEPROM_IDLE);
|
||||
bool eepromOpen();
|
||||
|
||||
#endif // _EEPROM_RAW_H_
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "opentx.h"
|
||||
#include "../timers.h"
|
||||
|
||||
#include "hal/eeprom_driver.h"
|
||||
#include "storage/eeprom_common.h"
|
||||
#include "storage/eeprom_rlc.h"
|
||||
#include "conversions/conversions.h"
|
||||
|
||||
@@ -154,8 +154,6 @@ inline void eeFlush()
|
||||
theFile.flush();
|
||||
}
|
||||
|
||||
void eepromWriteBlock(uint8_t * buffer, size_t address, size_t size);
|
||||
|
||||
inline bool eepromIsWriting()
|
||||
{
|
||||
return theFile.isWriting();
|
||||
|
||||
Reference in New Issue
Block a user