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)
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/>.
20 * Author: Dominic Clifton
26 typedef struct quadSpiPinDef_s
{
34 #define MAX_QUADSPI_PIN_SEL 3
37 typedef struct quadSpiHardware_s
{
40 quadSpiPinDef_t clkPins
[MAX_QUADSPI_PIN_SEL
];
41 quadSpiPinDef_t bk1IO0Pins
[MAX_QUADSPI_PIN_SEL
];
42 quadSpiPinDef_t bk1IO1Pins
[MAX_QUADSPI_PIN_SEL
];
43 quadSpiPinDef_t bk1IO2Pins
[MAX_QUADSPI_PIN_SEL
];
44 quadSpiPinDef_t bk1IO3Pins
[MAX_QUADSPI_PIN_SEL
];
45 quadSpiPinDef_t bk1CSPins
[MAX_QUADSPI_PIN_SEL
];
46 quadSpiPinDef_t bk2IO0Pins
[MAX_QUADSPI_PIN_SEL
];
47 quadSpiPinDef_t bk2IO1Pins
[MAX_QUADSPI_PIN_SEL
];
48 quadSpiPinDef_t bk2IO2Pins
[MAX_QUADSPI_PIN_SEL
];
49 quadSpiPinDef_t bk2IO3Pins
[MAX_QUADSPI_PIN_SEL
];
50 quadSpiPinDef_t bk2CSPins
[MAX_QUADSPI_PIN_SEL
];
55 extern const quadSpiHardware_t quadSpiHardware
[];
57 typedef struct QUADSPIDevice_s
{
85 volatile uint16_t errorCount
;
86 #if defined(USE_HAL_DRIVER)
87 QSPI_HandleTypeDef hquadSpi
;
91 extern quadSpiDevice_t quadSpiDevice
[QUADSPIDEV_COUNT
];
93 void quadSpiInitDevice(QUADSPIDevice device
);
94 uint32_t quadSpiTimeoutUserCallback(QUADSPI_TypeDef
*instance
);