libzedmd
Public Member Functions | List of all members
ZeDMD Class Reference

Public Member Functions

void SetLogCallback (ZeDMD_LogCallback callback, const void *userData)
 
void IgnoreDevice (const char *const ignore_device)
 Ignore a serial device when searching for ZeDMD. More...
 
void SetDevice (const char *const device)
 Use a specific serial device for ZeDMD. More...
 
bool Open ()
 Open the connection to ZeDMD. More...
 
bool Open (uint16_t width, uint16_t height)
 Open the connection to ZeDMD. More...
 
bool OpenWiFi (const char *ip, int port)
 Open a WiFi connection to ZeDMD. More...
 
void Close ()
 Close connection to ZeDMD. More...
 
void Reset ()
 Reset ZeDMD. More...
 
void SetFrameSize (uint16_t width, uint16_t height)
 Set the frame size. More...
 
uint16_t const GetWidth ()
 Get the physical panel width. More...
 
uint16_t const GetHeight ()
 Get the physical panel height. More...
 
bool const IsS3 ()
 Does ZeDMD run on an ESP32 S3? More...
 
void SetPalette (uint8_t *pPalette, uint8_t numColors)
 Set the palette. More...
 
void SetPalette (uint8_t *pPalette)
 Set the 4 color palette. More...
 
void SetDefaultPalette (uint8_t bitDepth)
 Set the default palette. More...
 
uint8_t * GetDefaultPalette (uint8_t bitDepth)
 Get the default palette. More...
 
void LedTest ()
 Test the panels attached to ZeDMD. More...
 
void EnableDebug ()
 Enable debug mode. More...
 
void DisableDebug ()
 Disable debug mode. More...
 
void SetRGBOrder (uint8_t rgbOrder)
 Set the RGB order. More...
 
void SetBrightness (uint8_t brightness)
 Set the brightness. More...
 
void SetWiFiSSID (const char *const ssid)
 Set the WiFi SSID. More...
 
void SetWiFiPassword (const char *const password)
 Set the WiFi Password. More...
 
void SetWiFiPort (int port)
 Set the WiFi Port. More...
 
void SaveSettings ()
 Save the current setting. More...
 
void EnablePreDownscaling ()
 Enable downscaling on the client side. More...
 
void DisablePreDownscaling ()
 Disable downscaling on the client side. More...
 
void EnablePreUpscaling ()
 Enable upscaling on the client side. More...
 
void DisablePreUpscaling ()
 Disable downscaling on the client side. More...
 
void EnableUpscaling ()
 Enable upscaling on ZeDMD itself. More...
 
void DisableUpscaling ()
 Disable upscaling on ZeDMD itself. More...
 
void EnforceStreaming ()
 Enforce zone streaming. More...
 
void DisableRGB24Streaming ()
 Disable zone streaming for RGB24. More...
 
void ClearScreen ()
 Clear the screen. More...
 
void RenderGray2 (uint8_t *frame)
 Render a 2 bit gray scaled frame. More...
 
void RenderGray4 (uint8_t *frame)
 Render a 4 bit gray scaled frame. More...
 
void RenderColoredGray6 (uint8_t *frame, uint8_t *rotations)
 Render a 6 bit frame. More...
 
void RenderColoredGray6 (uint8_t *frame, uint8_t *palette, uint8_t *rotations)
 Render a 6 bit frame. More...
 
void RenderRgb24 (uint8_t *frame)
 Render a RGB24 frame. More...
 
void RenderRgb24EncodedAs565 (uint8_t *frame)
 Render a RGB24 frame. More...
 
void RenderRgb24EncodedAs16 (uint8_t *frame)
 Render a RGB24 frame. More...
 
void RenderRgb565 (uint16_t *frame)
 Render a RGB565 frame. More...
 
void RenderRgb16 (uint16_t *frame)
 Render a RGB16 frame. More...
 

Member Function Documentation

◆ ClearScreen()

void ZeDMD::ClearScreen ( )

Clear the screen.

Turn off all pixels of ZeDMD, so a blank black screen will be shown.

◆ Close()

void ZeDMD::Close ( )

Close connection to ZeDMD.

Close connection to ZeDMD.

◆ DisableDebug()

void ZeDMD::DisableDebug ( )

Disable debug mode.

See also
EnableDebug()

◆ DisablePreDownscaling()

void ZeDMD::DisablePreDownscaling ( )

Disable downscaling on the client side.

See also
EnablePreDownscaling()

◆ DisablePreUpscaling()

void ZeDMD::DisablePreUpscaling ( )

Disable downscaling on the client side.

See also
EnablePreUpscaling()

◆ DisableRGB24Streaming()

void ZeDMD::DisableRGB24Streaming ( )

Disable zone streaming for RGB24.

By default, "zone streaming" is used for RenderRgb24(). That could be turned off using this function.

See also
EnforceStreaming()

◆ DisableUpscaling()

void ZeDMD::DisableUpscaling ( )

Disable upscaling on ZeDMD itself.

See also
EnableUpscaling()

◆ EnableDebug()

void ZeDMD::EnableDebug ( )

Enable debug mode.

ZeDMD will display various debug information as overlay to the displayed frame.

See also
https://github.com/PPUC/ZeDMD

◆ EnablePreDownscaling()

void ZeDMD::EnablePreDownscaling ( )

Enable downscaling on the client side.

If enabled, the content will centered and scaled down to fit into the physical dimensions of the ZeDMD panels, before the content gets send to ZeDMD, if required.

◆ EnablePreUpscaling()

void ZeDMD::EnablePreUpscaling ( )

Enable upscaling on the client side.

If enabled, the content will centered and scaled up to fit into the physical dimensions of the ZeDMD panels, before the content gets send to ZeDMD, if required.

◆ EnableUpscaling()

void ZeDMD::EnableUpscaling ( )

Enable upscaling on ZeDMD itself.

If enabled and required, the content will centered and scaled up to fit into the physical dimensions of the ZeDMD panels by ZeDMD itself. Compared to EnablePreUpscaling(), less data needs to be send to ZeDMD and this might resut in a higher frame rate. But this optimized variant won't work with zone streaming modes.

See also
EnforceStreaming()
DisableRGB24Streaming()
RenderRgb24EncodedAs565()

◆ EnforceStreaming()

void ZeDMD::EnforceStreaming ( )

Enforce zone streaming.

ZeDMD has two different render modes. One renders entire frames. This is the classic way and works pretty well. The other one is "zone streaming" which will be enable by this function. Zone streaming divides a frame into rectangular zones and only updates zones that have changes compared to the previous frame. This method results in less data that needs to be transfered and in smoother animations. But it takes a bit longer if the entire frame changes. Zone streaming is the default for RenderRGB24() and RenderRgb24EncodedAs565(). All other modes use the classic way by default unless EnforceStreaming() is called.

See also
RenderGray2()
RenderGray4()
RenderColoredGray6()
RenderRgb24()
DisableRGB24Streaming()

◆ GetDefaultPalette()

uint8_t * ZeDMD::GetDefaultPalette ( uint8_t  bitDepth)

Get the default palette.

Get the values of a default palette of shades of orange.

Parameters
bitDepththe bit depth, 2 means 4 colors, 4 means 16 colors
Returns
RGB array

◆ GetHeight()

uint16_t const ZeDMD::GetHeight ( )

Get the physical panel height.

Get the height of the physical dimensions of the LED panels.

Returns
height

◆ GetWidth()

uint16_t const ZeDMD::GetWidth ( )

Get the physical panel width.

Get the width of the physical dimensions of the LED panels.

Returns
width

◆ IgnoreDevice()

void ZeDMD::IgnoreDevice ( const char *const  ignore_device)

Ignore a serial device when searching for ZeDMD.

While searching for a ZeDMD any serial ports are tested. This could cause trouble with other devices attached via USB or serial ports. Using this mfunction, a serial device could be excluded from the scan. This function could be called multiple times to ignore multiple devices. Another option to limit the searching is to use SetDevice().

See also
SetDevice()
Open()
Parameters
ignore_devicethe device to ignore

◆ IsS3()

bool const ZeDMD::IsS3 ( )

Does ZeDMD run on an ESP32 S3?

On an ESP32 S3 a native USB connection is used to increase the bandwidth. Furthermore double buffering is active.

Returns
true if an ESP32 S3 is used.

◆ LedTest()

void ZeDMD::LedTest ( )

Test the panels attached to ZeDMD.

Renders a sequence of full red, full green and full blue frames.

◆ Open() [1/2]

bool ZeDMD::Open ( )

Open the connection to ZeDMD.

Open a cennection to ZeDMD. Therefore all serial ports will be scanned. Use IgnoreDevice() to exclude one or more specific serial devices during that scan. Use SetDevice() to omit the the scan and to use a specific seriel device instead.

See also
IgnoreDevice()
SetDevice()

◆ Open() [2/2]

bool ZeDMD::Open ( uint16_t  width,
uint16_t  height 
)

Open the connection to ZeDMD.

Backward compatibiility version of Open() which additionally sets the frame size. Use Open() and SetFrameSize() instead.

See also
Open()
SetFrameSize()
Deprecated:
Parameters
widththe frame width
heightthe frame height

◆ OpenWiFi()

bool ZeDMD::OpenWiFi ( const char *  ip,
int  port 
)

Open a WiFi connection to ZeDMD.

ZeDMD could be connected via WiFi instead of USB. The WiFi settings need to be stored in ZeDMD's EEPROM first using a USB connection.

See also
Open()
SetWiFiSSID()
SetWiFiPassword()
SetWiFiPort()
SaveSettings()
Parameters
ipthe IPv4 address of the ZeDMD device
portthe port

◆ RenderColoredGray6() [1/2]

void ZeDMD::RenderColoredGray6 ( uint8_t *  frame,
uint8_t *  palette,
uint8_t *  rotations 
)

Render a 6 bit frame.

Renders a 6 bit(indexed) frame using 64 colors. In oposite to standrad RenderColoredGray6(), the colors will not be used from the current palette set via SetPalette() but form the one provided to this function. ZeDMD is able to rotate parts of the palette natively as defined by the Serum format until the next frame is received.

Parameters
framethe indexed frame
palettethe colors to use
rotationsoptional rotation command array according to the Serum format

◆ RenderColoredGray6() [2/2]

void ZeDMD::RenderColoredGray6 ( uint8_t *  frame,
uint8_t *  rotations 
)

Render a 6 bit frame.

Renders a 6 bit(indexed) frame using 64 colors. The colors will be used from the current palette set via SetPalette(). ZeDMD is able to rotate parts of the palette natively as defined by the Serum format until the next frame is received.

See also
SetPalette()
Parameters
framethe indexed frame
rotationsoptional rotation command array according to the Serum format

◆ RenderGray2()

void ZeDMD::RenderGray2 ( uint8_t *  frame)

Render a 2 bit gray scaled frame.

Renders a 2 bit gray scaled (indexed) frame using 4 colors. The colors will be used from the current palette set via SetPalette().

See also
SetPalette()
Parameters
framethe indexed frame

◆ RenderGray4()

void ZeDMD::RenderGray4 ( uint8_t *  frame)

Render a 4 bit gray scaled frame.

Renders a 4 bit gray scaled (indexed) frame using 16 colors. The colors will be used from the current palette set via SetPalette().

See also
SetPalette()
Parameters
framethe indexed frame

◆ RenderRgb16()

void ZeDMD::RenderRgb16 ( uint16_t *  frame)
inline

Render a RGB16 frame.

Renders a true color RGB16 frame. Only zone streaming mode is supported. In fact, RGB16 is just another name for RGB565.

Parameters
framethe RGB16 frame

◆ RenderRgb24()

void ZeDMD::RenderRgb24 ( uint8_t *  frame)

Render a RGB24 frame.

Renders a true color RGB frame. By default the zone streaming mode is used. The encoding is RGB888.

See also
DisableRGB24Streaming()
Parameters
framethe RGB frame

◆ RenderRgb24EncodedAs16()

void ZeDMD::RenderRgb24EncodedAs16 ( uint8_t *  frame)
inline

Render a RGB24 frame.

Renders a true color RGB frame. Only zone streaming mode is supported. The encoding is RGB16. In fact, RGB16 is just another name for RGB565.

Parameters
framethe RGB frame

◆ RenderRgb24EncodedAs565()

void ZeDMD::RenderRgb24EncodedAs565 ( uint8_t *  frame)

Render a RGB24 frame.

Renders a true color RGB frame. Only zone streaming mode is supported. The encoding is RGB565.

Parameters
framethe RGB frame

◆ RenderRgb565()

void ZeDMD::RenderRgb565 ( uint16_t *  frame)

Render a RGB565 frame.

Renders a true color RGB565 frame. Only zone streaming mode is supported.

Parameters
framethe RGB565 frame

◆ Reset()

void ZeDMD::Reset ( )

Reset ZeDMD.

Reset ZeDMD.

◆ SaveSettings()

void ZeDMD::SaveSettings ( )

Save the current setting.

Saves all current setting within ZeDMD's EEPROM to be used as defualt at its next start.

See also
https://github.com/PPUC/ZeDMD
SetRGBOrder()
SetBrightness()
SetWiFiSSID()
SetWiFiPassword()
SetWiFiPort()
Parameters
brightnessa value between 0 and 15

◆ SetBrightness()

void ZeDMD::SetBrightness ( uint8_t  brightness)

Set the brightness.

Set the brightness of the LED panels.

See also
https://github.com/PPUC/ZeDMD
Parameters
brightnessa value between 0 and 15

◆ SetDefaultPalette()

void ZeDMD::SetDefaultPalette ( uint8_t  bitDepth)

Set the default palette.

Use a default palette of shades of orange to render gray scaled content.

See also
RenderGray2()
RenderGray4()
Parameters
bitDepththe bit depth, 2 means 4 colors, 4 means 16 colors

◆ SetDevice()

void ZeDMD::SetDevice ( const char *const  device)

Use a specific serial device for ZeDMD.

Instead of serching through all serial devices for a ZeDMD, just use this device.

See also
Open()
Parameters
devicethe device

◆ SetFrameSize()

void ZeDMD::SetFrameSize ( uint16_t  width,
uint16_t  height 
)

Set the frame size.

Set the frame size of the content that will be displayed next on the ZeDMD device. Depending on the settings and the physical dimensions of the LED panels, the content will by centered and scaled correctly.

See also
EnablePreDownscaling()
EnablePreUpscaling()
EnableDownscaling()
EnableUpscaling()
Parameters
widththe frame width
heightthe frame height

◆ SetPalette() [1/2]

void ZeDMD::SetPalette ( uint8_t *  pPalette)

Set the 4 color palette.

Backward compatibility version of SetPalette() to directly set the 4 color palette.

See also
RenderGray4()
Parameters
pPalettethe palette as RGB array
numColors4, 16, or 64 colors palette

◆ SetPalette() [2/2]

void ZeDMD::SetPalette ( uint8_t *  pPalette,
uint8_t  numColors 
)

Set the palette.

Set the color palette to use to render gray scaled content. This library stores and tracks changes to 4, 16 and 64 color palettes individually.

See also
RenderGray2()
RenderGray4()
Parameters
pPalettethe palette as RGB array
numColors4, 16, or 64 colors palette

◆ SetRGBOrder()

void ZeDMD::SetRGBOrder ( uint8_t  rgbOrder)

Set the RGB order.

ZeDMD supports different LED panels. Depending on the panel, the RGB order needs to be adjusted.

See also
https://github.com/PPUC/ZeDMD
Parameters
rgbOrdera value between 0 and 5

◆ SetWiFiPassword()

void ZeDMD::SetWiFiPassword ( const char *const  password)

Set the WiFi Password.

Set the WiFi Password ZeDMD should use to connect.

See also
https://github.com/PPUC/ZeDMD
Parameters
passwordthe password

◆ SetWiFiPort()

void ZeDMD::SetWiFiPort ( int  port)

Set the WiFi Port.

Set the Port ZeDMD should listen at over WiFi.

See also
https://github.com/PPUC/ZeDMD
Parameters
portthe port

◆ SetWiFiSSID()

void ZeDMD::SetWiFiSSID ( const char *const  ssid)

Set the WiFi SSID.

Set the WiFi SSID ZeDMD should connect with.

See also
https://github.com/PPUC/ZeDMD
Parameters
brightnessa value between 0 and 15

The documentation for this class was generated from the following files: