Blackbox device type 'file' (SITL) considered working when file handler is available
[inav.git] / src / main / drivers / system.h
blob539a4ea93fb3dcf2bfedc47b8d39c034018a841d
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/>.
18 #pragma once
20 #include <stdint.h>
21 #include <stdbool.h>
23 void systemInit(void);
25 typedef enum {
26 FAILURE_DEVELOPER = 0,
27 FAILURE_MISSING_ACC,
28 FAILURE_ACC_INIT,
29 FAILURE_ACC_INCOMPATIBLE,
30 FAILURE_INVALID_EEPROM_CONTENTS,
31 FAILURE_FLASH_WRITE_FAILED,
32 FAILURE_GYRO_INIT_FAILED,
33 FAILURE_FLASH_READ_FAILED,
34 } failureMode_e;
36 // failure
37 void failureMode(failureMode_e mode);
39 // bootloader/IAP
40 void systemReset(void);
41 void systemResetRequest(uint32_t requestId);
42 void systemResetToBootloader(void);
43 uint32_t systemBootloaderAddress(void);
44 bool isMPUSoftReset(void);
45 void cycleCounterInit(void);
46 void checkForBootLoaderRequest(void);
48 void initialiseMemorySections(void);
50 void enableGPIOPowerUsageAndNoiseReductions(void);
52 extern uint32_t hse_value;
53 extern uint32_t cachedRccCsrValue;