From 504e7568d4bd4da279bb38ada8f7b0abf296b046 Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Mon, 19 Jan 2026 20:51:46 +0100 Subject: [PATCH] gui2: added default signal maps, create first app for c03 graphics interface. --- avr/devices/c03/main/g_app.asm | 93 +++++ avr/devices/c03/main/g_win_climate.asm | 479 +++++++++++++++++++++++++ avr/devices/c03/main/main.asm | 29 +- avr/modules/lcd2/gui2/imageview.asm | 8 + avr/modules/lcd2/gui2/label.asm | 7 + avr/modules/lcd2/gui2/sensorwatch.asm | 12 + avr/modules/lcd2/gui2/valuelabel.asm | 8 + 7 files changed, 622 insertions(+), 14 deletions(-) create mode 100644 avr/devices/c03/main/g_app.asm create mode 100644 avr/devices/c03/main/g_win_climate.asm diff --git a/avr/devices/c03/main/g_app.asm b/avr/devices/c03/main/g_app.asm new file mode 100644 index 0000000..d4a10e5 --- /dev/null +++ b/avr/devices/c03/main/g_app.asm @@ -0,0 +1,93 @@ +; *************************************************************************** +; copyright : (C) 2026 by Martin Preuss +; email : martin@libchipcard.de +; +; *************************************************************************** +; * This file is part of the project "AqHome". * +; * Please see toplevel file COPYING of that project for license details. * +; *************************************************************************** + +#ifndef AQH_AVR_DEVICE_C03_APP_ASM +#define AQH_AVR_DEVICE_C03_APP_ASM + + +; *************************************************************************** +; defines + + + +; *************************************************************************** +; data + +.dseg + +appC03_ramdata: + .byte GUIAPP_SD_SIZE + + +testRootWin_ramdata: + .byte WIDGET_SD_SIZE + + + +; *************************************************************************** +; code + +.cseg + + + +appC03: + ; OBJECT + .db 0x55, 0xaa ; magic + .dw 0 ; next + .dw 0 ; parent + .dw 0 ; first child + .dw 0 ; target + .dw 0 ; selector (ony lower 8 bits used) + .dw appC03_signalmap*2 ; signal map + ; GUIAPP + .dw appC03_ramdata ; SDRAM data + .dw winRoot*2 ; root widget + +appC03_signalmap: + .db 0, OBJECT_SIGNAL_TIMER, LOW(GuiApp_OnTimer), HIGH(GuiApp_OnTimer) + .db 0, WIDGET_SIGNAL_TOUCH, LOW(GuiApp_OnTouch), HIGH(GuiApp_OnTouch) + .db 0, OBJECT_SIGNAL_RECVMSG, LOW(GuiApp_OnMsgReceived), HIGH(GuiApp_OnMsgReceived) + .db 0, OBJECT_SIGNAL_CREATE, LOW(GuiApp_OnCreate), HIGH(GuiApp_OnCreate) + .db 0, 0, 0, 0 ; end of table + + + +winRoot: + ; OBJECT + .db 0x55, 0xaa ; magic + .dw 0 ; next + .dw 0 ; parent + .dw winClimate*2 ; first child + .dw appC03*2 ; target + .dw 0 ; selector (ony lower 8 bits used) + .dw testRootWin_signalmap*2 ; signal map + ; WIDGET + .db 0, 0 ; opts lo, hi + .dw 0 ; X + .dw 0 ; Y + .dw DISPLAY_WIDTH ; W + .dw DISPLAY_HEIGHT ; H + .dw STYLE_WIN_FOREGROUND ; front color + .dw STYLE_WIN_BACKGROUND ; back color + .dw STYLE_WIN_FONT*2 ; font + .dw testRootWin_ramdata ; ptr to SDRAM + ; ROOTWIDGET + .dw appC03*2 ; GuiApp + +testRootWin_signalmap: + .db 0, OBJECT_SIGNAL_CREATE, LOW(Widget_OnCreate), HIGH(Widget_OnCreate) + .db 0, WIDGET_SIGNAL_DRAW, LOW(Widget_OnDrawNop), HIGH(Widget_OnDrawNop) + .db 0, 0, 0, 0 ; end of table + + + +#endif + + diff --git a/avr/devices/c03/main/g_win_climate.asm b/avr/devices/c03/main/g_win_climate.asm new file mode 100644 index 0000000..c263d9e --- /dev/null +++ b/avr/devices/c03/main/g_win_climate.asm @@ -0,0 +1,479 @@ +; *************************************************************************** +; copyright : (C) 2026 by Martin Preuss +; email : martin@libchipcard.de +; +; *************************************************************************** +; * This file is part of the project "AqHome". * +; * Please see toplevel file COPYING of that project for license details. * +; *************************************************************************** + +#ifndef AQH_AVR_DEVICE_C03_WIN_CLIMATE_ASM +#define AQH_AVR_DEVICE_C03_WIN_CLIMATE_ASM + + +; *************************************************************************** +; data + +.dseg + + +winClimate_ramdata: + .byte WIDGET_SD_SIZE + +winClimateHeader_ramdata: + .byte WIDGET_SD_SIZE + +winClimateBody_ramdata: + .byte WIDGET_SD_SIZE + +winClimateSensor1_ramdata: + .byte SENSORWATCH_SD_SIZE + +winClimateSensor1Title_ramdata: + .byte WIDGET_SD_SIZE + +winClimateSensor1Image_ramdata: + .byte IMGVIEW_SD_SIZE + +winClimateSensor1Value_ramdata: + .byte VLABEL_SD_SIZE + +winClimateSensor2_ramdata: + .byte SENSORWATCH_SD_SIZE + +winClimateSensor2Title_ramdata: + .byte WIDGET_SD_SIZE + +winClimateSensor2Image_ramdata: + .byte IMGVIEW_SD_SIZE + +winClimateSensor2Value_ramdata: + .byte VLABEL_SD_SIZE + + +winClimateSensor3_ramdata: + .byte SENSORWATCH_SD_SIZE + +winClimateSensor3Title_ramdata: + .byte WIDGET_SD_SIZE + +winClimateSensor3Image_ramdata: + .byte IMGVIEW_SD_SIZE + +winClimateSensor3Value_ramdata: + .byte VLABEL_SD_SIZE + +buttonClimateNetwork_ramdata: + .byte IMGVIEW_SD_SIZE + + + +; *************************************************************************** +; code + +.cseg + + +winClimate: + ; OBJECT + .db 0x55, 0xaa ; magic + .dw 0 ; next + .dw winRoot*2 ; parent + .dw winClimateHeader*2 ; first child + .dw 0 ; target + .dw 0 ; selector (ony lower 8 bits used) + .dw winClimate_signalmap*2 ; signal map + ; WIDGET + .db 0, 0 ; opts lo, hi + .dw 0 ; X + .dw 0 ; Y + .dw DISPLAY_WIDTH ; W + .dw DISPLAY_HEIGHT ; H + .dw STYLE_WIN_FOREGROUND ; front color + .dw STYLE_WIN_BACKGROUND ; back color + .dw STYLE_WIN_FONT*2 ; font + .dw winClimate_ramdata ; ptr to SDRAM + +winClimate_signalmap: + .db 0, OBJECT_SIGNAL_CREATE, LOW(Widget_OnCreate), HIGH(Widget_OnCreate) + .db 0, WIDGET_SIGNAL_DRAW, LOW(Widget_OnDraw), HIGH(Widget_OnDraw) + .db 0, 0, 0, 0 ; end of table + + + + winClimateHeader: + ; OBJECT + .db 0x55, 0xaa ; magic + .dw winClimateBody*2 ; next + .dw winClimate*2 ; parent + .dw 0 ; first child + .dw 0 ; target + .dw 0 ; selector (ony lower 8 bits used) + .dw Label_DefaultSignalmap*2 ; signal map + ; WIDGET + .db 0, 0 ; opts lo, hi + .dw 0 ; X + .dw 0 ; Y + .dw DISPLAY_WIDTH ; W + .dw STYLE_WIN_TITLE_HEIGHT ; H + .dw STYLE_WIN_TITLE_FOREGROUND ; front color + .dw STYLE_WIN_TITLE_BACKGROUND ; back color + .dw STYLE_WIN_FONT*2 ; font + .dw winClimateHeader_ramdata ; ptr to SDRAM + ; LABEL + .dw winClimateHeader_text*2 ; text + + winClimateHeader_text: + .db "Test-Window", 0 + + + + winClimateBody: + ; OBJECT + .db 0x55, 0xaa ; magic + .dw 0 ; next + .dw winClimate*2 ; parent + .dw winClimateSensor1*2 ; first child + .dw 0 ; target + .dw 0 ; selector (ony lower 8 bits used) + .dw winClimateBody_signalmap*2 ; signal map + ; WIDGET + .db 0, 0 ; opts lo, hi + .dw 0 ; X + .dw STYLE_WIN_TITLE_HEIGHT ; Y + .dw DISPLAY_WIDTH ; W + .dw DISPLAY_HEIGHT-STYLE_WIN_TITLE_HEIGHT ; H + .dw STYLE_WIN_FOREGROUND ; front color + ; .dw DISPLAY_COLOR_YELLOW + .dw STYLE_WIN_BACKGROUND ; back color + .dw STYLE_WIN_FONT*2 ; font + .dw winClimateBody_ramdata ; ptr to SDRAM + + winClimateBody_signalmap: + .db 0, OBJECT_SIGNAL_CREATE, LOW(Widget_OnCreate), HIGH(Widget_OnCreate) + .db 0, WIDGET_SIGNAL_DRAW, LOW(Widget_OnDraw), HIGH(Widget_OnDraw) + .db 0, 0, 0, 0 ; end of table + + + + winClimateSensor1: + ; OBJECT + .db 0x55, 0xaa ; magic + .dw winClimateSensor2*2 ; next + .dw winClimateBody*2 ; parent + .dw winClimateSensor1Title*2 ; first child + .dw 0 ; target + .dw 0 ; selector (ony lower 8 bits used) + .dw SensorWatch_DefaultSignalmap*2 ; signal map + ; WIDGET + .db (1<