Added the Matrix handling and clock/day wordmaps

Time and day display is functional again
This commit is contained in:
Matthias Mitscherlich
2024-03-21 16:39:20 +01:00
parent ac8505a157
commit 0fcd60ff57
17 changed files with 498 additions and 571 deletions
+113
View File
@@ -0,0 +1,113 @@
// --------------------------------------------------------------------------------------------------------------------
/// \file ledmatrix.h
/// \brief File description
// --------------------------------------------------------------------------------------------------------------------
//
// vbchaos software design
//
// --------------------------------------------------------------------------------------------------------------------
/// $Revision: $
/// $Author: $
/// $Date: $
// (c) 2023 vbchaos
// --------------------------------------------------------------------------------------------------------------------
#ifndef MAIN_PLATFORM_INC_LEDMATRIX_H_
#define MAIN_PLATFORM_INC_LEDMATRIX_H_
/**
* ledmatrix implementation
* \defgroup ledmatrix
* \brief {group_description}
* \addtogroup {Layer}
*
* Detailed description
* @{
*/
// --------------------------------------------------------------------------------------------------------------------
// Include files
// --------------------------------------------------------------------------------------------------------------------
// CompilerIncludes
// All include files that are provided by the compiler directly
// ProjectIncludes
// All include files that are provided by the project
#include "prgm_ledstrip.h"
// --------------------------------------------------------------------------------------------------------------------
// Constant and macro definitions
// --------------------------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// Type definitions.
// --------------------------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// Function declarations
// --------------------------------------------------------------------------------------------------------------------
class ledmatrix : public prgm_ledstrip
{
// -----------------------------------------------------------------------------------------------------------------
// Public Section
// -----------------------------------------------------------------------------------------------------------------
public:
typedef enum
{
ORIENTATION_ROW_LEFT_UP = 0,
ORIENTATION_ROW_LEFT_DOWN = 1,
ORIENTATION_ROW_RIGHT_UP = 2,
ORIENTATION_ROW_RIGHT_DOWN = 3,
ORIENTATION_COL_LEFT_UP = 4,
ORIENTATION_COL_LEFT_DOWN = 5,
ORIENTATION_COL_RIGHT_UP = 6,
ORIENTATION_COL_RIGHT_DOWN = 7,
ORIENTATION_END = 8
} Orientation_t;
struct coordinate
{
uint32_t x;
uint32_t y;
};
// Class Constructor
ledmatrix(uint32_t rows, uint32_t columns, uint32_t gpio);
FunctionStatus setOrientation(Orientation_t orientation);
FunctionStatus setPixel(uint32_t row, uint32_t column, uint8_t red, uint8_t green, uint8_t blue);
// -----------------------------------------------------------------------------------------------------------------
// Protected Section
// -----------------------------------------------------------------------------------------------------------------
protected:
// -----------------------------------------------------------------------------------------------------------------
// Private Section
// -----------------------------------------------------------------------------------------------------------------
private:
uint32_t width;
uint32_t highth;
Orientation_t orientation;
FunctionStatus calculateIndexFromCoordinates(uint32_t row, uint32_t column, uint32_t* index);
};
/** @} */
#endif /* MAIN_PLATFORM_INC_LEDMATRIX_H_ */
+8
View File
@@ -76,7 +76,15 @@ class prgm_ledstrip
// Class Constructor
prgm_ledstrip(uint32_t numberOfLEDs, uint32_t gpio);
// Set and clear functions only update the pixel value(s) locally but do not push the values to the strip
FunctionStatus setPixel(struct pixel& pixel);
FunctionStatus clearAll(void);
// Clears all pixels locally and automatically pushes the values to the strip
FunctionStatus clearAndUpdate(void);
// Push the latest pixel values to the strip
FunctionStatus update(void);
// -----------------------------------------------------------------------------------------------------------------
// Protected Section