ESPixelStick Firmware
Firmware for the ESPixelStick
Loading...
Searching...
No Matches
OutputTLS3001Rmt.hpp
Go to the documentation of this file.
1#pragma once
2/*
3* OutputTLS3001Rmt.h - TLS3001 driver code for ESPixelStick RMT Channel
4*
5* Project: ESPixelStick - An ESP8266 / ESP32 and E1.31 based pixel driver
6* Copyright (c) 2015, 2025 Shelby Merrick
7* http://www.forkineye.com
8*
9* This program is provided free for you to use in any way that you wish,
10* subject to the laws and regulations where you are using it. Due diligence
11* is strongly suggested before using this code. Please give credit where due.
12*
13* The Author makes no warranty of any kind, express or implied, with regard
14* to this program or the documentation contained in this document. The
15* Author shall not be liable in any event for incidental or consequential
16* damages in connection with, or arising out of, the furnishing, performance
17* or use of these programs.
18*
19* This is a derived class that converts data in the output buffer into
20* pixel intensities and then transmits them through the configured serial
21* interface.
22*
23*/
24#include "ESPixelStick.h"
25#if defined(SUPPORT_OutputType_TLS3001) && defined (ARDUINO_ARCH_ESP32)
26
27#include "OutputTLS3001.hpp"
28#include "OutputRmt.hpp"
29
30class fsm_RMT_state
31{
32public:
33 fsm_RMT_state() {}
34 virtual ~fsm_RMT_state() {}
35 virtual void Init(c_OutputTLS3001Rmt *Parent) = 0;
36 virtual void Poll (c_OutputTLS3001Rmt * Parent) = 0;
37 uint32_t FsmTimerStartTime = 0;
38 void GetDriverName (String& Name) { Name = "TLS3001"; }
39
40}; // fsm_RMT_state
41
42class c_OutputTLS3001Rmt : public c_OutputTLS3001
43{
44public:
45 // These functions are inherited from c_OutputCommon
46 c_OutputTLS3001Rmt (c_OutputMgr::e_OutputChannelIds OutputChannelId,
47 gpio_num_t outputGpio,
48 uart_port_t uart,
49 c_OutputMgr::e_OutputType outputType);
50 virtual ~c_OutputTLS3001Rmt ();
51
52 // functions to be provided by the derived class
53 void Begin ();
54 bool SetConfig (ArduinoJson::JsonObject& jsonConfig);
55 void Poll ();
56 bool RmtPoll ();
57 void GetStatus (ArduinoJson::JsonObject& jsonStatus);
58 void SetOutputBufferSize (uint32_t NumChannelsAvailable);
59 void PauseOutput(bool State);
60
61private:
62
63
64protected:
65 friend class fsm_RMT_state_SendReset;
66 friend class fsm_RMT_state_SendStart;
67 friend class fsm_RMT_state_SendData;
68 friend class fsm_RMT_state;
69 fsm_RMT_state * pCurrentFsmState = nullptr;
70
71 c_OutputRmt Rmt;
72
73}; // c_OutputTLS3001Rmt
74
75/*****************************************************************************/
76/*
77* Generic fsm base class.
78*/
79/*****************************************************************************/
80/*****************************************************************************/
81class fsm_RMT_state_SendReset : public fsm_RMT_state
82{
83public:
84 fsm_RMT_state_SendReset() {}
85 virtual ~fsm_RMT_state_SendReset() {}
86 virtual void Init(c_OutputTLS3001Rmt *Parent);
87 virtual void Poll (c_OutputTLS3001Rmt * Parent);
88
89}; // fsm_RMT_state_SendReset
90
91/*****************************************************************************/
92class fsm_RMT_state_SendStart : public fsm_RMT_state
93{
94public:
95 fsm_RMT_state_SendStart() {}
96 virtual ~fsm_RMT_state_SendStart() {}
97 virtual void Init(c_OutputTLS3001Rmt *Parent);
98 virtual void Poll (c_OutputTLS3001Rmt * Parent);
99
100}; // fsm_RMT_state_SendStart
101
102/*****************************************************************************/
103class fsm_RMT_state_SendData : public fsm_RMT_state
104{
105public:
106 fsm_RMT_state_SendData() {}
107 virtual ~fsm_RMT_state_SendData() {}
108 virtual void Init(c_OutputTLS3001Rmt *Parent);
109 virtual void Poll (c_OutputTLS3001Rmt * Parent);
110private:
111 uint32_t FrameCount = 0;
112
113}; // fsm_RMT_state_SendData
114
115#endif // defined(SUPPORT_OutputType_TLS3001) && defined (ARDUINO_ARCH_ESP32)
e_OutputChannelIds
Definition OutputMgr.hpp:67
e_OutputType
Definition OutputMgr.hpp:126
void GetDriverName(String &Name)
Definition main.cpp:115
void SetConfig(const char *DataString)
Definition main.cpp:286