ardupilot/libraries/AP_HAL_ChibiOS/hwdef/common/spi_hook.h
Andrew Tridgell 7e84028a91 HAL_ChibiOS: fixed sdcard lockup with SPI sdcard
this affects boards that share sdcard on the same bus as another SPI
device. In this case it was a QiotekZealotH743 where logging stopped

this issue is that the SPI hooks for MMC SPI did not do a DMA channel
lock before the SPI device lock. So when the RAMTRON driver on the
QiotekZealotH743 which is on the same SPI2 bus as the sdcard did an
operation we had a lock order violation
2023-05-13 18:18:14 +10:00

24 lines
560 B
C

#pragma once
#include "hal.h"
#ifdef __cplusplus
extern "C" {
#endif
#if HAL_USE_MMC_SPI == TRUE
void spiStartHook(SPIDriver *spip, const SPIConfig *config);
void spiStopHook(SPIDriver *spip);
void spiAcquireBusHook(SPIDriver *spip);
void spiReleaseBusHook(SPIDriver *spip);
void spiSelectHook(SPIDriver *spip);
void spiUnselectHook(SPIDriver *spip);
void spiIgnoreHook(SPIDriver *spip,size_t n);
void spiSendHook(SPIDriver *spip,size_t n, const void *txbuf);
void spiReceiveHook(SPIDriver *spip, size_t n, void *rxbuf);
#endif
#ifdef __cplusplus
}
#endif