Let the SEGFAULTS begin!
Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
5
components/led_matrix/CMakeLists.txt
Normal file
5
components/led_matrix/CMakeLists.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
idf_component_register(SRCS "led_matrix.c"
|
||||
INCLUDE_DIRS "include"
|
||||
PRIV_REQUIRES
|
||||
led_strip
|
||||
)
|
17
components/led_matrix/idf_component.yml
Normal file
17
components/led_matrix/idf_component.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
## IDF Component Manager Manifest File
|
||||
dependencies:
|
||||
## Required IDF version
|
||||
idf:
|
||||
version: '>=4.1.0'
|
||||
# # Put list of dependencies here
|
||||
# # For components maintained by Espressif:
|
||||
# component: "~1.0.0"
|
||||
# # For 3rd party components:
|
||||
# username/component: ">=1.0.0,<2.0.0"
|
||||
# username2/component2:
|
||||
# version: "~1.0.0"
|
||||
# # For transient dependencies `public` flag can be set.
|
||||
# # `public` flag doesn't have an effect dependencies of the `main` component.
|
||||
# # All dependencies of `main` are public by default.
|
||||
# public: true
|
||||
espressif/led_strip: '~3.0.0'
|
3
components/led_matrix/include/led_matrix.h
Normal file
3
components/led_matrix/include/led_matrix.h
Normal file
@@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
void init_led(void);
|
39
components/led_matrix/led_matrix.c
Normal file
39
components/led_matrix/led_matrix.c
Normal file
@@ -0,0 +1,39 @@
|
||||
#include <stdio.h>
|
||||
#include "led_matrix.h"
|
||||
|
||||
#include "led_strip.h"
|
||||
|
||||
#define LED_STRIP_RMT_RES_HZ (10 * 1000 * 1000)
|
||||
|
||||
led_strip_handle_t led_strip_init(uint8_t gpio_pin, uint32_t width, uint32_t height)
|
||||
{
|
||||
led_strip_config_t strip_config = {
|
||||
.strip_gpio_num = gpio_pin,
|
||||
.max_leds = width * height,
|
||||
.led_model = LED_MODEL_WS2812,
|
||||
.color_component_format = LED_STRIP_COLOR_COMPONENT_FMT_RGB,
|
||||
.flags = {
|
||||
.invert_out = false,
|
||||
}};
|
||||
|
||||
led_strip_rmt_config_t rmt_config = {
|
||||
.clk_src = RMT_CLK_SRC_DEFAULT,
|
||||
.resolution_hz = LED_STRIP_RMT_RES_HZ,
|
||||
.mem_block_symbols = 64,
|
||||
.flags = {
|
||||
.with_dma = true,
|
||||
}};
|
||||
|
||||
led_strip_handle_t led_strip;
|
||||
ESP_ERROR_CHECK(led_strip_new_rmt_device(&strip_config, &rmt_config, &led_strip));
|
||||
return led_strip;
|
||||
}
|
||||
|
||||
void init_led(void)
|
||||
{
|
||||
led_strip_handle_t led = led_strip_init(14, 8, 8);
|
||||
// led_strip_set_pixel(led, 0, 255, 0, 0);
|
||||
// led_strip_set_pixel(led, 1, 0, 255, 0);
|
||||
// led_strip_set_pixel(led, 2, 0, 0, 255);
|
||||
led_strip_refresh(led);
|
||||
}
|
2
components/remote_control/CMakeLists.txt
Normal file
2
components/remote_control/CMakeLists.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
idf_component_register(SRCS "remote_control.c"
|
||||
INCLUDE_DIRS "include")
|
1
components/remote_control/include/remote_control.h
Normal file
1
components/remote_control/include/remote_control.h
Normal file
@@ -0,0 +1 @@
|
||||
void func(void);
|
7
components/remote_control/remote_control.c
Normal file
7
components/remote_control/remote_control.c
Normal file
@@ -0,0 +1,7 @@
|
||||
#include <stdio.h>
|
||||
#include "remote_control.h"
|
||||
|
||||
void func(void)
|
||||
{
|
||||
|
||||
}
|
Reference in New Issue
Block a user