Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
#include <hal.h>
#include "modules/light/light_ws2812_arch.h"
#include "mcu_periph/hal_stm32_dma.h"
#include "mcu_periph/gpio.h"
#include <BOARD_CONFIG>
Go to the source code of this file.
Data Structures | |
struct | WS2812Config |
Configuration structure. More... | |
struct | WS2812Driver |
Driver structure. More... | |
Macros | |
#define | WS2812_SERVO_HZ 800000 |
#define | WS2812_PWM_FREQUENCY (STM32_SYSCLK/2) |
#define | WS2812_DUTYCYCLE_0 (WS2812_PWM_FREQUENCY/(1000000000/350)) |
#define | WS2812_DUTYCYCLE_1 (WS2812_PWM_FREQUENCY/(1000000000/800)) |
#define | WS2812_RESET_BIT_N (50) |
#define | WS2812_COLOR_BIT_N (WS2812_NB_LEDS * 24) |
#define | WS2812_BIT_N (WS2812_COLOR_BIT_N + WS2812_RESET_BIT_N) |
#define | WS2812_GPIO WS2812D1_GPIO |
#define | WS2812_PIN WS2812D1_PIN |
#define | WS2812_AF WS2812D1_AF |
#define | WS2812_CFG_DEF WS2812D1_CFG_DEF |
#define | WS2812_DMA_IRQ_PRIORITY 6 |
#define | WS2812_BIT(led, byte, bit) (24*(led) + 8*(byte) + (7 - (bit))) |
#define | WS2812_RED_BIT(led, bit) WS2812_BIT((led), 1, (bit)) |
#define | WS2812_GREEN_BIT(led, bit) WS2812_BIT((led), 0, (bit)) |
#define | WS2812_BLUE_BIT(led, bit) WS2812_BIT((led), 2, (bit)) |
Functions | |
void | light_ws2812_arch_init (void) |
void | light_ws2812_arch_set (uint32_t led_number, uint8_t r, uint8_t g, uint8_t b) |
set color RGB color of one led More... | |
Variables | |
static WS2812Config | WS2812CFG = WS2812_CFG_DEF |
static WS2812Driver | WS2812D |
struct WS2812Config |
struct WS2812Driver |
Driver structure.
Definition at line 77 of file light_ws2812_arch.c.
Data Fields | ||
---|---|---|
uint32_t | buf[WS2812_BIT_N+1] | |
const WS2812Config * | config | |
DMAConfig | dma_conf | |
DMADriver | dmap | |
PWMConfig | pwm_conf |
#define WS2812_AF WS2812D1_AF |
Definition at line 54 of file light_ws2812_arch.c.
Definition at line 156 of file light_ws2812_arch.c.
#define WS2812_BIT_N (WS2812_COLOR_BIT_N + WS2812_RESET_BIT_N) |
Definition at line 48 of file light_ws2812_arch.c.
#define WS2812_BLUE_BIT | ( | led, | |
bit | |||
) | WS2812_BIT((led), 2, (bit)) |
Definition at line 159 of file light_ws2812_arch.c.
#define WS2812_CFG_DEF WS2812D1_CFG_DEF |
Definition at line 55 of file light_ws2812_arch.c.
#define WS2812_COLOR_BIT_N (WS2812_NB_LEDS * 24) |
Definition at line 47 of file light_ws2812_arch.c.
#define WS2812_DMA_IRQ_PRIORITY 6 |
Definition at line 58 of file light_ws2812_arch.c.
#define WS2812_DUTYCYCLE_0 (WS2812_PWM_FREQUENCY/(1000000000/350)) |
Definition at line 43 of file light_ws2812_arch.c.
#define WS2812_DUTYCYCLE_1 (WS2812_PWM_FREQUENCY/(1000000000/800)) |
Definition at line 44 of file light_ws2812_arch.c.
#define WS2812_GPIO WS2812D1_GPIO |
Definition at line 52 of file light_ws2812_arch.c.
#define WS2812_GREEN_BIT | ( | led, | |
bit | |||
) | WS2812_BIT((led), 0, (bit)) |
Definition at line 158 of file light_ws2812_arch.c.
#define WS2812_PIN WS2812D1_PIN |
Definition at line 53 of file light_ws2812_arch.c.
#define WS2812_PWM_FREQUENCY (STM32_SYSCLK/2) |
Definition at line 41 of file light_ws2812_arch.c.
#define WS2812_RED_BIT | ( | led, | |
bit | |||
) | WS2812_BIT((led), 1, (bit)) |
Definition at line 157 of file light_ws2812_arch.c.
#define WS2812_RESET_BIT_N (50) |
Definition at line 46 of file light_ws2812_arch.c.
#define WS2812_SERVO_HZ 800000 |
Definition at line 40 of file light_ws2812_arch.c.
void light_ws2812_arch_init | ( | void | ) |
Definition at line 88 of file light_ws2812_arch.c.
References WS2812Driver::buf, WS2812Driver::config, WS2812Config::dma_channel, WS2812Driver::dma_conf, DMA_CONTINUOUS_HALF_BUFFER, DMA_DIR_M2P, WS2812Config::dma_priority, WS2812Config::dma_stream, dmaObjectInit(), WS2812Driver::dmap, dmaStart(), dmaStartTransfert(), gpio_setup_pin_af(), WS2812Config::pwm_channel, WS2812Driver::pwm_conf, WS2812Config::pwmp, DMAConfig::stream, WS2812_AF, WS2812_BIT_N, WS2812_COLOR_BIT_N, WS2812_DMA_IRQ_PRIORITY, WS2812_DUTYCYCLE_0, WS2812_GPIO, WS2812_PIN, WS2812_PWM_FREQUENCY, WS2812_RESET_BIT_N, WS2812_SERVO_HZ, WS2812CFG, and WS2812D.
Referenced by light_scheduler_init().
set color RGB color of one led
Definition at line 161 of file light_ws2812_arch.c.
References b, WS2812Driver::buf, g, WS2812_BLUE_BIT, WS2812_DUTYCYCLE_0, WS2812_DUTYCYCLE_1, WS2812_GREEN_BIT, WS2812_NB_LEDS, WS2812_RED_BIT, and WS2812D.
Referenced by light_scheduler_periodic().
|
static |
Definition at line 72 of file light_ws2812_arch.c.
Referenced by light_ws2812_arch_init().
|
static |
Definition at line 86 of file light_ws2812_arch.c.
Referenced by light_ws2812_arch_init(), and light_ws2812_arch_set().