ESPixelStick Firmware
Firmware for the ESPixelStick
Loading...
Searching...
No Matches
OutputTM1814Uart.hpp
Go to the documentation of this file.
1#pragma once
2/*
3* OutputTM1814Uart.h - TM1814 driver code for ESPixelStick UART
4*
5* Project: ESPixelStick - An ESP8266 / ESP32 and E1.31 based pixel driver
6* Copyright (c) 2015, 2022 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
25#include "ESPixelStick.h"
26#if defined(SUPPORT_OutputProtocol_TM1814) && defined(SUPPORT_UART)
27
28#include "OutputTM1814.hpp"
29#include "OutputUart.hpp"
30
31class c_OutputTM1814Uart : public c_OutputTM1814
32{
33public:
34 // These functions are inherited from c_OutputCommon
35 c_OutputTM1814Uart (OM_OutputPortDefinition_t & OutputPortDefinition,
37 virtual ~c_OutputTM1814Uart ();
38
39 // functions to be provided by the derived class
40 // functions to be provided by the derived class
41 void Begin ();
42 uint32_t Poll ();
43 void PauseOutput (bool State);
44 bool SetConfig (ArduinoJson::JsonObject& jsonConfig);
45 void GetConfig (ArduinoJson::JsonObject& jsonConfig);
46 void GetStatus (ArduinoJson::JsonObject& jsonStatus);
47
48private:
49 c_OutputUart Uart;
50
51#define TM1814_DATA_RATE (800000.0)
52
53#define TM1814_NUM_DATA_BITS_PER_INTENSITY_BIT 11
54#define TM1814_NUM_DATA_BYTES_PER_INTENSITY_BYTE 8
55#define TM1814_BAUD_RATE int(TM1814_DATA_RATE * TM1814_NUM_DATA_BITS_PER_INTENSITY_BIT)
56
57}; // c_OutputTM1814Uart
58
59#endif // defined(SUPPORT_OutputProtocol_TM1814) && defined(SUPPORT_UART)
e_OutputProtocolType
Definition OutputMgr.hpp:87
void GetConfig(JsonObject &json)
Definition main.cpp:507
void SetConfig(const char *DataString)
Definition main.cpp:329
Definition OutputMgrPortDefs.hpp:90