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
25 typedef struct quadSpiPinDef_s
{
33 #define MAX_QUADSPI_PIN_SEL 3
36 typedef struct quadSpiHardware_s
{
39 quadSpiPinDef_t clkPins
[MAX_QUADSPI_PIN_SEL
];
40 quadSpiPinDef_t bk1IO0Pins
[MAX_QUADSPI_PIN_SEL
];
41 quadSpiPinDef_t bk1IO1Pins
[MAX_QUADSPI_PIN_SEL
];
42 quadSpiPinDef_t bk1IO2Pins
[MAX_QUADSPI_PIN_SEL
];
43 quadSpiPinDef_t bk1IO3Pins
[MAX_QUADSPI_PIN_SEL
];
44 quadSpiPinDef_t bk1CSPins
[MAX_QUADSPI_PIN_SEL
];
45 quadSpiPinDef_t bk2IO0Pins
[MAX_QUADSPI_PIN_SEL
];
46 quadSpiPinDef_t bk2IO1Pins
[MAX_QUADSPI_PIN_SEL
];
47 quadSpiPinDef_t bk2IO2Pins
[MAX_QUADSPI_PIN_SEL
];
48 quadSpiPinDef_t bk2IO3Pins
[MAX_QUADSPI_PIN_SEL
];
49 quadSpiPinDef_t bk2CSPins
[MAX_QUADSPI_PIN_SEL
];
54 extern const quadSpiHardware_t quadSpiHardware
[];
56 typedef struct QUADSPIDevice_s
{
82 volatile uint16_t errorCount
;
83 #if defined(USE_HAL_DRIVER)
84 QSPI_HandleTypeDef hquadSpi
;
88 extern quadSpiDevice_t quadSpiDevice
[QUADSPIDEV_COUNT
];
90 void quadSpiInitDevice(QUADSPIDevice device
);
91 uint32_t quadSpiTimeoutUserCallback(QUADSPI_TypeDef
*instance
);