1
0
Fork 0

STM32 WS2812 Open Drain Configuration (#9414)

* update docs stm32 only and applies  to all 3 driver
* cformat
This commit is contained in:
Xelus22 2020-06-19 22:35:32 +00:00 committed by GitHub
parent b43bdc1c69
commit c785148445
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 54 additions and 11 deletions

View file

@ -14,6 +14,14 @@
# endif
#endif
// Push Pull or Open Drain Configuration
// Default Push Pull
#ifndef WS2812_EXTERNAL_PULLUP
# define WS2812_OUTPUT_MODE PAL_MODE_OUTPUT_PUSHPULL
#else
# define WS2812_OUTPUT_MODE PAL_MODE_OUTPUT_OPENDRAIN
#endif
#define NUMBER_NOPS 6
#define CYCLES_PER_SEC (STM32_SYSCLK / NUMBER_NOPS * NOP_FUDGE)
#define NS_PER_SEC (1000000000L) // Note that this has to be SIGNED since we want to be able to check for negative values of derivatives
@ -66,7 +74,7 @@ void sendByte(uint8_t byte) {
}
}
void ws2812_init(void) { setPinOutput(RGB_DI_PIN); }
void ws2812_init(void) { palSetLineMode(RGB_DI_PIN, WS2812_OUTPUT_MODE); }
// Setleds for standard RGB
void ws2812_setleds(LED_TYPE *ledarray, uint16_t leds) {