Browse Source

Adding LED demo

main
Goran Mahovlic 2 years ago
parent
commit
6a369c65f8
  1. 37061
      Debug/stm32f746g-disco.hex
  2. 1
      Middlewares/eez/gui/data.h
  3. 2186
      Src/eez-flow-template-stm32f746g-disco.eez-project
  4. 1
      Src/firmware.cpp
  5. 11
      Src/gui/action.cpp
  6. 6
      Src/gui/data.cpp
  7. 15831
      Src/gui/document.cpp
  8. 44
      Src/gui/document.h
  9. 2
      Src/gui/keypad.cpp

37061
Debug/stm32f746g-disco.hex

File diff suppressed because it is too large Load Diff

1
Middlewares/eez/gui/data.h

@ -51,6 +51,7 @@ struct EnumItem {
};
extern const EnumItem *g_enumDefinitions[];
extern bool g_set_pin_status;
struct EnumValue {
uint16_t enumValue;

2186
Src/eez-flow-template-stm32f746g-disco.eez-project

File diff suppressed because it is too large Load Diff

1
Src/firmware.cpp

@ -42,7 +42,6 @@ EM_PORT_API(void) init() {
extern "C" void init() {
#endif
LCD_init();
eez::initAssetsMemory();
eez::gui::loadMainAssets(eez::gui::assets, sizeof(eez::gui::assets));

11
Src/gui/action.cpp

@ -1,8 +1,19 @@
#include <eez/gui/gui.h>
#include <eez/gui/data.h>
#include "../firmware.h"
#include "main.h"
namespace eez {
namespace gui {
void action_set_pin_status() {
if(g_set_pin_status){
HAL_GPIO_WritePin(ARDUINO_PWM_D3_GPIO_Port, ARDUINO_PWM_D3_Pin, GPIO_PIN_SET);
}
else{
HAL_GPIO_WritePin(ARDUINO_PWM_D3_GPIO_Port, ARDUINO_PWM_D3_Pin, GPIO_PIN_RESET);
}
}
} // namespace gui
} // namespace eez

6
Src/gui/data.cpp

@ -1,9 +1,15 @@
#include <eez/gui/gui.h>
#include "../firmware.h"
namespace eez {
namespace gui {
const EnumItem *g_enumDefinitions[] = { nullptr };
bool g_set_pin_status = false;
void data_arduino_pwm_d3_pin_status(DataOperationEnum operation, const WidgetCursor &widgetCursor, Value &value) {
value = Value(g_set_pin_status, VALUE_TYPE_BOOLEAN);
}
} // namespace gui
} // namespace eez

15831
Src/gui/document.cpp

File diff suppressed because it is too large Load Diff

44
Src/gui/document.h

@ -23,7 +23,8 @@ enum DataEnum {
DATA_ID_KEYPAD_OPTION3_ENABLED = 11,
DATA_ID_KEYPAD_OPTION3_TEXT = 12,
DATA_ID_KEYPAD_MODE = 13,
DATA_ID_KEYPAD_OK_ENABLED = 14
DATA_ID_KEYPAD_OK_ENABLED = 14,
DATA_ID_ARDUINO_PWM_D3_PIN_STATUS = 15
};
void data_none(DataOperationEnum operation, const WidgetCursor &cursor, Value &value);
@ -41,6 +42,7 @@ void data_keypad_option3_enabled(DataOperationEnum operation, const WidgetCursor
void data_keypad_option3_text(DataOperationEnum operation, const WidgetCursor &cursor, Value &value);
void data_keypad_mode(DataOperationEnum operation, const WidgetCursor &cursor, Value &value);
void data_keypad_ok_enabled(DataOperationEnum operation, const WidgetCursor &cursor, Value &value);
void data_arduino_pwm_d3_pin_status(DataOperationEnum operation, const WidgetCursor &cursor, Value &value);
typedef void (*DataOperationsFunction)(DataOperationEnum operation, const WidgetCursor &widgetCursor, Value &value);
@ -64,7 +66,8 @@ enum ActionsEnum {
ACTION_ID_KEYPAD_OK = 14,
ACTION_ID_KEYPAD_CANCEL = 15,
ACTION_ID_TOGGLE_KEYPAD_MODE = 16,
ACTION_ID_KEYPAD_SPACE = 17
ACTION_ID_KEYPAD_SPACE = 17,
ACTION_ID_SET_PIN_STATUS = 18
};
void action_yes();
@ -84,6 +87,7 @@ void action_keypad_ok();
void action_keypad_cancel();
void action_toggle_keypad_mode();
void action_keypad_space();
void action_set_pin_status();
extern ActionExecFunc g_actionExecFunctions[];
@ -124,10 +128,8 @@ enum StylesEnum {
STYLE_ID_TEXT_BUTTON = 19,
STYLE_ID_TEXT_BUTTON_DISABLED = 20,
STYLE_ID_BUTTON_ICON = 21,
STYLE_ID_TEXT_INPUT = 22,
STYLE_ID_DEFAULT = 23,
STYLE_ID_TEXT_BUTTON_ICON = 24,
STYLE_ID_TEXT_BUTTON_ICON_DISABLED = 25
STYLE_ID_SWITCH_WIDGET = 22,
STYLE_ID_DEFAULT = 23
};
enum ThemesEnum {
@ -177,11 +179,11 @@ enum PagesEnum {
PAGE_ID_NONE = 0,
PAGE_ID_MAIN = 1,
PAGE_ID_NUMERIC_KEYPAD = 2,
PAGE_ID_KEYBOARD = 3,
PAGE_ID_PAGE1 = 4
PAGE_ID_PAGE1 = 3,
PAGE_ID_PAGE2 = 4
};
extern const uint8_t assets[61450];
extern const uint8_t assets[55672];
#elif defined(EEZ_PLATFORM_SIMULATOR)
@ -201,7 +203,8 @@ enum DataEnum {
DATA_ID_KEYPAD_OPTION3_TEXT = 12,
DATA_ID_KEYPAD_MODE = 13,
DATA_ID_KEYPAD_OK_ENABLED = 14,
DATA_ID_MAIN_APP_VIEW = 15
DATA_ID_MAIN_APP_VIEW = 15,
DATA_ID_ARDUINO_PWM_D3_PIN_STATUS = 16
};
void data_none(DataOperationEnum operation, const WidgetCursor &cursor, Value &value);
@ -220,6 +223,7 @@ void data_keypad_option3_text(DataOperationEnum operation, const WidgetCursor &c
void data_keypad_mode(DataOperationEnum operation, const WidgetCursor &cursor, Value &value);
void data_keypad_ok_enabled(DataOperationEnum operation, const WidgetCursor &cursor, Value &value);
void data_main_app_view(DataOperationEnum operation, const WidgetCursor &cursor, Value &value);
void data_arduino_pwm_d3_pin_status(DataOperationEnum operation, const WidgetCursor &cursor, Value &value);
typedef void (*DataOperationsFunction)(DataOperationEnum operation, const WidgetCursor &widgetCursor, Value &value);
@ -243,7 +247,8 @@ enum ActionsEnum {
ACTION_ID_KEYPAD_OK = 14,
ACTION_ID_KEYPAD_CANCEL = 15,
ACTION_ID_TOGGLE_KEYPAD_MODE = 16,
ACTION_ID_KEYPAD_SPACE = 17
ACTION_ID_KEYPAD_SPACE = 17,
ACTION_ID_SET_PIN_STATUS = 18
};
void action_yes();
@ -263,6 +268,7 @@ void action_keypad_ok();
void action_keypad_cancel();
void action_toggle_keypad_mode();
void action_keypad_space();
void action_set_pin_status();
extern ActionExecFunc g_actionExecFunctions[];
@ -304,11 +310,9 @@ enum StylesEnum {
STYLE_ID_TEXT_BUTTON = 19,
STYLE_ID_TEXT_BUTTON_DISABLED = 20,
STYLE_ID_BUTTON_ICON = 21,
STYLE_ID_TEXT_INPUT = 22,
STYLE_ID_DEFAULT = 23,
STYLE_ID_TEXT_BUTTON_ICON = 24,
STYLE_ID_TEXT_BUTTON_ICON_DISABLED = 25,
STYLE_ID_INLINE25 = 26
STYLE_ID_DEFAULT = 22,
STYLE_ID_INLINE22 = 23,
STYLE_ID_SWITCH_WIDGET = 24
};
enum ThemesEnum {
@ -359,12 +363,12 @@ enum PagesEnum {
PAGE_ID_NONE = 0,
PAGE_ID_MAIN = 1,
PAGE_ID_NUMERIC_KEYPAD = 2,
PAGE_ID_KEYBOARD = 3,
PAGE_ID_FRONT_PANEL = 4,
PAGE_ID_PAGE1 = 5
PAGE_ID_FRONT_PANEL = 3,
PAGE_ID_PAGE1 = 4,
PAGE_ID_PAGE2 = 5
};
extern const uint8_t assets[77889];
extern const uint8_t assets[72109];
#endif

2
Src/gui/keypad.cpp

@ -35,7 +35,7 @@ NumericKeypad *startNumericKeypad(
void startTextKeyboard(const char *label, const char *text, int minChars_, int maxChars_, bool isPassword_, void(*ok)(char *), void(*cancel)(), void(*setDefault)()) {
g_activeKeypad = &g_textKeyboard;
g_textKeyboard.start(&g_deviceAppContext, label, text, minChars_, maxChars_, isPassword_, ok, cancel, setDefault);
g_deviceAppContext.pushPage(PAGE_ID_KEYBOARD, &g_textKeyboard);
//g_deviceAppContext.pushPage(PAGE_ID_KEYBOARD, &g_textKeyboard);
}
void executeNumericKeypadOptionHook(int optionActionIndex) {

Loading…
Cancel
Save