STM32 SPI driver optimization.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2427 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
gdisirio 2010-11-25 20:45:15 +00:00
parent c852dcb3c9
commit 06593fd396
2 changed files with 14 additions and 12 deletions

View File

@ -391,10 +391,9 @@ void spi_lld_unselect(SPIDriver *spip) {
void spi_lld_ignore(SPIDriver *spip, size_t n) { void spi_lld_ignore(SPIDriver *spip, size_t n) {
dmaChannelSetup(spip->spd_dmarx, n, &dummyrx, dmaChannelSetup(spip->spd_dmarx, n, &dummyrx,
spip->spd_dmaccr | DMA_CCR1_TCIE); spip->spd_dmaccr | DMA_CCR1_TCIE | DMA_CCR1_EN);
dmaChannelSetup(spip->spd_dmatx, n, &dummytx, dmaChannelSetup(spip->spd_dmatx, n, &dummytx,
spip->spd_dmaccr | DMA_CCR1_DIR); spip->spd_dmaccr | DMA_CCR1_DIR | DMA_CCR1_EN);
dma_start(spip);
} }
/** /**
@ -416,10 +415,11 @@ void spi_lld_exchange(SPIDriver *spip, size_t n,
const void *txbuf, void *rxbuf) { const void *txbuf, void *rxbuf) {
dmaChannelSetup(spip->spd_dmarx, n, rxbuf, dmaChannelSetup(spip->spd_dmarx, n, rxbuf,
spip->spd_dmaccr | DMA_CCR1_TCIE | DMA_CCR1_MINC); spip->spd_dmaccr | DMA_CCR1_TCIE | DMA_CCR1_MINC |
DMA_CCR1_EN);
dmaChannelSetup(spip->spd_dmatx, n, txbuf, dmaChannelSetup(spip->spd_dmatx, n, txbuf,
spip->spd_dmaccr | DMA_CCR1_DIR | DMA_CCR1_MINC); spip->spd_dmaccr | DMA_CCR1_DIR | DMA_CCR1_MINC |
dma_start(spip); DMA_CCR1_EN);
} }
/** /**
@ -438,10 +438,10 @@ void spi_lld_exchange(SPIDriver *spip, size_t n,
void spi_lld_send(SPIDriver *spip, size_t n, const void *txbuf) { void spi_lld_send(SPIDriver *spip, size_t n, const void *txbuf) {
dmaChannelSetup(spip->spd_dmarx, n, &dummyrx, dmaChannelSetup(spip->spd_dmarx, n, &dummyrx,
spip->spd_dmaccr | DMA_CCR1_TCIE); spip->spd_dmaccr | DMA_CCR1_TCIE | DMA_CCR1_EN);
dmaChannelSetup(spip->spd_dmatx, n, txbuf, dmaChannelSetup(spip->spd_dmatx, n, txbuf,
spip->spd_dmaccr | DMA_CCR1_DIR | DMA_CCR1_MINC); spip->spd_dmaccr | DMA_CCR1_DIR | DMA_CCR1_MINC |
dma_start(spip); DMA_CCR1_EN);
} }
/** /**
@ -460,10 +460,10 @@ void spi_lld_send(SPIDriver *spip, size_t n, const void *txbuf) {
void spi_lld_receive(SPIDriver *spip, size_t n, void *rxbuf) { void spi_lld_receive(SPIDriver *spip, size_t n, void *rxbuf) {
dmaChannelSetup(spip->spd_dmarx, n, rxbuf, dmaChannelSetup(spip->spd_dmarx, n, rxbuf,
spip->spd_dmaccr | DMA_CCR1_TCIE | DMA_CCR1_MINC); spip->spd_dmaccr | DMA_CCR1_TCIE | DMA_CCR1_MINC |
DMA_CCR1_EN);
dmaChannelSetup(spip->spd_dmatx, n, &dummytx, dmaChannelSetup(spip->spd_dmatx, n, &dummytx,
spip->spd_dmaccr | DMA_CCR1_DIR); spip->spd_dmaccr | DMA_CCR1_DIR | DMA_CCR1_EN);
dma_start(spip);
} }
/** /**

View File

@ -92,6 +92,8 @@
- NEW: Added demo for the ST STM8L-Discovery kit. - NEW: Added demo for the ST STM8L-Discovery kit.
- NEW: Added support for the STM32 Value Line to the HAL. - NEW: Added support for the STM32 Value Line to the HAL.
- NEW: Added demo for the ST STM32VL-Discovery kit. - NEW: Added demo for the ST STM32VL-Discovery kit.
- OPT: STM32 SPI driver implementation improved, reduced latency when
starting a transfer.
- CHANGE: Improved the STM32 HAL to support multiple sub-families, at compile - CHANGE: Improved the STM32 HAL to support multiple sub-families, at compile
time now it is possible to test the presence of any single peripheral into time now it is possible to test the presence of any single peripheral into
the specified STM32 device. the specified STM32 device.