• R/O
  • SSH
  • HTTPS

chibios: 提交


Commit MetaInfo

修订版15845 (tree)
时间2022-11-20 18:35:39
作者gdisirio

Log Message

STM32 DMA drivers now export an STM32_DMA_MAX_TRANSFER definition.

更改概述

差异

--- trunk/os/hal/ports/STM32/LLD/DMAv1/stm32_dma.h (revision 15844)
+++ trunk/os/hal/ports/STM32/LLD/DMAv1/stm32_dma.h (revision 15845)
@@ -39,6 +39,11 @@
3939 #define STM32_DMA_ADVANCED FALSE
4040
4141 /**
42+ * @brief Maximum number of transfers in a single operation.
43+ */
44+#define STM32_DMA_MAX_TRANSFER 65535
45+
46+/**
4247 * @brief Total number of DMA streams.
4348 * @details This is the total number of streams among all the DMA units.
4449 */
--- trunk/os/hal/ports/STM32/LLD/DMAv2/stm32_dma.h (revision 15844)
+++ trunk/os/hal/ports/STM32/LLD/DMAv2/stm32_dma.h (revision 15845)
@@ -37,6 +37,11 @@
3737 #define STM32_DMA_ADVANCED TRUE
3838
3939 /**
40+ * @brief Maximum number of transfers in a single operation.
41+ */
42+#define STM32_DMA_MAX_TRANSFER 65535
43+
44+/**
4045 * @brief Total number of DMA streams.
4146 * @details This is the total number of streams among all the DMA units.
4247 */
--- trunk/os/hal/ports/STM32/LLD/SPIv1/hal_spi_lld.c (revision 15844)
+++ trunk/os/hal/ports/STM32/LLD/SPIv1/hal_spi_lld.c (revision 15845)
@@ -534,7 +534,7 @@
534534 */
535535 void spi_lld_ignore(SPIDriver *spip, size_t n) {
536536
537- osalDbgAssert(n < 65536, "unsupported DMA transfer size");
537+ osalDbgAssert(n <= STM32_DMA_MAX_TRANSFER, "unsupported DMA transfer size");
538538
539539 dmaStreamSetMemory0(spip->dmarx, &dummyrx);
540540 dmaStreamSetTransactionSize(spip->dmarx, n);
@@ -566,7 +566,7 @@
566566 void spi_lld_exchange(SPIDriver *spip, size_t n,
567567 const void *txbuf, void *rxbuf) {
568568
569- osalDbgAssert(n < 65536, "unsupported DMA transfer size");
569+ osalDbgAssert(n <= STM32_DMA_MAX_TRANSFER, "unsupported DMA transfer size");
570570
571571 dmaStreamSetMemory0(spip->dmarx, rxbuf);
572572 dmaStreamSetTransactionSize(spip->dmarx, n);
@@ -595,7 +595,7 @@
595595 */
596596 void spi_lld_send(SPIDriver *spip, size_t n, const void *txbuf) {
597597
598- osalDbgAssert(n < 65536, "unsupported DMA transfer size");
598+ osalDbgAssert(n <= STM32_DMA_MAX_TRANSFER, "unsupported DMA transfer size");
599599
600600 dmaStreamSetMemory0(spip->dmarx, &dummyrx);
601601 dmaStreamSetTransactionSize(spip->dmarx, n);
@@ -624,7 +624,7 @@
624624 */
625625 void spi_lld_receive(SPIDriver *spip, size_t n, void *rxbuf) {
626626
627- osalDbgAssert(n < 65536, "unsupported DMA transfer size");
627+ osalDbgAssert(n <= STM32_DMA_MAX_TRANSFER, "unsupported DMA transfer size");
628628
629629 dmaStreamSetMemory0(spip->dmarx, rxbuf);
630630 dmaStreamSetTransactionSize(spip->dmarx, n);
--- trunk/os/hal/ports/STM32/LLD/SPIv1/hal_spi_v2_lld.c (revision 15844)
+++ trunk/os/hal/ports/STM32/LLD/SPIv1/hal_spi_v2_lld.c (revision 15845)
@@ -720,7 +720,7 @@
720720 */
721721 msg_t spi_lld_ignore(SPIDriver *spip, size_t n) {
722722
723- osalDbgAssert(n < 65536, "unsupported DMA transfer size");
723+ osalDbgAssert(n <= STM32_DMA_MAX_TRANSFER, "unsupported DMA transfer size");
724724
725725 dmaStreamSetMemory0(spip->dmarx, &spip->rxsink);
726726 dmaStreamSetTransactionSize(spip->dmarx, n);
@@ -755,7 +755,7 @@
755755 msg_t spi_lld_exchange(SPIDriver *spip, size_t n,
756756 const void *txbuf, void *rxbuf) {
757757
758- osalDbgAssert(n < 65536, "unsupported DMA transfer size");
758+ osalDbgAssert(n <= STM32_DMA_MAX_TRANSFER, "unsupported DMA transfer size");
759759
760760 dmaStreamSetMemory0(spip->dmarx, rxbuf);
761761 dmaStreamSetTransactionSize(spip->dmarx, n);
@@ -787,7 +787,7 @@
787787 */
788788 msg_t spi_lld_send(SPIDriver *spip, size_t n, const void *txbuf) {
789789
790- osalDbgAssert(n < 65536, "unsupported DMA transfer size");
790+ osalDbgAssert(n <= STM32_DMA_MAX_TRANSFER, "unsupported DMA transfer size");
791791
792792 dmaStreamSetMemory0(spip->dmarx, &spip->rxsink);
793793 dmaStreamSetTransactionSize(spip->dmarx, n);
@@ -819,7 +819,7 @@
819819 */
820820 msg_t spi_lld_receive(SPIDriver *spip, size_t n, void *rxbuf) {
821821
822- osalDbgAssert(n < 65536, "unsupported DMA transfer size");
822+ osalDbgAssert(n <= STM32_DMA_MAX_TRANSFER, "unsupported DMA transfer size");
823823
824824 dmaStreamSetMemory0(spip->dmarx, rxbuf);
825825 dmaStreamSetTransactionSize(spip->dmarx, n);
--- trunk/os/hal/ports/STM32/LLD/SPIv2/hal_spi_lld.c (revision 15844)
+++ trunk/os/hal/ports/STM32/LLD/SPIv2/hal_spi_lld.c (revision 15845)
@@ -559,7 +559,7 @@
559559 */
560560 void spi_lld_ignore(SPIDriver *spip, size_t n) {
561561
562- osalDbgAssert(n < 65536, "unsupported DMA transfer size");
562+ osalDbgAssert(n <= STM32_DMA_MAX_TRANSFER, "unsupported DMA transfer size");
563563
564564 dmaStreamSetMemory0(spip->dmarx, &dummyrx);
565565 dmaStreamSetTransactionSize(spip->dmarx, n);
@@ -591,7 +591,7 @@
591591 void spi_lld_exchange(SPIDriver *spip, size_t n,
592592 const void *txbuf, void *rxbuf) {
593593
594- osalDbgAssert(n < 65536, "unsupported DMA transfer size");
594+ osalDbgAssert(n <= STM32_DMA_MAX_TRANSFER, "unsupported DMA transfer size");
595595
596596 dmaStreamSetMemory0(spip->dmarx, rxbuf);
597597 dmaStreamSetTransactionSize(spip->dmarx, n);
@@ -620,7 +620,7 @@
620620 */
621621 void spi_lld_send(SPIDriver *spip, size_t n, const void *txbuf) {
622622
623- osalDbgAssert(n < 65536, "unsupported DMA transfer size");
623+ osalDbgAssert(n <= STM32_DMA_MAX_TRANSFER, "unsupported DMA transfer size");
624624
625625 dmaStreamSetMemory0(spip->dmarx, &dummyrx);
626626 dmaStreamSetTransactionSize(spip->dmarx, n);
@@ -649,7 +649,7 @@
649649 */
650650 void spi_lld_receive(SPIDriver *spip, size_t n, void *rxbuf) {
651651
652- osalDbgAssert(n < 65536, "unsupported DMA transfer size");
652+ osalDbgAssert(n <= STM32_DMA_MAX_TRANSFER, "unsupported DMA transfer size");
653653
654654 dmaStreamSetMemory0(spip->dmarx, rxbuf);
655655 dmaStreamSetTransactionSize(spip->dmarx, n);
--- trunk/os/hal/ports/STM32/LLD/SPIv2/hal_spi_v2_lld.c (revision 15844)
+++ trunk/os/hal/ports/STM32/LLD/SPIv2/hal_spi_v2_lld.c (revision 15845)
@@ -730,7 +730,7 @@
730730 */
731731 msg_t spi_lld_ignore(SPIDriver *spip, size_t n) {
732732
733- osalDbgAssert(n < 65536, "unsupported DMA transfer size");
733+ osalDbgAssert(n <= STM32_DMA_MAX_TRANSFER, "unsupported DMA transfer size");
734734
735735 dmaStreamSetMemory0(spip->dmarx, &spip->rxsink);
736736 dmaStreamSetTransactionSize(spip->dmarx, n);
@@ -765,7 +765,7 @@
765765 msg_t spi_lld_exchange(SPIDriver *spip, size_t n,
766766 const void *txbuf, void *rxbuf) {
767767
768- osalDbgAssert(n < 65536, "unsupported DMA transfer size");
768+ osalDbgAssert(n <= STM32_DMA_MAX_TRANSFER, "unsupported DMA transfer size");
769769
770770 dmaStreamSetMemory0(spip->dmarx, rxbuf);
771771 dmaStreamSetTransactionSize(spip->dmarx, n);
@@ -797,7 +797,7 @@
797797 */
798798 msg_t spi_lld_send(SPIDriver *spip, size_t n, const void *txbuf) {
799799
800- osalDbgAssert(n < 65536, "unsupported DMA transfer size");
800+ osalDbgAssert(n <= STM32_DMA_MAX_TRANSFER, "unsupported DMA transfer size");
801801
802802 dmaStreamSetMemory0(spip->dmarx, &spip->rxsink);
803803 dmaStreamSetTransactionSize(spip->dmarx, n);
@@ -829,7 +829,7 @@
829829 */
830830 msg_t spi_lld_receive(SPIDriver *spip, size_t n, void *rxbuf) {
831831
832- osalDbgAssert(n < 65536, "unsupported DMA transfer size");
832+ osalDbgAssert(n <= STM32_DMA_MAX_TRANSFER, "unsupported DMA transfer size");
833833
834834 dmaStreamSetMemory0(spip->dmarx, rxbuf);
835835 dmaStreamSetTransactionSize(spip->dmarx, n);
--- trunk/os/hal/ports/STM32/LLD/SPIv3/hal_spi_lld.c (revision 15844)
+++ trunk/os/hal/ports/STM32/LLD/SPIv3/hal_spi_lld.c (revision 15845)
@@ -825,7 +825,7 @@
825825 */
826826 void spi_lld_ignore(SPIDriver *spip, size_t n) {
827827
828- osalDbgAssert(n < 65536, "unsupported DMA transfer size");
828+ osalDbgAssert(n <= STM32_DMA_MAX_TRANSFER, "unsupported DMA transfer size");
829829
830830 spi_lld_wait_complete(spip);
831831
@@ -885,7 +885,7 @@
885885 void spi_lld_exchange(SPIDriver *spip, size_t n,
886886 const void *txbuf, void *rxbuf) {
887887
888- osalDbgAssert(n < 65536, "unsupported DMA transfer size");
888+ osalDbgAssert(n <= STM32_DMA_MAX_TRANSFER, "unsupported DMA transfer size");
889889
890890 spi_lld_wait_complete(spip);
891891
@@ -942,7 +942,7 @@
942942 */
943943 void spi_lld_send(SPIDriver *spip, size_t n, const void *txbuf) {
944944
945- osalDbgAssert(n < 65536, "unsupported DMA transfer size");
945+ osalDbgAssert(n <= STM32_DMA_MAX_TRANSFER, "unsupported DMA transfer size");
946946
947947 spi_lld_wait_complete(spip);
948948
@@ -999,7 +999,7 @@
999999 */
10001000 void spi_lld_receive(SPIDriver *spip, size_t n, void *rxbuf) {
10011001
1002- osalDbgAssert(n < 65536, "unsupported DMA transfer size");
1002+ osalDbgAssert(n <= STM32_DMA_MAX_TRANSFER, "unsupported DMA transfer size");
10031003
10041004 spi_lld_wait_complete(spip);
10051005
--- trunk/os/hal/ports/STM32/LLD/SPIv3/hal_spi_v2_lld.c (revision 15844)
+++ trunk/os/hal/ports/STM32/LLD/SPIv3/hal_spi_v2_lld.c (revision 15845)
@@ -1069,7 +1069,7 @@
10691069 */
10701070 msg_t spi_lld_ignore(SPIDriver *spip, size_t n) {
10711071
1072- osalDbgAssert(n < 65536, "unsupported DMA transfer size");
1072+ osalDbgAssert(n <= STM32_DMA_MAX_TRANSFER, "unsupported DMA transfer size");
10731073
10741074 #if defined(STM32_SPI_DMA_REQUIRED) && defined(STM32_SPI_BDMA_REQUIRED)
10751075 if (spip->is_bdma)
@@ -1130,7 +1130,7 @@
11301130 msg_t spi_lld_exchange(SPIDriver *spip, size_t n,
11311131 const void *txbuf, void *rxbuf) {
11321132
1133- osalDbgAssert(n < 65536, "unsupported DMA transfer size");
1133+ osalDbgAssert(n <= STM32_DMA_MAX_TRANSFER, "unsupported DMA transfer size");
11341134
11351135 #if defined(STM32_SPI_DMA_REQUIRED) && defined(STM32_SPI_BDMA_REQUIRED)
11361136 if (spip->is_bdma)
@@ -1188,7 +1188,7 @@
11881188 */
11891189 msg_t spi_lld_send(SPIDriver *spip, size_t n, const void *txbuf) {
11901190
1191- osalDbgAssert(n < 65536, "unsupported DMA transfer size");
1191+ osalDbgAssert(n <= STM32_DMA_MAX_TRANSFER, "unsupported DMA transfer size");
11921192
11931193 #if defined(STM32_SPI_DMA_REQUIRED) && defined(STM32_SPI_BDMA_REQUIRED)
11941194 if (spip->is_bdma)
@@ -1246,7 +1246,7 @@
12461246 */
12471247 msg_t spi_lld_receive(SPIDriver *spip, size_t n, void *rxbuf) {
12481248
1249- osalDbgAssert(n < 65536, "unsupported DMA transfer size");
1249+ osalDbgAssert(n <= STM32_DMA_MAX_TRANSFER, "unsupported DMA transfer size");
12501250
12511251 #if defined(STM32_SPI_DMA_REQUIRED) && defined(STM32_SPI_BDMA_REQUIRED)
12521252 if (spip->is_bdma)
--- trunk/readme.txt (revision 15844)
+++ trunk/readme.txt (revision 15845)
@@ -74,6 +74,7 @@
7474 *****************************************************************************
7575
7676 *** Next ***
77+- NEW: STM32 DMA drivers now export an STM32_DMA_MAX_TRANSFER definition.
7778 - NEW: PAL events for RP2040 added.
7879 - NEW: Added a "waend" field to the thread structure in RT for debug
7980 convenience.
Show on old repository browser