1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-13 19:40:31 +03:00

Update flash drivers to support QuadSPI

- Update flash w25n01g driver to support QuadSPI.

- flash_m25p16 update for QuadSPI support

- w25m driver update for QuadSPI support

- Use 100Mhz (ULTRAFAST) clock for QuadSPI w25n01

- Conditionalize QUADSPI code in w25n01g driver

- Use handle instead of handle_u
This commit is contained in:
Dominic Clifton 2019-05-07 14:55:59 +09:00 committed by jflyper
parent c0ee056d68
commit dcd138ae20
7 changed files with 385 additions and 148 deletions

View file

@ -28,8 +28,23 @@
struct flashVTable_s;
typedef enum {
FLASHIO_NONE = 0,
FLASHIO_SPI,
FLASHIO_QUADSPI
} flashDeviceIoMode_e;
typedef struct flashDeviceIO_s {
union {
busDevice_t *busdev; // Device interface dependent handle (spi/i2c)
#ifdef USE_QUADSPI
QUADSPI_TypeDef *quadSpi;
#endif
} handle;
flashDeviceIoMode_e mode;
} flashDeviceIO_t;
typedef struct flashDevice_s {
busDevice_t *busdev;
const struct flashVTable_s *vTable;
flashGeometry_t geometry;
uint32_t currentWriteAddress;
@ -38,6 +53,7 @@ typedef struct flashDevice_s {
// for writes. This allows us to avoid polling for writable status
// when it is definitely ready already.
bool couldBeBusy;
flashDeviceIO_t io;
} flashDevice_t;
typedef struct flashVTable_s {