Refactor missing prototypes 2 (#14170)
[betaflight.git] / src / main / drivers / bus_spi_config.c
blob0fd6999dbe014e0f329b33728c2a9114621f3db3
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/>.
21 #include <stdbool.h>
22 #include <stdint.h>
24 #include "platform.h"
26 #ifdef USE_SPI
28 #include "drivers/bus_spi.h"
29 #include "drivers/io.h"
30 #include "drivers/resource.h"
31 #include "drivers/system.h"
33 #include "drivers/flash/flash.h"
34 #include "drivers/max7456.h"
35 #include "drivers/rx/rx_spi.h"
36 #include "drivers/sdcard.h"
38 #include "pg/flash.h"
39 #include "pg/max7456.h"
40 #include "pg/rx_spi.h"
41 #include "pg/sdcard.h"
43 void spiPreinit(void)
45 #ifdef USE_SDCARD_SPI
46 sdcard_preinit(sdcardConfig());
47 #endif
49 #if defined(RTC6705_CS_PIN) && !defined(USE_VTX_RTC6705_SOFTSPI) // RTC6705 soft SPI initialisation handled elsewhere.
50 // XXX Waiting for "RTC6705 cleanup #7114" to be done
51 #endif
53 #ifdef USE_FLASH_CHIP
54 flashPreinit(flashConfig());
55 #endif
57 #if defined(USE_RX_SPI)
58 rxSpiDevicePreinit(rxSpiConfig());
59 #endif
61 #ifdef USE_MAX7456
62 max7456Preinit(max7456Config());
63 #endif
66 #endif