6#include "DataProtocol.h"
7#include "BindUtils.hpp"
8#include "BindWidgets.hpp"
11#if defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_RP2040) || defined(ARDUINO_ARCH_STM32)
12#define MAX_HANDLERS 32
14#define MAX_HANDLERS 16
18#define BIND_ADD_OR_REFRESH_CMD 0
21#define BIND_DATA_ONLY_CMD 6
24#define BIND_REMOVE_CMD 1
27#define BIND_DISABLE_CMD 2
30#define BIND_ENABLE_CMD 3
33#define BIND_HIDE_CMD 4
36#define BIND_VISIBLE_CMD 5
72 knobObjects =
new BindKnob*[MAX_HANDLERS];
79 for (
int i = 0; i < MAX_HANDLERS; ++i)
82 switchObjects[i] =
nullptr;
83 buttonObjects[i] =
nullptr;
84 knobObjects[i] =
nullptr;
85 seekBarObjects[i] =
nullptr;
86 joystickObjects[i] =
nullptr;
87 colorPickerObjects[i] =
nullptr;
88 textInputObjects[i] =
nullptr;
89 dialogObjects[i] =
nullptr;
103 Bind(
void (*_setupCallback)(int16_t, int16_t)) :
Bind()
105 setupCallback = _setupCallback;
118 return isInitialized;
143 bool init(Stream &stream,
void (&setupCallback)(int16_t, int16_t));
177 void sync(
const uint8_t *buffer,
size_t size);
206 void sync(
const char *str, int32_t textColor,
bool autoScroll,
bool newLine,
bool bold,
bool italic,
BindTerminal &obj);
309 uint8_t bufFrame[MAX_DATA_LENGHT];
310 uint8_t frameTXBuffer[MAX_DATA_LENGHT + 6];
316 uint32_t deltaMs = 0;
326 uint8_t buttonIndex = 1;
327 uint8_t dialKnobIndex = 1;
328 uint8_t switchIndex = 1;
329 uint8_t seekBarIndex = 1;
330 uint8_t joystickHandlerIndex = 1;
331 uint8_t colorPickerHandlerIndex = 1;
332 uint8_t textInputHandlerIndex = 1;
333 bool isInitialized =
false;
334 void (*setupCallback)(int16_t, int16_t);
335 bool internalInit(Stream *stream,
void (*setupCallback)(int16_t, int16_t));
336 void screenInit(int16_t w, int16_t h);
337 Stream *bindStream = NULL;
338 int updateScreen(uint8_t inp);
339 void updateScreen(Stream *stream);
340 int updateScreenInternal(uint8_t *dataFrame);
341 void updateJoystick(uint8_t tag, int16_t valX, int16_t valY);
342 void updateColorPicker(uint8_t tag, uint8_t r, uint8_t g, uint8_t b);
343 void updateSeekBar(uint8_t tag, int16_t val);
344 void knobChanged(int8_t tag,
int val);
345 void clickButton(uint8_t tag);
346 void updateSwitch(uint8_t tag,
bool val);
347 void updateTextInput(uint8_t tag,
const char *val, uint8_t length);
348 void dialogResult(uint8_t tag,
bool result,
const char *text, uint8_t length);
Represents a customizable chart element for BindCanvas.
Definition BindChart.hpp:32
BindColorPicker Class.
Definition BindColorPicker.hpp:56
BindDialog class represents a dialog box for use with BindCanvas app.
Definition BindDialog.hpp:38
The Bind class provides a framework for creating interactive applications with BindCanvas.
Definition Bind.h:62
bool init(Stream &stream, void(&setupCallback)(int16_t, int16_t))
Initializes the Bind framework with communication and screen setup.
Definition Bind.cpp:23
bool isReady()
Checks if the bind object is in a ready state.
Definition Bind.h:116
void sync()
Synchronizes the bind with the current state.
Definition Bind.cpp:137
Bind(void(*_setupCallback)(int16_t, int16_t))
Constructs a Bind object with a setup callback function.
Definition Bind.h:103
BindJoystick Class.
Definition BindJoystick.hpp:58
The BindKnob class represents a knob UI element for use with BindCanvas.
Definition BindKnob.hpp:30
Represents a SeekBar object in the Bind framework.
Definition BindSeekBar.hpp:24
Represents a toggle switch UI element in the Bind framework.
Definition BindSwitch.hpp:33
Represents a terminal display for BindCanvas.
Definition BindTerminal.hpp:26
The BindTextInput class represents a text input UI element for use with BindCanvas.
Definition BindTextInput.hpp:16
Definition BindView.hpp:22
Definition DataProtocol.h:18