Adding more servos
[inav.git] / src / main / io / serial_4way_avrootloader.h
blob2a51a89087fc278283724f2422dc6beacacdf2e0
1 /*
2 * This file is part of Cleanflight.
4 * Cleanflight 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.
9 * Cleanflight 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.
14 * You should have received a copy of the GNU General Public License
15 * along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
16 * Author: 4712
17 * for info about Hagens AVRootloader:
18 * http://www.mikrocontroller.net/topic/avr-bootloader-mit-verschluesselung
21 #pragma once
22 // Bootloader result codes
23 #define brSUCCESS 0x30
24 #define brERRORVERIFY 0xC0
25 #define brERRORCOMMAND 0xC1
26 #define brERRORCRC 0xC2
27 #define brNONE 0xFF
29 void BL_SendBootInit(void);
30 uint8_t BL_ConnectEx(uint8_32_u *pDeviceInfo);
31 uint8_t BL_SendCMDKeepAlive(void);
32 uint8_t BL_PageErase(ioMem_t *pMem);
33 uint8_t BL_ReadEEprom(ioMem_t *pMem);
34 uint8_t BL_WriteEEprom(ioMem_t *pMem);
35 uint8_t BL_WriteFlash(ioMem_t *pMem);
36 uint8_t BL_ReadFlash(uint8_t interface_mode, ioMem_t *pMem);
37 uint8_t BL_VerifyFlash(ioMem_t *pMem);
38 void BL_SendCMDRunRestartBootloader(uint8_32_u *pDeviceInfo);