6#include "DataProtocol.h"
7#include "BindUtils.hpp"
8#include "BindWidgets.hpp"
11#define MAX_HANDLERS 16
14#define BIND_ADD_OR_REFRESH_CMD 0
17#define BIND_DATA_ONLY_CMD 6
20#define BIND_REMOVE_CMD 1
23#define BIND_DISABLE_CMD 2
26#define BIND_ENABLE_CMD 3
29#define BIND_HIDE_CMD 4
32#define BIND_VISIBLE_CMD 5
83 Bind(
void (*_setupCallback)(int16_t, int16_t)) :
Bind()
85 setupCallback = _setupCallback;
155 bool init(Stream *stream,
void (*setupCallback)(int16_t, int16_t));
179 bool init(Stream &stream,
void (&setupCallback)(int16_t, int16_t));
217 void join(
BindKnob *screenKnob,
void (*changeCallback)(int16_t));
231 void join(
BindKnob &screenKnob,
void (&changeCallback)(int16_t));
272 void join(
BindSeekBar *screenSeekBar,
void (*changeCallback)(int16_t));
287 void join(
BindSeekBar &screenSeekBar,
void (&changeCallback)(int16_t));
301 void join(
BindJoystick *screenJoystick,
void (*changeCallback)(int16_t, int16_t));
315 void join(
BindJoystick &screenJoystick,
void (&changeCallback)(int16_t, int16_t));
329 void join(
BindColorPicker *screenColorPicker,
void (*clickCallback)(uint8_t, uint8_t, uint8_t));
343 void join(
BindColorPicker &screenColorPicker,
void (&clickCallback)(uint8_t, uint8_t, uint8_t));
372 void sync(
const char *str, int32_t textColor,
bool autoScroll,
bool newLine,
bool bold,
bool italic,
BindTerminal &obj);
390 uint8_t bufFrame[MAX_DATA_LENGHT];
391 uint8_t frameTXBuffer[MAX_DATA_LENGHT + 6];
397 uint32_t deltaMs = 0;
405 uint8_t buttonIndex = 1;
406 uint8_t dialKnobIndex = 1;
407 uint8_t switchIndex = 1;
408 uint8_t seekBarIndex = 1;
409 uint8_t joystickHandlerIndex = 1;
410 uint8_t colorPickerHandlerIndex = 1;
411 bool isInitialized =
false;
412 void (*setupCallback)(int16_t, int16_t);
413 void screenInit(int16_t w, int16_t h);
414 Stream *bindStream = NULL;
415 int updateScreen(uint8_t inp);
416 void updateScreen(Stream *stream);
417 int updateScreenInternal(uint8_t *dataFrame);
418 void updateJoystick(uint8_t tag, int16_t valX, int16_t valY);
419 void updateColorPicker(uint8_t tag, uint8_t r, uint8_t g, uint8_t b);
420 void updateSeekBar(uint8_t tag, int16_t val);
421 void knobChanged(int8_t tag,
int val);
422 void clickButton(uint8_t tag);
423 void updateSwitch(uint8_t tag,
bool val);
Represents a customizable chart element for BindCanvas.
Definition BindChart.hpp:31
BindColorPicker Class.
Definition BindColorPicker.hpp:53
The Bind class provides a framework for creating interactive applications with BindCanvas.
Definition Bind.hpp:58
bool isReady()
Checks if the bind object is in a ready state.
Definition Bind.hpp:96
void sync()
Synchronizes the bind with the current state.
Definition Bind.cpp:60
bool init(Stream *stream, void(*setupCallback)(int16_t, int16_t))
Initializes the Bind framework with communication and screen setup.
Definition Bind.cpp:9
Bind(void(*_setupCallback)(int16_t, int16_t))
Constructs a Bind object with a setup callback function.
Definition Bind.hpp:83
void join(BindButton *screenButton, void(*clickCallback)(void))
Binds a Button object to a click callback function.
Definition Bind.cpp:103
BindJoystick Class.
Definition BindJoystick.hpp:56
The BindKnob class represents a knob UI element for use with BindCanvas.
Definition BindKnob.hpp:29
Represents a SeekBar object in the Bind framework.
Definition BindSeekBar.hpp:23
Represents a toggle switch UI element in the Bind framework.
Definition BindSwitch.hpp:32
Represents a terminal display for BindCanvas.
Definition BindTerminal.hpp:25
Definition BindView.hpp:22
Definition BindColorPickerHandler.hpp:7
Definition DataProtocol.h:19
Definition BindDialKnobHandler.hpp:6
Definition BindJoystickHandler.hpp:7
Definition BindSeekBarHandler.hpp:7
Definition BindSwitchHandler.hpp:7