added a new LEDstrip module based on the espressif component

This commit is contained in:
Matthias Mitscherlich
2024-03-20 16:57:08 +01:00
parent 4b26e6080f
commit ac8505a157
10 changed files with 1118 additions and 1201 deletions
+103
View File
@@ -0,0 +1,103 @@
// --------------------------------------------------------------------------------------------------------------------
/// \file prgm_ledstrip.h
/// \brief File description
// --------------------------------------------------------------------------------------------------------------------
//
// vbchaos software design
//
// --------------------------------------------------------------------------------------------------------------------
/// $Revision: $
/// $Author: $
/// $Date: $
// (c) 2023 vbchaos
// --------------------------------------------------------------------------------------------------------------------
#ifndef MAIN_PLATFORM_INC_PRGM_LEDSTRIP_H_
#define MAIN_PLATFORM_INC_PRGM_LEDSTRIP_H_
/**
* prgm_ledstrip implementation
* \defgroup prgm_ledstrip
* \brief {group_description}
* \addtogroup {Layer}
*
* Detailed description
* @{
*/
// --------------------------------------------------------------------------------------------------------------------
// Include files
// --------------------------------------------------------------------------------------------------------------------
// CompilerIncludes
// All include files that are provided by the compiler directly
#include <stdint.h>
// ProjectIncludes
// All include files that are provided by the project
#include "FunctionStatus.h"
#include "led_strip.h"
// --------------------------------------------------------------------------------------------------------------------
// Constant and macro definitions
// --------------------------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// Type definitions.
// --------------------------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// Function declarations
// --------------------------------------------------------------------------------------------------------------------
class prgm_ledstrip
{
// -----------------------------------------------------------------------------------------------------------------
// Public Section
// -----------------------------------------------------------------------------------------------------------------
public:
struct pixel
{
uint32_t index;
uint8_t red;
uint8_t green;
uint8_t blue;
};
// Class Constructor
prgm_ledstrip(uint32_t numberOfLEDs, uint32_t gpio);
FunctionStatus setPixel(struct pixel& pixel);
// -----------------------------------------------------------------------------------------------------------------
// Protected Section
// -----------------------------------------------------------------------------------------------------------------
protected:
// -----------------------------------------------------------------------------------------------------------------
// Private Section
// -----------------------------------------------------------------------------------------------------------------
private:
uint32_t numberOfLEDs;
uint32_t gpio;
led_strip_handle_t led_strip;
led_strip_config_t strip_config;
led_strip_rmt_config_t rmt_config;
};
/** @} */
#endif /* MAIN_PLATFORM_INC_PRGM_LEDSTRIP_H_ */