Partially revert some WB32 specific changes (#18038)

This commit is contained in:
Joel Challis 2022-08-14 20:48:44 +01:00 committed by GitHub
parent 74b4bcb607
commit 463fb72d29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 23 deletions

View File

@ -17,25 +17,13 @@
# define WS2812_PWM_CHANNEL 2 // Channel # define WS2812_PWM_CHANNEL 2 // Channel
#endif #endif
#ifndef WS2812_PWM_PAL_MODE #ifndef WS2812_PWM_PAL_MODE
# if defined(WB32F3G71xx) || defined(WB32FQ95xx)
# define WS2812_PWM_PAL_MODE 1 // DI Pin's alternate function value
# else
# define WS2812_PWM_PAL_MODE 2 // DI Pin's alternate function value # define WS2812_PWM_PAL_MODE 2 // DI Pin's alternate function value
# endif
#endif #endif
#ifndef WS2812_DMA_STREAM #ifndef WS2812_DMA_STREAM
# if defined(WB32F3G71xx) || defined(WB32FQ95xx)
# define WS2812_DMA_STREAM WB32_DMA1_STREAM1 // DMA Stream for TIMx_UP
# else
# define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA Stream for TIMx_UP # define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA Stream for TIMx_UP
# endif
#endif #endif
#ifndef WS2812_DMA_CHANNEL #ifndef WS2812_DMA_CHANNEL
# if defined(WB32F3G71xx) || defined(WB32FQ95xx)
# define WS2812_DMA_CHANNEL WB32_DMAC_HWHIF_TIM2_UP // DMA Channel for TIM2_UP
# else
# define WS2812_DMA_CHANNEL 2 // DMA Channel for TIMx_UP # define WS2812_DMA_CHANNEL 2 // DMA Channel for TIMx_UP
# endif
#endif #endif
#if (STM32_DMA_SUPPORTS_DMAMUX == TRUE) && !defined(WS2812_DMAMUX_ID) #if (STM32_DMA_SUPPORTS_DMAMUX == TRUE) && !defined(WS2812_DMAMUX_ID)
# error "please consult your MCU's datasheet and specify in your config.h: #define WS2812_DMAMUX_ID STM32_DMAMUX1_TIM?_UP" # error "please consult your MCU's datasheet and specify in your config.h: #define WS2812_DMAMUX_ID STM32_DMAMUX1_TIM?_UP"

View File

@ -5,11 +5,7 @@
// Define the spi your LEDs are plugged to here // Define the spi your LEDs are plugged to here
#ifndef WS2812_SPI #ifndef WS2812_SPI
# if defined(WB32F3G71xx) || defined(WB32FQ95xx)
# define WS2812_SPI SPIDQ
# else
# define WS2812_SPI SPID1 # define WS2812_SPI SPID1
# endif
#endif #endif
#ifndef WS2812_SPI_MOSI_PAL_MODE #ifndef WS2812_SPI_MOSI_PAL_MODE
@ -20,6 +16,10 @@
# define WS2812_SPI_SCK_PAL_MODE 5 # define WS2812_SPI_SCK_PAL_MODE 5
#endif #endif
#ifndef WS2812_SPI_DIVISOR
# define WS2812_SPI_DIVISOR 16
#endif
// Push Pull or Open Drain Configuration // Push Pull or Open Drain Configuration
// Default Push Pull // Default Push Pull
#ifndef WS2812_EXTERNAL_PULLUP #ifndef WS2812_EXTERNAL_PULLUP
@ -46,7 +46,7 @@
# define WS2812_SPI_DIVISOR_CR1_BR_X (SPI_CR1_BR_0) # define WS2812_SPI_DIVISOR_CR1_BR_X (SPI_CR1_BR_0)
#elif WS2812_SPI_DIVISOR == 8 #elif WS2812_SPI_DIVISOR == 8
# define WS2812_SPI_DIVISOR_CR1_BR_X (SPI_CR1_BR_1) # define WS2812_SPI_DIVISOR_CR1_BR_X (SPI_CR1_BR_1)
#elif WS2812_SPI_DIVISOR == 16 // same as default #elif WS2812_SPI_DIVISOR == 16 // default
# define WS2812_SPI_DIVISOR_CR1_BR_X (SPI_CR1_BR_1 | SPI_CR1_BR_0) # define WS2812_SPI_DIVISOR_CR1_BR_X (SPI_CR1_BR_1 | SPI_CR1_BR_0)
#elif WS2812_SPI_DIVISOR == 32 #elif WS2812_SPI_DIVISOR == 32
# define WS2812_SPI_DIVISOR_CR1_BR_X (SPI_CR1_BR_2) # define WS2812_SPI_DIVISOR_CR1_BR_X (SPI_CR1_BR_2)
@ -57,8 +57,7 @@
#elif WS2812_SPI_DIVISOR == 256 #elif WS2812_SPI_DIVISOR == 256
# define WS2812_SPI_DIVISOR_CR1_BR_X (SPI_CR1_BR_2 | SPI_CR1_BR_1 | SPI_CR1_BR_0) # define WS2812_SPI_DIVISOR_CR1_BR_X (SPI_CR1_BR_2 | SPI_CR1_BR_1 | SPI_CR1_BR_0)
#else #else
# define WS2812_SPI_DIVISOR_CR1_BR_X (SPI_CR1_BR_1 | SPI_CR1_BR_0) // default # error "Configured WS2812_SPI_DIVISOR value is not supported at this time."
# define WS2812_SPI_DIVISOR 16
#endif #endif
// Use SPI circular buffer // Use SPI circular buffer