ESPixelStick Firmware
Firmware for the ESPixelStick
Loading...
Searching...
No Matches
ESPixelStick.h File Reference
#include <Arduino.h>
#include <Ticker.h>
#include <ArduinoJson.h>
#include "memdebug.h"
#include "ConstNames.hpp"
#include "GPIO_Defs.hpp"
#include "FastTimer.hpp"
Include dependency graph for ESPixelStick.h:

Go to the source code of this file.

Classes

struct  config_t
 Core configuration structure. More...
 

Macros

#define ARDUINOJSON_USE_LONG_LONG   1
 
#define ARDUINOJSON_DEFAULT_NESTING_LIMIT   15
 
#define REBOOT_DELAY   100
 Delay for rebooting once reboot flag is set.
 
#define LOG_PORT   Serial
 Serial port for console logging.
 
#define CLIENT_TIMEOUT   15
 In station/client mode try to connection for 15 seconds.
 
#define AP_TIMEOUT   120
 In AP mode, wait 120 seconds for a connection or reboot.
 
#define MilliSecondsInASecond   1000
 
#define MicroSecondsInAmilliSecond   1000
 
#define MicroSecondsInASecond   (MicroSecondsInAmilliSecond * MilliSecondsInASecond)
 
#define NanoSecondsInAMicroSecond   1000
 
#define NanoSecondsInASecond   (MicroSecondsInASecond * NanoSecondsInAMicroSecond)
 
#define NanoSecondsInAMilliSecond   (NanoSecondsInAMicroSecond * MicroSecondsInAmilliSecond)
 
#define CPU_ClockTimeNS   ((1.0 / float(F_CPU)) * float(NanoSecondsInASecond))
 
#define STRINGIFY(X)
 
#define STRING(X)
 
#define JsonWrite(j, n, v)
 
#define logcon(msg)
 
#define LOAD_CONFIG_DELAY   4
 

Functions

void RequestReboot (uint32_t LoopDelay, bool SkipDisable=false)
 
bool RebootInProgress ()
 
String serializeCore (bool pretty=false)
 
void deserializeCoreHandler (JsonDocument &jsonDoc)
 
bool deserializeCore (JsonObject &json)
 
bool dsDevice (JsonObject &json)
 Deserialize device configuration JSON to config structure - returns true if config change detected.
 
bool dsNetwork (JsonObject &json)
 
void FeedWDT ()
 
void PrettyPrint (JsonObject &jsonStuff, String Name)
 
void PrettyPrint (JsonArray &jsonStuff, String Name)
 
void PrettyPrint (JsonDocument &jsonStuff, String Name)
 
template<typename T , typename N >
bool setFromJSON (T &OutValue, JsonObject &Json, N Name)
 
template<typename T , typename N >
bool setFromJSON (T &OutValue, JsonVariant &Json, N Name)
 
void ResetGpio (const gpio_num_t pinId)
 

Variables

bool IsBooting
 
bool ResetWiFi
 
const String ConfigFileName
 
uint32_t DiscardedRxData
 
bool ConsoleUartIsActive
 
config_t config
 
bool ConfigSaveNeeded
 
const uint8_t CurrentConfigVersion
 

Macro Definition Documentation

◆ AP_TIMEOUT

#define AP_TIMEOUT   120

In AP mode, wait 120 seconds for a connection or reboot.

◆ ARDUINOJSON_DEFAULT_NESTING_LIMIT

#define ARDUINOJSON_DEFAULT_NESTING_LIMIT   15

◆ ARDUINOJSON_USE_LONG_LONG

#define ARDUINOJSON_USE_LONG_LONG   1

◆ CLIENT_TIMEOUT

#define CLIENT_TIMEOUT   15

In station/client mode try to connection for 15 seconds.

◆ CPU_ClockTimeNS

#define CPU_ClockTimeNS   ((1.0 / float(F_CPU)) * float(NanoSecondsInASecond))

◆ JsonWrite

#define JsonWrite ( j,
n,
v )
Value:
(j)[(char*)(n)] = (v)

◆ LOAD_CONFIG_DELAY

#define LOAD_CONFIG_DELAY   4

◆ LOG_PORT

#define LOG_PORT   Serial

Serial port for console logging.

◆ logcon

#define logcon ( msg)
Value:
{ \
String DN; \
GetDriverName (DN); \
extern void _logcon (String & DriverName, String Message); \
_logcon (DN, msg); \
}
void _logcon(String &DriverName, String Message)
Definition main.cpp:587

◆ MicroSecondsInAmilliSecond

#define MicroSecondsInAmilliSecond   1000

◆ MicroSecondsInASecond

#define MicroSecondsInASecond   (MicroSecondsInAmilliSecond * MilliSecondsInASecond)

◆ MilliSecondsInASecond

#define MilliSecondsInASecond   1000

◆ NanoSecondsInAMicroSecond

#define NanoSecondsInAMicroSecond   1000

◆ NanoSecondsInAMilliSecond

#define NanoSecondsInAMilliSecond   (NanoSecondsInAMicroSecond * MicroSecondsInAmilliSecond)

◆ NanoSecondsInASecond

#define NanoSecondsInASecond   (MicroSecondsInASecond * NanoSecondsInAMicroSecond)

◆ REBOOT_DELAY

#define REBOOT_DELAY   100

Delay for rebooting once reboot flag is set.

◆ STRING

#define STRING ( X)
Value:
#define STRINGIFY(X)
Definition ESPixelStick.h:61

◆ STRINGIFY

#define STRINGIFY ( X)
Value:
#X

Function Documentation

◆ deserializeCore()

bool deserializeCore ( JsonObject & json)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ deserializeCoreHandler()

void deserializeCoreHandler ( JsonDocument & jsonDoc)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dsDevice()

bool dsDevice ( JsonObject & json)

Deserialize device configuration JSON to config structure - returns true if config change detected.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dsNetwork()

bool dsNetwork ( JsonObject & json)

◆ FeedWDT()

void FeedWDT ( )
extern
Here is the caller graph for this function:

◆ PrettyPrint() [1/3]

void PrettyPrint ( JsonArray & jsonStuff,
String Name )
extern

◆ PrettyPrint() [2/3]

void PrettyPrint ( JsonDocument & jsonStuff,
String Name )
extern
Here is the caller graph for this function:

◆ PrettyPrint() [3/3]

void PrettyPrint ( JsonObject & jsonStuff,
String Name )
extern
Here is the caller graph for this function:

◆ RebootInProgress()

bool RebootInProgress ( )
extern
Here is the caller graph for this function:

◆ RequestReboot()

void RequestReboot ( uint32_t LoopDelay,
bool SkipDisable = false )
extern
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ResetGpio()

void ResetGpio ( const gpio_num_t pinId)
inline
Here is the caller graph for this function:

◆ serializeCore()

String serializeCore ( bool pretty = false)
Here is the call graph for this function:

◆ setFromJSON() [1/2]

template<typename T , typename N >
bool setFromJSON ( T & OutValue,
JsonObject & Json,
N Name )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setFromJSON() [2/2]

template<typename T , typename N >
bool setFromJSON ( T & OutValue,
JsonVariant & Json,
N Name )
Here is the call graph for this function:

Variable Documentation

◆ config

config_t config
extern

◆ ConfigFileName

const String ConfigFileName
extern

◆ ConfigSaveNeeded

bool ConfigSaveNeeded
extern

◆ ConsoleUartIsActive

bool ConsoleUartIsActive
extern

◆ CurrentConfigVersion

const uint8_t CurrentConfigVersion
extern

◆ DiscardedRxData

uint32_t DiscardedRxData
extern

◆ IsBooting

bool IsBooting
extern

◆ ResetWiFi

bool ResetWiFi
extern