1 #include <twr_module_power.h>
2 #include <twr_scheduler.h>
4 #include <twr_ws2812b.h>
6 #define TWR_MODULE_POWER_PIN_RELAY TWR_GPIO_P0
8 static uint32_t _twr_module_power_led_strip_dma_buffer_rgbw_144[144 * 4 * 2];
9 static uint32_t _twr_module_power_led_strip_dma_buffer_rgb_150[150 * 3 * 2];
13 .type = TWR_LED_STRIP_TYPE_RGBW,
15 .buffer = _twr_module_power_led_strip_dma_buffer_rgbw_144
20 .type = TWR_LED_STRIP_TYPE_RGB,
22 .buffer = _twr_module_power_led_strip_dma_buffer_rgb_150
25 #if LED_STRIP_SWAP_RG == 0
29 .init = twr_ws2812b_init,
30 .write = twr_ws2812b_write,
31 .set_pixel = twr_ws2812b_set_pixel_from_uint32,
32 .set_pixel_rgbw = twr_ws2812b_set_pixel_from_rgb,
33 .is_ready = twr_ws2812b_is_ready
40 .init = twr_ws2812b_init,
41 .write = twr_ws2812b_write,
42 .set_pixel = twr_ws2812b_set_pixel_from_uint32_swap_rg,
43 .set_pixel_rgbw = twr_ws2812b_set_pixel_from_rgb_swap_rg,
44 .is_ready = twr_ws2812b_is_ready
61 memset(&_twr_module_power, 0,
sizeof(_twr_module_power));
69 _twr_module_power.relay.on = state;
76 return _twr_module_power.relay.on;
81 return &twr_module_power_led_strip_driver;
void twr_gpio_set_output(twr_gpio_channel_t channel, int state)
Set output state for GPIO channel.
void twr_gpio_init(twr_gpio_channel_t channel)
Initialize GPIO channel.
void twr_gpio_set_mode(twr_gpio_channel_t channel, twr_gpio_mode_t mode)
Set mode of operation for GPIO channel.
@ TWR_GPIO_MODE_OUTPUT
GPIO channel operates as output.
void twr_module_power_relay_set_state(bool state)
Set relay state.
void twr_module_power_init(void)
Initialize power module.
bool twr_module_power_relay_get_state(void)
Set relay state.
const twr_led_strip_driver_t * twr_module_power_get_led_strip_driver(void)
Set relay state.