Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small patch up for AT32F415 #416

Draft
wants to merge 1 commit into
base: chibios-21.11.x
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions os/hal/ports/AT32/AT32F415/at32_registry.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@
#define AT32_CAN_MAX_FILTERS 14

/* DMA attributes.*/
#define AT32_ADVANCED_DMA FALSE

#if (AT32_DMA_USE_DMAMUX == TRUE) || defined(__DOXYGEN__)
#define AT32_ADVANCED_DMA TRUE
#define AT32_DMA_SUPPORTS_DMAMUX TRUE
#else
#define AT32_ADVANCED_DMA FALSE
#define AT32_DMA_SUPPORTS_DMAMUX FALSE
#endif

Expand All @@ -101,8 +101,11 @@
#define AT32_HAS_GPIOB TRUE
#define AT32_HAS_GPIOD TRUE

#if !defined(AT32_HAS_GPIOC) || defined(__DOXYGEN__)
#define AT32_HAS_GPIOC FALSE
#elif !defined(AT32_HAS_GPIOF)
#define AT32_HAS_GPIOF FALSE
#endif

/* I2C attributes.*/
#define AT32_HAS_I2C1 TRUE
Expand Down Expand Up @@ -298,11 +301,11 @@
#define AT32_CAN_MAX_FILTERS 14

/* DMA attributes.*/
#define AT32_ADVANCED_DMA FALSE

#if (AT32_DMA_USE_DMAMUX == TRUE) || defined(__DOXYGEN__)
#define AT32_ADVANCED_DMA TRUE
#define AT32_DMA_SUPPORTS_DMAMUX TRUE
#else
#define AT32_ADVANCED_DMA FALSE
#define AT32_DMA_SUPPORTS_DMAMUX FALSE
#endif

Expand All @@ -326,8 +329,11 @@
#define AT32_HAS_GPIOB TRUE
#define AT32_HAS_GPIOD TRUE

#if !defined(AT32_HAS_GPIOC) || defined(__DOXYGEN__)
#define AT32_HAS_GPIOC FALSE
#elif !defined(AT32_HAS_GPIOF)
#define AT32_HAS_GPIOF FALSE
#endif

/* I2C attributes.*/
#define AT32_HAS_I2C1 TRUE
Expand Down Expand Up @@ -523,11 +529,11 @@
#define AT32_CAN_MAX_FILTERS 14

/* DMA attributes.*/
#define AT32_ADVANCED_DMA FALSE

#if (AT32_DMA_USE_DMAMUX == TRUE) || defined(__DOXYGEN__)
#define AT32_ADVANCED_DMA TRUE
#define AT32_DMA_SUPPORTS_DMAMUX TRUE
#else
#define AT32_ADVANCED_DMA FALSE
#define AT32_DMA_SUPPORTS_DMAMUX FALSE
#endif

Expand Down Expand Up @@ -758,11 +764,11 @@
#define AT32_CAN_MAX_FILTERS 14

/* DMA attributes.*/
#define AT32_ADVANCED_DMA FALSE

#if (AT32_DMA_USE_DMAMUX == TRUE) || defined(__DOXYGEN__)
#define AT32_ADVANCED_DMA TRUE
#define AT32_DMA_SUPPORTS_DMAMUX TRUE
#else
#define AT32_ADVANCED_DMA FALSE
#define AT32_DMA_SUPPORTS_DMAMUX FALSE
#endif

Expand Down Expand Up @@ -993,11 +999,11 @@
#define AT32_CAN_MAX_FILTERS 14

/* DMA attributes.*/
#define AT32_ADVANCED_DMA FALSE

#if (AT32_DMA_USE_DMAMUX == TRUE) || defined(__DOXYGEN__)
#define AT32_ADVANCED_DMA TRUE
#define AT32_DMA_SUPPORTS_DMAMUX TRUE
#else
#define AT32_ADVANCED_DMA FALSE
#define AT32_DMA_SUPPORTS_DMAMUX FALSE
#endif

Expand Down Expand Up @@ -1247,11 +1253,11 @@
#define AT32_CAN_MAX_FILTERS 14

/* DMA attributes.*/
#define AT32_ADVANCED_DMA FALSE

#if (AT32_DMA_USE_DMAMUX == TRUE) || defined(__DOXYGEN__)
#define AT32_ADVANCED_DMA TRUE
#define AT32_DMA_SUPPORTS_DMAMUX TRUE
#else
#define AT32_ADVANCED_DMA FALSE
#define AT32_DMA_SUPPORTS_DMAMUX FALSE
#endif

Expand Down
17 changes: 17 additions & 0 deletions os/hal/ports/AT32/LLD/I2Cv1/hal_i2c_lld.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,23 @@
#error "Invalid DMA priority assigned to I2C2"
#endif

/* The following checks are only required when there is a DMA able to
reassign streams to different channels.*/
#if AT32_ADVANCED_DMA

/* Check on the presence of the DMA streams settings in mcuconf.h.*/
#if AT32_I2C_USE_I2C1 && (!defined(AT32_I2C_I2C1_RX_DMA_STREAM) || \
!defined(AT32_I2C_I2C1_TX_DMA_STREAM))
#error "I2C1 DMA streams not defined"
#endif

#if AT32_I2C_USE_I2C2 && (!defined(AT32_I2C_I2C2_RX_DMA_STREAM) || \
!defined(AT32_I2C_I2C2_TX_DMA_STREAM))
#error "I2C2 DMA streams not defined"
#endif

#endif /* AT32_ADVANCED_DMA */

#if !defined(AT32_DMA_REQUIRED)
#define AT32_DMA_REQUIRED
#endif
Expand Down
11 changes: 11 additions & 0 deletions os/hal/ports/AT32/LLD/SDIOv1/hal_sdc_lld.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,17 @@
#error "Invalid DMA priority assigned to SDIO"
#endif

/* The following checks are only required when there is a DMA able to
reassign streams to different channels.*/
#if AT32_ADVANCED_DMA

/* Check on the presence of the DMA streams settings in mcuconf.h.*/
#if !defined(AT32_SDC_SDIO_DMA_STREAM)
#error "SDIO DMA streams not defined"
#endif

#endif /* AT32_ADVANCED_DMA */

#if !defined(AT32_DMA_REQUIRED)
#define AT32_DMA_REQUIRED
#endif
Expand Down
32 changes: 32 additions & 0 deletions os/hal/ports/AT32/LLD/USARTv1/hal_uart_lld.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,38 @@
#error "Invalid DMA priority assigned to UART5"
#endif

/* The following checks are only required when there is a DMA able to
reassign streams to different channels.*/
#if AT32_ADVANCED_DMA

/* Check on the presence of the DMA streams settings in mcuconf.h.*/
#if AT32_UART_USE_USART1 && (!defined(AT32_UART_USART1_RX_DMA_STREAM) || \
!defined(AT32_UART_USART1_TX_DMA_STREAM))
#error "USART1 DMA streams not defined"
#endif

#if AT32_UART_USE_USART2 && (!defined(AT32_UART_USART2_RX_DMA_STREAM) || \
!defined(AT32_UART_USART2_TX_DMA_STREAM))
#error "USART2 DMA streams not defined"
#endif

#if AT32_UART_USE_USART3 && (!defined(AT32_UART_USART3_RX_DMA_STREAM) || \
!defined(AT32_UART_USART3_TX_DMA_STREAM))
#error "USART3 DMA streams not defined"
#endif

#if AT32_UART_USE_UART4 && (!defined(AT32_UART_UART4_RX_DMA_STREAM) || \
!defined(AT32_UART_UART4_TX_DMA_STREAM))
#error "UART4 DMA streams not defined"
#endif

#if AT32_UART_USE_UART5 && (!defined(AT32_UART_UART5_RX_DMA_STREAM) || \
!defined(AT32_UART_UART5_TX_DMA_STREAM))
#error "UART5 DMA streams not defined"
#endif

#endif /* AT32_ADVANCED_DMA */

#if !defined(AT32_DMA_REQUIRED)
#define AT32_DMA_REQUIRED
#endif
Expand Down
Loading