-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat (driver) implement our own LED driver (#141)
* Add from internal repo * Remove c-style casts * Fix stale LEDs * Minor stuff like comments * Update TesLight.cpp * Small fix
- Loading branch information
1 parent
cccad11
commit ee117dd
Showing
38 changed files
with
1,717 additions
and
396 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/** | ||
* @file LedBuffer.h | ||
* @author TheRealKasumi | ||
* @brief Contains a class to manage the LED buffer for multiple LED strips. | ||
* | ||
* @copyright Copyright (c) 2022-2023 TheRealKasumi | ||
* | ||
* This project, including hardware and software, is provided "as is". There is no warranty | ||
* of any kind, express or implied, including but not limited to the warranties of fitness | ||
* for a particular purpose and noninfringement. TheRealKasumi (https://github.com/TheRealKasumi) | ||
* is holding ownership of this project. You are free to use, modify, distribute and contribute | ||
* to this project for private, non-commercial purposes. It is granted to include this hardware | ||
* and software into private, non-commercial projects. However, the source code of any project, | ||
* software and hardware that is including this project must be public and free to use for private | ||
* persons. Any commercial use is hereby strictly prohibited without agreement from the owner. | ||
* By contributing to the project, you agree that the ownership of your work is transferred to | ||
* the project owner and that you lose any claim to your contribute work. This copyright and | ||
* license note applies to all files of this project and must not be removed without agreement | ||
* from the owner. | ||
* | ||
*/ | ||
#ifndef LED_BUFFER_H | ||
#define LED_BUFFER_H | ||
|
||
#include <stdint.h> | ||
#include <stddef.h> | ||
#include <vector> | ||
|
||
#include "LedStrip.h" | ||
|
||
namespace TL | ||
{ | ||
class LedBuffer | ||
{ | ||
public: | ||
LedBuffer(const std::vector<TL::LedStrip> &ledStrips); | ||
~LedBuffer(); | ||
|
||
size_t getBufferSize(); | ||
uint8_t *getBuffer(); | ||
|
||
size_t getTotalLedCount(); | ||
size_t getMaxLedCount(); | ||
|
||
size_t getTotalHiddenLedCount(); | ||
size_t getMaxHiddenLedCount(); | ||
|
||
size_t getLedStripCount(); | ||
TL::LedStrip &getLedStrip(const size_t index); | ||
|
||
private: | ||
std::vector<TL::LedStrip> ledStrips; | ||
size_t totalLedCount; | ||
size_t maxLedCount; | ||
size_t totalHiddenLedCount; | ||
size_t maxHiddenLedCount; | ||
uint8_t *buffer; | ||
}; | ||
} | ||
|
||
#endif |
Oops, something went wrong.