104 lines
3.5 KiB
C++
104 lines
3.5 KiB
C++
// --------------------------------------------------------------------------------------------------------------------
|
|
/// \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_ */
|