diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-12-16 10:05:35 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-12-16 10:05:35 +0000 |
commit | ce80dcb337586d700d37580a5768400abcc797be (patch) | |
tree | 4703e07c60a3cd90a3c60f39ba705eca30c1e405 /os/hal/platforms | |
parent | aaac1b2e53af4dcee1278c2de6e90ce952a5f904 (diff) | |
download | ChibiOS-ce80dcb337586d700d37580a5768400abcc797be.tar.gz ChibiOS-ce80dcb337586d700d37580a5768400abcc797be.tar.bz2 ChibiOS-ce80dcb337586d700d37580a5768400abcc797be.zip |
Added UART driver support to the STM32F3xx HAL.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4920 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms')
-rw-r--r-- | os/hal/platforms/STM32/SPIv2/spi_lld.h | 8 | ||||
-rw-r--r-- | os/hal/platforms/STM32/USARTv2/uart_lld.h | 24 | ||||
-rw-r--r-- | os/hal/platforms/STM32F3xx/platform.mk | 1 |
3 files changed, 29 insertions, 4 deletions
diff --git a/os/hal/platforms/STM32/SPIv2/spi_lld.h b/os/hal/platforms/STM32/SPIv2/spi_lld.h index d97775dc0..d8cc49357 100644 --- a/os/hal/platforms/STM32/SPIv2/spi_lld.h +++ b/os/hal/platforms/STM32/SPIv2/spi_lld.h @@ -186,17 +186,17 @@ #define STM32_SPI_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
#define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
#define STM32_SPI_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
+#endif /* defined(STM32F0XX) */
-#else /* !defined(STM32F0XX) */
-/* Fixed streams for platforms using the old DMA peripheral, the values are
- valid for STM32F3xx.*/
+#if defined(STM32F30X)
+/* Fixed values for STM32F3xx devices.*/
#define STM32_SPI_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
#define STM32_SPI_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
#define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
#define STM32_SPI_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
#define STM32_SPI_SPI3_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 1)
#define STM32_SPI_SPI3_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 2)
-#endif /* !defined(STM32F0XX) */
+#endif /* defined(STM32F30X) */
#endif /* !STM32_ADVANCED_DMA*/
/** @} */
diff --git a/os/hal/platforms/STM32/USARTv2/uart_lld.h b/os/hal/platforms/STM32/USARTv2/uart_lld.h index d832b9d02..a4e9c3428 100644 --- a/os/hal/platforms/STM32/USARTv2/uart_lld.h +++ b/os/hal/platforms/STM32/USARTv2/uart_lld.h @@ -130,6 +130,8 @@ #define STM32_UART_DMA_ERROR_HOOK(uartp) chSysHalt()
#endif
+#if STM32_ADVANCED_DMA || defined(__DOXYGEN__)
+
/**
* @brief DMA stream used for USART1 RX operations.
* @note This option is only available on platforms with enhanced DMA.
@@ -177,6 +179,28 @@ #if !defined(STM32_UART_USART3_TX_DMA_STREAM) || defined(__DOXYGEN__)
#define STM32_UART_USART3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
#endif
+
+#else /* !STM32_ADVANCED_DMA*/
+
+#if defined(STM32F0XX)
+/* Fixed values for STM32F0xx devices.*/
+#define STM32_UART_USART1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
+#define STM32_UART_USART1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
+#define STM32_UART_USART2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
+#define STM32_UART_USART2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
+#endif /* defined(STM32F0XX) */
+
+#if defined(STM32F30X)
+/* Fixed values for STM32F3xx devices.*/
+#define STM32_UART_USART1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
+#define STM32_UART_USART1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
+#define STM32_UART_USART2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6)
+#define STM32_UART_USART2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7)
+#define STM32_UART_USART3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
+#define STM32_UART_USART3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 2)
+#endif /* defined(STM32F30X) */
+
+#endif /* !STM32_ADVANCED_DMA*/
/** @} */
/*===========================================================================*/
diff --git a/os/hal/platforms/STM32F3xx/platform.mk b/os/hal/platforms/STM32F3xx/platform.mk index 6b02db68a..ae51f0140 100644 --- a/os/hal/platforms/STM32F3xx/platform.mk +++ b/os/hal/platforms/STM32F3xx/platform.mk @@ -8,6 +8,7 @@ PLATFORMSRC = ${CHIBIOS}/os/hal/platforms/STM32F3xx/stm32_dma.c \ ${CHIBIOS}/os/hal/platforms/STM32/GPIOv2/pal_lld.c \
${CHIBIOS}/os/hal/platforms/STM32/SPIv2/spi_lld.c \
${CHIBIOS}/os/hal/platforms/STM32/USARTv2/serial_lld.c \
+ ${CHIBIOS}/os/hal/platforms/STM32/USARTv2/uart_lld.c \
${CHIBIOS}/os/hal/platforms/STM32/USBv1/usb_lld.c
# Required include directories
|