Merge pull request #11198 from SteveCEvans/sce_rc2
[betaflight.git] / src / main / io / serial_4way_avrootloader.h
blobe86a2dd4b9585ee8db61fbed725cab90eb08113b
1 /*
2 * This file is part of Cleanflight and Betaflight.
4 * Cleanflight and Betaflight are free software. You can redistribute
5 * this software and/or modify this software under the terms of the
6 * GNU General Public License as published by the Free Software
7 * Foundation, either version 3 of the License, or (at your option)
8 * any later version.
10 * Cleanflight and Betaflight are distributed in the hope that they
11 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
12 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 * See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this software.
18 * If not, see <http://www.gnu.org/licenses/>.
22 * Author: 4712
23 * for info about Hagens AVRootloader:
24 * http://www.mikrocontroller.net/topic/avr-bootloader-mit-verschluesselung
27 #pragma once
28 // Bootloader result codes
29 #define brSUCCESS 0x30
30 #define brERRORVERIFY 0xC0
31 #define brERRORCOMMAND 0xC1
32 #define brERRORCRC 0xC2
33 #define brNONE 0xFF
35 void BL_SendBootInit(void);
36 uint8_t BL_ConnectEx(uint8_32_u *pDeviceInfo);
37 uint8_t BL_SendCMDKeepAlive(void);
38 uint8_t BL_PageErase(ioMem_t *pMem);
39 uint8_t BL_ReadEEprom(ioMem_t *pMem);
40 uint8_t BL_WriteEEprom(ioMem_t *pMem);
41 uint8_t BL_WriteFlash(ioMem_t *pMem);
42 uint8_t BL_ReadFlash(uint8_t interface_mode, ioMem_t *pMem);
43 uint8_t BL_VerifyFlash(ioMem_t *pMem);
44 void BL_SendCMDRunRestartBootloader(uint8_32_u *pDeviceInfo);