Removed not needed change.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@14499 27425a3e-05d8-49a3-a47f-9c15f0e5edd8
This commit is contained in:
parent
a2769a3669
commit
cbb355f514
|
@ -78,14 +78,6 @@
|
|||
STM32_DMA_GETCHANNEL(STM32_SPI_SPI6_TX_DMA_STREAM, \
|
||||
STM32_SPI6_TX_DMA_CHN)
|
||||
|
||||
#define SPIR_RX_DMA_STREAM \
|
||||
STM32_DMA_GETCHANNEL(STM32_SPI_SPIR_RX_DMA_STREAM, \
|
||||
STM32_SPIR_RX_DMA_CHN)
|
||||
|
||||
#define SPIR_TX_DMA_STREAM \
|
||||
STM32_DMA_GETCHANNEL(STM32_SPI_SPIR_TX_DMA_STREAM, \
|
||||
STM32_SPIR_TX_DMA_CHN)
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Driver exported variables. */
|
||||
/*===========================================================================*/
|
||||
|
@ -120,11 +112,6 @@ SPIDriver SPID5;
|
|||
SPIDriver SPID6;
|
||||
#endif
|
||||
|
||||
/** @brief SPIR driver identifier.*/
|
||||
#if STM32_SPI_USE_SPIR || defined(__DOXYGEN__)
|
||||
SPIDriver SPIDR;
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Driver local variables and types. */
|
||||
/*===========================================================================*/
|
||||
|
@ -316,24 +303,6 @@ void spi_lld_init(void) {
|
|||
STM32_DMA_CR_DMEIE |
|
||||
STM32_DMA_CR_TEIE;
|
||||
#endif
|
||||
|
||||
#if STM32_SPI_USE_SPIR
|
||||
spiObjectInit(&SPIDR);
|
||||
SPIDR.spi = SUBGHZSPI;
|
||||
SPIDR.dmarx = NULL;
|
||||
SPIDR.dmatx = NULL;
|
||||
SPIDR.rxdmamode = STM32_DMA_CR_CHSEL(SPIR_RX_DMA_STREAM) |
|
||||
STM32_DMA_CR_PL(STM32_SPI_SPIR_DMA_PRIORITY) |
|
||||
STM32_DMA_CR_DIR_P2M |
|
||||
STM32_DMA_CR_TCIE |
|
||||
STM32_DMA_CR_DMEIE |
|
||||
STM32_DMA_CR_TEIE;
|
||||
SPIDR.txdmamode = STM32_DMA_CR_CHSEL(SPIR_TX_DMA_STREAM) |
|
||||
STM32_DMA_CR_PL(STM32_SPI_SPIR_DMA_PRIORITY) |
|
||||
STM32_DMA_CR_DIR_M2P |
|
||||
STM32_DMA_CR_DMEIE |
|
||||
STM32_DMA_CR_TEIE;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -462,25 +431,6 @@ void spi_lld_start(SPIDriver *spip) {
|
|||
#endif
|
||||
}
|
||||
#endif
|
||||
#if STM32_SPI_USE_SPIR
|
||||
if (&SPIDR == spip) {
|
||||
spip->dmarx = dmaStreamAllocI(STM32_SPI_SPIR_RX_DMA_STREAM,
|
||||
STM32_SPI_SPIR_IRQ_PRIORITY,
|
||||
(stm32_dmaisr_t)spi_lld_serve_rx_interrupt,
|
||||
(void *)spip);
|
||||
osalDbgAssert(spip->dmarx != NULL, "unable to allocate stream");
|
||||
spip->dmatx = dmaStreamAllocI(STM32_SPI_SPIR_TX_DMA_STREAM,
|
||||
STM32_SPI_SPIR_IRQ_PRIORITY,
|
||||
(stm32_dmaisr_t)spi_lld_serve_tx_interrupt,
|
||||
(void *)spip);
|
||||
osalDbgAssert(spip->dmatx != NULL, "unable to allocate stream");
|
||||
rccEnableSPIR(true);
|
||||
#if STM32_DMA_SUPPORTS_DMAMUX
|
||||
dmaSetRequestSource(spip->dmarx, STM32_DMAMUX1_SPIR_RX);
|
||||
dmaSetRequestSource(spip->dmatx, STM32_DMAMUX1_SPIR_TX);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
/* DMA setup.*/
|
||||
dmaStreamSetPeripheral(spip->dmarx, &spip->spi->DR);
|
||||
|
@ -565,10 +515,6 @@ void spi_lld_stop(SPIDriver *spip) {
|
|||
#if STM32_SPI_USE_SPI6
|
||||
if (&SPID6 == spip)
|
||||
rccDisableSPI6();
|
||||
#endif
|
||||
#if STM32_SPI_USE_SPIR
|
||||
if (&SPIDR == spip)
|
||||
rccDisableSPIR();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -98,15 +98,6 @@
|
|||
#define STM32_SPI_USE_SPI6 FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief SPIR driver enable switch.
|
||||
* @details If set to @p TRUE the support for SPIR is included.
|
||||
* @note The default is @p FALSE.
|
||||
*/
|
||||
#if !defined(STM32_SPI_USE_SPIR) || defined(__DOXYGEN__)
|
||||
#define STM32_SPI_USE_SPIR FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief SPI1 interrupt priority level setting.
|
||||
*/
|
||||
|
@ -149,13 +140,6 @@
|
|||
#define STM32_SPI_SPI6_IRQ_PRIORITY 10
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief SPIR interrupt priority level setting.
|
||||
*/
|
||||
#if !defined(STM32_SPI_SPIR_IRQ_PRIORITY) || defined(__DOXYGEN__)
|
||||
#define STM32_SPI_SPIR_IRQ_PRIORITY 10
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief SPI1 DMA priority (0..3|lowest..highest).
|
||||
* @note The priority level is used for both the TX and RX DMA streams but
|
||||
|
@ -216,23 +200,12 @@
|
|||
#define STM32_SPI_SPI6_DMA_PRIORITY 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief SPIR DMA priority (0..3|lowest..highest).
|
||||
* @note The priority level is used for both the TX and RX DMA streams but
|
||||
* because of the streams ordering the RX stream has always priority
|
||||
* over the TX stream.
|
||||
*/
|
||||
#if !defined(STM32_SPI_SPIR_DMA_PRIORITY) || defined(__DOXYGEN__)
|
||||
#define STM32_SPI_SPIR_DMA_PRIORITY 1
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief SPI DMA error hook.
|
||||
*/
|
||||
#if !defined(STM32_SPI_DMA_ERROR_HOOK) || defined(__DOXYGEN__)
|
||||
#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure")
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
|
||||
/*===========================================================================*/
|
||||
|
@ -263,13 +236,8 @@
|
|||
#error "SPI6 not present in the selected device"
|
||||
#endif
|
||||
|
||||
#if STM32_SPI_USE_SPIR && !STM32_HAS_SPIR
|
||||
#error "SPIR not present in the selected device"
|
||||
#endif
|
||||
|
||||
#if !STM32_SPI_USE_SPI1 && !STM32_SPI_USE_SPI2 && !STM32_SPI_USE_SPI3 && \
|
||||
!STM32_SPI_USE_SPI4 && !STM32_SPI_USE_SPI5 && !STM32_SPI_USE_SPI6 && \
|
||||
!STM32_SPI_USE_SPIR
|
||||
!STM32_SPI_USE_SPI4 && !STM32_SPI_USE_SPI5 && !STM32_SPI_USE_SPI6
|
||||
#error "SPI driver activated but no SPI peripheral assigned"
|
||||
#endif
|
||||
|
||||
|
@ -303,11 +271,6 @@
|
|||
#error "Invalid IRQ priority assigned to SPI6"
|
||||
#endif
|
||||
|
||||
#if STM32_SPI_USE_SPIR && \
|
||||
!OSAL_IRQ_IS_VALID_PRIORITY(STM32_SPI_SPIR_IRQ_PRIORITY)
|
||||
#error "Invalid IRQ priority assigned to SPIR"
|
||||
#endif
|
||||
|
||||
#if STM32_SPI_USE_SPI1 && \
|
||||
!STM32_DMA_IS_VALID_PRIORITY(STM32_SPI_SPI1_DMA_PRIORITY)
|
||||
#error "Invalid DMA priority assigned to SPI1"
|
||||
|
@ -338,11 +301,6 @@
|
|||
#error "Invalid DMA priority assigned to SPI6"
|
||||
#endif
|
||||
|
||||
#if STM32_SPI_USE_SPIR && \
|
||||
!STM32_DMA_IS_VALID_PRIORITY(STM32_SPI_SPIR_DMA_PRIORITY)
|
||||
#error "Invalid DMA priority assigned to SPIR"
|
||||
#endif
|
||||
|
||||
/* Check on the presence of the DMA streams settings in mcuconf.h.*/
|
||||
#if STM32_SPI_USE_SPI1 && (!defined(STM32_SPI_SPI1_RX_DMA_STREAM) || \
|
||||
!defined(STM32_SPI_SPI1_TX_DMA_STREAM))
|
||||
|
@ -374,11 +332,6 @@
|
|||
#error "SPI6 DMA streams not defined"
|
||||
#endif
|
||||
|
||||
#if STM32_SPI_USE_SPIR && (!defined(STM32_SPI_SPIR_RX_DMA_STREAM) || \
|
||||
!defined(STM32_SPI_SPIR_TX_DMA_STREAM))
|
||||
#error "SPIR DMA streams not defined"
|
||||
#endif
|
||||
|
||||
/* Check on the validity of the assigned DMA channels.*/
|
||||
#if STM32_SPI_USE_SPI1 && \
|
||||
!STM32_DMA_IS_VALID_STREAM(STM32_SPI_SPI1_TX_DMA_STREAM)
|
||||
|
@ -435,16 +388,6 @@
|
|||
#error "Invalid DMA channel assigned to SPI6 TX"
|
||||
#endif
|
||||
|
||||
#if STM32_SPI_USE_SPIR && \
|
||||
!STM32_DMA_IS_VALID_STREAM(STM32_SPI_SPIR_RX_DMA_STREAM)
|
||||
#error "Invalid DMA channel assigned to SPIR RX"
|
||||
#endif
|
||||
|
||||
#if STM32_SPI_USE_SPIR && \
|
||||
!STM32_DMA_IS_VALID_STREAM(STM32_SPI_SPIR_TX_DMA_STREAM)
|
||||
#error "Invalid DMA channel assigned to SPIR TX"
|
||||
#endif
|
||||
|
||||
/* Devices without DMAMUX require an additional check.*/
|
||||
#if STM32_ADVANCED_DMA && !STM32_DMA_SUPPORTS_DMAMUX
|
||||
|
||||
|
@ -509,16 +452,6 @@
|
|||
#error "invalid DMA stream associated to SPI6 TX"
|
||||
#endif
|
||||
|
||||
#if STM32_SPI_USE_SPIR && \
|
||||
!STM32_DMA_IS_VALID_ID(STM32_SPI_SPIR_RX_DMA_STREAM, STM32_SPIR_RX_DMA_MSK)
|
||||
#error "invalid DMA stream associated to SPIR RX"
|
||||
#endif
|
||||
|
||||
#if STM32_SPI_USE_SPIR && \
|
||||
!STM32_DMA_IS_VALID_ID(STM32_SPI_SPIR_TX_DMA_STREAM, STM32_SPIR_TX_DMA_MSK)
|
||||
#error "invalid DMA stream associated to SPIR TX"
|
||||
#endif
|
||||
|
||||
#endif /* STM32_ADVANCED_DMA && !STM32_DMA_SUPPORTS_DMAMUX */
|
||||
|
||||
#if !defined(STM32_DMA_REQUIRED)
|
||||
|
@ -589,10 +522,6 @@ extern SPIDriver SPID5;
|
|||
extern SPIDriver SPID6;
|
||||
#endif
|
||||
|
||||
#if STM32_SPI_USE_SPIR && !defined(__DOXYGEN__)
|
||||
extern SPIDriver SPIDR;
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue