├── simulator ├── readme.md ├── images │ ├── eez.ico │ ├── eez.png │ ├── r1b9 │ │ ├── load.png │ │ ├── led-off.png │ │ ├── led-red.png │ │ ├── led-blue.png │ │ ├── led-green.png │ │ ├── front-panel.png │ │ ├── led-yellow.png │ │ ├── reset-normal.png │ │ ├── reset-pressed.png │ │ └── load-disconnected.png │ ├── r3b4 │ │ ├── large │ │ │ ├── load.png │ │ │ ├── led-off.png │ │ │ ├── led-red.png │ │ │ ├── front-panel.png │ │ │ ├── led-green.png │ │ │ ├── led-orange.png │ │ │ ├── led-yellow.png │ │ │ ├── reset-normal.png │ │ │ ├── reset-pressed.png │ │ │ └── load-disconnected.png │ │ └── small │ │ │ ├── load.png │ │ │ ├── led-off.png │ │ │ ├── led-red.png │ │ │ ├── front-panel.png │ │ │ ├── led-green.png │ │ │ ├── led-orange.png │ │ │ ├── led-yellow.png │ │ │ ├── reset-normal.png │ │ │ ├── reset-pressed.png │ │ │ └── load-disconnected.png │ └── r5b12 │ │ ├── large │ │ ├── load.png │ │ ├── led-off.png │ │ ├── led-red.png │ │ ├── led-green.png │ │ ├── led-orange.png │ │ ├── led-yellow.png │ │ ├── front-panel.png │ │ ├── reset-normal.png │ │ ├── reset-pressed.png │ │ └── load-disconnected.png │ │ └── small │ │ ├── load.png │ │ ├── led-off.png │ │ ├── led-red.png │ │ ├── led-green.png │ │ ├── led-orange.png │ │ ├── led-yellow.png │ │ ├── front-panel.png │ │ ├── reset-normal.png │ │ ├── reset-pressed.png │ │ └── load-disconnected.png ├── fonts │ └── OpenSansRegular.ttf ├── platform │ ├── linux │ │ ├── .gitignore │ │ ├── Makefile │ │ └── src │ │ │ └── main_loop.cpp │ └── win32 │ │ ├── eez_psu_sim │ │ ├── resource.h │ │ └── eez_psu_sim.rc │ │ ├── third_party │ │ ├── SDL2 │ │ │ ├── include │ │ │ │ ├── SDL_revision.h │ │ │ │ ├── SDL_copying.h │ │ │ │ ├── SDL_types.h │ │ │ │ ├── SDL_name.h │ │ │ │ ├── SDL_opengles.h │ │ │ │ ├── close_code.h │ │ │ │ ├── SDL_config.h │ │ │ │ ├── SDL_test_log.h │ │ │ │ ├── SDL_test.h │ │ │ │ ├── SDL_clipboard.h │ │ │ │ ├── SDL_quit.h │ │ │ │ └── SDL_test_compare.h │ │ │ ├── lib │ │ │ │ ├── x64 │ │ │ │ │ ├── SDL2.dll │ │ │ │ │ ├── SDL2.lib │ │ │ │ │ ├── SDL2main.lib │ │ │ │ │ └── SDL2test.lib │ │ │ │ └── x86 │ │ │ │ │ ├── SDL2.dll │ │ │ │ │ ├── SDL2.lib │ │ │ │ │ ├── SDL2main.lib │ │ │ │ │ └── SDL2test.lib │ │ │ ├── README-SDL.txt │ │ │ ├── BUGS.txt │ │ │ ├── COPYING.txt │ │ │ └── README.txt │ │ ├── SDL2_ttf │ │ │ ├── lib │ │ │ │ ├── x64 │ │ │ │ │ ├── zlib1.dll │ │ │ │ │ ├── SDL2_ttf.dll │ │ │ │ │ ├── SDL2_ttf.lib │ │ │ │ │ ├── libfreetype-6.dll │ │ │ │ │ ├── LICENSE.freetype.txt │ │ │ │ │ └── LICENSE.zlib.txt │ │ │ │ └── x86 │ │ │ │ │ ├── zlib1.dll │ │ │ │ │ ├── SDL2_ttf.dll │ │ │ │ │ ├── SDL2_ttf.lib │ │ │ │ │ ├── libfreetype-6.dll │ │ │ │ │ ├── LICENSE.freetype.txt │ │ │ │ │ └── LICENSE.zlib.txt │ │ │ ├── CHANGES.txt │ │ │ ├── COPYING.txt │ │ │ └── README.txt │ │ └── SDL2_image │ │ │ ├── lib │ │ │ ├── x64 │ │ │ │ ├── zlib1.dll │ │ │ │ ├── SDL2_image.dll │ │ │ │ ├── SDL2_image.lib │ │ │ │ ├── libjpeg-9.dll │ │ │ │ ├── libtiff-5.dll │ │ │ │ ├── libwebp-4.dll │ │ │ │ ├── libpng16-16.dll │ │ │ │ ├── LICENSE.tiff.txt │ │ │ │ ├── LICENSE.zlib.txt │ │ │ │ └── LICENSE.webp.txt │ │ │ └── x86 │ │ │ │ ├── zlib1.dll │ │ │ │ ├── SDL2_image.dll │ │ │ │ ├── SDL2_image.lib │ │ │ │ ├── libjpeg-9.dll │ │ │ │ ├── libtiff-5.dll │ │ │ │ ├── libwebp-4.dll │ │ │ │ ├── libpng16-16.dll │ │ │ │ ├── LICENSE.tiff.txt │ │ │ │ ├── LICENSE.zlib.txt │ │ │ │ └── LICENSE.webp.txt │ │ │ ├── COPYING.txt │ │ │ └── README.txt │ │ └── eez_imgui │ │ ├── eez_imgui.vcxproj.filters │ │ └── eez_imgui.sln └── src │ ├── main_loop.h │ ├── imgui │ └── beeper.h │ ├── main.cpp │ ├── front_panel │ ├── control.h │ ├── render.h │ └── data.h │ ├── arduino │ ├── arduino_internal.h │ └── SPI.h │ ├── simulator_conf.h │ ├── ethernet │ ├── ethernet_platform.h │ ├── UIPServer.h │ ├── EthernetUdp2.h │ ├── UIPClient.h │ ├── EthernetUdp2.cpp │ └── UIPEthernet.h │ ├── dll.h │ ├── simulator_psu.h │ └── thread.h ├── doc ├── build.bat ├── eez-studio.png ├── architecture.odg ├── architecture.png ├── template │ ├── eez_logo.png │ ├── favicon.ico │ ├── footer.html │ └── header.html ├── main_page_overview.png ├── simulator_screenshot.png ├── windows_download_button.png ├── SCPI reference guide │ ├── EEZ PSU SCPI reference 5.odt │ ├── EEZ PSU SCPI reference guide.odm │ ├── EEZ PSU SCPI reference guide.pdf │ ├── EEZ PSU SCPI reference - last page.odt │ ├── EEZ PSU SCPI reference 5.1 - ABORt.odt │ ├── EEZ PSU SCPI reference 5.5 - FETCh.odt │ ├── Registers │ │ ├── SCPI all registers v1.1.png │ │ ├── SCPI register summary v1.1.png │ │ ├── SCPI OPERation register group v1.0.png │ │ └── SCPI QUEStionable register group v1.0.png │ ├── EEZ PSU SCPI reference - start page.odt │ ├── EEZ PSU SCPI reference 5.11 - OUTPut.odt │ ├── EEZ PSU SCPI reference 5.12 - SENSe.odt │ ├── EEZ PSU SCPI reference 5.13 - SOURce.odt │ ├── EEZ PSU SCPI reference 5.14 - STATus.odt │ ├── EEZ PSU SCPI reference 5.15 - SYSTem.odt │ ├── EEZ PSU SCPI reference 5.4 - DISPlay.odt │ ├── EEZ PSU SCPI reference 5.8 - MEASure.odt │ ├── EEZ PSU SCPI reference 5.9 - MEMory.odt │ ├── EEZ PSU SCPI reference 1 - introduction.odt │ ├── EEZ PSU SCPI reference 5.10 - MMEMory.odt │ ├── EEZ PSU SCPI reference 5.16 - TRIGger.odt │ ├── EEZ PSU SCPI reference 5.2 - CALibrate.odt │ ├── EEZ PSU SCPI reference 5.3 - DIAGnostic.odt │ ├── EEZ PSU SCPI reference 5.6 - INITiate.odt │ ├── EEZ PSU SCPI reference 5.7 - INSTrument.odt │ ├── EEZ PSU SCPI reference 5.1 - ABORt (pdf).odt │ ├── EEZ PSU SCPI reference 7 - Error messages.odt │ ├── EEZ PSU SCPI reference 2 - syntax and style.odt │ ├── EEZ PSU SCPI reference 3 - registers and queue.odt │ ├── EEZ PSU SCPI reference 9 - Software simulator.odt │ ├── EEZ PSU SCPI reference 10 - Programming examples.odt │ ├── EEZ PSU SCPI reference 12 - SCPI commands summary.odt │ ├── EEZ PSU SCPI reference 4 - common comand reference.odt │ ├── EEZ PSU SCPI reference 6 - Device-specific commands.odt │ ├── EEZ PSU SCPI reference 8 - Parameters and settings.odt │ ├── EEZ PSU SCPI reference 11 - SCPI commands scheduled for upcoming releases.odt │ └── Commands │ │ └── images │ │ ├── EEZ PSU SCPI reference 9 - Software simulator-simulator_gui.png │ │ ├── EEZ PSU SCPI reference 9 - Software simulator-simulator_gui_r5B12.png │ │ ├── EEZ PSU SCPI reference 10 - Programming examples-scpi_example_list.png │ │ ├── EEZ PSU SCPI reference 9 - Software simulator-simulator_gui_r3B4_off.png │ │ ├── EEZ PSU SCPI reference 9 - Software simulator-simulator telnet session.png │ │ ├── EEZ PSU SCPI reference 9 - Software simulator-simulator welcome screen.png │ │ ├── EEZ PSU SCPI reference 3 - registers and queue-OPERation status registers.png │ │ ├── EEZ PSU SCPI reference 3 - registers and queue-status_structure_registers_v1.1.png │ │ └── EEZ PSU SCPI reference 3 - registers and queue-QUEStionable INSTrument registers_M2.png └── components.dot ├── libraries ├── readme.md ├── scpi-parser │ ├── src │ │ ├── scpi-parser.h │ │ ├── scpi │ │ │ ├── scpi.h │ │ │ ├── constants.h │ │ │ ├── units.h │ │ │ └── minimal.h │ │ └── impl │ │ │ ├── parser_private.h │ │ │ └── fifo_private.h │ └── library.properties └── eez_psu_lib │ ├── library.properties │ └── src │ ├── eez_psu_rev.h │ └── eez_psu.cpp ├── images ├── eez_logo_48x48.png ├── r3b4-front-panel.png ├── r5b12-front-panel.png ├── simulator-front-panel.png └── eez_logo_48x48_transparent.png ├── .gitignore ├── sketch_build.bat ├── eez_psu_sketch ├── gesture.h ├── buzzer.h ├── eez_psu_sketch.sln ├── gui_page_main.h ├── gui_password.h ├── gui_page_sys_info.h ├── watchdog.h ├── gui_page_ch_settings_info.h ├── idle.h ├── gui_page_event_queue.h ├── timer.h ├── gui_widget_button_group.h ├── board.h ├── ntp.h ├── conf_user_revision.h ├── arduino_util.h ├── gui_page_ch_settings_info.cpp ├── touch_filter.h ├── ethernet.h ├── gui_page_self_test_result.h ├── gui_edit_mode_keypad.h ├── gui_edit_mode_slider.h ├── sound.h ├── gui_edit_mode_step.h ├── touch_calibration.h ├── arduino_psu.h ├── gui_calibration.h ├── devices.h ├── fan.h ├── serial_psu.h ├── touch.h ├── eez_psu_sketch.ino ├── encoder.h ├── arduino_util.cpp ├── timer.cpp ├── io_pins.h ├── gui_page_self_test_result.cpp ├── ontime.h ├── gui_edit_mode.h ├── gui_page_user_profiles.h ├── conf_user.h ├── dlog.h ├── gui.h ├── gui_page_main.cpp ├── dac.h ├── font.h ├── trigger.h ├── scpi_psu.h ├── board.cpp ├── gui_edit_mode_keypad.cpp └── sd_card.h ├── CONTRIB.TXT ├── issue_template.md └── platformio.ini /simulator/readme.md: -------------------------------------------------------------------------------- 1 | # Simulator 2 | 3 | Hello, world! -------------------------------------------------------------------------------- /doc/build.bat: -------------------------------------------------------------------------------- 1 | dot -Tpng components.dot -o components.png -------------------------------------------------------------------------------- /libraries/readme.md: -------------------------------------------------------------------------------- 1 | # Libraries 2 | 3 | - eez_psu_lib 4 | 5 | - scpi_parser -------------------------------------------------------------------------------- /doc/eez-studio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/eez-studio.png -------------------------------------------------------------------------------- /doc/architecture.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/architecture.odg -------------------------------------------------------------------------------- /doc/architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/architecture.png -------------------------------------------------------------------------------- /doc/template/eez_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/template/eez_logo.png -------------------------------------------------------------------------------- /doc/template/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/template/favicon.ico -------------------------------------------------------------------------------- /images/eez_logo_48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/images/eez_logo_48x48.png -------------------------------------------------------------------------------- /simulator/images/eez.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/eez.ico -------------------------------------------------------------------------------- /simulator/images/eez.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/eez.png -------------------------------------------------------------------------------- /doc/main_page_overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/main_page_overview.png -------------------------------------------------------------------------------- /doc/simulator_screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/simulator_screenshot.png -------------------------------------------------------------------------------- /images/r3b4-front-panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/images/r3b4-front-panel.png -------------------------------------------------------------------------------- /images/r5b12-front-panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/images/r5b12-front-panel.png -------------------------------------------------------------------------------- /simulator/images/r1b9/load.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r1b9/load.png -------------------------------------------------------------------------------- /doc/windows_download_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/windows_download_button.png -------------------------------------------------------------------------------- /images/simulator-front-panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/images/simulator-front-panel.png -------------------------------------------------------------------------------- /simulator/images/r1b9/led-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r1b9/led-off.png -------------------------------------------------------------------------------- /simulator/images/r1b9/led-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r1b9/led-red.png -------------------------------------------------------------------------------- /simulator/fonts/OpenSansRegular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/fonts/OpenSansRegular.ttf -------------------------------------------------------------------------------- /simulator/images/r1b9/led-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r1b9/led-blue.png -------------------------------------------------------------------------------- /simulator/images/r1b9/led-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r1b9/led-green.png -------------------------------------------------------------------------------- /simulator/platform/linux/.gitignore: -------------------------------------------------------------------------------- 1 | eez_psu_sim 2 | eez_imgui.so 3 | *.o 4 | .eez_psu_sim 5 | EEPROM.state 6 | RTC.state 7 | -------------------------------------------------------------------------------- /images/eez_logo_48x48_transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/images/eez_logo_48x48_transparent.png -------------------------------------------------------------------------------- /simulator/images/r1b9/front-panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r1b9/front-panel.png -------------------------------------------------------------------------------- /simulator/images/r1b9/led-yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r1b9/led-yellow.png -------------------------------------------------------------------------------- /simulator/images/r1b9/reset-normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r1b9/reset-normal.png -------------------------------------------------------------------------------- /simulator/images/r3b4/large/load.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r3b4/large/load.png -------------------------------------------------------------------------------- /simulator/images/r3b4/small/load.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r3b4/small/load.png -------------------------------------------------------------------------------- /simulator/images/r5b12/large/load.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r5b12/large/load.png -------------------------------------------------------------------------------- /simulator/images/r5b12/small/load.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r5b12/small/load.png -------------------------------------------------------------------------------- /simulator/images/r1b9/reset-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r1b9/reset-pressed.png -------------------------------------------------------------------------------- /simulator/images/r3b4/large/led-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r3b4/large/led-off.png -------------------------------------------------------------------------------- /simulator/images/r3b4/large/led-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r3b4/large/led-red.png -------------------------------------------------------------------------------- /simulator/images/r3b4/small/led-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r3b4/small/led-off.png -------------------------------------------------------------------------------- /simulator/images/r3b4/small/led-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r3b4/small/led-red.png -------------------------------------------------------------------------------- /simulator/images/r5b12/large/led-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r5b12/large/led-off.png -------------------------------------------------------------------------------- /simulator/images/r5b12/large/led-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r5b12/large/led-red.png -------------------------------------------------------------------------------- /simulator/images/r5b12/small/led-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r5b12/small/led-off.png -------------------------------------------------------------------------------- /simulator/images/r5b12/small/led-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r5b12/small/led-red.png -------------------------------------------------------------------------------- /simulator/images/r1b9/load-disconnected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r1b9/load-disconnected.png -------------------------------------------------------------------------------- /simulator/images/r3b4/large/front-panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r3b4/large/front-panel.png -------------------------------------------------------------------------------- /simulator/images/r3b4/large/led-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r3b4/large/led-green.png -------------------------------------------------------------------------------- /simulator/images/r3b4/large/led-orange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r3b4/large/led-orange.png -------------------------------------------------------------------------------- /simulator/images/r3b4/large/led-yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r3b4/large/led-yellow.png -------------------------------------------------------------------------------- /simulator/images/r3b4/small/front-panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r3b4/small/front-panel.png -------------------------------------------------------------------------------- /simulator/images/r3b4/small/led-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r3b4/small/led-green.png -------------------------------------------------------------------------------- /simulator/images/r3b4/small/led-orange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r3b4/small/led-orange.png -------------------------------------------------------------------------------- /simulator/images/r3b4/small/led-yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r3b4/small/led-yellow.png -------------------------------------------------------------------------------- /simulator/images/r5b12/large/led-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r5b12/large/led-green.png -------------------------------------------------------------------------------- /simulator/images/r5b12/large/led-orange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r5b12/large/led-orange.png -------------------------------------------------------------------------------- /simulator/images/r5b12/large/led-yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r5b12/large/led-yellow.png -------------------------------------------------------------------------------- /simulator/images/r5b12/small/led-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r5b12/small/led-green.png -------------------------------------------------------------------------------- /simulator/images/r5b12/small/led-orange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r5b12/small/led-orange.png -------------------------------------------------------------------------------- /simulator/images/r5b12/small/led-yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r5b12/small/led-yellow.png -------------------------------------------------------------------------------- /simulator/images/r3b4/large/reset-normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r3b4/large/reset-normal.png -------------------------------------------------------------------------------- /simulator/images/r3b4/large/reset-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r3b4/large/reset-pressed.png -------------------------------------------------------------------------------- /simulator/images/r3b4/small/reset-normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r3b4/small/reset-normal.png -------------------------------------------------------------------------------- /simulator/images/r3b4/small/reset-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r3b4/small/reset-pressed.png -------------------------------------------------------------------------------- /simulator/images/r5b12/large/front-panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r5b12/large/front-panel.png -------------------------------------------------------------------------------- /simulator/images/r5b12/large/reset-normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r5b12/large/reset-normal.png -------------------------------------------------------------------------------- /simulator/images/r5b12/small/front-panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r5b12/small/front-panel.png -------------------------------------------------------------------------------- /simulator/images/r5b12/small/reset-normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r5b12/small/reset-normal.png -------------------------------------------------------------------------------- /simulator/images/r5b12/large/reset-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r5b12/large/reset-pressed.png -------------------------------------------------------------------------------- /simulator/images/r5b12/small/reset-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r5b12/small/reset-pressed.png -------------------------------------------------------------------------------- /simulator/platform/win32/eez_psu_sim/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/platform/win32/eez_psu_sim/resource.h -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2/include/SDL_revision.h: -------------------------------------------------------------------------------- 1 | #define SDL_REVISION "hg-8628:b558f99d48f0" 2 | #define SDL_REVISION_NUMBER 8628 3 | -------------------------------------------------------------------------------- /simulator/images/r3b4/large/load-disconnected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r3b4/large/load-disconnected.png -------------------------------------------------------------------------------- /simulator/images/r3b4/small/load-disconnected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r3b4/small/load-disconnected.png -------------------------------------------------------------------------------- /simulator/images/r5b12/large/load-disconnected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r5b12/large/load-disconnected.png -------------------------------------------------------------------------------- /simulator/images/r5b12/small/load-disconnected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/images/r5b12/small/load-disconnected.png -------------------------------------------------------------------------------- /doc/SCPI reference guide/EEZ PSU SCPI reference 5.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/EEZ PSU SCPI reference 5.odt -------------------------------------------------------------------------------- /simulator/platform/win32/eez_psu_sim/eez_psu_sim.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/platform/win32/eez_psu_sim/eez_psu_sim.rc -------------------------------------------------------------------------------- /doc/SCPI reference guide/EEZ PSU SCPI reference guide.odm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/EEZ PSU SCPI reference guide.odm -------------------------------------------------------------------------------- /doc/SCPI reference guide/EEZ PSU SCPI reference guide.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/EEZ PSU SCPI reference guide.pdf -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2/lib/x64/SDL2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/platform/win32/third_party/SDL2/lib/x64/SDL2.dll -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2/lib/x64/SDL2.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/platform/win32/third_party/SDL2/lib/x64/SDL2.lib -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2/lib/x86/SDL2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/platform/win32/third_party/SDL2/lib/x86/SDL2.dll -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2/lib/x86/SDL2.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/platform/win32/third_party/SDL2/lib/x86/SDL2.lib -------------------------------------------------------------------------------- /libraries/scpi-parser/src/scpi-parser.h: -------------------------------------------------------------------------------- 1 | #ifndef ARDUINO_SCPI_PARSER_H 2 | #define ARDUINO_SCPI_PARSER_H 3 | 4 | #include "scpi/scpi.h" 5 | 6 | #endif // ARDUINO_SCPI_PARSER_H -------------------------------------------------------------------------------- /doc/SCPI reference guide/EEZ PSU SCPI reference - last page.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/EEZ PSU SCPI reference - last page.odt -------------------------------------------------------------------------------- /doc/SCPI reference guide/EEZ PSU SCPI reference 5.1 - ABORt.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/EEZ PSU SCPI reference 5.1 - ABORt.odt -------------------------------------------------------------------------------- /doc/SCPI reference guide/EEZ PSU SCPI reference 5.5 - FETCh.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/EEZ PSU SCPI reference 5.5 - FETCh.odt -------------------------------------------------------------------------------- /doc/SCPI reference guide/Registers/SCPI all registers v1.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/Registers/SCPI all registers v1.1.png -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2/lib/x64/SDL2main.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/platform/win32/third_party/SDL2/lib/x64/SDL2main.lib -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2/lib/x64/SDL2test.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/platform/win32/third_party/SDL2/lib/x64/SDL2test.lib -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2/lib/x86/SDL2main.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/platform/win32/third_party/SDL2/lib/x86/SDL2main.lib -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2/lib/x86/SDL2test.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/platform/win32/third_party/SDL2/lib/x86/SDL2test.lib -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_ttf/lib/x64/zlib1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/platform/win32/third_party/SDL2_ttf/lib/x64/zlib1.dll -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_ttf/lib/x86/zlib1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/platform/win32/third_party/SDL2_ttf/lib/x86/zlib1.dll -------------------------------------------------------------------------------- /doc/SCPI reference guide/EEZ PSU SCPI reference - start page.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/EEZ PSU SCPI reference - start page.odt -------------------------------------------------------------------------------- /doc/SCPI reference guide/EEZ PSU SCPI reference 5.11 - OUTPut.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/EEZ PSU SCPI reference 5.11 - OUTPut.odt -------------------------------------------------------------------------------- /doc/SCPI reference guide/EEZ PSU SCPI reference 5.12 - SENSe.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/EEZ PSU SCPI reference 5.12 - SENSe.odt -------------------------------------------------------------------------------- /doc/SCPI reference guide/EEZ PSU SCPI reference 5.13 - SOURce.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/EEZ PSU SCPI reference 5.13 - SOURce.odt -------------------------------------------------------------------------------- /doc/SCPI reference guide/EEZ PSU SCPI reference 5.14 - STATus.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/EEZ PSU SCPI reference 5.14 - STATus.odt -------------------------------------------------------------------------------- /doc/SCPI reference guide/EEZ PSU SCPI reference 5.15 - SYSTem.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/EEZ PSU SCPI reference 5.15 - SYSTem.odt -------------------------------------------------------------------------------- /doc/SCPI reference guide/EEZ PSU SCPI reference 5.4 - DISPlay.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/EEZ PSU SCPI reference 5.4 - DISPlay.odt -------------------------------------------------------------------------------- /doc/SCPI reference guide/EEZ PSU SCPI reference 5.8 - MEASure.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/EEZ PSU SCPI reference 5.8 - MEASure.odt -------------------------------------------------------------------------------- /doc/SCPI reference guide/EEZ PSU SCPI reference 5.9 - MEMory.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/EEZ PSU SCPI reference 5.9 - MEMory.odt -------------------------------------------------------------------------------- /doc/SCPI reference guide/Registers/SCPI register summary v1.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/Registers/SCPI register summary v1.1.png -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_image/lib/x64/zlib1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/platform/win32/third_party/SDL2_image/lib/x64/zlib1.dll -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_image/lib/x86/zlib1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/platform/win32/third_party/SDL2_image/lib/x86/zlib1.dll -------------------------------------------------------------------------------- /doc/SCPI reference guide/EEZ PSU SCPI reference 1 - introduction.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/EEZ PSU SCPI reference 1 - introduction.odt -------------------------------------------------------------------------------- /doc/SCPI reference guide/EEZ PSU SCPI reference 5.10 - MMEMory.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/EEZ PSU SCPI reference 5.10 - MMEMory.odt -------------------------------------------------------------------------------- /doc/SCPI reference guide/EEZ PSU SCPI reference 5.16 - TRIGger.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/EEZ PSU SCPI reference 5.16 - TRIGger.odt -------------------------------------------------------------------------------- /doc/SCPI reference guide/EEZ PSU SCPI reference 5.2 - CALibrate.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/EEZ PSU SCPI reference 5.2 - CALibrate.odt -------------------------------------------------------------------------------- /doc/SCPI reference guide/EEZ PSU SCPI reference 5.3 - DIAGnostic.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/EEZ PSU SCPI reference 5.3 - DIAGnostic.odt -------------------------------------------------------------------------------- /doc/SCPI reference guide/EEZ PSU SCPI reference 5.6 - INITiate.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/EEZ PSU SCPI reference 5.6 - INITiate.odt -------------------------------------------------------------------------------- /doc/SCPI reference guide/EEZ PSU SCPI reference 5.7 - INSTrument.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/EEZ PSU SCPI reference 5.7 - INSTrument.odt -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_ttf/lib/x64/SDL2_ttf.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/platform/win32/third_party/SDL2_ttf/lib/x64/SDL2_ttf.dll -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_ttf/lib/x64/SDL2_ttf.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/platform/win32/third_party/SDL2_ttf/lib/x64/SDL2_ttf.lib -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_ttf/lib/x86/SDL2_ttf.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/platform/win32/third_party/SDL2_ttf/lib/x86/SDL2_ttf.dll -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_ttf/lib/x86/SDL2_ttf.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/platform/win32/third_party/SDL2_ttf/lib/x86/SDL2_ttf.lib -------------------------------------------------------------------------------- /doc/SCPI reference guide/EEZ PSU SCPI reference 5.1 - ABORt (pdf).odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/EEZ PSU SCPI reference 5.1 - ABORt (pdf).odt -------------------------------------------------------------------------------- /doc/SCPI reference guide/EEZ PSU SCPI reference 7 - Error messages.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/EEZ PSU SCPI reference 7 - Error messages.odt -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_image/lib/x64/SDL2_image.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/platform/win32/third_party/SDL2_image/lib/x64/SDL2_image.dll -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_image/lib/x64/SDL2_image.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/platform/win32/third_party/SDL2_image/lib/x64/SDL2_image.lib -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_image/lib/x64/libjpeg-9.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/platform/win32/third_party/SDL2_image/lib/x64/libjpeg-9.dll -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_image/lib/x64/libtiff-5.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/platform/win32/third_party/SDL2_image/lib/x64/libtiff-5.dll -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_image/lib/x64/libwebp-4.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/platform/win32/third_party/SDL2_image/lib/x64/libwebp-4.dll -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_image/lib/x86/SDL2_image.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/platform/win32/third_party/SDL2_image/lib/x86/SDL2_image.dll -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_image/lib/x86/SDL2_image.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/platform/win32/third_party/SDL2_image/lib/x86/SDL2_image.lib -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_image/lib/x86/libjpeg-9.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/platform/win32/third_party/SDL2_image/lib/x86/libjpeg-9.dll -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_image/lib/x86/libtiff-5.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/platform/win32/third_party/SDL2_image/lib/x86/libtiff-5.dll -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_image/lib/x86/libwebp-4.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/platform/win32/third_party/SDL2_image/lib/x86/libwebp-4.dll -------------------------------------------------------------------------------- /doc/SCPI reference guide/EEZ PSU SCPI reference 2 - syntax and style.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/EEZ PSU SCPI reference 2 - syntax and style.odt -------------------------------------------------------------------------------- /doc/SCPI reference guide/Registers/SCPI OPERation register group v1.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/Registers/SCPI OPERation register group v1.0.png -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_image/lib/x64/libpng16-16.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/platform/win32/third_party/SDL2_image/lib/x64/libpng16-16.dll -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_image/lib/x86/libpng16-16.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/platform/win32/third_party/SDL2_image/lib/x86/libpng16-16.dll -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_ttf/lib/x64/libfreetype-6.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/platform/win32/third_party/SDL2_ttf/lib/x64/libfreetype-6.dll -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_ttf/lib/x86/libfreetype-6.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/platform/win32/third_party/SDL2_ttf/lib/x86/libfreetype-6.dll -------------------------------------------------------------------------------- /doc/SCPI reference guide/EEZ PSU SCPI reference 3 - registers and queue.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/EEZ PSU SCPI reference 3 - registers and queue.odt -------------------------------------------------------------------------------- /doc/SCPI reference guide/EEZ PSU SCPI reference 9 - Software simulator.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/EEZ PSU SCPI reference 9 - Software simulator.odt -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_ttf/lib/x64/LICENSE.freetype.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/platform/win32/third_party/SDL2_ttf/lib/x64/LICENSE.freetype.txt -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_ttf/lib/x86/LICENSE.freetype.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/simulator/platform/win32/third_party/SDL2_ttf/lib/x86/LICENSE.freetype.txt -------------------------------------------------------------------------------- /doc/SCPI reference guide/EEZ PSU SCPI reference 10 - Programming examples.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/EEZ PSU SCPI reference 10 - Programming examples.odt -------------------------------------------------------------------------------- /doc/SCPI reference guide/EEZ PSU SCPI reference 12 - SCPI commands summary.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/EEZ PSU SCPI reference 12 - SCPI commands summary.odt -------------------------------------------------------------------------------- /doc/SCPI reference guide/Registers/SCPI QUEStionable register group v1.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/Registers/SCPI QUEStionable register group v1.0.png -------------------------------------------------------------------------------- /doc/SCPI reference guide/EEZ PSU SCPI reference 4 - common comand reference.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/EEZ PSU SCPI reference 4 - common comand reference.odt -------------------------------------------------------------------------------- /doc/SCPI reference guide/EEZ PSU SCPI reference 6 - Device-specific commands.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/EEZ PSU SCPI reference 6 - Device-specific commands.odt -------------------------------------------------------------------------------- /doc/SCPI reference guide/EEZ PSU SCPI reference 8 - Parameters and settings.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/EEZ PSU SCPI reference 8 - Parameters and settings.odt -------------------------------------------------------------------------------- /doc/SCPI reference guide/EEZ PSU SCPI reference 11 - SCPI commands scheduled for upcoming releases.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/EEZ PSU SCPI reference 11 - SCPI commands scheduled for upcoming releases.odt -------------------------------------------------------------------------------- /doc/SCPI reference guide/Commands/images/EEZ PSU SCPI reference 9 - Software simulator-simulator_gui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/Commands/images/EEZ PSU SCPI reference 9 - Software simulator-simulator_gui.png -------------------------------------------------------------------------------- /doc/SCPI reference guide/Commands/images/EEZ PSU SCPI reference 9 - Software simulator-simulator_gui_r5B12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/Commands/images/EEZ PSU SCPI reference 9 - Software simulator-simulator_gui_r5B12.png -------------------------------------------------------------------------------- /doc/SCPI reference guide/Commands/images/EEZ PSU SCPI reference 10 - Programming examples-scpi_example_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/Commands/images/EEZ PSU SCPI reference 10 - Programming examples-scpi_example_list.png -------------------------------------------------------------------------------- /doc/SCPI reference guide/Commands/images/EEZ PSU SCPI reference 9 - Software simulator-simulator_gui_r3B4_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/Commands/images/EEZ PSU SCPI reference 9 - Software simulator-simulator_gui_r3B4_off.png -------------------------------------------------------------------------------- /doc/SCPI reference guide/Commands/images/EEZ PSU SCPI reference 9 - Software simulator-simulator telnet session.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/Commands/images/EEZ PSU SCPI reference 9 - Software simulator-simulator telnet session.png -------------------------------------------------------------------------------- /doc/SCPI reference guide/Commands/images/EEZ PSU SCPI reference 9 - Software simulator-simulator welcome screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/Commands/images/EEZ PSU SCPI reference 9 - Software simulator-simulator welcome screen.png -------------------------------------------------------------------------------- /doc/SCPI reference guide/Commands/images/EEZ PSU SCPI reference 3 - registers and queue-OPERation status registers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/Commands/images/EEZ PSU SCPI reference 3 - registers and queue-OPERation status registers.png -------------------------------------------------------------------------------- /doc/SCPI reference guide/Commands/images/EEZ PSU SCPI reference 3 - registers and queue-status_structure_registers_v1.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/Commands/images/EEZ PSU SCPI reference 3 - registers and queue-status_structure_registers_v1.1.png -------------------------------------------------------------------------------- /doc/SCPI reference guide/Commands/images/EEZ PSU SCPI reference 3 - registers and queue-QUEStionable INSTrument registers_M2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eez-open/psu-firmware/HEAD/doc/SCPI reference guide/Commands/images/EEZ PSU SCPI reference 3 - registers and queue-QUEStionable INSTrument registers_M2.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | doc/html 3 | .vscode 4 | simulator/platform/win32/eez_psu_sim.VC.db 5 | *.opendb 6 | *.eez-studio-cache 7 | psu.eez-project-ui-state 8 | .pioenvs 9 | .piolibdeps 10 | .vscode/c_cpp_properties.json 11 | .travis.yml 12 | lib/readme.txt 13 | .clang_complete 14 | .gcc-flags.json 15 | psu-extensions.eez-project-ui-state 16 | -------------------------------------------------------------------------------- /libraries/scpi-parser/library.properties: -------------------------------------------------------------------------------- 1 | name=SCPI Parser 2 | version=1.0.0 3 | author=Jan Breuer 4 | maintainer=??? 5 | sentence=Open Source SCPI device library 6 | paragraph=SCPI Parser library aims to provide parsing ability of SCPI commands on instrument side. 7 | category=Communication 8 | url=https://github.com/j123b567/scpi-parser 9 | architectures=* 10 | -------------------------------------------------------------------------------- /libraries/eez_psu_lib/library.properties: -------------------------------------------------------------------------------- 1 | name=EEZ PSU 2 | version=1.0.0 3 | author=Envox d.o.o. 4 | maintainer=martin.vladic 5 | sentence=This library contains pinout mappings and initializations for various EEZ H24005 power supply boards revisions. 6 | paragraph= 7 | category=Device Control 8 | url=https://github.com/eez-open/psu-firmware 9 | architectures=* 10 | -------------------------------------------------------------------------------- /sketch_build.bat: -------------------------------------------------------------------------------- 1 | REM In C:\Users\mvladic\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.11\platform.txt 2 | REM replace "-g" with "-g3 -gdwarf-2" 3 | 4 | call "C:\Program Files (x86)\Arduino\arduino_debug.exe" --verify --board arduino:sam:arduino_due_x "C:\Users\mvladic\Dropbox\Code\EEZ\psu-firmware\eez_psu_sketch\eez_psu_sketch.ino" --pref build.path="C:\Users\mvladic\Documents\Arduino\build\psu-firmware" 5 | pause -------------------------------------------------------------------------------- /doc/components.dot: -------------------------------------------------------------------------------- 1 | digraph hierarchy { 2 | 3 | nodesep=1.0 // increases the separation between nodes 4 | 5 | node [color=Red,fontname=Courier,shape=box] //All nodes will this shape and colour 6 | edge [color=Blue, style=dashed] //All the lines look like this 7 | 8 | Headteacher->{Deputy1 Deputy2 BusinessManager} 9 | Deputy1->{Teacher1 Teacher2} 10 | BusinessManager->ITManager 11 | {rank=same;ITManager Teacher1 Teacher2} // Put them on the same level 12 | } -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2/README-SDL.txt: -------------------------------------------------------------------------------- 1 | 2 | Please distribute this file with the SDL runtime environment: 3 | 4 | The Simple DirectMedia Layer (SDL for short) is a cross-platform library 5 | designed to make it easy to write multi-media software, such as games and 6 | emulators. 7 | 8 | The Simple DirectMedia Layer library source code is available from: 9 | http://www.libsdl.org/ 10 | 11 | This library is distributed under the terms of the zlib license: 12 | http://www.zlib.net/zlib_license.html 13 | 14 | -------------------------------------------------------------------------------- /eez_psu_sketch/gesture.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace eez { 4 | namespace psu { 5 | namespace gui { 6 | namespace gesture { 7 | 8 | enum GestureType { 9 | GESTURE_NONE, 10 | 11 | GESTURE_TAP, 12 | 13 | GESTURE_SLIDE_UP, 14 | GESTURE_SLIDE_RIGHT, 15 | GESTURE_SLIDE_DOWN, 16 | GESTURE_SLIDE_LEFT 17 | }; 18 | 19 | extern GestureType gesture_type; 20 | extern int start_x; 21 | extern int start_y; 22 | 23 | void tick(uint32_t tick_usec); 24 | 25 | } 26 | } 27 | } 28 | } // namespace eez::psu::ui::touch 29 | -------------------------------------------------------------------------------- /CONTRIB.TXT: -------------------------------------------------------------------------------- 1 | You must attempt to send the modified documentation by email to any of the developers who have provided their email address in the list below. This is a good faith obligation - if the email fails, you need do nothing more and may go on with your distribution. 2 | 3 | If you wish to be notified of modifications that others may make, include your email address in this file. 4 | 5 | -----BEGINING OF THE MAILING LIST----- 6 | 7 | Name - email 8 | ------------ 9 | Envox d.o.o. - eez@envox.hr 10 | 11 | -----END OF THE MAILING LIST----- 12 | -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2/BUGS.txt: -------------------------------------------------------------------------------- 1 | 2 | Bugs are now managed in the SDL bug tracker, here: 3 | 4 | http://bugzilla.libsdl.org/ 5 | 6 | You may report bugs there, and search to see if a given issue has already 7 | been reported, discussed, and maybe even fixed. 8 | 9 | 10 | You may also find help on the SDL mailing list. Subscription information: 11 | 12 | http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org 13 | 14 | Bug reports are welcome here, but we really appreciate if you use Bugzilla, as 15 | bugs discussed on the mailing list may be forgotten or missed. 16 | 17 | -------------------------------------------------------------------------------- /issue_template.md: -------------------------------------------------------------------------------- 1 | 9 | 10 | * Firmware version: 11 | * Shield version 12 | * Powerboard version 13 | 14 | ### Expected behavior 15 | 16 | 17 | 18 | ### Actual behavior 19 | 20 | 21 | 22 | ### How to reproduce 23 | 24 | -------------------------------------------------------------------------------- /platformio.ini: -------------------------------------------------------------------------------- 1 | ; PlatformIO Project Configuration File 2 | ; 3 | ; Build options: build flags, source filter 4 | ; Upload options: custom upload port, speed and extra flags 5 | ; Library options: dependencies, extra library storages 6 | ; Advanced options: extra scripting 7 | ; 8 | ; Please visit documentation for the other options and examples 9 | ; http://docs.platformio.org/page/projectconf.html 10 | 11 | [platformio] 12 | src_dir = eez_psu_sketch 13 | lib_dir = libraries 14 | 15 | [env:dueUSB] 16 | platform = atmelsam 17 | board = dueUSB 18 | framework = arduino 19 | lib_deps = 20 | 868 21 | https://github.com/eez-open/Ethernet2 22 | -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_ttf/CHANGES.txt: -------------------------------------------------------------------------------- 1 | 2.0.12: 2 | Sam Lantinga - Sat Jun 1 19:11:26 PDT 2013 3 | * Updated for SDL 2.0 release 4 | 5 | 2.0.11: 6 | Sam Lantinga - Sat Dec 31 10:49:42 EST 2011 7 | * SDL_ttf is now under the zlib license 8 | Peter Kosyh - Mon Feb 28 14:57:03 PST 2011 9 | * Improved font glyph caching for non-latin languages 10 | Erik Snoek - Wed Jan 12 09:10:15 PST 2011 11 | * Added API to get kerning info: TTF_GetFontKerningSize() 12 | Sam Lantinga - Mon Jan 10 10:58:34 2011 -0800 13 | * Added Android.mk to build on the Android platform 14 | 15 | 2.0.10: 16 | Adam Strzelecki - Wed Oct 21 21:02:37 PDT 2009 17 | * Find the Unicode or symbol character map if it's available in the font 18 | -------------------------------------------------------------------------------- /simulator/platform/win32/eez_imgui/eez_imgui.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /doc/template/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /simulator/src/main_loop.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #define TICK_TIMEOUT 1 22 | 23 | int main_loop(); 24 | void main_loop_exit(); 25 | -------------------------------------------------------------------------------- /simulator/src/imgui/beeper.h: -------------------------------------------------------------------------------- 1 | /** 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | namespace eez { 22 | 23 | typedef void (*beep_ptr_t)(double freq, int duration); 24 | 25 | } // namespace eez::imgui 26 | -------------------------------------------------------------------------------- /eez_psu_sketch/buzzer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | namespace eez { 22 | namespace psu { 23 | namespace buzzer { 24 | 25 | void tone(uint32_t frequency, int32_t duration); 26 | 27 | } 28 | } 29 | } // namespace eez::psu::buzzer 30 | -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2/COPYING.txt: -------------------------------------------------------------------------------- 1 | 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | 21 | -------------------------------------------------------------------------------- /eez_psu_sketch/eez_psu_sketch.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.24720.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "eez_psu_sketch", "eez_psu_sketch.vcxproj", "{65B2DABC-CFA6-4777-8819-E7FFCBE5F163}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x86 = Debug|x86 11 | Release|x86 = Release|x86 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {65B2DABC-CFA6-4777-8819-E7FFCBE5F163}.Debug|x86.ActiveCfg = Debug|Win32 15 | {65B2DABC-CFA6-4777-8819-E7FFCBE5F163}.Debug|x86.Build.0 = Debug|Win32 16 | {65B2DABC-CFA6-4777-8819-E7FFCBE5F163}.Release|x86.ActiveCfg = Release|Win32 17 | {65B2DABC-CFA6-4777-8819-E7FFCBE5F163}.Release|x86.Build.0 = Release|Win32 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2/include/SDL_copying.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_image/COPYING.txt: -------------------------------------------------------------------------------- 1 | /* 2 | SDL_image: An example image loading library for use with SDL 3 | Copyright (C) 1997-2013 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | -------------------------------------------------------------------------------- /eez_psu_sketch/gui_page_main.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2016-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "gui_page.h" 22 | 23 | namespace eez { 24 | namespace psu { 25 | namespace gui { 26 | 27 | class MainPage : public Page { 28 | public: 29 | data::Value getData(const data::Cursor &cursor, uint8_t id); 30 | }; 31 | 32 | } 33 | } 34 | } // namespace eez::psu::gui 35 | -------------------------------------------------------------------------------- /eez_psu_sketch/gui_password.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2016-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | namespace eez { 22 | namespace psu { 23 | namespace gui { 24 | 25 | void checkPassword(const char *label PROGMEM, const char *password, void (*ok)()); 26 | 27 | void editSystemPassword(); 28 | void editCalibrationPassword(); 29 | 30 | } 31 | } 32 | } // namespace eez::psu::gui 33 | -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_ttf/COPYING.txt: -------------------------------------------------------------------------------- 1 | /* 2 | SDL_ttf: A companion library to SDL for working with TrueType (tm) fonts 3 | Copyright (C) 1997-2013 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | -------------------------------------------------------------------------------- /eez_psu_sketch/gui_page_sys_info.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2016-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "gui_page.h" 22 | 23 | namespace eez { 24 | namespace psu { 25 | namespace gui { 26 | 27 | class SysInfoPage: public Page { 28 | public: 29 | data::Value getData(const data::Cursor &cursor, uint8_t id); 30 | }; 31 | 32 | } 33 | } 34 | } // namespace eez::psu::gui 35 | -------------------------------------------------------------------------------- /eez_psu_sketch/watchdog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2016-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | namespace eez { 22 | namespace psu { 23 | namespace watchdog { 24 | 25 | void tick(uint32_t tick_usec); 26 | 27 | #if CONF_DEBUG || CONF_DEBUG_LATEST 28 | void printInfo(); 29 | #endif 30 | 31 | void enable(); 32 | void disable(); 33 | 34 | } 35 | } 36 | } // namespace eez::psu::watchdog 37 | -------------------------------------------------------------------------------- /eez_psu_sketch/gui_page_ch_settings_info.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2016-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "gui_page.h" 22 | 23 | namespace eez { 24 | namespace psu { 25 | namespace gui { 26 | 27 | class ChSettingsInfoPage: public Page { 28 | public: 29 | data::Value getData(const data::Cursor &cursor, uint8_t id); 30 | }; 31 | 32 | } 33 | } 34 | } // namespace eez::psu::gui 35 | -------------------------------------------------------------------------------- /eez_psu_sketch/idle.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2017-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | namespace eez { 22 | namespace psu { 23 | namespace idle { 24 | 25 | void tick(); 26 | 27 | void noteScpiActivity(); 28 | 29 | void noteGuiActivity(); 30 | 31 | void noteEncoderActivity(); 32 | 33 | uint32_t getGuiAndEncoderInactivityPeriod(); 34 | 35 | bool isIdle(); 36 | 37 | } 38 | } 39 | } // namespace eez::psu::idle -------------------------------------------------------------------------------- /eez_psu_sketch/gui_page_event_queue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2016-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "gui_page.h" 22 | 23 | namespace eez { 24 | namespace psu { 25 | namespace gui { 26 | 27 | class EventQueuePage : public Page { 28 | public: 29 | void pageWillAppear(); 30 | data::Value getData(const data::Cursor &cursor, uint8_t id); 31 | }; 32 | 33 | } 34 | } 35 | } // namespace eez::psu::gui 36 | -------------------------------------------------------------------------------- /eez_psu_sketch/timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2016-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | namespace eez { 22 | namespace psu { 23 | 24 | class Interval { 25 | public: 26 | Interval(uint32_t interval_msec); 27 | 28 | void reset(); 29 | 30 | bool test(uint32_t tick_usec); 31 | 32 | private: 33 | uint32_t interval_usec; 34 | uint32_t next_tick_usec; 35 | }; 36 | 37 | } 38 | } // namespace eez::psu 39 | -------------------------------------------------------------------------------- /simulator/src/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #include "psu.h" 20 | #include "main_loop.h" 21 | #if OPTION_DISPLAY 22 | #include "front_panel/control.h" 23 | #endif 24 | 25 | using namespace eez::psu; 26 | 27 | int main() { 28 | simulator::init(); 29 | boot(); 30 | main_loop(); 31 | #if OPTION_DISPLAY 32 | simulator::front_panel::close(); 33 | #endif 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_ttf/README.txt: -------------------------------------------------------------------------------- 1 | 2 | This library is a wrapper around the excellent FreeType 2.0 library, 3 | available at: 4 | http://www.freetype.org/ 5 | 6 | This library allows you to use TrueType fonts to render text in SDL 7 | applications. 8 | 9 | To make the library, first install the FreeType library, then type 10 | './configure' then 'make' to build the SDL truetype library and the 11 | showfont and glfont example applications. 12 | 13 | Be careful when including fonts with your application, as many of them 14 | are copyrighted. The Microsoft fonts, for example, are not freely 15 | redistributable and even the free "web" fonts they provide are only 16 | redistributable in their special executable installer form (May 1998). 17 | There are plenty of freeware and shareware fonts available on the Internet 18 | though, and may suit your purposes. 19 | 20 | This library is under the zlib license, see the file "COPYING.txt" for details. 21 | 22 | Portions of this software are copyright © 2013 The FreeType Project (www.freetype.org). All rights reserved. 23 | 24 | Enjoy! 25 | -Sam Lantinga (6/20/2001) 26 | -------------------------------------------------------------------------------- /eez_psu_sketch/gui_widget_button_group.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "gui_internal.h" 22 | 23 | namespace eez { 24 | namespace psu { 25 | namespace gui { 26 | namespace widgetButtonGroup { 27 | 28 | void draw(int pageId, const WidgetCursor &widgetCursor); 29 | void onTouchDown(const WidgetCursor &widgetCursor); 30 | 31 | } 32 | } 33 | } 34 | } // namespace eez::psu::gui::widget_button_group 35 | -------------------------------------------------------------------------------- /simulator/src/front_panel/control.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | namespace eez { 22 | namespace psu { 23 | namespace simulator { 24 | /// GUI front panel for the simulator. 25 | namespace front_panel { 26 | 27 | bool isOpened(); 28 | bool open(); 29 | void close(); 30 | void tick(); 31 | 32 | void beep(double freq, int duration); 33 | 34 | } 35 | } 36 | } 37 | } // namespace eez_psu_gui 38 | -------------------------------------------------------------------------------- /eez_psu_sketch/board.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | namespace eez { 22 | namespace psu { 23 | namespace board { 24 | 25 | void powerUp(); 26 | void powerDown(); 27 | 28 | #if EEZ_PSU_SELECTED_REVISION == EEZ_PSU_REVISION_R1B9 29 | void cvLedSwitch(Channel *channel, bool on); 30 | void ccLedSwitch(Channel *channel, bool on); 31 | #endif 32 | 33 | } 34 | } 35 | } // namespace eez::psu::board 36 | -------------------------------------------------------------------------------- /simulator/src/arduino/arduino_internal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #define NUM_PINS 256 22 | #define NUM_INTERRUPTS 256 23 | 24 | namespace eez { 25 | namespace psu { 26 | namespace simulator { 27 | namespace arduino { 28 | 29 | extern int pins[NUM_PINS]; 30 | extern InterruptCallback interrupt_callbacks[NUM_INTERRUPTS]; 31 | 32 | } 33 | } 34 | } 35 | } // namespace eez::psu::simulator::arduino; 36 | -------------------------------------------------------------------------------- /eez_psu_sketch/ntp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2017-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | namespace eez { 22 | namespace psu { 23 | namespace ntp { 24 | 25 | void init(); 26 | void tick(uint32_t tickCount); 27 | void reset(); 28 | 29 | void testNtpServer(const char *ntpServer); 30 | // returns true if test is done and sets result to true if successfull 31 | bool isTestNtpServerDone(bool &testResult); 32 | 33 | } 34 | } 35 | } // namespace eez::psu::ntp 36 | -------------------------------------------------------------------------------- /simulator/src/simulator_conf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #undef OPTION_ETHERNET 22 | #define OPTION_ETHERNET 1 23 | 24 | // SIMULATOR SPECIFC CONFIG 25 | #define SIM_LOAD_MIN 0 26 | #define SIM_LOAD_DEF 1000.0f 27 | #define SIM_LOAD_MAX 10000000.0F 28 | 29 | #define SIM_TEMP_MIN 0 30 | #define SIM_TEMP_DEF 25.0f 31 | #define SIM_TEMP_MAX 120.0f 32 | 33 | #define SIM_FRONT_PANEL_LARGE_MODE_MIN_WIDTH 2560 34 | 35 | -------------------------------------------------------------------------------- /eez_psu_sketch/conf_user_revision.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2016-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | /** @file conf_user.h 20 | @brief EEZ PSU revision specification. 21 | Use this header file to specify EEZ PSU revision. 22 | */ 23 | 24 | #pragma once 25 | 26 | /// Selected EEZ PSU revison, possible values are: 27 | /// - EEZ_PSU_REVISION_R1B9 28 | /// - EEZ_PSU_REVISION_R3B4 29 | /// - EEZ_PSU_REVISION_R5B12 30 | #define EEZ_PSU_SELECTED_REVISION EEZ_PSU_REVISION_R5B12 31 | 32 | -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2/include/SDL_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_types.h 24 | * 25 | * \deprecated 26 | */ 27 | 28 | /* DEPRECATED */ 29 | #include "SDL_stdinc.h" 30 | -------------------------------------------------------------------------------- /eez_psu_sketch/arduino_util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | namespace eez { 22 | namespace psu { 23 | /// Utility code (PROGMEM access) for Arduino platform 24 | namespace arduino_util { 25 | 26 | uint8_t prog_read_byte(const uint8_t *p PROGMEM); 27 | uint16_t prog_read_word(const uint8_t *p PROGMEM); 28 | void prog_read_buffer(const uint8_t *src PROGMEM, uint8_t *dest, int length); 29 | 30 | } 31 | } 32 | } // namespace eez::psu::arduino_util 33 | -------------------------------------------------------------------------------- /eez_psu_sketch/gui_page_ch_settings_info.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2016-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #include "psu.h" 20 | 21 | #if OPTION_DISPLAY 22 | 23 | #include "temperature.h" 24 | 25 | #include "gui_page_ch_settings_info.h" 26 | 27 | namespace eez { 28 | namespace psu { 29 | namespace gui { 30 | 31 | data::Value ChSettingsInfoPage::getData(const data::Cursor &cursor, uint8_t id) { 32 | return data::Value(); 33 | } 34 | 35 | } 36 | } 37 | } // namespace eez::psu::gui 38 | 39 | #endif -------------------------------------------------------------------------------- /libraries/eez_psu_lib/src/eez_psu_rev.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2016-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef EEZ_PSU_REV_H 20 | #define EEZ_PSU_REV_H 21 | 22 | #define EEZ_PSU_REVISION_R1B9 1 23 | #define EEZ_PSU_REVISION_R3B4 2 24 | #define EEZ_PSU_REVISION_R5B12 3 25 | 26 | #if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) 27 | #define EEZ_PSU_ARDUINO_MEGA 28 | #elif defined(_VARIANT_ARDUINO_DUE_X_) 29 | #define EEZ_PSU_ARDUINO_DUE 30 | #endif 31 | 32 | #endif // EEZ_PSU_REV_H -------------------------------------------------------------------------------- /simulator/src/ethernet/ethernet_platform.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | namespace eez { 22 | namespace psu { 23 | namespace ethernet_platform { 24 | 25 | bool bind(int port); 26 | bool client_available(); 27 | 28 | bool connected(); 29 | 30 | int available(); 31 | int read(char *buffer, int buffer_size); 32 | int write(const char *buffer, int buffer_size); 33 | 34 | void stop(); 35 | 36 | } 37 | } 38 | } // namespace eez::psu::ethernet_platform 39 | -------------------------------------------------------------------------------- /eez_psu_sketch/touch_filter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | namespace eez { 22 | namespace psu { 23 | namespace gui { 24 | namespace touch { 25 | 26 | bool calibrateTransform(int tl_x, int tl_y, int br_x, int br_y, int tr_x, int tr_y, int margin, int width, int height); 27 | void resetTransformCalibration(); 28 | bool filter(bool is_pressed, int& x, int& y); 29 | void transform(int& x, int& y); 30 | 31 | } 32 | } 33 | } 34 | } // namespace eez::psu::ui::touch 35 | -------------------------------------------------------------------------------- /eez_psu_sketch/ethernet.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "scpi_psu.h" 22 | 23 | namespace eez { 24 | namespace psu { 25 | namespace ethernet { 26 | 27 | extern TestResult g_testResult; 28 | extern scpi_t g_scpiContext; 29 | 30 | void init(); 31 | bool test(); 32 | 33 | void tick(uint32_t tick_usec); 34 | 35 | uint32_t getIpAddress(); 36 | 37 | bool isConnected(); 38 | 39 | void update(); 40 | 41 | } 42 | } 43 | } // namespace eez::psu::ethernet 44 | -------------------------------------------------------------------------------- /eez_psu_sketch/gui_page_self_test_result.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2016-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "gui_page.h" 22 | 23 | namespace eez { 24 | namespace psu { 25 | namespace gui { 26 | 27 | class SelfTestResultPage : public Page { 28 | public: 29 | void pageWillAppear(); 30 | void pageDidDisappear(); 31 | 32 | data::Value getData(const data::Cursor &cursor, uint8_t id); 33 | 34 | private: 35 | char *selfTestResult; 36 | }; 37 | 38 | } 39 | } 40 | } // namespace eez::psu::gui 41 | -------------------------------------------------------------------------------- /eez_psu_sketch/gui_edit_mode_keypad.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "gui_internal.h" 22 | 23 | namespace eez { 24 | namespace psu { 25 | namespace gui { 26 | 27 | class NumericKeypad; 28 | 29 | namespace edit_mode_keypad { 30 | 31 | void enter(Channel &channel, const data::Value& editValue, const data::Value& minValue, data::Value& maxValue); 32 | void exit(); 33 | 34 | extern NumericKeypad *g_keypad; 35 | 36 | } 37 | } 38 | } 39 | } // namespace eez::psu::gui::edit_mode_keypad 40 | -------------------------------------------------------------------------------- /simulator/src/front_panel/render.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "data.h" 22 | 23 | namespace eez { 24 | 25 | namespace imgui { 26 | struct WindowDefinition; 27 | class Window; 28 | } 29 | 30 | namespace psu { 31 | namespace simulator { 32 | namespace front_panel { 33 | 34 | imgui::WindowDefinition *getWindowDefinition(int w, int h); 35 | void render(imgui::Window *window, Data *data); 36 | 37 | } 38 | } 39 | } 40 | } // namespace eez::psu::simulator::front_panel; 41 | -------------------------------------------------------------------------------- /eez_psu_sketch/gui_edit_mode_slider.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "gui_internal.h" 22 | 23 | namespace eez { 24 | namespace psu { 25 | namespace gui { 26 | namespace edit_mode_slider { 27 | 28 | extern bool scale_is_vertical; 29 | extern int scale_width; 30 | extern float scale_height; 31 | 32 | void onTouchDown(); 33 | void onTouchMove(); 34 | void onTouchUp(); 35 | 36 | void increment(int counter); 37 | 38 | } 39 | } 40 | } 41 | } // namespace eez::psu::gui::edit_mode_slider 42 | -------------------------------------------------------------------------------- /eez_psu_sketch/sound.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | namespace eez { 22 | namespace psu { 23 | 24 | /// Play simple sound tunes. 25 | namespace sound { 26 | 27 | void tick(uint32_t tick_usec); 28 | 29 | /// Play power up tune. 30 | void playPowerUp(); 31 | 32 | /// Play power down tune. 33 | void playPowerDown(); 34 | 35 | /// Play beep sound. 36 | void playBeep(bool force = false); 37 | 38 | /// Play click sound 39 | void playClick(); 40 | 41 | } 42 | } 43 | } // namespace eez::psu::sound 44 | -------------------------------------------------------------------------------- /eez_psu_sketch/gui_edit_mode_step.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | namespace eez { 22 | namespace psu { 23 | namespace gui { 24 | namespace edit_mode_step { 25 | 26 | int getStepIndex(); 27 | void getStepValues(const data::Value **labels, int &count); 28 | 29 | void setStepIndex(int value); 30 | 31 | #if OPTION_ENCODER 32 | void onEncoder(int counter); 33 | #endif 34 | 35 | void onTouchDown(); 36 | void onTouchMove(); 37 | void onTouchUp(); 38 | 39 | } 40 | } 41 | } 42 | } // namespace eez::psu::gui::edit_mode_step 43 | -------------------------------------------------------------------------------- /eez_psu_sketch/touch_calibration.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "gui_document.h" 22 | 23 | namespace eez { 24 | namespace psu { 25 | namespace gui { 26 | namespace touch { 27 | namespace calibration { 28 | 29 | void init(); 30 | void enterCalibrationMode(int yesNoPageId = PAGE_ID_SCREEN_CALIBRATION_YES_NO_CANCEL, int nextPageId = -1); 31 | bool isCalibrated(); 32 | bool isCalibrating(); 33 | void tick(uint32_t tick_usec); 34 | 35 | } 36 | } 37 | } 38 | } 39 | } // namespace eez::psu::ui::touch 40 | -------------------------------------------------------------------------------- /eez_psu_sketch/arduino_psu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015 Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #define SCPI_SIMU_COMMANDS 22 | 23 | #pragma GCC diagnostic ignored "-Wunused-variable" 24 | 25 | #if defined(EEZ_PSU_ARDUINO_DUE) 26 | 27 | #ifndef strncmp_P 28 | #define strncmp_P(a, b, c) strncmp((a), (b), (c)) 29 | #endif 30 | 31 | #ifndef snprintf_P 32 | #define snprintf_P snprintf 33 | #endif 34 | 35 | #ifndef vsnprintf_P 36 | #define vsnprintf_P vsnprintf 37 | #endif 38 | 39 | #ifndef strncpy_P 40 | #define strncpy_P strncpy 41 | #endif 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /eez_psu_sketch/gui_calibration.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2016-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "gui_internal.h" 22 | 23 | namespace eez { 24 | namespace psu { 25 | namespace gui { 26 | namespace calibration { 27 | 28 | void start(); 29 | data::Value getData(const data::Cursor &cursor, uint8_t id); 30 | void setLevelValue(); 31 | void set(); 32 | void previousStep(); 33 | void nextStep(); 34 | void save(); 35 | void stop(void (*callback)()); 36 | void toggleEnable(); 37 | 38 | } 39 | } 40 | } 41 | } // namespace eez::psu::gui::calibration 42 | -------------------------------------------------------------------------------- /eez_psu_sketch/devices.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2016-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | namespace eez { 22 | namespace psu { 23 | namespace devices { 24 | 25 | struct Device { 26 | const char *deviceName; 27 | bool installed; 28 | TestResult* testResult; 29 | }; 30 | 31 | extern Device devices[]; 32 | extern int numDevices; 33 | 34 | bool anyFailed(); 35 | char *getSelfTestResultString(); 36 | 37 | const char *getInstalledString(bool installed); 38 | const char *getTestResultString(psu::TestResult g_testResult); 39 | 40 | } 41 | } 42 | } // namespace eez::psu::devices 43 | -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2/include/SDL_name.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef _SDLname_h_ 23 | #define _SDLname_h_ 24 | 25 | #if defined(__STDC__) || defined(__cplusplus) 26 | #define NeedFunctionPrototypes 1 27 | #endif 28 | 29 | #define SDL_NAME(X) SDL_##X 30 | 31 | #endif /* _SDLname_h_ */ 32 | 33 | /* vi: set ts=4 sw=4 expandtab: */ 34 | -------------------------------------------------------------------------------- /eez_psu_sketch/fan.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2016-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | namespace eez { 22 | namespace psu { 23 | namespace fan { 24 | 25 | extern psu::TestResult g_testResult; 26 | extern volatile int g_rpm; 27 | 28 | void init(); 29 | void test_start(); 30 | bool test(); 31 | void tick(uint32_t tick_usec); 32 | 33 | extern bool g_fanManualControl; 34 | extern int g_fanSpeedPWM; 35 | 36 | extern double g_Kp; 37 | extern double g_Ki; 38 | extern double g_Kd; 39 | extern int g_POn; 40 | 41 | void setPidTunings(double Kp, double Ki, double Kd, int POn); 42 | 43 | } 44 | } 45 | } // namespace eez::psu::fan 46 | -------------------------------------------------------------------------------- /eez_psu_sketch/serial_psu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "scpi_psu.h" 22 | 23 | namespace eez { 24 | namespace psu { 25 | namespace serial { 26 | 27 | extern TestResult g_testResult; 28 | extern scpi_t g_scpiContext; 29 | 30 | void init(); 31 | void tick(uint32_t tick_usec); 32 | 33 | bool isConnected(); 34 | 35 | void update(); 36 | 37 | extern long g_bauds[]; 38 | extern size_t g_baudsSize; 39 | 40 | enum Parity { 41 | PARITY_NONE, 42 | PARITY_EVEN, 43 | PARITY_ODD, 44 | PARITY_MARK, 45 | PARITY_SPACE 46 | }; 47 | 48 | 49 | } 50 | } 51 | } // namespace eez::psu::serial 52 | -------------------------------------------------------------------------------- /simulator/src/ethernet/UIPServer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "UIPClient.h" 22 | 23 | namespace eez { 24 | namespace psu { 25 | namespace simulator { 26 | namespace arduino { 27 | 28 | /// Bare minimum implementation of the Arduino EthernetServer class 29 | class EthernetServer { 30 | public: 31 | EthernetServer(int port); 32 | 33 | void begin(); 34 | EthernetClient available(); 35 | 36 | private: 37 | bool bind_result; 38 | int port; 39 | EthernetClient client; 40 | }; 41 | 42 | } 43 | } 44 | } 45 | } // namespace eez::psu::simulator::arduino; 46 | 47 | using namespace eez::psu::simulator::arduino; 48 | -------------------------------------------------------------------------------- /eez_psu_sketch/touch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "touch_calibration.h" 22 | 23 | namespace eez { 24 | namespace psu { 25 | namespace gui { 26 | namespace touch { 27 | 28 | extern void init(); 29 | extern void tick(uint32_t tick_usec); 30 | 31 | enum EventType { 32 | TOUCH_NONE, 33 | TOUCH_DOWN, 34 | TOUCH_MOVE, 35 | TOUCH_UP 36 | }; 37 | 38 | extern EventType event_type; 39 | extern int x; 40 | extern int y; 41 | 42 | extern bool directIsPressed(); 43 | 44 | #ifdef EEZ_PSU_SIMULATOR 45 | void touch_write(bool is_pressed, int x, int y); 46 | #endif 47 | 48 | } 49 | } 50 | } 51 | } // namespace eez::psu::ui::touch 52 | -------------------------------------------------------------------------------- /eez_psu_sketch/eez_psu_sketch.ino: -------------------------------------------------------------------------------- 1 | /** 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015 Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #include "SPI.h" 20 | 21 | #include 22 | #include 23 | 24 | #include "psu.h" 25 | 26 | #if OPTION_ETHERNET 27 | #if EEZ_PSU_SELECTED_REVISION == EEZ_PSU_REVISION_R1B9 28 | #include 29 | #include 30 | #include 31 | #elif EEZ_PSU_SELECTED_REVISION == EEZ_PSU_REVISION_R3B4 || EEZ_PSU_SELECTED_REVISION == EEZ_PSU_REVISION_R5B12 32 | #include 33 | #include 34 | #include 35 | #endif 36 | #endif 37 | 38 | void setup() { 39 | PSU_boot(); 40 | } 41 | 42 | void loop() { 43 | PSU_tick(); 44 | } 45 | 46 | -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_image/lib/x64/LICENSE.tiff.txt: -------------------------------------------------------------------------------- 1 | The source code to this library used with SDL_image can be found here: 2 | http://www.libsdl.org/projects/SDL_image/libs/ 3 | --- 4 | 5 | Copyright (c) 1988-1997 Sam Leffler 6 | Copyright (c) 1991-1997 Silicon Graphics, Inc. 7 | 8 | Permission to use, copy, modify, distribute, and sell this software and 9 | its documentation for any purpose is hereby granted without fee, provided 10 | that (i) the above copyright notices and this permission notice appear in 11 | all copies of the software and related documentation, and (ii) the names of 12 | Sam Leffler and Silicon Graphics may not be used in any advertising or 13 | publicity relating to the software without the specific, prior written 14 | permission of Sam Leffler and Silicon Graphics. 15 | 16 | THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 18 | WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 19 | 20 | IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR 21 | ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, 22 | OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 23 | WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 24 | LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 25 | OF THIS SOFTWARE. 26 | -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_image/lib/x86/LICENSE.tiff.txt: -------------------------------------------------------------------------------- 1 | The source code to this library used with SDL_image can be found here: 2 | http://www.libsdl.org/projects/SDL_image/libs/ 3 | --- 4 | 5 | Copyright (c) 1988-1997 Sam Leffler 6 | Copyright (c) 1991-1997 Silicon Graphics, Inc. 7 | 8 | Permission to use, copy, modify, distribute, and sell this software and 9 | its documentation for any purpose is hereby granted without fee, provided 10 | that (i) the above copyright notices and this permission notice appear in 11 | all copies of the software and related documentation, and (ii) the names of 12 | Sam Leffler and Silicon Graphics may not be used in any advertising or 13 | publicity relating to the software without the specific, prior written 14 | permission of Sam Leffler and Silicon Graphics. 15 | 16 | THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 18 | WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 19 | 20 | IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR 21 | ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, 22 | OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 23 | WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 24 | LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 25 | OF THIS SOFTWARE. 26 | -------------------------------------------------------------------------------- /eez_psu_sketch/encoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2017-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | namespace eez { 22 | namespace psu { 23 | namespace encoder { 24 | 25 | static const uint8_t MAX_MOVING_SPEED = 10; 26 | static const uint8_t MIN_MOVING_SPEED = 1; 27 | static const uint8_t DEFAULT_MOVING_DOWN_SPEED = 8; 28 | static const uint8_t DEFAULT_MOVING_UP_SPEED = 6; 29 | 30 | void init(); 31 | void read(uint32_t tickCount, int &counter, bool &clicked); 32 | 33 | void enableAcceleration(bool enable); 34 | void setMovingSpeed(uint8_t down, uint8_t up); 35 | 36 | #ifdef EEZ_PSU_SIMULATOR 37 | void write(int counter, bool clicked); 38 | #endif 39 | 40 | } 41 | } 42 | } // namespace eez::psu::encoder 43 | -------------------------------------------------------------------------------- /simulator/src/ethernet/EthernetUdp2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2017-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | namespace eez { 22 | namespace psu { 23 | namespace simulator { 24 | namespace arduino { 25 | 26 | /// Arduino Ethernet object simulator 27 | class EthernetUDP { 28 | public: 29 | uint8_t begin(uint16_t port); 30 | void stop(); 31 | int beginPacket(const char *host, uint16_t port); 32 | size_t write(const uint8_t *buffer, size_t size); 33 | int endPacket(); 34 | int read(unsigned char* buffer, size_t len); 35 | int parsePacket(); 36 | }; 37 | 38 | } 39 | } 40 | } 41 | } // namespace eez::psu::simulator::arduino; 42 | 43 | using namespace eez::psu::simulator::arduino; 44 | -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2/include/SDL_opengles.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_opengles.h 24 | * 25 | * This is a simple file to encapsulate the OpenGL ES 1.X API headers. 26 | */ 27 | 28 | #ifdef __IPHONEOS__ 29 | #include 30 | #include 31 | #else 32 | #include 33 | #include 34 | #endif 35 | 36 | #ifndef APIENTRY 37 | #define APIENTRY 38 | #endif 39 | -------------------------------------------------------------------------------- /eez_psu_sketch/arduino_util.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #include "psu.h" 20 | #include "arduino_util.h" 21 | 22 | namespace eez { 23 | namespace psu { 24 | namespace arduino_util { 25 | 26 | uint8_t prog_read_byte(const uint8_t *p PROGMEM) { 27 | return pgm_read_byte_near(p); 28 | } 29 | 30 | uint16_t prog_read_word(const uint8_t *p PROGMEM) { 31 | return (((uint16_t)pgm_read_byte_near(p)) << 8) + pgm_read_byte_near(p + 1); 32 | } 33 | 34 | void prog_read_buffer(const uint8_t *src PROGMEM, uint8_t *dest, int length) { 35 | for (int i = 0; i < length; ++i) { 36 | *dest++ = pgm_read_byte_near(src); 37 | ++src; 38 | } 39 | } 40 | 41 | } 42 | } 43 | } // namespace eez::psu::arduino_util 44 | -------------------------------------------------------------------------------- /eez_psu_sketch/timer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2016-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #include "psu.h" 20 | #include "timer.h" 21 | 22 | namespace eez { 23 | namespace psu { 24 | 25 | Interval::Interval(uint32_t interval_msec) 26 | : interval_usec(interval_msec * 1000L) 27 | { 28 | reset(); 29 | } 30 | 31 | void Interval::reset() { 32 | next_tick_usec = micros() + interval_usec; 33 | } 34 | 35 | bool Interval::test(uint32_t tick_usec) { 36 | int32_t diff = tick_usec - next_tick_usec; 37 | if (diff > 0) { 38 | do { 39 | next_tick_usec += interval_usec; 40 | diff = tick_usec - next_tick_usec; 41 | } while (diff > 0); 42 | 43 | return true; 44 | } 45 | 46 | return false; 47 | } 48 | 49 | } 50 | } // namespace eez::psu 51 | -------------------------------------------------------------------------------- /libraries/eez_psu_lib/src/eez_psu.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #include 20 | #include "eez_psu.h" 21 | 22 | SPISettings MCP23S08_SPI(4000000, MSBFIRST, SPI_MODE0); // IO EXPANDER 23 | SPISettings DAC8552_SPI(4000000, MSBFIRST, SPI_MODE1); // DAC 24 | SPISettings ADS1120_SPI(4000000, MSBFIRST, SPI_MODE1); // ADC 25 | SPISettings TLC5925_SPI(4000000, MSBFIRST, SPI_MODE0); // Binding Post 26 | SPISettings PCA21125_SPI(4000000, MSBFIRST, SPI_MODE0); // RTC 27 | SPISettings AT25256B_SPI(4000000, MSBFIRST, SPI_MODE0); // EEPROM 28 | 29 | #if defined(EEZ_PSU_ARDUINO_DUE) 30 | SPISettings ETHERNET_SPI(F_CPU / 5, MSBFIRST, SPI_MODE0); 31 | #else 32 | SPISettings ETHERNET_SPI(8000000, MSBFIRST, SPI_MODE0); 33 | #endif 34 | -------------------------------------------------------------------------------- /eez_psu_sketch/io_pins.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2017-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | namespace eez { 22 | namespace psu { 23 | namespace io_pins { 24 | 25 | enum Polarity { 26 | POLARITY_NEGATIVE, 27 | POLARITY_POSITIVE 28 | }; 29 | 30 | enum Function { 31 | FUNCTION_NONE, 32 | FUNCTION_INPUT, 33 | FUNCTION_OUTPUT, 34 | FUNCTION_FAULT, 35 | FUNCTION_INHIBIT, 36 | FUNCTION_ON_COUPLE, 37 | FUNCTION_TINPUT, 38 | FUNCTION_TOUTPUT 39 | }; 40 | 41 | void tick(uint32_t tickCount); 42 | void onTrigger(); 43 | void refresh(); 44 | 45 | bool isInhibited(); 46 | 47 | void setDigitalOutputPinState(int pin, bool state); 48 | bool getDigitalOutputPinState(int pin); 49 | 50 | } 51 | } 52 | } // namespace eez::psu::io_pins -------------------------------------------------------------------------------- /eez_psu_sketch/gui_page_self_test_result.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2016-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #include "psu.h" 20 | 21 | #if OPTION_DISPLAY 22 | 23 | #include "devices.h" 24 | 25 | #include "gui_page_self_test_result.h" 26 | 27 | namespace eez { 28 | namespace psu { 29 | namespace gui { 30 | 31 | void SelfTestResultPage::pageWillAppear() { 32 | selfTestResult = devices::getSelfTestResultString(); 33 | } 34 | 35 | void SelfTestResultPage::pageDidDisappear() { 36 | free(selfTestResult); 37 | } 38 | 39 | data::Value SelfTestResultPage::getData(const data::Cursor &cursor, uint8_t id) { 40 | if (id == DATA_ID_SELF_TEST_RESULT) { 41 | return data::Value(selfTestResult); 42 | } 43 | 44 | return data::Value(); 45 | } 46 | 47 | } 48 | } 49 | } // namespace eez::psu::gui 50 | 51 | #endif -------------------------------------------------------------------------------- /simulator/src/ethernet/UIPClient.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | namespace eez { 22 | namespace psu { 23 | namespace simulator { 24 | namespace arduino { 25 | 26 | /// Bare minimum implementation of the Arduino EthernetClient class 27 | class EthernetClient { 28 | public: 29 | EthernetClient(); 30 | EthernetClient(bool valid); 31 | 32 | operator bool(); 33 | bool operator==(EthernetClient &other) { return true; } 34 | 35 | bool connected(); 36 | 37 | size_t available(); 38 | size_t read(uint8_t*, size_t); 39 | size_t write(const char *data, size_t len); 40 | void flush(); 41 | 42 | void stop(); 43 | 44 | private: 45 | bool valid; 46 | }; 47 | 48 | } 49 | } 50 | } 51 | } // namespace eez::psu::simulator::arduino; 52 | 53 | using namespace eez::psu::simulator::arduino; 54 | -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_ttf/lib/x64/LICENSE.zlib.txt: -------------------------------------------------------------------------------- 1 | The source code to this library used with SDL_ttf can be found here: 2 | http://www.libsdl.org/projects/SDL_ttf/libs/ 3 | --- 4 | 5 | Copyright notice: 6 | 7 | (C) 1995-2010 Jean-loup Gailly and Mark Adler 8 | 9 | This software is provided 'as-is', without any express or implied 10 | warranty. In no event will the authors be held liable for any damages 11 | arising from the use of this software. 12 | 13 | Permission is granted to anyone to use this software for any purpose, 14 | including commercial applications, and to alter it and redistribute it 15 | freely, subject to the following restrictions: 16 | 17 | 1. The origin of this software must not be misrepresented; you must not 18 | claim that you wrote the original software. If you use this software 19 | in a product, an acknowledgment in the product documentation would be 20 | appreciated but is not required. 21 | 2. Altered source versions must be plainly marked as such, and must not be 22 | misrepresented as being the original software. 23 | 3. This notice may not be removed or altered from any source distribution. 24 | 25 | Jean-loup Gailly Mark Adler 26 | jloup@gzip.org madler@alumni.caltech.edu 27 | 28 | If you use the zlib library in a product, we would appreciate *not* receiving 29 | lengthy legal documents to sign. The sources are provided for free but without 30 | warranty of any kind. The library has been entirely written by Jean-loup 31 | Gailly and Mark Adler; it does not include third-party code. 32 | -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_ttf/lib/x86/LICENSE.zlib.txt: -------------------------------------------------------------------------------- 1 | The source code to this library used with SDL_ttf can be found here: 2 | http://www.libsdl.org/projects/SDL_ttf/libs/ 3 | --- 4 | 5 | Copyright notice: 6 | 7 | (C) 1995-2010 Jean-loup Gailly and Mark Adler 8 | 9 | This software is provided 'as-is', without any express or implied 10 | warranty. In no event will the authors be held liable for any damages 11 | arising from the use of this software. 12 | 13 | Permission is granted to anyone to use this software for any purpose, 14 | including commercial applications, and to alter it and redistribute it 15 | freely, subject to the following restrictions: 16 | 17 | 1. The origin of this software must not be misrepresented; you must not 18 | claim that you wrote the original software. If you use this software 19 | in a product, an acknowledgment in the product documentation would be 20 | appreciated but is not required. 21 | 2. Altered source versions must be plainly marked as such, and must not be 22 | misrepresented as being the original software. 23 | 3. This notice may not be removed or altered from any source distribution. 24 | 25 | Jean-loup Gailly Mark Adler 26 | jloup@gzip.org madler@alumni.caltech.edu 27 | 28 | If you use the zlib library in a product, we would appreciate *not* receiving 29 | lengthy legal documents to sign. The sources are provided for free but without 30 | warranty of any kind. The library has been entirely written by Jean-loup 31 | Gailly and Mark Adler; it does not include third-party code. 32 | -------------------------------------------------------------------------------- /simulator/src/ethernet/EthernetUdp2.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2017-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #include "psu.h" 20 | #include "EthernetUdp2.h" 21 | 22 | namespace eez { 23 | namespace psu { 24 | namespace simulator { 25 | namespace arduino { 26 | 27 | uint8_t EthernetUDP::begin(uint16_t port) { 28 | return 0; 29 | } 30 | 31 | void EthernetUDP::stop() { 32 | } 33 | 34 | int EthernetUDP::beginPacket(const char *host, uint16_t port) { 35 | return 0; 36 | } 37 | 38 | size_t EthernetUDP::write(const uint8_t *buffer, size_t size) { 39 | return 0; 40 | } 41 | 42 | int EthernetUDP::endPacket() { 43 | return 0; 44 | } 45 | 46 | int EthernetUDP::read(unsigned char* buffer, size_t len) { 47 | return 0; 48 | } 49 | 50 | int EthernetUDP::parsePacket() { 51 | return 0; 52 | } 53 | 54 | } 55 | } 56 | } 57 | } // namespace eez::psu::simulator::arduino; 58 | -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_image/lib/x64/LICENSE.zlib.txt: -------------------------------------------------------------------------------- 1 | The source code to this library used with SDL_image can be found here: 2 | http://www.libsdl.org/projects/SDL_image/libs/ 3 | --- 4 | 5 | Copyright notice: 6 | 7 | (C) 1995-2010 Jean-loup Gailly and Mark Adler 8 | 9 | This software is provided 'as-is', without any express or implied 10 | warranty. In no event will the authors be held liable for any damages 11 | arising from the use of this software. 12 | 13 | Permission is granted to anyone to use this software for any purpose, 14 | including commercial applications, and to alter it and redistribute it 15 | freely, subject to the following restrictions: 16 | 17 | 1. The origin of this software must not be misrepresented; you must not 18 | claim that you wrote the original software. If you use this software 19 | in a product, an acknowledgment in the product documentation would be 20 | appreciated but is not required. 21 | 2. Altered source versions must be plainly marked as such, and must not be 22 | misrepresented as being the original software. 23 | 3. This notice may not be removed or altered from any source distribution. 24 | 25 | Jean-loup Gailly Mark Adler 26 | jloup@gzip.org madler@alumni.caltech.edu 27 | 28 | If you use the zlib library in a product, we would appreciate *not* receiving 29 | lengthy legal documents to sign. The sources are provided for free but without 30 | warranty of any kind. The library has been entirely written by Jean-loup 31 | Gailly and Mark Adler; it does not include third-party code. 32 | -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_image/lib/x86/LICENSE.zlib.txt: -------------------------------------------------------------------------------- 1 | The source code to this library used with SDL_image can be found here: 2 | http://www.libsdl.org/projects/SDL_image/libs/ 3 | --- 4 | 5 | Copyright notice: 6 | 7 | (C) 1995-2010 Jean-loup Gailly and Mark Adler 8 | 9 | This software is provided 'as-is', without any express or implied 10 | warranty. In no event will the authors be held liable for any damages 11 | arising from the use of this software. 12 | 13 | Permission is granted to anyone to use this software for any purpose, 14 | including commercial applications, and to alter it and redistribute it 15 | freely, subject to the following restrictions: 16 | 17 | 1. The origin of this software must not be misrepresented; you must not 18 | claim that you wrote the original software. If you use this software 19 | in a product, an acknowledgment in the product documentation would be 20 | appreciated but is not required. 21 | 2. Altered source versions must be plainly marked as such, and must not be 22 | misrepresented as being the original software. 23 | 3. This notice may not be removed or altered from any source distribution. 24 | 25 | Jean-loup Gailly Mark Adler 26 | jloup@gzip.org madler@alumni.caltech.edu 27 | 28 | If you use the zlib library in a product, we would appreciate *not* receiving 29 | lengthy legal documents to sign. The sources are provided for free but without 30 | warranty of any kind. The library has been entirely written by Jean-loup 31 | Gailly and Mark Adler; it does not include third-party code. 32 | -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2/include/close_code.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file close_code.h 24 | * 25 | * This file reverses the effects of begin_code.h and should be included 26 | * after you finish any function and structure declarations in your headers 27 | */ 28 | 29 | #undef _begin_code_h 30 | 31 | /* Reset structure packing at previous byte alignment */ 32 | #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__WATCOMC__) || defined(__BORLANDC__) 33 | #ifdef __BORLANDC__ 34 | #pragma nopackwarning 35 | #endif 36 | #pragma pack(pop) 37 | #endif /* Compiler needs structure packing set */ 38 | -------------------------------------------------------------------------------- /eez_psu_sketch/ontime.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2016-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "timer.h" 22 | 23 | namespace eez { 24 | namespace psu { 25 | namespace ontime { 26 | 27 | void counterToString(char *str, size_t count, uint32_t counterTime); 28 | 29 | enum { 30 | ON_TIME_COUNTER_POWER, 31 | ON_TIME_COUNTER_CH1, 32 | ON_TIME_COUNTER_CH2 33 | }; 34 | 35 | class Counter { 36 | public: 37 | Counter(int type); 38 | 39 | int getType(); 40 | bool isActive(); 41 | 42 | void start(); 43 | void stop(); 44 | 45 | void init(); 46 | void tick(uint32_t tick_usec); 47 | 48 | uint32_t getTotalTime(); 49 | uint32_t getLastTime(); 50 | 51 | private: 52 | uint8_t typeAndIsActive; 53 | uint32_t totalTime; 54 | uint32_t lastTime; 55 | uint32_t lastTick; 56 | uint32_t fractionTime; 57 | Interval writeInterval; 58 | }; 59 | 60 | } 61 | } 62 | } // namespace eez::psu::ontime 63 | -------------------------------------------------------------------------------- /simulator/src/ethernet/UIPEthernet.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | namespace eez { 22 | namespace psu { 23 | namespace simulator { 24 | namespace arduino { 25 | 26 | /// Fake (do nothing) implementation of Enc28J60Network class 27 | class Enc28J60Network { 28 | public: 29 | static void setControlCS(int pin); 30 | }; 31 | 32 | /// Arduino Ethernet object simulator 33 | class SimulatorEthernet { 34 | public: 35 | bool begin(uint8_t *mac, uint8_t *ipAddress = 0, uint8_t *dns = 0, uint8_t *gateway = 0, uint8_t *subnetMask = 0); 36 | uint8_t maintain(); 37 | 38 | IPAddress localIP(); 39 | IPAddress subnetMask(); 40 | IPAddress gatewayIP(); 41 | IPAddress dnsServerIP(); 42 | }; 43 | 44 | extern SimulatorEthernet Ethernet; 45 | 46 | } 47 | } 48 | } 49 | } // namespace eez::psu::simulator::arduino; 50 | 51 | using namespace eez::psu::simulator::arduino; 52 | -------------------------------------------------------------------------------- /eez_psu_sketch/gui_edit_mode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "gui_internal.h" 22 | 23 | namespace eez { 24 | namespace psu { 25 | namespace gui { 26 | namespace edit_mode { 27 | 28 | bool isActive(); 29 | void enter(int tabIndex = -1); 30 | void update(); 31 | void exit(); 32 | bool isInteractiveMode(); 33 | void toggleInteractiveMode(); 34 | 35 | data::Value getData(const data::Cursor &cursor, uint8_t id); 36 | bool isBlinking(const data::Cursor &cursor, uint8_t id, bool &result); 37 | 38 | const data::Value& getEditValue(); 39 | data::Value getCurrentValue(); 40 | const data::Value &getMin(); 41 | const data::Value &getMax(); 42 | ValueType getUnit(); 43 | bool setValue(float value); 44 | 45 | void getInfoText(int part, char *infoText); 46 | 47 | void nonInteractiveSet(); 48 | void nonInteractiveDiscard(); 49 | 50 | } 51 | } 52 | } 53 | } // namespace eez::psu::gui::edit_mode 54 | -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_image/README.txt: -------------------------------------------------------------------------------- 1 | 2 | SDL_image 2.0 3 | 4 | The latest version of this library is available from: 5 | http://www.libsdl.org/projects/SDL_image/ 6 | 7 | This is a simple library to load images of various formats as SDL surfaces. 8 | This library supports BMP, PNM (PPM/PGM/PBM), XPM, LBM, PCX, GIF, JPEG, PNG, 9 | TGA, and TIFF formats. 10 | 11 | API: 12 | #include "SDL_image.h" 13 | 14 | SDL_Surface *IMG_Load(const char *file); 15 | or 16 | SDL_Surface *IMG_Load_RW(SDL_RWops *src, int freesrc); 17 | or 18 | SDL_Surface *IMG_LoadTyped_RW(SDL_RWops *src, int freesrc, char *type); 19 | 20 | where type is a string specifying the format (i.e. "PNG" or "pcx"). 21 | Note that IMG_Load_RW cannot load TGA images. 22 | 23 | To create a surface from an XPM image included in C source, use: 24 | 25 | SDL_Surface *IMG_ReadXPMFromArray(char **xpm); 26 | 27 | An example program 'showimage' is included, with source in showimage.c 28 | 29 | JPEG support requires the JPEG library: http://www.ijg.org/ 30 | PNG support requires the PNG library: http://www.libpng.org/pub/png/libpng.html 31 | and the Zlib library: http://www.gzip.org/zlib/ 32 | TIFF support requires the TIFF library: ftp://ftp.sgi.com/graphics/tiff/ 33 | 34 | If you have these libraries installed in non-standard places, you can 35 | try adding those paths to the configure script, e.g. 36 | sh ./configure CPPFLAGS="-I/somewhere/include" LDFLAGS="-L/somewhere/lib" 37 | If this works, you may need to add /somewhere/lib to your LD_LIBRARY_PATH 38 | so shared library loading works correctly. 39 | 40 | This library is under the zlib License, see the file "COPYING.txt" for details. 41 | -------------------------------------------------------------------------------- /eez_psu_sketch/gui_page_user_profiles.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2016-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "gui_page.h" 22 | #include "profile.h" 23 | 24 | namespace eez { 25 | namespace psu { 26 | namespace gui { 27 | 28 | class UserProfilesPage : public Page { 29 | public: 30 | void pageWillAppear(); 31 | data::Value getData(const data::Cursor &cursor, uint8_t id); 32 | 33 | void showProfile(); 34 | 35 | void toggleAutoRecall(); 36 | void toggleIsAutoRecallLocation(); 37 | void recall(); 38 | void save(); 39 | void deleteProfile(); 40 | void editRemark(); 41 | 42 | private: 43 | profile::Parameters profile; 44 | 45 | static void onSaveFinish(char *remark = 0, void (*callback)() = 0); 46 | static void onSaveEditRemarkOk(char *remark); 47 | static void onSaveYes(); 48 | static void onDeleteProfileYes(); 49 | static void onEditRemarkOk(char *newRemark); 50 | }; 51 | 52 | } 53 | } 54 | } // namespace eez::psu::gui 55 | -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2/README.txt: -------------------------------------------------------------------------------- 1 | 2 | Simple DirectMedia Layer 3 | 4 | (SDL) 5 | 6 | Version 2.0 7 | 8 | --- 9 | http://www.libsdl.org/ 10 | 11 | Simple DirectMedia Layer is a cross-platform development library designed 12 | to provide low level access to audio, keyboard, mouse, joystick, and graphics 13 | hardware via OpenGL and Direct3D. It is used by video playback software, 14 | emulators, and popular games including Valve's award winning catalog 15 | and many Humble Bundle games. 16 | 17 | SDL officially supports Windows, Mac OS X, Linux, iOS, and Android. 18 | Support for other platforms may be found in the source code. 19 | 20 | SDL is written in C, works natively with C++, and there are bindings 21 | available for several other languages, including C# and Python. 22 | 23 | This library is distributed under the zlib license, which can be found 24 | in the file "COPYING.txt". 25 | 26 | The best way to learn how to use SDL is to check out the header files in 27 | the "include" subdirectory and the programs in the "test" subdirectory. 28 | The header files and test programs are well commented and always up to date. 29 | More documentation and FAQs are available online at: 30 | http://wiki.libsdl.org/ 31 | 32 | If you need help with the library, or just want to discuss SDL related 33 | issues, you can join the developers mailing list: 34 | http://www.libsdl.org/mailing-list.php 35 | 36 | If you want to report bugs or contribute patches, please submit them to 37 | bugzilla: 38 | http://bugzilla.libsdl.org/ 39 | 40 | Enjoy! 41 | Sam Lantinga (slouken@libsdl.org) 42 | 43 | -------------------------------------------------------------------------------- /eez_psu_sketch/conf_user.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015 Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | 17 | /** @file conf_user.h 18 | @brief Configuration overrided by the user. 19 | Use this header file to override anything from conf.h or conf_advanced.h. 20 | */ 21 | 22 | #pragma once 23 | 24 | #define ETHERNET_MAC_ADDRESS { 0x74, 0x69, 0x69, 0x2D, 0x30, 0x00 } 25 | 26 | /* Redefine channels 27 | #undef CHANNELS 28 | #define CHANNELS \ 29 | CHANNEL(1, CH_BOARD_REVISION_R5B9_PARAMS, CH_PINS_1, CH_PARAMS_40V_5A_R5B9), \ 30 | CHANNEL(2, CH_BOARD_REVISION_R5B9_PARAMS, CH_PINS_2, CH_PARAMS_40V_5A_R5B9) \ 31 | */ 32 | 33 | // Select Arduino shield r3B4 34 | //#undef EEZ_PSU_SELECTED_REVISION 35 | //#define EEZ_PSU_SELECTED_REVISION EEZ_PSU_REVISION_R3B4 36 | 37 | // Enable TFT display with SDD1289 controller 38 | //#undef DISPLAY_TYPE 39 | //#define DISPLAY_TYPE TFT_320QVT_1289 40 | 41 | // Disable encoder 42 | //#undef OPTION_ENCODER 43 | //#define OPTION_ENCODER 0 44 | 45 | // Disable SD card 46 | //#undef OPTION_SD_CARD 47 | //#define OPTION_SD_CARD 0 48 | 49 | -------------------------------------------------------------------------------- /eez_psu_sketch/dlog.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2018-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "trigger.h" 22 | 23 | namespace eez { 24 | namespace psu { 25 | namespace dlog { 26 | 27 | extern bool g_logVoltage[CH_NUM]; 28 | extern bool g_logCurrent[CH_NUM]; 29 | extern bool g_logPower[CH_NUM]; 30 | 31 | static const float PERIOD_MIN = 0.02f; 32 | static const float PERIOD_MAX = 120.0f; 33 | static const float PERIOD_DEFAULT = 0.02f; 34 | extern float g_period; 35 | 36 | static const float TIME_MIN = 1.0f; 37 | static const float TIME_MAX = 86400000.0f; 38 | static const float TIME_DEFAULT = 60.0f; 39 | extern float g_time; 40 | 41 | extern trigger::Source g_triggerSource; 42 | 43 | extern double g_currentTime; 44 | 45 | bool isIdle(); 46 | bool isInitiated(); 47 | int initiate(const char *filePath); 48 | void triggerGenerated(bool startImmediatelly = true); 49 | int startImmediately(); 50 | void abort(); 51 | 52 | void tick(uint32_t tick_usec); 53 | void reset(); 54 | 55 | } 56 | } 57 | } // namespace eez::psu::dlog 58 | -------------------------------------------------------------------------------- /simulator/src/dll.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #ifdef _WIN32 22 | #include 23 | typedef HANDLE eez_dll_lib_t; 24 | #define EEZ_DLL_EXPORT extern "C" __declspec(dllexport) 25 | #else 26 | #include 27 | typedef void* eez_dll_lib_t; 28 | #define EEZ_DLL_EXPORT extern "C" 29 | #endif 30 | 31 | inline eez_dll_lib_t eez_dll_load(const char* lib_file_path) { 32 | # ifdef _WIN32 33 | return ::LoadLibraryA(lib_file_path); 34 | # else //_WIN32 35 | return ::dlopen(lib_file_path, RTLD_LAZY); 36 | # endif //_WIN32 37 | } 38 | 39 | inline void eez_dll_unload(eez_dll_lib_t lib) { 40 | # ifdef _WIN32 41 | ::FreeLibrary((HMODULE)lib); 42 | # else //_WIN32 43 | ::dlclose(lib); 44 | # endif //_WIN32 45 | } 46 | 47 | inline void* eez_dll_get_proc_address(eez_dll_lib_t lib, const char* proc_name) { 48 | # ifdef _WIN32 49 | return ::GetProcAddress((HMODULE)lib, proc_name); 50 | # else //_WIN32 51 | return ::dlsym(lib, proc_name); 52 | # endif //_WIN32 53 | } 54 | -------------------------------------------------------------------------------- /eez_psu_sketch/gui.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #if OPTION_ETHERNET 22 | #include "ethernet.h" 23 | #endif 24 | 25 | namespace eez { 26 | namespace psu { 27 | /// GUI for local control using TFT with touch 28 | namespace gui { 29 | 30 | void init(); 31 | void tick(uint32_t tick_usec); 32 | void touchHandling(uint32_t tick_usec); 33 | 34 | void refreshPage(); 35 | 36 | void showWelcomePage(); 37 | void showStandbyPage(); 38 | void showEnteringStandbyPage(); 39 | void showEthernetInit(); 40 | 41 | void showAsyncOperationInProgress(const char *message, void (*checkStatus)() = 0); 42 | void hideAsyncOperationInProgress(); 43 | 44 | void showProgressPage(const char *message, void (*abortCallback)() = 0); 45 | bool updateProgressPage(size_t processedSoFar, size_t totalSize); 46 | void hideProgressPage(); 47 | 48 | void setTextMessage(const char *message, unsigned int len); 49 | void clearTextMessage(); 50 | const char *getTextMessage(); 51 | 52 | bool isActivePage(int pageId); 53 | 54 | } 55 | } 56 | } // namespace eez::psu::gui 57 | -------------------------------------------------------------------------------- /eez_psu_sketch/gui_page_main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2016-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #include "psu.h" 20 | 21 | #if OPTION_DISPLAY 22 | 23 | #include "gui_page_main.h" 24 | 25 | namespace eez { 26 | namespace psu { 27 | namespace gui { 28 | 29 | event_queue::Event g_lastEvent[2]; 30 | 31 | data::Value MainPage::getData(const data::Cursor &cursor, uint8_t id) { 32 | if (id == DATA_ID_EVENT_QUEUE_LAST_EVENT_TYPE) { 33 | event_queue::Event *lastEvent = &g_lastEvent[getCurrentStateBufferIndex()]; 34 | event_queue::getLastErrorEvent(lastEvent); 35 | return data::Value(event_queue::getEventType(lastEvent)); 36 | } 37 | 38 | if (id == DATA_ID_EVENT_QUEUE_LAST_EVENT_MESSAGE) { 39 | event_queue::Event *lastEvent = &g_lastEvent[getCurrentStateBufferIndex()]; 40 | event_queue::getLastErrorEvent(lastEvent); 41 | if (event_queue::getEventType(lastEvent) != event_queue::EVENT_TYPE_NONE) { 42 | return data::Value(lastEvent); 43 | } 44 | } 45 | 46 | return data::Value(); 47 | } 48 | 49 | } 50 | } 51 | } // namespace eez::psu::gui 52 | 53 | #endif -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_image/lib/x64/LICENSE.webp.txt: -------------------------------------------------------------------------------- 1 | The source code to this library used with SDL_image can be found here: 2 | http://www.libsdl.org/projects/SDL_image/libs/ 3 | --- 4 | 5 | Copyright (c) 2010, Google Inc. All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are 9 | met: 10 | 11 | * Redistributions of source code must retain the above copyright 12 | notice, this list of conditions and the following disclaimer. 13 | 14 | * Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in 16 | the documentation and/or other materials provided with the 17 | distribution. 18 | 19 | * Neither the name of Google nor the names of its contributors may 20 | be used to endorse or promote products derived from this software 21 | without specific prior written permission. 22 | 23 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2_image/lib/x86/LICENSE.webp.txt: -------------------------------------------------------------------------------- 1 | The source code to this library used with SDL_image can be found here: 2 | http://www.libsdl.org/projects/SDL_image/libs/ 3 | --- 4 | 5 | Copyright (c) 2010, Google Inc. All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are 9 | met: 10 | 11 | * Redistributions of source code must retain the above copyright 12 | notice, this list of conditions and the following disclaimer. 13 | 14 | * Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in 16 | the documentation and/or other materials provided with the 17 | distribution. 18 | 19 | * Neither the name of Google nor the names of its contributors may 20 | be used to endorse or promote products derived from this software 21 | without specific prior written permission. 22 | 23 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 26 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 27 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 29 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 31 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | -------------------------------------------------------------------------------- /eez_psu_sketch/dac.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | namespace eez { 22 | namespace psu { 23 | 24 | /// Digital to analog converter HW used by the channel. 25 | class DigitalAnalogConverter { 26 | public: 27 | static const uint8_t DATA_BUFFER_A = 0B00010000; 28 | static const uint8_t DATA_BUFFER_B = 0B00100100; 29 | 30 | static const uint16_t DAC_MIN = 0; 31 | static const uint16_t DAC_MAX = (1L << DAC_RES) - 1; 32 | 33 | psu::TestResult g_testResult; 34 | 35 | DigitalAnalogConverter(Channel &channel); 36 | 37 | void init(); 38 | bool test(); 39 | 40 | void set_voltage(float voltage); 41 | void set_current(float voltage); 42 | 43 | void set_voltage(uint16_t voltage); 44 | void set_current(uint16_t current); 45 | 46 | bool isTesting() { return m_testing; } 47 | 48 | private: 49 | Channel &channel; 50 | bool m_testing; 51 | 52 | void set_value(uint8_t buffer, uint16_t value); 53 | void set_value(uint8_t buffer, float value); 54 | }; 55 | 56 | } 57 | } // namespace eez::psu 58 | -------------------------------------------------------------------------------- /simulator/platform/win32/eez_imgui/eez_imgui.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.31101.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "eez_imgui", "eez_imgui.vcxproj", "{8D61FA31-9D48-413F-9C36-27629F647AD1}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug EXE|Win32 = Debug EXE|Win32 11 | Debug EXE|x64 = Debug EXE|x64 12 | Debug|Win32 = Debug|Win32 13 | Debug|x64 = Debug|x64 14 | Release|Win32 = Release|Win32 15 | Release|x64 = Release|x64 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {8D61FA31-9D48-413F-9C36-27629F647AD1}.Debug EXE|Win32.ActiveCfg = Debug EXE|Win32 19 | {8D61FA31-9D48-413F-9C36-27629F647AD1}.Debug EXE|Win32.Build.0 = Debug EXE|Win32 20 | {8D61FA31-9D48-413F-9C36-27629F647AD1}.Debug EXE|x64.ActiveCfg = Debug EXE|x64 21 | {8D61FA31-9D48-413F-9C36-27629F647AD1}.Debug EXE|x64.Build.0 = Debug EXE|x64 22 | {8D61FA31-9D48-413F-9C36-27629F647AD1}.Debug|Win32.ActiveCfg = Debug|Win32 23 | {8D61FA31-9D48-413F-9C36-27629F647AD1}.Debug|Win32.Build.0 = Debug|Win32 24 | {8D61FA31-9D48-413F-9C36-27629F647AD1}.Debug|x64.ActiveCfg = Debug|x64 25 | {8D61FA31-9D48-413F-9C36-27629F647AD1}.Debug|x64.Build.0 = Debug|x64 26 | {8D61FA31-9D48-413F-9C36-27629F647AD1}.Release|Win32.ActiveCfg = Release|Win32 27 | {8D61FA31-9D48-413F-9C36-27629F647AD1}.Release|Win32.Build.0 = Release|Win32 28 | {8D61FA31-9D48-413F-9C36-27629F647AD1}.Release|x64.ActiveCfg = Release|x64 29 | {8D61FA31-9D48-413F-9C36-27629F647AD1}.Release|x64.Build.0 = Release|x64 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | EndGlobal 35 | -------------------------------------------------------------------------------- /eez_psu_sketch/font.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | namespace eez { 22 | namespace psu { 23 | namespace gui { 24 | namespace font { 25 | 26 | static const int GLYPH_HEADER_SIZE = 5; 27 | 28 | struct Glyph { 29 | const uint8_t *data PROGMEM; 30 | 31 | int8_t dx; 32 | int8_t x; 33 | int8_t y; 34 | uint8_t width; 35 | uint8_t height; 36 | 37 | bool isFound() { return data != 0; } 38 | }; 39 | 40 | struct Font { 41 | const uint8_t *fontData PROGMEM; 42 | 43 | Font(); 44 | Font(const uint8_t *data PROGMEM); 45 | 46 | void getGlyph(uint8_t requested_encoding, Glyph &glyph); 47 | 48 | uint8_t getAscent(); 49 | uint8_t getDescent(); 50 | uint8_t getHeight(); 51 | 52 | private: 53 | uint8_t getByte(int offset); 54 | uint16_t getWord(int offset); 55 | 56 | uint8_t getEncodingStart(); 57 | uint8_t getEncodingEnd(); 58 | 59 | const uint8_t * PROGMEM findGlyphData(uint8_t requested_encoding); 60 | void fillGlyphParameters(Glyph &glyph); 61 | }; 62 | } 63 | } 64 | } 65 | } // namespace eez::psu::gui::font 66 | -------------------------------------------------------------------------------- /simulator/src/simulator_psu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #define EEZ_PSU_ARDUINO_DUE 22 | 23 | #ifdef _MSC_VER 24 | #define _CRT_SECURE_NO_WARNINGS 25 | #else 26 | #pragma GCC diagnostic ignored "-Wunused-value" 27 | #pragma GCC diagnostic ignored "-Wwrite-strings" 28 | #endif 29 | 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | #define PSTR(U) U 37 | #define strcpy_P strcpy 38 | #define strncpy_P strncpy 39 | #define strcat_P strcat 40 | #define sprintf_P sprintf 41 | #define snprintf_P snprintf 42 | #define vsnprintf_P vsnprintf 43 | #define strcmp_P strcmp 44 | #define strncmp_P strncmp 45 | 46 | extern void eez_psu_init(); 47 | 48 | #define interrupts() 0 49 | #define noInterrupts() 0 50 | 51 | namespace eez { 52 | namespace psu { 53 | /// Firmware simulator. 54 | namespace simulator { 55 | 56 | void init(); 57 | void tick(); 58 | 59 | void setTemperature(int sensor, float value); 60 | float getTemperature(int sensor); 61 | 62 | char *getConfFilePath(const char *file_name); 63 | 64 | void exit(); 65 | 66 | } 67 | } 68 | } // namespace eez::psu::simulator 69 | -------------------------------------------------------------------------------- /eez_psu_sketch/trigger.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2017-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | namespace eez { 22 | namespace psu { 23 | namespace trigger { 24 | 25 | static const float DELAY_DEFAULT = 0; 26 | static const float DELAY_MIN = 0; 27 | static const float DELAY_MAX = 3600.0f; 28 | 29 | enum Source { 30 | SOURCE_BUS, 31 | SOURCE_IMMEDIATE, 32 | SOURCE_MANUAL, 33 | SOURCE_PIN1 34 | }; 35 | 36 | void init(); 37 | void reset(); 38 | 39 | void setDelay(float delay); 40 | float getDelay(); 41 | 42 | void setSource(Source source); 43 | Source getSource(); 44 | 45 | void setVoltage(Channel &channel, float value); 46 | float getVoltage(Channel &channel); 47 | 48 | void setCurrent(Channel &channel, float value); 49 | float getCurrent(Channel &channel); 50 | 51 | int generateTrigger(Source source, bool checkImmediatelly = true); 52 | int startImmediately(); 53 | int initiate(); 54 | int enableInitiateContinuous(bool enable); 55 | bool isContinuousInitializationEnabled(); 56 | void setTriggerFinished(Channel &channel); 57 | bool isIdle(); 58 | bool isInitiated(); 59 | void abort(); 60 | 61 | void tick(uint32_t tick_usec); 62 | 63 | } 64 | } 65 | } // namespace eez::psu::trigger -------------------------------------------------------------------------------- /simulator/src/front_panel/data.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "imgui/window.h" 22 | 23 | namespace eez { 24 | namespace psu { 25 | namespace simulator { 26 | namespace front_panel { 27 | 28 | struct ChannelData { 29 | bool cv; 30 | bool cc; 31 | #if EEZ_PSU_SELECTED_REVISION == EEZ_PSU_REVISION_R1B9 32 | bool out_plus; 33 | bool sense_plus; 34 | bool sense_minus; 35 | bool out_minus; 36 | #elif EEZ_PSU_SELECTED_REVISION == EEZ_PSU_REVISION_R3B4 || EEZ_PSU_SELECTED_REVISION == EEZ_PSU_REVISION_R5B12 37 | bool out; 38 | bool sense; 39 | bool prog; 40 | #endif 41 | const char *load_text; 42 | float load; 43 | float loadOnMouseDown; 44 | imgui::UserWidget loadWidget; 45 | }; 46 | 47 | /// Data presented in GUI front panel. 48 | struct Data { 49 | bool standby; 50 | 51 | bool coupled; 52 | bool coupledOut; 53 | 54 | ChannelData ch1; 55 | ChannelData ch2; 56 | 57 | bool reset; 58 | 59 | imgui::UserWidget local_control_widget; 60 | }; 61 | 62 | void fillData(Data *data); 63 | void processData(Data *data); 64 | 65 | } 66 | } 67 | } 68 | } // namespace eez::psu::simulator::front_panel; 69 | -------------------------------------------------------------------------------- /libraries/scpi-parser/src/scpi/scpi.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2012-2013 Jan Breuer, 3 | * 4 | * All Rights Reserved 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are 8 | * met: 9 | * 1. Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR 16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE 19 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 22 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 23 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 24 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 25 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /** 29 | * @file scpi.h 30 | * @date Thu Nov 15 10:58:45 UTC 2012 31 | * 32 | * @brief SCPI library include file 33 | * 34 | * 35 | */ 36 | 37 | #ifndef SCPI_H 38 | #define SCPI_H 39 | 40 | #include "scpi/parser.h" 41 | #include "scpi/ieee488.h" 42 | #include "scpi/error.h" 43 | #include "scpi/constants.h" 44 | #include "scpi/minimal.h" 45 | #include "scpi/units.h" 46 | #include "scpi/utils.h" 47 | #include "scpi/expression.h" 48 | 49 | #endif /* SCPI_H */ 50 | 51 | -------------------------------------------------------------------------------- /eez_psu_sketch/scpi_psu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "scpi_regs.h" 22 | #include "scpi_params.h" 23 | 24 | namespace eez { 25 | namespace psu { 26 | /// SCPI commands. 27 | namespace scpi { 28 | 29 | /// EEZ PSU specific SCPI parser context data. 30 | struct scpi_psu_t { 31 | scpi_reg_val_t *registers; 32 | uint8_t selected_channel_index; 33 | #if OPTION_SD_CARD 34 | char currentDirectory[MAX_PATH_LENGTH + 1]; 35 | #endif 36 | bool isBufferOverrun; 37 | uint32_t bufferOverrunTime; 38 | }; 39 | 40 | void init(scpi_t &scpi_context, 41 | scpi_psu_t &scpi_psu_context, 42 | scpi_interface_t *interface, 43 | char *input_buffer, 44 | size_t input_buffer_length, 45 | int16_t *error_queue_data, 46 | int16_t error_queue_size); 47 | 48 | void input(scpi_t &scpi_context, const char *str, size_t size); 49 | 50 | void emptyBuffer(scpi_t &context); 51 | void onBufferOverrun(scpi_t &context); 52 | 53 | void printError(int_fast16_t err); 54 | 55 | void resultChoiceName(scpi_t *context, scpi_choice_def_t *choice, int tag); 56 | 57 | extern bool g_busy; 58 | 59 | void resetContext(scpi_t *context); 60 | 61 | } 62 | } 63 | } // namespace eez::psu::scpi 64 | -------------------------------------------------------------------------------- /simulator/src/thread.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef EEZ_PSU_THREAD_H 20 | #define EEZ_PSU_THREAD_H 21 | 22 | #ifdef _WIN32 23 | 24 | #include 25 | typedef HANDLE eez_thread_handle_t; 26 | typedef DWORD(WINAPI *eez_thread_proc_t)(_In_ LPVOID); 27 | #define THREAD_PROC(NAME) DWORD WINAPI NAME(_In_ LPVOID param) 28 | 29 | #else 30 | 31 | #include 32 | typedef pthread_t eez_thread_handle_t; 33 | typedef void *(*eez_thread_proc_t)(void *); 34 | #define THREAD_PROC(NAME) void *NAME(void *param) 35 | 36 | #endif 37 | 38 | eez_thread_handle_t eez_thread_create(eez_thread_proc_t thread_proc, void *param) { 39 | # ifdef _WIN32 40 | return ::CreateThread(0, 0, thread_proc, param, 0, 0); 41 | # else //_WIN32 42 | eez_thread_handle_t thread_handle; 43 | int rc = pthread_create(&thread_handle, NULL, thread_proc, param); 44 | if (rc) { 45 | return 0; 46 | } 47 | return thread_handle; 48 | # endif //_WIN32 49 | } 50 | 51 | void eez_thread_join(eez_thread_handle_t handle) { 52 | # ifdef _WIN32 53 | ::WaitForSingleObject(handle, INFINITE); 54 | ::CloseHandle(handle); 55 | # else //_WIN32 56 | pthread_join(handle, NULL); 57 | # endif //_WIN32 58 | } 59 | 60 | #endif // EEZ_PSU_DLL_H -------------------------------------------------------------------------------- /simulator/platform/linux/Makefile: -------------------------------------------------------------------------------- 1 | CC = gcc 2 | CXX = g++ 3 | 4 | # Simulator main program 5 | 6 | SIM_PROGRAM_NAME = eez_psu_sim 7 | 8 | SIM_CFLAGS = -g -c -Wextra -Wmissing-prototypes -Wimplicit \ 9 | -DUSE_FULL_ERROR_LIST=0 \ 10 | -I../../../libraries/scpi-parser/src \ 11 | 12 | SIM_CSOURCES = \ 13 | -c ../../../libraries/scpi-parser/src/impl/*.c \ 14 | -c third_party/thread_queue.c 15 | 16 | SIM_CXXFLAGS = -g \ 17 | -Wall -Wno-unused-variable -fpermissive -Wno-reorder -Wno-parentheses \ 18 | -DUSE_FULL_ERROR_LIST=0 \ 19 | -DEEZ_PSU_SIMULATOR \ 20 | -I../../../eez_psu_sketch \ 21 | -I../../src \ 22 | -I../../src/arduino \ 23 | -I../../src/chips \ 24 | -I../../src/ethernet \ 25 | -I../../../libraries/eez_psu_lib/src \ 26 | -I../../../libraries/scpi-parser/src \ 27 | -Ithird_party \ 28 | 29 | SIM_CXXSOURCES = \ 30 | src/*.cpp \ 31 | ../../src/*.cpp \ 32 | ../../src/arduino/*.cpp \ 33 | ../../src/chips/*.cpp \ 34 | ../../src/ethernet/*.cpp \ 35 | ../../src/front_panel/*.cpp \ 36 | ../../../eez_psu_sketch/*.cpp \ 37 | ../../../libraries/eez_psu_lib/src/eez_psu.cpp \ 38 | ../../../libraries/eez_psu_lib/src/R1B9/R1B9_init.cpp \ 39 | ../../../libraries/eez_psu_lib/src/R3B4/R3B4_init.cpp \ 40 | ../../../libraries/eez_psu_lib/src/R5B12/R5B12_init.cpp 41 | 42 | SIM_LINKERFLAGS = -ldl -lpthread 43 | 44 | # GUI dynamic library 45 | 46 | GUI_DLIB_NAME = eez_imgui.so 47 | 48 | GUI_CXXFLAGS = -Wall -fpermissive -fPIC `sdl2-config --cflags` -I../../src 49 | 50 | GUI_SOURCES = ../../src/imgui/*.cpp 51 | 52 | GUI_LINKERFLAGS = -shared `sdl2-config --libs` \ 53 | -ldl -lpthread -lSDL2_image -lSDL2_ttf 54 | 55 | # rules 56 | 57 | all: clean simulator gui 58 | 59 | clean: 60 | rm -f *.o $(SIM_PROGRAM_NAME) $(GUI_DLIB_NAME) 61 | 62 | simulator: 63 | $(CC) $(SIM_CFLAGS) $(SIM_CSOURCES) 64 | $(CXX) *.o $(SIM_CXXFLAGS) $(SIM_CXXSOURCES) $(SIM_LINKERFLAGS) -o $(SIM_PROGRAM_NAME) 65 | 66 | gui: 67 | $(CXX) $(GUI_CXXFLAGS) $(GUI_SOURCES) $(GUI_LINKERFLAGS) -o $(GUI_DLIB_NAME) 68 | 69 | -------------------------------------------------------------------------------- /libraries/scpi-parser/src/scpi/constants.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2012-2013 Jan Breuer, 3 | * 4 | * All Rights Reserved 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are 8 | * met: 9 | * 1. Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR 16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE 19 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 22 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 23 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 24 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 25 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /** 29 | * @file scpi_constants.h 30 | * @date Thu Nov 15 10:58:45 UTC 2012 31 | * 32 | * @brief SCPI Device constants 33 | * 34 | * 35 | */ 36 | 37 | #ifndef SCPI_CONSTANTS_H 38 | #define SCPI_CONSTANTS_H 39 | 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | /* 21.21 :VERSion? 45 | * YYYY.V 46 | * YYYY = SCPI year 47 | * V = SCPI revision 48 | */ 49 | #define SCPI_STD_VERSION_REVISION "1999.0" 50 | 51 | #ifdef __cplusplus 52 | } 53 | #endif 54 | 55 | #endif /* SCPI_CONSTANTS_H */ 56 | 57 | -------------------------------------------------------------------------------- /eez_psu_sketch/board.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #include "psu.h" 20 | #include "board.h" 21 | #if (EEZ_PSU_SELECTED_REVISION == EEZ_PSU_REVISION_R3B4 || EEZ_PSU_SELECTED_REVISION == EEZ_PSU_REVISION_R5B12) && OPTION_WATCHDOG 22 | #include "watchdog.h" 23 | #endif 24 | 25 | namespace eez { 26 | namespace psu { 27 | namespace board { 28 | 29 | void powerUp() { 30 | digitalWrite(PWR_SSTART, HIGH); 31 | delay(700); 32 | 33 | DebugTrace("PWR_DIRECT -> HIGH"); 34 | digitalWrite(PWR_DIRECT, HIGH); 35 | delay(100); 36 | 37 | digitalWrite(PWR_SSTART, LOW); 38 | } 39 | 40 | void powerDown() { 41 | //#if (EEZ_PSU_SELECTED_REVISION == EEZ_PSU_REVISION_R3B4 || EEZ_PSU_SELECTED_REVISION == EEZ_PSU_REVISION_R5B12) && OPTION_WATCHDOG && (CONF_DEBUG || CONF_DEBUG_LATEST) 42 | // watchdog::printInfo(); 43 | //#endif 44 | 45 | DebugTrace("PWR_DIRECT -> LOW"); 46 | digitalWrite(PWR_DIRECT, LOW); 47 | } 48 | 49 | #if EEZ_PSU_SELECTED_REVISION == EEZ_PSU_REVISION_R1B9 50 | 51 | void cvLedSwitch(Channel *channel, bool on) { 52 | digitalWrite(channel->cv_led_pin, on); 53 | } 54 | 55 | void ccLedSwitch(Channel *channel, bool on) { 56 | digitalWrite(channel->cc_led_pin, on); 57 | } 58 | 59 | #endif 60 | 61 | } 62 | } 63 | } // namespace eez::psu::board -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2/include/SDL_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef _SDL_config_h 23 | #define _SDL_config_h 24 | 25 | #include "SDL_platform.h" 26 | 27 | /** 28 | * \file SDL_config.h 29 | */ 30 | 31 | /* Add any platform that doesn't build using the configure system. */ 32 | #ifdef USING_PREMAKE_CONFIG_H 33 | #include "SDL_config_premake.h" 34 | #elif defined(__WIN32__) 35 | #include "SDL_config_windows.h" 36 | #elif defined(__WINRT__) 37 | #include "SDL_config_winrt.h" 38 | #elif defined(__MACOSX__) 39 | #include "SDL_config_macosx.h" 40 | #elif defined(__IPHONEOS__) 41 | #include "SDL_config_iphoneos.h" 42 | #elif defined(__ANDROID__) 43 | #include "SDL_config_android.h" 44 | #elif defined(__PSP__) 45 | #include "SDL_config_psp.h" 46 | #else 47 | /* This is a minimal configuration just to get SDL running on new platforms */ 48 | #include "SDL_config_minimal.h" 49 | #endif /* platform config */ 50 | 51 | #ifdef USING_GENERATED_CONFIG_H 52 | #error Wrong SDL_config.h, check your include path? 53 | #endif 54 | 55 | #endif /* _SDL_config_h */ 56 | -------------------------------------------------------------------------------- /simulator/src/arduino/SPI.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include "Arduino.h" 22 | 23 | #define SPI_CLOCK_DIV4 0x00 24 | #define SPI_CLOCK_DIV16 0x01 25 | #define SPI_CLOCK_DIV64 0x02 26 | #define SPI_CLOCK_DIV128 0x03 27 | #define SPI_CLOCK_DIV2 0x04 28 | #define SPI_CLOCK_DIV8 0x05 29 | #define SPI_CLOCK_DIV32 0x06 30 | 31 | #define SPI_MODE0 0x00 32 | #define SPI_MODE1 0x04 33 | #define SPI_MODE2 0x08 34 | #define SPI_MODE3 0x0C 35 | 36 | namespace eez { 37 | namespace psu { 38 | namespace simulator { 39 | namespace arduino { 40 | 41 | /// Bare minimum implementation of the Arduino SPISettings class 42 | class SPISettings { 43 | public: 44 | SPISettings(uint32_t clock, uint8_t bitOrder, uint8_t dataMode); 45 | }; 46 | 47 | /// Bare minimum implementation of the Arduino SPI object 48 | class SimulatorSPI { 49 | public: 50 | void begin(); 51 | 52 | void usingInterrupt(uint8_t interruptNumber); 53 | void beginTransaction(SPISettings settings); 54 | uint8_t transfer(uint8_t data); 55 | void endTransaction(void); 56 | void attachInterrupt(); 57 | 58 | void setBitOrder(int _order); 59 | void setDataMode(uint8_t _mode); 60 | void setClockDivider(uint8_t _div); 61 | }; 62 | 63 | extern SimulatorSPI SPI; 64 | 65 | } 66 | } 67 | } 68 | } // namespace eez::psu::simulator::arduino; 69 | -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2/include/SDL_test_log.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_log.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | * 32 | * Wrapper to log in the TEST category 33 | * 34 | */ 35 | 36 | #ifndef _SDL_test_log_h 37 | #define _SDL_test_log_h 38 | 39 | #include "begin_code.h" 40 | /* Set up for C function definitions, even when using C++ */ 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | /** 46 | * \brief Prints given message with a timestamp in the TEST category and INFO priority. 47 | * 48 | * \param fmt Message to be logged 49 | */ 50 | void SDLTest_Log(const char *fmt, ...); 51 | 52 | /** 53 | * \brief Prints given message with a timestamp in the TEST category and the ERROR priority. 54 | * 55 | * \param fmt Message to be logged 56 | */ 57 | void SDLTest_LogError(const char *fmt, ...); 58 | 59 | /* Ends C function definitions when using C++ */ 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | #include "close_code.h" 64 | 65 | #endif /* _SDL_test_log_h */ 66 | 67 | /* vi: set ts=4 sw=4 expandtab: */ 68 | -------------------------------------------------------------------------------- /eez_psu_sketch/gui_edit_mode_keypad.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #include "psu.h" 20 | 21 | #if OPTION_DISPLAY 22 | 23 | #include "sound.h" 24 | #include "channel_dispatcher.h" 25 | 26 | #include "gui_edit_mode.h" 27 | #include "gui_edit_mode_keypad.h" 28 | #include "gui_numeric_keypad.h" 29 | 30 | namespace eez { 31 | namespace psu { 32 | namespace gui { 33 | namespace edit_mode_keypad { 34 | 35 | NumericKeypad *g_keypad; 36 | 37 | //////////////////////////////////////////////////////////////////////////////// 38 | 39 | bool onKeypadOk(float value) { 40 | return edit_mode::setValue(value); 41 | } 42 | 43 | void enter(Channel &channel, const data::Value& editValue, const data::Value& minValue, data::Value& maxValue) { 44 | g_keypad = new NumericKeypad(); 45 | 46 | NumericKeypadOptions options; 47 | 48 | options.channelIndex = channel.index - 1; 49 | 50 | options.editUnit = editValue.getType(); 51 | 52 | options.min = minValue.getFloat(); 53 | options.max = maxValue.getFloat(); 54 | options.def = 0; 55 | 56 | options.enableMaxButton(); 57 | options.enableDefButton(); 58 | options.flags.signButtonEnabled = true; 59 | options.flags.dotButtonEnabled = true; 60 | 61 | g_keypad->init(0, editValue, options, (void (*)(float))onKeypadOk, 0); 62 | } 63 | 64 | void exit() { 65 | if (g_keypad) { 66 | delete g_keypad; 67 | g_keypad = 0; 68 | } 69 | } 70 | 71 | } 72 | } 73 | } 74 | } // namespace eez::psu::gui::edit_mode_keypad 75 | 76 | #endif -------------------------------------------------------------------------------- /libraries/scpi-parser/src/impl/parser_private.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2012-2013 Jan Breuer, 3 | * 4 | * All Rights Reserved 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are 8 | * met: 9 | * 1. Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR 16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE 19 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 22 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 23 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 24 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 25 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /** 29 | * @file parser_private.h 30 | * 31 | * @brief SCPI Parser private definitions 32 | * 33 | * 34 | */ 35 | 36 | #ifndef SCPI_PARSER_PRIVATE_H 37 | #define SCPI_PARSER_PRIVATE_H 38 | 39 | #include "scpi/types.h" 40 | #include "utils_private.h" 41 | 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif 45 | 46 | int scpiParser_parseProgramData(lex_state_t * state, scpi_token_t * token) LOCAL; 47 | int scpiParser_parseAllProgramData(lex_state_t * state, scpi_token_t * token, int * numberOfParameters) LOCAL; 48 | int scpiParser_detectProgramMessageUnit(scpi_parser_state_t * state, char * buffer, int len) LOCAL; 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #endif /* SCPI_PARSER_PRIVATE_H */ 55 | 56 | -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2/include/SDL_test.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | #ifndef _SDL_test_h 31 | #define _SDL_test_h 32 | 33 | #include "SDL.h" 34 | #include "SDL_test_common.h" 35 | #include "SDL_test_font.h" 36 | #include "SDL_test_random.h" 37 | #include "SDL_test_fuzzer.h" 38 | #include "SDL_test_crc32.h" 39 | #include "SDL_test_md5.h" 40 | #include "SDL_test_log.h" 41 | #include "SDL_test_assert.h" 42 | #include "SDL_test_harness.h" 43 | #include "SDL_test_images.h" 44 | #include "SDL_test_compare.h" 45 | 46 | #include "begin_code.h" 47 | /* Set up for C function definitions, even when using C++ */ 48 | #ifdef __cplusplus 49 | extern "C" { 50 | #endif 51 | 52 | /* Global definitions */ 53 | 54 | /* 55 | * Note: Maximum size of SDLTest log message is less than SDLs limit 56 | * to ensure we can fit additional information such as the timestamp. 57 | */ 58 | #define SDLTEST_MAX_LOGMESSAGE_LENGTH 3584 59 | 60 | /* Ends C function definitions when using C++ */ 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | #include "close_code.h" 65 | 66 | #endif /* _SDL_test_h */ 67 | 68 | /* vi: set ts=4 sw=4 expandtab: */ 69 | -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2/include/SDL_clipboard.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_clipboard.h 24 | * 25 | * Include file for SDL clipboard handling 26 | */ 27 | 28 | #ifndef _SDL_clipboard_h 29 | #define _SDL_clipboard_h 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /* Function prototypes */ 40 | 41 | /** 42 | * \brief Put UTF-8 text into the clipboard 43 | * 44 | * \sa SDL_GetClipboardText() 45 | */ 46 | extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text); 47 | 48 | /** 49 | * \brief Get UTF-8 text from the clipboard, which must be freed with SDL_free() 50 | * 51 | * \sa SDL_SetClipboardText() 52 | */ 53 | extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void); 54 | 55 | /** 56 | * \brief Returns a flag indicating whether the clipboard exists and contains a text string that is non-empty 57 | * 58 | * \sa SDL_GetClipboardText() 59 | */ 60 | extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void); 61 | 62 | 63 | /* Ends C function definitions when using C++ */ 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | #include "close_code.h" 68 | 69 | #endif /* _SDL_clipboard_h */ 70 | 71 | /* vi: set ts=4 sw=4 expandtab: */ 72 | -------------------------------------------------------------------------------- /libraries/scpi-parser/src/scpi/units.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2012-2013 Jan Breuer, 3 | * 4 | * All Rights Reserved 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are 8 | * met: 9 | * 1. Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR 16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE 19 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 22 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 23 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 24 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 25 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /** 29 | * @file scpi_units.h 30 | * @date Thu Nov 15 10:58:45 UTC 2012 31 | * 32 | * @brief SCPI Units 33 | * 34 | * 35 | */ 36 | 37 | #ifndef SCPI_UNITS_H 38 | #define SCPI_UNITS_H 39 | 40 | #include "scpi/types.h" 41 | 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif 45 | 46 | extern const scpi_unit_def_t scpi_units_def[]; 47 | extern const scpi_choice_def_t scpi_special_numbers_def[]; 48 | 49 | scpi_bool_t SCPI_ParamNumber(scpi_t * context, const scpi_choice_def_t * special, scpi_number_t * value, scpi_bool_t mandatory); 50 | 51 | scpi_bool_t SCPI_ParamTranslateNumberVal(scpi_t * context, scpi_parameter_t * parameter); 52 | size_t SCPI_NumberToStr(scpi_t * context, const scpi_choice_def_t * special, scpi_number_t * value, char * str, size_t len); 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif /* SCPI_UNITS_H */ 59 | 60 | -------------------------------------------------------------------------------- /eez_psu_sketch/sd_card.h: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2017-present, Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | extern SdFat SD; 24 | 25 | namespace eez { 26 | namespace psu { 27 | namespace sd_card { 28 | 29 | extern TestResult g_testResult; 30 | 31 | void init(); 32 | bool test(); 33 | 34 | void dumpInfo(char *buffer); 35 | 36 | void matchZeroOrMoreSpaces(File& file); 37 | bool match(File& file, float &result); 38 | bool match(File& file, char c); 39 | 40 | bool makeParentDir(const char *filePath); 41 | 42 | bool exists(const char *dirPath, int *err); 43 | bool catalog(const char *dirPath, void *param, void (*callback)(void *param, const char *name, const char *type, size_t size), int *err); 44 | bool catalogLength(const char *dirPath, size_t *length, int *err); 45 | bool upload(const char *filePath, void *param, void (*callback)(void *param, const void *buffer, size_t size), int *err); 46 | bool download(const char *filePath, bool truncate, const void *buffer, size_t size, int *err); 47 | bool moveFile(const char *sourcePath, const char *destinationPath, int *err); 48 | bool copyFile(const char *sourcePath, const char *destinationPath, int *err); 49 | bool deleteFile(const char *filePath, int *err); 50 | bool makeDir(const char *dirPath, int *err); 51 | bool removeDir(const char *dirPath, int *err); 52 | bool getDate(const char *filePath, uint8_t &year, uint8_t &month, uint8_t &day, int *err); 53 | bool getTime(const char *filePath, uint8_t &hour, uint8_t &minute, uint8_t &second, int *err); 54 | 55 | bool getInfo(uint64_t &usedSpace, uint64_t &freeSpace); 56 | 57 | } 58 | } 59 | } // namespace eez::psu::sd_card 60 | -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2/include/SDL_quit.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_quit.h 24 | * 25 | * Include file for SDL quit event handling. 26 | */ 27 | 28 | #ifndef _SDL_quit_h 29 | #define _SDL_quit_h 30 | 31 | #include "SDL_stdinc.h" 32 | #include "SDL_error.h" 33 | 34 | /** 35 | * \file SDL_quit.h 36 | * 37 | * An ::SDL_QUIT event is generated when the user tries to close the application 38 | * window. If it is ignored or filtered out, the window will remain open. 39 | * If it is not ignored or filtered, it is queued normally and the window 40 | * is allowed to close. When the window is closed, screen updates will 41 | * complete, but have no effect. 42 | * 43 | * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) 44 | * and SIGTERM (system termination request), if handlers do not already 45 | * exist, that generate ::SDL_QUIT events as well. There is no way 46 | * to determine the cause of an ::SDL_QUIT event, but setting a signal 47 | * handler in your application will override the default generation of 48 | * quit events for that signal. 49 | * 50 | * \sa SDL_Quit() 51 | */ 52 | 53 | /* There are no functions directly affecting the quit event */ 54 | 55 | #define SDL_QuitRequested() \ 56 | (SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0)) 57 | 58 | #endif /* _SDL_quit_h */ 59 | -------------------------------------------------------------------------------- /simulator/platform/linux/src/main_loop.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * EEZ PSU Firmware 3 | * Copyright (C) 2015 Envox d.o.o. 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #include "psu.h" 20 | #include "serial_psu.h" 21 | #include "main_loop.h" 22 | 23 | #include 24 | #include "thread_queue.h" 25 | 26 | using namespace eez::psu; 27 | 28 | #define NEW_INPUT_MESSAGE 1 29 | #define QUIT_MESSAGE 2 30 | 31 | threadqueue queue; 32 | 33 | void *input_thread(void *) { 34 | while (1) { 35 | int ch = getchar(); 36 | if (ch == EOF) break; 37 | 38 | thread_queue_add(&queue, new char(ch), NEW_INPUT_MESSAGE); 39 | } 40 | 41 | thread_queue_add(&queue, 0, QUIT_MESSAGE); 42 | 43 | return 0; 44 | } 45 | 46 | 47 | int main_loop() { 48 | timespec timeout = { 0, TICK_TIMEOUT * 1000 * 1000 }; 49 | 50 | if (thread_queue_init(&queue) != 0) return -1; 51 | 52 | pthread_t thread; 53 | pthread_create(&thread, 0, input_thread, 0); 54 | 55 | while (1) { 56 | threadmsg msg; 57 | char *p_ch; 58 | int ret; 59 | switch (ret = thread_queue_get(&queue, &timeout, &msg)) { 60 | case 0: 61 | switch (msg.msgtype) { 62 | case NEW_INPUT_MESSAGE: 63 | p_ch = (char *)msg.data; 64 | SERIAL_PORT.put(*p_ch); 65 | delete p_ch; 66 | break; 67 | 68 | case QUIT_MESSAGE: 69 | return 0; 70 | } 71 | break; 72 | 73 | case ETIMEDOUT: 74 | simulator::tick(); 75 | break; 76 | 77 | default: 78 | return ret; 79 | } 80 | } 81 | } 82 | 83 | void main_loop_exit() { 84 | ::exit(0); 85 | } -------------------------------------------------------------------------------- /doc/template/header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | $projectname: $title 17 | $title 18 | 19 | 20 | $treeview 21 | $search 22 | $mathjax 23 | 24 | $extrastylesheet 25 | 26 | 27 | 28 | 29 | 30 | 31 | 38 |
39 |
40 |
41 |
42 |
43 |
44 | -------------------------------------------------------------------------------- /libraries/scpi-parser/src/impl/fifo_private.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2012-2013 Jan Breuer, 3 | * 4 | * All Rights Reserved 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are 8 | * met: 9 | * 1. Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR 16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE 19 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 22 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 23 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 24 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 25 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /** 29 | * @file scpi_fifo.h 30 | * @date Thu Nov 15 10:58:45 UTC 2012 31 | * 32 | * @brief basic FIFO implementation 33 | * 34 | * 35 | */ 36 | 37 | #ifndef SCPI_FIFO_H 38 | #define SCPI_FIFO_H 39 | 40 | #include "scpi/types.h" 41 | #include "utils_private.h" 42 | 43 | #ifdef __cplusplus 44 | extern "C" { 45 | #endif 46 | 47 | void fifo_init(scpi_fifo_t * fifo, int16_t * data, int16_t size) LOCAL; 48 | void fifo_clear(scpi_fifo_t * fifo) LOCAL; 49 | scpi_bool_t fifo_is_empty(scpi_fifo_t * fifo) LOCAL; 50 | scpi_bool_t fifo_is_full(scpi_fifo_t * fifo) LOCAL; 51 | scpi_bool_t fifo_add(scpi_fifo_t * fifo, int16_t value) LOCAL; 52 | scpi_bool_t fifo_remove(scpi_fifo_t * fifo, int16_t * value) LOCAL; 53 | scpi_bool_t fifo_remove_last(scpi_fifo_t * fifo, int16_t * value) LOCAL; 54 | scpi_bool_t fifo_count(scpi_fifo_t * fifo, int16_t * value) LOCAL; 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif /* SCPI_FIFO_H */ 61 | -------------------------------------------------------------------------------- /simulator/platform/win32/third_party/SDL2/include/SDL_test_compare.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2014 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_compare.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | 32 | Defines comparison functions (i.e. for surfaces). 33 | 34 | */ 35 | 36 | #ifndef _SDL_test_compare_h 37 | #define _SDL_test_compare_h 38 | 39 | #include "SDL.h" 40 | 41 | #include "SDL_test_images.h" 42 | 43 | #include "begin_code.h" 44 | /* Set up for C function definitions, even when using C++ */ 45 | #ifdef __cplusplus 46 | extern "C" { 47 | #endif 48 | 49 | /** 50 | * \brief Compares a surface and with reference image data for equality 51 | * 52 | * \param surface Surface used in comparison 53 | * \param referenceSurface Test Surface used in comparison 54 | * \param allowable_error Allowable difference (squared) in blending accuracy. 55 | * 56 | * \returns 0 if comparison succeeded, >0 (=number of pixels where comparison failed) if comparison failed, -1 if any of the surfaces were NULL, -2 if the surface sizes differ. 57 | */ 58 | int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error); 59 | 60 | 61 | /* Ends C function definitions when using C++ */ 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | #include "close_code.h" 66 | 67 | #endif /* _SDL_test_compare_h */ 68 | 69 | /* vi: set ts=4 sw=4 expandtab: */ 70 | -------------------------------------------------------------------------------- /libraries/scpi-parser/src/scpi/minimal.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2012-2013 Jan Breuer, 3 | * 4 | * All Rights Reserved 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are 8 | * met: 9 | * 1. Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR 16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE 19 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 22 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 23 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 24 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 25 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /** 29 | * @file scpi_minimal.h 30 | * @date Thu Nov 15 10:58:45 UTC 2012 31 | * 32 | * @brief SCPI minimal implementation 33 | * 34 | * 35 | */ 36 | 37 | #ifndef SCPI_MINIMAL_H 38 | #define SCPI_MINIMAL_H 39 | 40 | #include "scpi/types.h" 41 | 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif 45 | 46 | scpi_result_t SCPI_Stub(scpi_t * context); 47 | scpi_result_t SCPI_StubQ(scpi_t * context); 48 | 49 | scpi_result_t SCPI_SystemVersionQ(scpi_t * context); 50 | scpi_result_t SCPI_SystemErrorNextQ(scpi_t * context); 51 | scpi_result_t SCPI_SystemErrorCountQ(scpi_t * context); 52 | scpi_result_t SCPI_StatusQuestionableEventQ(scpi_t * context); 53 | scpi_result_t SCPI_StatusQuestionableEnableQ(scpi_t * context); 54 | scpi_result_t SCPI_StatusQuestionableEnable(scpi_t * context); 55 | scpi_result_t SCPI_StatusPreset(scpi_t * context); 56 | 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | 62 | #endif /* SCPI_MINIMAL_H */ 63 | 64 | --------------------------------------------------------------------------------