├── Firmware
└── OpenHeat-fw
│ ├── .gitignore
│ ├── .idea
│ ├── .gitignore
│ ├── OpenHeat-fw.iml
│ ├── deployment.xml
│ ├── encodings.xml
│ ├── misc.xml
│ ├── modules.xml
│ ├── serialmonitor_settings.xml
│ └── vcs.xml
│ ├── .vscode
│ ├── c_cpp_properties.json
│ ├── extensions.json
│ └── launch.json
│ ├── CMakeLists.txt
│ ├── include
│ └── README
│ ├── lib
│ ├── OneButton
│ │ ├── .github
│ │ │ └── workflows
│ │ │ │ └── arduino-checks.yml
│ │ ├── .gitignore
│ │ ├── CHANGELOG.md
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── examples
│ │ │ ├── BlinkMachine
│ │ │ │ └── BlinkMachine.ino
│ │ │ ├── InterruptOneButton
│ │ │ │ └── InterruptOneButton.ino
│ │ │ ├── SimpleOneButton
│ │ │ │ └── SimpleOneButton.ino
│ │ │ ├── SpecialInput
│ │ │ │ └── SpecialInput.ino
│ │ │ └── TwoButtons
│ │ │ │ └── TwoButtons.ino
│ │ ├── keywords.txt
│ │ ├── library.json
│ │ ├── library.properties
│ │ └── src
│ │ │ ├── OneButton.cpp
│ │ │ └── OneButton.h
│ ├── PID
│ │ ├── PID_v1.cpp
│ │ ├── PID_v1.h
│ │ ├── README.txt
│ │ ├── examples
│ │ │ ├── PID_AdaptiveTunings
│ │ │ │ └── PID_AdaptiveTunings.ino
│ │ │ ├── PID_Basic
│ │ │ │ └── PID_Basic.ino
│ │ │ ├── PID_PonM
│ │ │ │ └── PID_PonM.ino
│ │ │ └── PID_RelayOutput
│ │ │ │ └── PID_RelayOutput.ino
│ │ ├── keywords.txt
│ │ ├── library.json
│ │ └── library.properties
│ ├── QRCode
│ │ ├── .gitignore
│ │ ├── LICENSE.txt
│ │ ├── README.md
│ │ ├── examples
│ │ │ └── QRCode
│ │ │ │ └── QRCode.ino
│ │ ├── generate_table.py
│ │ ├── keywords.txt
│ │ ├── library.properties
│ │ ├── src
│ │ │ ├── qrcode.c
│ │ │ └── qrcode.h
│ │ └── tests
│ │ │ ├── BitBuffer.cpp
│ │ │ ├── BitBuffer.hpp
│ │ │ ├── QrCode.cpp
│ │ │ ├── QrCode.hpp
│ │ │ ├── QrSegment.cpp
│ │ │ ├── QrSegment.hpp
│ │ │ ├── README.md
│ │ │ ├── run-tests.cpp
│ │ │ └── run.sh
│ ├── README
│ ├── Shell
│ │ ├── README.md
│ │ ├── Shell.c
│ │ ├── Shell.h
│ │ ├── examples
│ │ │ ├── Shell_Basic
│ │ │ │ └── Shell_Basic.ino
│ │ │ ├── Shell_Command_Args
│ │ │ │ └── Shell_Command_Args.ino
│ │ │ ├── Shell_IO_Control
│ │ │ │ └── Shell_IO_Control.ino
│ │ │ ├── Shell_Minimum
│ │ │ │ └── Shell_Minimum.ino
│ │ │ ├── Shell_RGB_Control
│ │ │ │ └── Shell_RGB_Control.ino
│ │ │ └── Shell_Telnet
│ │ │ │ └── Shell_Telnet.ino
│ │ ├── keywords.txt
│ │ ├── library.properties
│ │ └── license.txt
│ └── U8g2
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── examples
│ │ ├── full_buffer
│ │ │ ├── FPS
│ │ │ │ └── FPS.ino
│ │ │ ├── FontUsage
│ │ │ │ └── FontUsage.ino
│ │ │ ├── GraphicsTest
│ │ │ │ └── GraphicsTest.ino
│ │ │ ├── HelloWorld
│ │ │ │ └── HelloWorld.ino
│ │ │ ├── IconMenu
│ │ │ │ └── IconMenu.ino
│ │ │ ├── PrintUTF8
│ │ │ │ └── PrintUTF8.ino
│ │ │ ├── SelectionList
│ │ │ │ └── SelectionList.ino
│ │ │ ├── Shennong
│ │ │ │ └── Shennong.ino
│ │ │ ├── U8g2Logo
│ │ │ │ └── U8g2Logo.ino
│ │ │ ├── UpdateArea
│ │ │ │ └── UpdateArea.ino
│ │ │ └── Weather
│ │ │ │ └── Weather.ino
│ │ ├── games
│ │ │ ├── LittleRookChess
│ │ │ │ └── LittleRookChess.ino
│ │ │ └── SpaceTrash
│ │ │ │ └── SpaceTrash.ino
│ │ ├── page_buffer
│ │ │ ├── A2Printer
│ │ │ │ └── A2Printer.ino
│ │ │ ├── Chinese
│ │ │ │ └── Chinese.ino
│ │ │ ├── ClipWindow
│ │ │ │ └── ClipWindow.ino
│ │ │ ├── Clock
│ │ │ │ └── Clock.ino
│ │ │ ├── ContrastTest
│ │ │ │ └── ContrastTest.ino
│ │ │ ├── Devanagari
│ │ │ │ └── Devanagari.ino
│ │ │ ├── DirectAccess
│ │ │ │ └── DirectAccess.ino
│ │ │ ├── DrawLog
│ │ │ │ └── DrawLog.ino
│ │ │ ├── ExtUTF8
│ │ │ │ └── ExtUTF8.ino
│ │ │ ├── FPS
│ │ │ │ └── FPS.ino
│ │ │ ├── FlipMode
│ │ │ │ └── FlipMode.ino
│ │ │ ├── GraphicsTest
│ │ │ │ └── GraphicsTest.ino
│ │ │ ├── HelloWorld
│ │ │ │ └── HelloWorld.ino
│ │ │ ├── IconMenu
│ │ │ │ └── IconMenu.ino
│ │ │ ├── Japanese
│ │ │ │ └── Japanese.ino
│ │ │ ├── Korean
│ │ │ │ └── Korean.ino
│ │ │ ├── PowerSaveTest
│ │ │ │ └── PowerSaveTest.ino
│ │ │ ├── PrintHelloWorld
│ │ │ │ └── PrintHelloWorld.ino
│ │ │ ├── PrintProgmem
│ │ │ │ └── PrintProgmem.ino
│ │ │ ├── PrintUTF8
│ │ │ │ └── PrintUTF8.ino
│ │ │ ├── ScrollingText
│ │ │ │ └── ScrollingText.ino
│ │ │ ├── SelectionList
│ │ │ │ └── SelectionList.ino
│ │ │ ├── Serial
│ │ │ │ └── Serial.ino
│ │ │ ├── Shennong
│ │ │ │ └── Shennong.ino
│ │ │ ├── StateBufferLoop
│ │ │ │ └── StateBufferLoop.ino
│ │ │ ├── Terminal
│ │ │ │ └── Terminal.ino
│ │ │ ├── U8g2Logo
│ │ │ │ └── U8g2Logo.ino
│ │ │ ├── UpdatePartly
│ │ │ │ └── UpdatePartly.ino
│ │ │ ├── Weather
│ │ │ │ └── Weather.ino
│ │ │ ├── XBM
│ │ │ │ └── XBM.ino
│ │ │ └── XORTest
│ │ │ │ └── XORTest.ino
│ │ └── u8x8
│ │ │ ├── 16x16Font
│ │ │ └── 16x16Font.ino
│ │ │ ├── ArduboyTest
│ │ │ └── ArduboyTest.ino
│ │ │ ├── FlipMode
│ │ │ └── FlipMode.ino
│ │ │ ├── GraphicsTest
│ │ │ └── GraphicsTest.ino
│ │ │ ├── HelloWorld
│ │ │ └── HelloWorld.ino
│ │ │ ├── MessageBox
│ │ │ └── MessageBox.ino
│ │ │ └── Terminal
│ │ │ └── Terminal.ino
│ │ ├── extras
│ │ └── ChangeLog
│ │ ├── keywords.txt
│ │ ├── library.properties
│ │ └── src
│ │ ├── U8g2lib.h
│ │ ├── U8x8lib.cpp
│ │ ├── U8x8lib.h
│ │ └── clib
│ │ ├── u8g2.h
│ │ ├── u8g2_bitmap.c
│ │ ├── u8g2_box.c
│ │ ├── u8g2_buffer.c
│ │ ├── u8g2_circle.c
│ │ ├── u8g2_cleardisplay.c
│ │ ├── u8g2_d_memory.c
│ │ ├── u8g2_d_setup.c
│ │ ├── u8g2_font.c
│ │ ├── u8g2_fonts.c
│ │ ├── u8g2_hvline.c
│ │ ├── u8g2_input_value.c
│ │ ├── u8g2_intersection.c
│ │ ├── u8g2_kerning.c
│ │ ├── u8g2_line.c
│ │ ├── u8g2_ll_hvline.c
│ │ ├── u8g2_message.c
│ │ ├── u8g2_polygon.c
│ │ ├── u8g2_selection_list.c
│ │ ├── u8g2_setup.c
│ │ ├── u8log.c
│ │ ├── u8log_u8g2.c
│ │ ├── u8log_u8x8.c
│ │ ├── u8x8.h
│ │ ├── u8x8_8x8.c
│ │ ├── u8x8_byte.c
│ │ ├── u8x8_cad.c
│ │ ├── u8x8_capture.c
│ │ ├── u8x8_d_a2printer.c
│ │ ├── u8x8_d_il3820_296x128.c
│ │ ├── u8x8_d_ist3020.c
│ │ ├── u8x8_d_ist7920.c
│ │ ├── u8x8_d_ks0108.c
│ │ ├── u8x8_d_lc7981.c
│ │ ├── u8x8_d_ld7032_60x32.c
│ │ ├── u8x8_d_ls013b7dh03.c
│ │ ├── u8x8_d_max7219.c
│ │ ├── u8x8_d_pcd8544_84x48.c
│ │ ├── u8x8_d_pcf8812.c
│ │ ├── u8x8_d_pcf8814_hx1230.c
│ │ ├── u8x8_d_s1d15721.c
│ │ ├── u8x8_d_s1d15e06.c
│ │ ├── u8x8_d_sbn1661.c
│ │ ├── u8x8_d_sed1330.c
│ │ ├── u8x8_d_sh1106_64x32.c
│ │ ├── u8x8_d_sh1106_72x40.c
│ │ ├── u8x8_d_sh1107.c
│ │ ├── u8x8_d_sh1108.c
│ │ ├── u8x8_d_sh1122.c
│ │ ├── u8x8_d_ssd1305.c
│ │ ├── u8x8_d_ssd1306_128x32.c
│ │ ├── u8x8_d_ssd1306_128x64_noname.c
│ │ ├── u8x8_d_ssd1306_128x80_noname.c
│ │ ├── u8x8_d_ssd1306_2040x16.c
│ │ ├── u8x8_d_ssd1306_48x64.c
│ │ ├── u8x8_d_ssd1306_64x32.c
│ │ ├── u8x8_d_ssd1306_64x48.c
│ │ ├── u8x8_d_ssd1306_72x40.c
│ │ ├── u8x8_d_ssd1306_96x16.c
│ │ ├── u8x8_d_ssd1309.c
│ │ ├── u8x8_d_ssd1316.c
│ │ ├── u8x8_d_ssd1317.c
│ │ ├── u8x8_d_ssd1318.c
│ │ ├── u8x8_d_ssd1320.c
│ │ ├── u8x8_d_ssd1322.c
│ │ ├── u8x8_d_ssd1325.c
│ │ ├── u8x8_d_ssd1326.c
│ │ ├── u8x8_d_ssd1327.c
│ │ ├── u8x8_d_ssd1329.c
│ │ ├── u8x8_d_ssd1606_172x72.c
│ │ ├── u8x8_d_ssd1607_200x200.c
│ │ ├── u8x8_d_st7511.c
│ │ ├── u8x8_d_st75256.c
│ │ ├── u8x8_d_st7528.c
│ │ ├── u8x8_d_st75320.c
│ │ ├── u8x8_d_st7565.c
│ │ ├── u8x8_d_st7567.c
│ │ ├── u8x8_d_st7571.c
│ │ ├── u8x8_d_st7586s_erc240160.c
│ │ ├── u8x8_d_st7586s_s028hn118a.c
│ │ ├── u8x8_d_st7586s_ymc240160.c
│ │ ├── u8x8_d_st7588.c
│ │ ├── u8x8_d_st7920.c
│ │ ├── u8x8_d_stdio.c
│ │ ├── u8x8_d_t6963.c
│ │ ├── u8x8_d_uc1601.c
│ │ ├── u8x8_d_uc1604.c
│ │ ├── u8x8_d_uc1608.c
│ │ ├── u8x8_d_uc1610.c
│ │ ├── u8x8_d_uc1611.c
│ │ ├── u8x8_d_uc1617.c
│ │ ├── u8x8_d_uc1638.c
│ │ ├── u8x8_d_uc1701_dogs102.c
│ │ ├── u8x8_d_uc1701_mini12864.c
│ │ ├── u8x8_debounce.c
│ │ ├── u8x8_display.c
│ │ ├── u8x8_fonts.c
│ │ ├── u8x8_gpio.c
│ │ ├── u8x8_input_value.c
│ │ ├── u8x8_message.c
│ │ ├── u8x8_selection_list.c
│ │ ├── u8x8_setup.c
│ │ ├── u8x8_string.c
│ │ ├── u8x8_u16toa.c
│ │ └── u8x8_u8toa.c
│ ├── platformio.ini
│ ├── src
│ ├── BLE.cpp
│ ├── BLE.h
│ ├── Beep.cpp
│ ├── Beep.h
│ ├── Bezier.cpp
│ ├── Bezier.h
│ ├── Bitmap.cpp
│ ├── Bitmap.h
│ ├── Calibration.cpp
│ ├── Calibration.h
│ ├── Event.cpp
│ ├── Event.h
│ ├── ExternDraw.cpp
│ ├── ExternDraw.h
│ ├── FilesSystem.cpp
│ ├── FilesSystem.h
│ ├── MathFun.cpp
│ ├── MathFun.h
│ ├── Menu.cpp
│ ├── Menu.h
│ ├── MyShell.cpp
│ ├── MyShell.h
│ ├── OpenT12.h
│ ├── Rotary.cpp
│ ├── Rotary.h
│ ├── TipControl.cpp
│ ├── TipControl.h
│ ├── TipManager.cpp
│ ├── TipManager.h
│ ├── Type.h
│ ├── main.cpp
│ ├── serial_putc.cpp
│ └── serial_putc.h
│ └── test
│ └── README
├── Hardware
├── AD_Project
│ ├── Gerber
│ │ └── OpenHeat_20220117-1427.zip
│ ├── __Previews
│ │ └── relflow_bed.SchDocPreview
│ ├── bom
│ │ └── ibom.html
│ ├── relflow_bed.PCB
│ ├── relflow_bed.PcbDoc
│ ├── relflow_bed.SchDoc
│ └── relflow_bed.pdf
├── Datasheets
│ ├── 5566连接器2x2p_molex-039281043_sd.pdf
│ ├── 5569连接器2x2p_molex-026013115_sd.pdf
│ ├── 74LVC1G08_ Single 2-input AND gate.pdf
│ ├── CH340DS1.PDF
│ ├── CLP0212FPEX5Z03A.pdf
│ ├── DCDC_ME3116_降压型_2017-03-22.PDF
│ ├── DCDC_MP2451.pdf
│ ├── DCDC_MP2456GJ-Z.pdf
│ ├── IND_NRS3015T6R8MNGHM_C2880382_6.8UH±20%_2019-03-29.PDF
│ ├── MAX31855.pdf
│ ├── MAX6675.pdf
│ ├── MOS_HY210N06_N沟道60V210A10V4mR-乐积mos控制板使用.PDF
│ ├── MOS_Infineon-IRFP064N-DataSheet-v01_01-EN.pdf
│ ├── MOS_Infineon-IRFP4410Z-DataSheet-v01_01-EN.pdf
│ ├── MOS_Infineon-IRFP4468-DataSheet-v01_01-EN.pdf
│ ├── OMEGA_SMPW_SMP_HMP_HMPW.pdf
│ ├── Sharp_PC817XxNSZ1B_e.pdf
│ ├── TVS_NUP2105L-D.PDF
│ └── umh3-SOT363-双npn晶体管.pdf
├── LCEDA_Project
│ └── GSH_Bed_100x100_12Vor24V_PogoPin版本
│ │ ├── 12Vor24V探针位置.PNG
│ │ ├── 2D预览图-2.png
│ │ ├── 2D预览图.png
│ │ ├── Gerber_GSH_Bed_100X100_12V150W_W45mil.zip
│ │ ├── PCB_GSH_Bed_100x100_12V288W_W=43mil.PcbDoc_2022-02-26.json
│ │ ├── README.md
│ │ └── pcb_layout.png
├── POG_PIN_Board
│ ├── Gerber
│ │ ├── POG_PIN_Board_2layer_220212-1921.zip
│ │ └── POG_PIN_Board_4layer_220212-1921.zip
│ ├── Images
│ │ ├── Pogo_Pin_Board_1.png
│ │ ├── Pogo_Pin_Board_2.png
│ │ └── Pogo_Pin_Board_3.png
│ ├── POG_PIN_Board.PcbDoc
│ └── POG_PIN_Board.SchDoc
└── 开孔尺寸图纸CAD
│ ├── 125X51-铝壳-前面板.DWG
│ ├── 125X51-铝壳-后面板.DWG
│ ├── 125X51-铝壳-壳体.DWG
│ ├── 单面玻纤板121x100x1.DWG
│ └── 开孔图AD.PcbDoc
├── Images
├── 12.7V供电_线宽28mil热床温度功率测试(2级PID限制).png
├── 12.7V供电_线宽43mil热床温度功率测试(3级PID限制).png
├── AD_2Dview_PCB.png
├── AD_3Dview_BUTTOM.png
├── AD_3Dview_PCB_BUTTOM.png
├── AD_3Dview_PCB_TOP.png
├── AD_3Dview_TOP.png
├── PCB绝缘层承受的温度限制.png
├── 主界面.png
├── 保护温度图标.bmp
├── 初号机1.jpg
├── 初号机2.JPG
├── 初号机3.JPG
├── 初号机4.JPG
├── 初号机5.JPG
├── 初号机6.JPG
├── 安装-上壳体3.png
├── 安装-下壳体1.png
├── 开孔-前面板.png
├── 开孔-单面玻纤板厚1.5mm.png
├── 开孔-后面板.png
├── 开孔-铝壳体.png
├── 手搓螺柱顶针是咋回事.mp4
├── 控制板1.JPG
├── 控制板2.JPG
├── 控制板3.JPG
├── 注释安装-上壳体2.png
├── 注释安装-下壳体2.png
├── 注释安装-前面板2.png
├── 注释安装-前面板3.png
├── 注释安装-后面板2.png
├── 注释安装-后面板3.png
├── 注释安装-玻纤板抽拉示意.png
├── 烧150ml水触发电源过热保护,全程功率200W.PNG
├── 热床希尔伯特曲线图标.bmp
├── 组装1.png
├── 轴测1.png
└── 轴测2.png
└── README.md
/Firmware/OpenHeat-fw/.gitignore:
--------------------------------------------------------------------------------
1 | .pio
2 | CMakeListsPrivate.txt
3 | cmake-build-*/
4 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Editor-based HTTP Client requests
5 | /httpRequests/
6 | # Datasource local storage ignored files
7 | /dataSources/
8 | /dataSources.local.xml
9 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/.idea/OpenHeat-fw.iml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/.idea/deployment.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/.idea/serialmonitor_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | // See http://go.microsoft.com/fwlink/?LinkId=827846
3 | // for the documentation about the extensions.json format
4 | "recommendations": [
5 | "platformio.platformio-ide"
6 | ],
7 | "unwantedRecommendations": [
8 | "ms-vscode.cpptools-extension-pack"
9 | ]
10 | }
11 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | // AUTOMATICALLY GENERATED FILE. PLEASE DO NOT MODIFY IT MANUALLY
2 | //
3 | // PIO Unified Debugger
4 | //
5 | // Documentation: https://docs.platformio.org/page/plus/debugging.html
6 | // Configuration: https://docs.platformio.org/page/projectconf/section_env_debug.html
7 |
8 | {
9 | "version": "0.2.0",
10 | "configurations": [
11 | {
12 | "type": "platformio-debug",
13 | "request": "launch",
14 | "name": "PIO Debug",
15 | "executable": "d:/ODG-PROJECT/OpenHeat-Split/Firmware/OpenHeat-fw/.pio/build/pico32/firmware.elf",
16 | "projectEnvName": "pico32",
17 | "toolchainBinDir": "C:/Users/PSA/.platformio/packages/toolchain-xtensa32/bin",
18 | "internalConsoleOptions": "openOnSessionStart",
19 | "preLaunchTask": {
20 | "type": "PlatformIO",
21 | "task": "Pre-Debug"
22 | }
23 | },
24 | {
25 | "type": "platformio-debug",
26 | "request": "launch",
27 | "name": "PIO Debug (skip Pre-Debug)",
28 | "executable": "d:/ODG-PROJECT/OpenHeat-Split/Firmware/OpenHeat-fw/.pio/build/pico32/firmware.elf",
29 | "projectEnvName": "pico32",
30 | "toolchainBinDir": "C:/Users/PSA/.platformio/packages/toolchain-xtensa32/bin",
31 | "internalConsoleOptions": "openOnSessionStart"
32 | },
33 | {
34 | "type": "platformio-debug",
35 | "request": "launch",
36 | "name": "PIO Debug (without uploading)",
37 | "executable": "d:/ODG-PROJECT/OpenHeat-Split/Firmware/OpenHeat-fw/.pio/build/pico32/firmware.elf",
38 | "projectEnvName": "pico32",
39 | "toolchainBinDir": "C:/Users/PSA/.platformio/packages/toolchain-xtensa32/bin",
40 | "internalConsoleOptions": "openOnSessionStart",
41 | "loadMode": "manual"
42 | }
43 | ]
44 | }
45 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # !!! WARNING !!! AUTO-GENERATED FILE, PLEASE DO NOT MODIFY IT AND USE
2 | # https://docs.platformio.org/page/projectconf/section_env_build.html#build-flags
3 | #
4 | # If you need to override existing CMake configuration or add extra,
5 | # please create `CMakeListsUser.txt` in the root of project.
6 | # The `CMakeListsUser.txt` will not be overwritten by PlatformIO.
7 |
8 | cmake_minimum_required(VERSION 3.13)
9 | set(CMAKE_SYSTEM_NAME Generic)
10 | set(CMAKE_C_COMPILER_WORKS 1)
11 | set(CMAKE_CXX_COMPILER_WORKS 1)
12 |
13 | project("OpenHeat-fw" C CXX)
14 |
15 | include(CMakeListsPrivate.txt)
16 |
17 | if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/CMakeListsUser.txt)
18 | include(CMakeListsUser.txt)
19 | endif()
20 |
21 | add_custom_target(
22 | Production ALL
23 | COMMAND platformio -c clion run "$<$>:-e${CMAKE_BUILD_TYPE}>"
24 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
25 | )
26 |
27 | add_custom_target(
28 | Debug ALL
29 | COMMAND platformio -c clion run --target debug "$<$>:-e${CMAKE_BUILD_TYPE}>"
30 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
31 | )
32 |
33 | add_executable(Z_DUMMY_TARGET ${SRC_LIST})
34 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/include/README:
--------------------------------------------------------------------------------
1 |
2 | This directory is intended for project header files.
3 |
4 | A header file is a file containing C declarations and macro definitions
5 | to be shared between several project source files. You request the use of a
6 | header file in your project source file (C, C++, etc) located in `src` folder
7 | by including it, with the C preprocessing directive `#include'.
8 |
9 | ```src/main.c
10 |
11 | #include "header.h"
12 |
13 | int main (void)
14 | {
15 | ...
16 | }
17 | ```
18 |
19 | Including a header file produces the same results as copying the header file
20 | into each source file that needs it. Such copying would be time-consuming
21 | and error-prone. With a header file, the related declarations appear
22 | in only one place. If they need to be changed, they can be changed in one
23 | place, and programs that include the header file will automatically use the
24 | new version when next recompiled. The header file eliminates the labor of
25 | finding and changing all the copies as well as the risk that a failure to
26 | find one copy will result in inconsistencies within a program.
27 |
28 | In C, the usual convention is to give header files names that end with `.h'.
29 | It is most portable to use only letters, digits, dashes, and underscores in
30 | header file names, and at most one dot.
31 |
32 | Read more about using header files in official GCC documentation:
33 |
34 | * Include Syntax
35 | * Include Operation
36 | * Once-Only Headers
37 | * Computed Includes
38 |
39 | https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html
40 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/OneButton/.github/workflows/arduino-checks.yml:
--------------------------------------------------------------------------------
1 | # This is a basic workflow to help you get started with Actions for Arduino library projects
2 |
3 | name: Arduino Library Checks
4 |
5 | # Controls when the action will run.
6 | on:
7 | # Triggers the workflow on push or pull request events but only for the develop branch
8 | push:
9 | branches: [develop,master]
10 | pull_request:
11 | branches: [develop,master]
12 |
13 | # Allows you to run this workflow manually from the Actions tab
14 | workflow_dispatch:
15 |
16 | jobs:
17 |
18 | # This defines a job for checking the Arduino library format specifications
19 | # see
20 | lint:
21 | name: check library format
22 | runs-on: ubuntu-latest
23 | continue-on-error: true
24 |
25 | steps:
26 | - uses: actions/checkout@v2
27 |
28 | # Arduino - lint
29 | - name: Arduino-lint
30 | uses: arduino/arduino-lint-action@v1
31 | with:
32 | library-manager: update
33 | verbose: false
34 |
35 | # These jobs are used to compile the examples fot the specific processor/board.
36 | # see
37 | compile-uno:
38 | name: compile uno examples
39 | runs-on: ubuntu-latest
40 | continue-on-error: true
41 |
42 | steps:
43 | - uses: actions/checkout@v2
44 |
45 | # Compile Examples for UNO
46 | - name: Compile examples on uno
47 | uses: arduino/compile-sketches@v1
48 | with:
49 | verbose: true
50 | fqbn: arduino:avr:uno
51 | sketch-paths: |
52 | - 'examples/SimpleOneButton'
53 | - 'examples/TwoButtons'
54 | - 'examples/BlinkMachine'
55 | - 'examples/InterruptOneButton'
56 | - 'examples/SpecialInput'
57 |
58 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/OneButton/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .idea/
3 | .vscode
4 | _*
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/OneButton/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | All notable changes to this project will be documented in this file starting 2021.
4 |
5 | ## [2.0.1] - 2021-01-31
6 |
7 | * Compiler warning removed
8 | * Documentation
9 |
10 | ## [2.0.0] - 2021-01-22
11 |
12 | * CHANGELOG created.
13 | * Many thanks to the improvements included from #27 (**@aslobodyanuk**), #59 (**@ShaggyDog18**) and #73 (**@geeksville**).
14 |
15 | This is a major update with breaking changes.
16 |
17 | The **states** are re-factored to support counting the clicks.
18 |
19 | By design only one of the events (click, doubleClick, MultiClick) are triggered within one interaction.
20 | As a consequence a single-click interaction is detected after waiting some milliseconds (see setClickTicks()) without another click happening;
21 | Only if you have not attached any double-click event function the waiting time can be skipped.
22 |
23 | Detecting a long 'down' not only works with the first but always as the last click.
24 |
25 | The number of actual clicks can be retrieved from the library any time.
26 |
27 | The function **getPressedTicks()** was removed. See example SimpleOneButton on how to get that time by using attachLongPressStart to save starting time.
28 |
29 | The function **attachPressStart()** is removed as **attachLongPressStart()** does the same but also supports parameters.
30 |
31 | One additional feature has been added not to call the event functions from the interrupt routine and detect
32 | the need for event functions to be called only when the tick() function is called from the main loop() method.
33 | This is because some boards and processors do not support timing or Serial functions (among others) from interrupt routines.
34 |
35 | The function **isIdle()** was added to allow detect a current interaction.
36 |
37 | The library now supports to detect multiple (>2) clicks in a row using **attachMultiClick()** .
38 |
39 |
40 | * The internal _state is using enum instead of plain numbers to make the library more readable.
41 | * functions that had been marked deprecated are now removed. (attachPress->attachLongPressXXX)
42 | * added const to constant parameters to enable meaningful compiler warnings.
43 | * added code for de-bouncing double clicks from pull 27.
44 | * added isIdle() function to find out that the internal state is `init`.
45 |
46 |
47 | ### Examples
48 |
49 | * Examples run on NodeMCU boards. (the library worked already).
50 |
51 | * The **SimpleOneButton.ino** example got some cleanup and definition to be used with ESP8266 boards as well.
52 |
53 | * The **InterruptOneButton.ino** example now is using attachInterrupt instead of UNO specific register modifications.
54 |
55 | * The **SpecialInput.ino** example was added to shpow how to use the OneButton algorythm and input pattern recognition with your own source of input.
56 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/OneButton/LICENSE:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Firmware/OpenHeat-fw/lib/OneButton/LICENSE
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/OneButton/examples/BlinkMachine/BlinkMachine.ino:
--------------------------------------------------------------------------------
1 | /*
2 | BlinkMachine.ino
3 |
4 | This is a sample sketch to show how to use the OneButtonLibrary to detect double-click events on a button.
5 |
6 | Copyright (c) by Matthias Hertel, http://www.mathertel.de
7 | This work is licensed under a BSD style license. See http://www.mathertel.de/License.aspx
8 | More information on: http://www.mathertel.de/Arduino
9 |
10 | The library internals are explained at
11 | http://www.mathertel.de/Arduino/OneButtonLibrary.aspx
12 |
13 | Setup a test circuit:
14 | * Connect a pushbutton to pin A1 (Uno) or D3 (ESP8266) and ground.
15 | * The pin 13 (UNO) or D4 (ESP8266) is used for output attach a led and resistor to ground
16 | or see the built-in led on the standard arduino board.
17 |
18 | The Sketch shows how to setup the library and bind a "machine" that can blink the LED slow or fast.
19 | A click on the button turns the led on.
20 | A doubleclick on the button changes the blink rate from ON to SLOW to FAST and back.
21 | In the loop function the button.tick function has to be called as often as you like.
22 |
23 | State-Diagram
24 |
25 | start
26 | | +-------\
27 | V V |
28 | -------- ------ |
29 | | OFF |<--click-+->| ON | |
30 | -------- | ------ |
31 | | | |
32 | | d-click |
33 | | | |
34 | | V |
35 | | ------ |
36 | +- | SLOW | |
37 | | ------ |
38 | | | |
39 | | d-click |
40 | | | |
41 | | V d-click
42 | | ------ |
43 | +--| FAST |---/
44 | ------
45 | */
46 |
47 | // 06.10.2012 created by Matthias Hertel
48 | // 26.03.2017 state diagram added, minor changes
49 |
50 | #include "OneButton.h"
51 |
52 | // The actions I ca do...
53 | typedef enum {
54 | ACTION_OFF, // set LED "OFF".
55 | ACTION_ON, // set LED "ON"
56 | ACTION_SLOW, // blink LED "SLOW"
57 | ACTION_FAST // blink LED "FAST"
58 | }
59 | MyActions;
60 |
61 | #if defined(ARDUINO_AVR_UNO) || defined(ARDUINO_AVR_NANO_EVERY)
62 | // Example for Arduino UNO with input button on pin 2 and builtin LED on pin 13
63 | #define PIN_INPUT A1
64 | #define PIN_LED 13
65 |
66 | #elif defined(ESP8266)
67 | // Example for NodeMCU with input button using FLASH button on D3 and using the led on -12 module (D4).
68 | // This LED is lighting on output level LOW.
69 | #define PIN_INPUT D3
70 | #define PIN_LED D4
71 |
72 | #endif
73 |
74 | // Setup a new OneButton on pin A1.
75 | OneButton button(PIN_INPUT, true);
76 |
77 | MyActions nextAction = ACTION_OFF; // no action when starting
78 |
79 |
80 | // setup code here, to run once.
81 | void setup() {
82 | // enable the standard led on pin 13.
83 | pinMode(PIN_LED, OUTPUT); // sets the digital pin as output
84 |
85 | // link the myClickFunction function to be called on a click event.
86 | button.attachClick(myClickFunction);
87 |
88 | // link the doubleclick function to be called on a doubleclick event.
89 | button.attachDoubleClick(myDoubleClickFunction);
90 |
91 | // set 80 msec. debouncing time. Default is 50 msec.
92 | button.setDebounceTicks(80);
93 | } // setup
94 |
95 |
96 | // main code here, to run repeatedly:
97 | void loop() {
98 | unsigned long now = millis();
99 |
100 | // keep watching the push button:
101 | button.tick();
102 |
103 | // You can implement other code in here or just wait a while
104 |
105 | if (nextAction == ACTION_OFF) {
106 | // do nothing.
107 | digitalWrite(PIN_LED, LOW);
108 |
109 | } else if (nextAction == ACTION_ON) {
110 | // turn LED on
111 | digitalWrite(PIN_LED, HIGH);
112 |
113 | } else if (nextAction == ACTION_SLOW) {
114 | // do a slow blinking
115 | if (now % 1000 < 500) {
116 | digitalWrite(PIN_LED, LOW);
117 | } else {
118 | digitalWrite(PIN_LED, HIGH);
119 | } // if
120 |
121 | } else if (nextAction == ACTION_FAST) {
122 | // do a fast blinking
123 | if (now % 200 < 100) {
124 | digitalWrite(PIN_LED, LOW);
125 | } else {
126 | digitalWrite(PIN_LED, HIGH);
127 | } // if
128 | } // if
129 | } // loop
130 |
131 |
132 | // this function will be called when the button was pressed 1 time and them some time has passed.
133 | void myClickFunction() {
134 | if (nextAction == ACTION_OFF)
135 | nextAction = ACTION_ON;
136 | else
137 | nextAction = ACTION_OFF;
138 | } // myClickFunction
139 |
140 |
141 | // this function will be called when the button was pressed 2 times in a short timeframe.
142 | void myDoubleClickFunction() {
143 | if (nextAction == ACTION_ON) {
144 | nextAction = ACTION_SLOW;
145 |
146 | } else if (nextAction == ACTION_SLOW) {
147 | nextAction = ACTION_FAST;
148 |
149 | } else if (nextAction == ACTION_FAST) {
150 | nextAction = ACTION_ON;
151 | } // if
152 | } // myDoubleClickFunction
153 |
154 | // End
155 |
156 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/OneButton/examples/SimpleOneButton/SimpleOneButton.ino:
--------------------------------------------------------------------------------
1 | /*
2 | This is a sample sketch to show how to use the OneButtonLibrary
3 | to detect double-click events on a button.
4 | The library internals are explained at
5 | http://www.mathertel.de/Arduino/OneButtonLibrary.aspx
6 |
7 | Setup a test circuit:
8 | * Connect a pushbutton to pin A1 (ButtonPin) and ground.
9 | * The pin 13 (StatusPin) is used for output attach a led and resistor to ground
10 | or see the built-in led on the standard arduino board.
11 |
12 | The sketch shows how to setup the library and bind the functions (singleClick, doubleClick) to the events.
13 | In the loop function the button.tick function must be called as often as you like.
14 | */
15 |
16 | // 03.03.2011 created by Matthias Hertel
17 | // 01.12.2011 extension changed to work with the Arduino 1.0 environment
18 |
19 | #include "OneButton.h"
20 |
21 | #if defined(ARDUINO_AVR_UNO) || defined(ARDUINO_AVR_NANO_EVERY)
22 | // Example for Arduino UNO with input button on pin 2 and builtin LED on pin 13
23 | #define PIN_INPUT 2
24 | #define PIN_LED 13
25 |
26 | #else if defined(ESP8266)
27 | // Example for NodeMCU with input button using FLASH button on D3 and using the led on -12 module (D4).
28 | // This LED is lighting on output level LOW.
29 | #define PIN_INPUT D3
30 | #define PIN_LED D4
31 |
32 | #endif
33 |
34 | // Setup a new OneButton on pin PIN_INPUT
35 | // The 2. parameter activeLOW is true, because external wiring sets the button to LOW when pressed.
36 | OneButton button(PIN_INPUT, true);
37 |
38 | // In case the momentary button puts the input to HIGH when pressed:
39 | // The 2. parameter activeLOW is false when the external wiring sets the button to HIGH when pressed.
40 | // The 3. parameter can be used to disable the PullUp .
41 | // OneButton button(PIN_INPUT, false, false);
42 |
43 | // current LED state, staring with LOW (0)
44 | int ledState = LOW;
45 |
46 | // setup code here, to run once:
47 | void setup()
48 | {
49 | Serial.begin(115200);
50 | Serial.println("One Button Example with polling.");
51 |
52 | // enable the standard led on pin 13.
53 | pinMode(PIN_LED, OUTPUT); // sets the digital pin as output
54 |
55 | // enable the standard led on pin 13.
56 | digitalWrite(PIN_LED, ledState);
57 |
58 | // link the doubleclick function to be called on a doubleclick event.
59 | button.attachDoubleClick(doubleClick);
60 | } // setup
61 |
62 |
63 | // main code here, to run repeatedly:
64 | void loop()
65 | {
66 | // keep watching the push button:
67 | button.tick();
68 |
69 | // You can implement other code in here or just wait a while
70 | delay(10);
71 | } // loop
72 |
73 |
74 | // this function will be called when the button was pressed 2 times in a short timeframe.
75 | void doubleClick()
76 | {
77 | Serial.println("x2");
78 |
79 | ledState = !ledState; // reverse the LED
80 | digitalWrite(PIN_LED, ledState);
81 | } // doubleClick
82 |
83 | // End
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/OneButton/examples/SpecialInput/SpecialInput.ino:
--------------------------------------------------------------------------------
1 | /*
2 | * SpecialInput.ino - Example for the OneButtonLibrary library.
3 | * This is a sample sketch to show how to use the OneClick library on other input sources than standard digital pins.
4 | *
5 | * The library internals are explained at
6 | * http://www.mathertel.de/Arduino/OneButtonLibrary.aspx
7 | *
8 | * Setup a test circuit:
9 | * * Connect a pushbutton to pin 2 (ButtonPin) and ground.
10 | *
11 | * The sketch shows how to setup the library and bind the functions (singleClick, doubleClick) to the events.
12 | * In the loop function the button.tick function must be called as often as you like.
13 | *
14 | * * 22.01.2021 created by Matthias Hertel
15 | */
16 |
17 | #include "OneButton.h"
18 |
19 | // This is an example on how to use the OneClick library on other input sources than standard digital pins.
20 | // 1. do not use a pin in the initialization of the OneClick library.
21 | // 2. pass the input state to the tick function.
22 |
23 | // You can also find how to create an instance in setup and not by declaration.
24 | // You can also find how to use inline callback functions.
25 |
26 | #if defined(ARDUINO_AVR_UNO) || defined(ARDUINO_AVR_NANO_EVERY)
27 | #define PIN_INPUT 2
28 |
29 | #else if defined(ESP8266)
30 | #define PIN_INPUT D3
31 |
32 | #endif
33 |
34 |
35 | // OneButton instance will be created in setup.
36 | OneButton *button;
37 |
38 | void fClicked(void *s)
39 | {
40 | Serial.print("Click:");
41 | Serial.println((char *)s);
42 | }
43 |
44 | void setup()
45 | {
46 | Serial.begin(115200);
47 | Serial.println("One Button Example with custom input.");
48 |
49 | // create the OneButton instance without a pin.
50 | button = new OneButton();
51 |
52 | // Here is an example on how to use a parameter to the registered function:
53 | button->attachClick(fClicked, "me");
54 |
55 | // Here is an example on how to use an inline function:
56 | button->attachDoubleClick([]() { Serial.println("DoubleClick"); });
57 |
58 | // setup your own source of input:
59 | pinMode(PIN_INPUT, INPUT_PULLUP);
60 |
61 | } // setup()
62 |
63 | void loop()
64 | {
65 | // read your own source of input:
66 | bool isPressed = (digitalRead(PIN_INPUT) == LOW);
67 |
68 | // call tick frequently with current push-state of the input
69 | button->tick(isPressed);
70 | } // loop()
71 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/OneButton/examples/TwoButtons/TwoButtons.ino:
--------------------------------------------------------------------------------
1 | /*
2 | This is a sample sketch to show how to use the OneButtonLibrary
3 | to detect click events on 2 buttons in parallel.
4 | The library internals are explained at
5 | http://www.mathertel.de/Arduino/OneButtonLibrary.aspx
6 |
7 | Setup a test circuit:
8 | * Connect a pushbutton to pin A1 (ButtonPin) and ground.
9 | * Connect a pushbutton to pin A2 (ButtonPin) and ground.
10 | * The Serial interface is used for output the detected button events.
11 |
12 | The Sketch shows how to setup the library and bind 2 buttons to their functions.
13 | In the loop function the button1.tick and button2.tick functions have to be called as often as you like.
14 | */
15 |
16 | // 01.03.2014 created by Matthias Hertel
17 | // ... and working.
18 |
19 | /* Sample output:
20 |
21 | Starting TwoButtons...
22 | Button 1 click.
23 | Button 2 click.
24 | Button 1 doubleclick.
25 | Button 2 doubleclick.
26 | Button 1 longPress start
27 | Button 1 longPress...
28 | Button 1 longPress...
29 | Button 1 longPress...
30 | Button 1 longPress stop
31 | Button 2 longPress start
32 | Button 2 longPress...
33 | Button 2 longPress...
34 | Button 2 longPress stop
35 |
36 | */
37 |
38 | #include "OneButton.h"
39 |
40 | // Setup a new OneButton on pin A1.
41 | OneButton button1(A1, true);
42 | // Setup a new OneButton on pin A2.
43 | OneButton button2(A2, true);
44 |
45 |
46 | // setup code here, to run once:
47 | void setup() {
48 | // Setup the Serial port. see http://arduino.cc/en/Serial/IfSerial
49 | Serial.begin(115200);
50 | while (!Serial) {
51 | ; // wait for serial port to connect. Needed for Leonardo only
52 | }
53 | Serial.println("Starting TwoButtons...");
54 |
55 | // link the button 1 functions.
56 | button1.attachClick(click1);
57 | button1.attachDoubleClick(doubleclick1);
58 | button1.attachLongPressStart(longPressStart1);
59 | button1.attachLongPressStop(longPressStop1);
60 | button1.attachDuringLongPress(longPress1);
61 |
62 | // link the button 2 functions.
63 | button2.attachClick(click2);
64 | button2.attachDoubleClick(doubleclick2);
65 | button2.attachLongPressStart(longPressStart2);
66 | button2.attachLongPressStop(longPressStop2);
67 | button2.attachDuringLongPress(longPress2);
68 |
69 | } // setup
70 |
71 |
72 | // main code here, to run repeatedly:
73 | void loop() {
74 | // keep watching the push buttons:
75 | button1.tick();
76 | button2.tick();
77 |
78 | // You can implement other code in here or just wait a while
79 | delay(10);
80 | } // loop
81 |
82 |
83 | // ----- button 1 callback functions
84 |
85 | // This function will be called when the button1 was pressed 1 time (and no 2. button press followed).
86 | void click1() {
87 | Serial.println("Button 1 click.");
88 | } // click1
89 |
90 |
91 | // This function will be called when the button1 was pressed 2 times in a short timeframe.
92 | void doubleclick1() {
93 | Serial.println("Button 1 doubleclick.");
94 | } // doubleclick1
95 |
96 |
97 | // This function will be called once, when the button1 is pressed for a long time.
98 | void longPressStart1() {
99 | Serial.println("Button 1 longPress start");
100 | } // longPressStart1
101 |
102 |
103 | // This function will be called often, while the button1 is pressed for a long time.
104 | void longPress1() {
105 | Serial.println("Button 1 longPress...");
106 | } // longPress1
107 |
108 |
109 | // This function will be called once, when the button1 is released after beeing pressed for a long time.
110 | void longPressStop1() {
111 | Serial.println("Button 1 longPress stop");
112 | } // longPressStop1
113 |
114 |
115 | // ... and the same for button 2:
116 |
117 | void click2() {
118 | Serial.println("Button 2 click.");
119 | } // click2
120 |
121 |
122 | void doubleclick2() {
123 | Serial.println("Button 2 doubleclick.");
124 | } // doubleclick2
125 |
126 |
127 | void longPressStart2() {
128 | Serial.println("Button 2 longPress start");
129 | } // longPressStart2
130 |
131 |
132 | void longPress2() {
133 | Serial.println("Button 2 longPress...");
134 | } // longPress2
135 |
136 | void longPressStop2() {
137 | Serial.println("Button 2 longPress stop");
138 | } // longPressStop2
139 |
140 |
141 | // End
142 |
143 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/OneButton/keywords.txt:
--------------------------------------------------------------------------------
1 | #######################################
2 | # Syntax Coloring Map for OneButton
3 | #######################################
4 |
5 | #######################################
6 | # Datatypes (KEYWORD1)
7 | #######################################
8 |
9 | callbackFunction KEYWORD1
10 | parameterizedCallbackFunction KEYWORD1
11 |
12 | #######################################
13 | # Methods and Functions (KEYWORD2)
14 | #######################################
15 |
16 | setClickTicks KEYWORD2
17 | setPressTicks KEYWORD2
18 | setDebounceTicks KEYWORD2
19 | attachClick KEYWORD2
20 | attachDoubleClick KEYWORD2
21 | attachMultiClick KEYWORD2
22 | attachLongPressStart KEYWORD2
23 | attachLongPressStop KEYWORD2
24 | attachDuringLongPress KEYWORD2
25 | tick KEYWORD2
26 | reset KEYWORD2
27 | getNumberClicks KEYWORD2
28 | isIdle KEYWORD2
29 | isLongPressed KEYWORD2
30 |
31 | #######################################
32 | # Instances (KEYWORD2)
33 | #######################################
34 |
35 | OneButton KEYWORD2
36 |
37 | #######################################
38 | # Constants (LITERAL1)
39 | #######################################
40 |
41 |
42 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/OneButton/library.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "OneButton",
3 | "version": "2.0.2",
4 | "keywords": "arduino, button, pushbutton",
5 | "description": "This Arduino library is improving the usage of a singe button for input. It shows how to use an digital input pin with a single pushbutton attached for detecting some of the typical button press events like single clicks, double clicks and long-time pressing. This enables you to reuse the same button for multiple functions and lowers the hardware invests.",
6 | "repository": {
7 | "type": "git",
8 | "url": "https://github.com/mathertel/OneButton"
9 | },
10 | "authors": {
11 | "name": "Matthias Hertel",
12 | "email": "mathertel@hotmail.com",
13 | "url": "https://www.mathertel.de/impressum.aspx"
14 | },
15 | "license": "BSD-3-Clause",
16 | "homepage": "http://www.mathertel.de/Arduino/OneButtonLibrary.aspx",
17 | "frameworks": "arduino",
18 | "platforms": "*"
19 | }
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/OneButton/library.properties:
--------------------------------------------------------------------------------
1 | name=OneButton
2 | version=2.0.2
3 | author=Matthias Hertel, mathertel@hotmail.com
4 | maintainer=Matthias Hertel
5 | sentence=Arduino library for improving the usage of a singe input button.
6 | paragraph=It supports detecting events like single, double, multiple clicks and long-time pressing. This enables you to reuse the same button for multiple functions and lowers the hardware invests.
7 | category=Signal Input/Output
8 | url=https://github.com/mathertel/OneButton
9 | architectures=*
10 | includes=OneButton.h
11 | license=BSD-3-Clause
12 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/PID/PID_v1.h:
--------------------------------------------------------------------------------
1 | #ifndef PID_v1_h
2 | #define PID_v1_h
3 | #define LIBRARY_VERSION 1.2.1
4 |
5 | class PID
6 | {
7 |
8 |
9 | public:
10 |
11 | //Constants used in some of the functions below
12 | #define AUTOMATIC 1
13 | #define MANUAL 0
14 | #define DIRECT 0
15 | #define REVERSE 1
16 | #define P_ON_M 0
17 | #define P_ON_E 1
18 |
19 | //commonly used functions **************************************************************************
20 | PID(double*, double*, double*, // * constructor. links the PID to the Input, Output, and
21 | double, double, double, int, int);// Setpoint. Initial tuning parameters are also set here.
22 | // (overload for specifying proportional mode)
23 |
24 | PID(double*, double*, double*, // * constructor. links the PID to the Input, Output, and
25 | double, double, double, int); // Setpoint. Initial tuning parameters are also set here
26 |
27 | void SetMode(int Mode); // * sets PID to either Manual (0) or Auto (non-0)
28 |
29 | bool Compute(); // * performs the PID calculation. it should be
30 | // called every time loop() cycles. ON/OFF and
31 | // calculation frequency can be set using SetMode
32 | // SetSampleTime respectively
33 |
34 | void SetOutputLimits(double, double); // * clamps the output to a specific range. 0-255 by default, but
35 | // it's likely the user will want to change this depending on
36 | // the application
37 |
38 |
39 |
40 | //available but not commonly used functions ********************************************************
41 | void SetTunings(double, double, // * While most users will set the tunings once in the
42 | double); // constructor, this function gives the user the option
43 | // of changing tunings during runtime for Adaptive control
44 | void SetTunings(double, double, // * overload for specifying proportional mode
45 | double, int);
46 |
47 | void SetControllerDirection(int); // * Sets the Direction, or "Action" of the controller. DIRECT
48 | // means the output will increase when error is positive. REVERSE
49 | // means the opposite. it's very unlikely that this will be needed
50 | // once it is set in the constructor.
51 | void SetSampleTime(int); // * sets the frequency, in Milliseconds, with which
52 | // the PID calculation is performed. default is 100
53 |
54 |
55 |
56 | //Display functions ****************************************************************
57 | double GetKp(); // These functions query the pid for interal values.
58 | double GetKi(); // they were created mainly for the pid front-end,
59 | double GetKd(); // where it's important to know what is actually
60 | int GetMode(); // inside the PID.
61 | int GetDirection(); //
62 |
63 | private:
64 | void Initialize();
65 |
66 | double dispKp; // * we'll hold on to the tuning parameters in user-entered
67 | double dispKi; // format for display purposes
68 | double dispKd; //
69 |
70 | double kp; // * (P)roportional Tuning Parameter
71 | double ki; // * (I)ntegral Tuning Parameter
72 | double kd; // * (D)erivative Tuning Parameter
73 |
74 | int controllerDirection;
75 | int pOn;
76 |
77 | double *myInput; // * Pointers to the Input, Output, and Setpoint variables
78 | double *myOutput; // This creates a hard link between the variables and the
79 | double *mySetpoint; // PID, freeing the user from having to constantly tell us
80 | // what these values are. with pointers we'll just know.
81 |
82 | unsigned long lastTime;
83 | double outputSum, lastInput;
84 |
85 | unsigned long SampleTime;
86 | double outMin, outMax;
87 | bool inAuto, pOnE;
88 | };
89 | #endif
90 |
91 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/PID/README.txt:
--------------------------------------------------------------------------------
1 | ***************************************************************
2 | * Arduino PID Library - Version 1.2.1
3 | * by Brett Beauregard brettbeauregard.com
4 | *
5 | * This Library is licensed under the MIT License
6 | ***************************************************************
7 |
8 | - For an ultra-detailed explanation of why the code is the way it is, please visit:
9 | http://brettbeauregard.com/blog/2011/04/improving-the-beginners-pid-introduction/
10 |
11 | - For function documentation see: http://playground.arduino.cc/Code/PIDLibrary
12 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/PID/examples/PID_AdaptiveTunings/PID_AdaptiveTunings.ino:
--------------------------------------------------------------------------------
1 | /********************************************************
2 | * PID Adaptive Tuning Example
3 | * One of the benefits of the PID library is that you can
4 | * change the tuning parameters at any time. this can be
5 | * helpful if we want the controller to be agressive at some
6 | * times, and conservative at others. in the example below
7 | * we set the controller to use Conservative Tuning Parameters
8 | * when we're near setpoint and more agressive Tuning
9 | * Parameters when we're farther away.
10 | ********************************************************/
11 |
12 | #include
13 |
14 | #define PIN_INPUT 0
15 | #define PIN_OUTPUT 3
16 |
17 | //Define Variables we'll be connecting to
18 | double Setpoint, Input, Output;
19 |
20 | //Define the aggressive and conservative Tuning Parameters
21 | double aggKp=4, aggKi=0.2, aggKd=1;
22 | double consKp=1, consKi=0.05, consKd=0.25;
23 |
24 | //Specify the links and initial tuning parameters
25 | PID myPID(&Input, &Output, &Setpoint, consKp, consKi, consKd, DIRECT);
26 |
27 | void setup()
28 | {
29 | //initialize the variables we're linked to
30 | Input = analogRead(PIN_INPUT);
31 | Setpoint = 100;
32 |
33 | //turn the PID on
34 | myPID.SetMode(AUTOMATIC);
35 | }
36 |
37 | void loop()
38 | {
39 | Input = analogRead(PIN_INPUT);
40 |
41 | double gap = abs(Setpoint-Input); //distance away from setpoint
42 | if (gap < 10)
43 | { //we're close to setpoint, use conservative tuning parameters
44 | myPID.SetTunings(consKp, consKi, consKd);
45 | }
46 | else
47 | {
48 | //we're far from setpoint, use aggressive tuning parameters
49 | myPID.SetTunings(aggKp, aggKi, aggKd);
50 | }
51 |
52 | myPID.Compute();
53 | analogWrite(PIN_OUTPUT, Output);
54 | }
55 |
56 |
57 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/PID/examples/PID_Basic/PID_Basic.ino:
--------------------------------------------------------------------------------
1 | /********************************************************
2 | * PID Basic Example
3 | * Reading analog input 0 to control analog PWM output 3
4 | ********************************************************/
5 |
6 | #include
7 |
8 | #define PIN_INPUT 0
9 | #define PIN_OUTPUT 3
10 |
11 | //Define Variables we'll be connecting to
12 | double Setpoint, Input, Output;
13 |
14 | //Specify the links and initial tuning parameters
15 | double Kp=2, Ki=5, Kd=1;
16 | PID myPID(&Input, &Output, &Setpoint, Kp, Ki, Kd, DIRECT);
17 |
18 | void setup()
19 | {
20 | //initialize the variables we're linked to
21 | Input = analogRead(PIN_INPUT);
22 | Setpoint = 100;
23 |
24 | //turn the PID on
25 | myPID.SetMode(AUTOMATIC);
26 | }
27 |
28 | void loop()
29 | {
30 | Input = analogRead(PIN_INPUT);
31 | myPID.Compute();
32 | analogWrite(PIN_OUTPUT, Output);
33 | }
34 |
35 |
36 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/PID/examples/PID_PonM/PID_PonM.ino:
--------------------------------------------------------------------------------
1 | /********************************************************
2 | * PID Proportional on measurement Example
3 | * Setting the PID to use Proportional on measurement will
4 | * make the output move more smoothly when the setpoint
5 | * is changed. In addition, it can eliminate overshoot
6 | * in certain processes like sous-vides.
7 | ********************************************************/
8 |
9 | #include
10 |
11 | //Define Variables we'll be connecting to
12 | double Setpoint, Input, Output;
13 |
14 | //Specify the links and initial tuning parameters
15 | PID myPID(&Input, &Output, &Setpoint,2,5,1,P_ON_M, DIRECT); //P_ON_M specifies that Proportional on Measurement be used
16 | //P_ON_E (Proportional on Error) is the default behavior
17 |
18 | void setup()
19 | {
20 | //initialize the variables we're linked to
21 | Input = analogRead(0);
22 | Setpoint = 100;
23 |
24 | //turn the PID on
25 | myPID.SetMode(AUTOMATIC);
26 | }
27 |
28 | void loop()
29 | {
30 | Input = analogRead(0);
31 | myPID.Compute();
32 | analogWrite(3,Output);
33 | }
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/PID/examples/PID_RelayOutput/PID_RelayOutput.ino:
--------------------------------------------------------------------------------
1 | /********************************************************
2 | * PID RelayOutput Example
3 | * Same as basic example, except that this time, the output
4 | * is going to a digital pin which (we presume) is controlling
5 | * a relay. the pid is designed to Output an analog value,
6 | * but the relay can only be On/Off.
7 | *
8 | * to connect them together we use "time proportioning
9 | * control" it's essentially a really slow version of PWM.
10 | * first we decide on a window size (5000mS say.) we then
11 | * set the pid to adjust its output between 0 and that window
12 | * size. lastly, we add some logic that translates the PID
13 | * output into "Relay On Time" with the remainder of the
14 | * window being "Relay Off Time"
15 | ********************************************************/
16 |
17 | #include
18 |
19 | #define PIN_INPUT 0
20 | #define RELAY_PIN 6
21 |
22 | //Define Variables we'll be connecting to
23 | double Setpoint, Input, Output;
24 |
25 | //Specify the links and initial tuning parameters
26 | double Kp=2, Ki=5, Kd=1;
27 | PID myPID(&Input, &Output, &Setpoint, Kp, Ki, Kd, DIRECT);
28 |
29 | int WindowSize = 5000;
30 | unsigned long windowStartTime;
31 |
32 | void setup()
33 | {
34 | windowStartTime = millis();
35 |
36 | //initialize the variables we're linked to
37 | Setpoint = 100;
38 |
39 | //tell the PID to range between 0 and the full window size
40 | myPID.SetOutputLimits(0, WindowSize);
41 |
42 | //turn the PID on
43 | myPID.SetMode(AUTOMATIC);
44 | }
45 |
46 | void loop()
47 | {
48 | Input = analogRead(PIN_INPUT);
49 | myPID.Compute();
50 |
51 | /************************************************
52 | * turn the output pin on/off based on pid output
53 | ************************************************/
54 | if (millis() - windowStartTime > WindowSize)
55 | { //time to shift the Relay Window
56 | windowStartTime += WindowSize;
57 | }
58 | if (Output < millis() - windowStartTime) digitalWrite(RELAY_PIN, HIGH);
59 | else digitalWrite(RELAY_PIN, LOW);
60 |
61 | }
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/PID/keywords.txt:
--------------------------------------------------------------------------------
1 | #######################################
2 | # Syntax Coloring Map For PID Library
3 | #######################################
4 |
5 | #######################################
6 | # Datatypes (KEYWORD1)
7 | #######################################
8 |
9 | PID KEYWORD1
10 |
11 | #######################################
12 | # Methods and Functions (KEYWORD2)
13 | #######################################
14 |
15 | SetMode KEYWORD2
16 | Compute KEYWORD2
17 | SetOutputLimits KEYWORD2
18 | SetTunings KEYWORD2
19 | SetControllerDirection KEYWORD2
20 | SetSampleTime KEYWORD2
21 | GetKp KEYWORD2
22 | GetKi KEYWORD2
23 | GetKd KEYWORD2
24 | GetMode KEYWORD2
25 | GetDirection KEYWORD2
26 |
27 | #######################################
28 | # Constants (LITERAL1)
29 | #######################################
30 |
31 | AUTOMATIC LITERAL1
32 | MANUAL LITERAL1
33 | DIRECT LITERAL1
34 | REVERSE LITERAL1
35 | P_ON_E LITERAL1
36 | P_ON_M LITERAL1
37 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/PID/library.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "PID",
3 | "keywords": "PID, controller, signal",
4 | "description": "A PID controller seeks to keep some input variable close to a desired setpoint by adjusting an output. The way in which it does this can be 'tuned' by adjusting three parameters (P,I,D).",
5 | "url": "http://playground.arduino.cc/Code/PIDLibrary",
6 | "include": "PID_v1",
7 | "authors":
8 | [
9 | {
10 | "name": "Brett Beauregard"
11 | }
12 | ],
13 | "repository":
14 | {
15 | "type": "git",
16 | "url": "https://github.com/br3ttb/Arduino-PID-Library.git"
17 | },
18 | "frameworks": "arduino"
19 | }
20 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/PID/library.properties:
--------------------------------------------------------------------------------
1 | name=PID
2 | version=1.2.1
3 | author=Brett Beauregard
4 | maintainer=Brett Beauregard
5 | sentence=PID controller
6 | paragraph=A PID controller seeks to keep some input variable close to a desired setpoint by adjusting an output. The way in which it does this can be 'tuned' by adjusting three parameters (P,I,D).
7 | category=Signal Input/Output
8 | url=http://playground.arduino.cc/Code/PIDLibrary
9 | architectures=*
10 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/QRCode/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/QRCode/LICENSE.txt:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | This library is written and maintained by Richard Moore.
4 | Major parts were derived from Project Nayuki's library.
5 |
6 | Copyright (c) 2017 Richard Moore (https://github.com/ricmoo/QRCode)
7 | Copyright (c) 2017 Project Nayuki (https://www.nayuki.io/page/qr-code-generator-library)
8 |
9 | Permission is hereby granted, free of charge, to any person obtaining a copy
10 | of this software and associated documentation files (the "Software"), to deal
11 | in the Software without restriction, including without limitation the rights
12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | copies of the Software, and to permit persons to whom the Software is
14 | furnished to do so, subject to the following conditions:
15 |
16 | The above copyright notice and this permission notice shall be included in
17 | all copies or substantial portions of the Software.
18 |
19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | THE SOFTWARE.
26 |
27 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/QRCode/examples/QRCode/QRCode.ino:
--------------------------------------------------------------------------------
1 | /**
2 | * QRCode
3 | *
4 | * A quick example of generating a QR code.
5 | *
6 | * This prints the QR code to the serial monitor as solid blocks. Each module
7 | * is two characters wide, since the monospace font used in the serial monitor
8 | * is approximately twice as tall as wide.
9 | *
10 | */
11 |
12 | #include "qrcode.h"
13 |
14 | void setup() {
15 | Serial.begin(115200);
16 |
17 | // Start time
18 | uint32_t dt = millis();
19 |
20 | // Create the QR code
21 | QRCode qrcode;
22 | uint8_t qrcodeData[qrcode_getBufferSize(3)];
23 | qrcode_initText(&qrcode, qrcodeData, 3, 0, "HELLO WORLD");
24 |
25 | // Delta time
26 | dt = millis() - dt;
27 | Serial.print("QR Code Generation Time: ");
28 | Serial.print(dt);
29 | Serial.print("\n");
30 |
31 | // Top quiet zone
32 | Serial.print("\n\n\n\n");
33 |
34 | for (uint8_t y = 0; y < qrcode.size; y++) {
35 |
36 | // Left quiet zone
37 | Serial.print(" ");
38 |
39 | // Each horizontal module
40 | for (uint8_t x = 0; x < qrcode.size; x++) {
41 |
42 | // Print each module (UTF-8 \u2588 is a solid block)
43 | Serial.print(qrcode_getModule(&qrcode, x, y) ? "\u2588\u2588": " ");
44 |
45 | }
46 |
47 | Serial.print("\n");
48 | }
49 |
50 | // Bottom quiet zone
51 | Serial.print("\n\n\n\n");
52 | }
53 |
54 | void loop() {
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/QRCode/generate_table.py:
--------------------------------------------------------------------------------
1 | Data = [
2 | ["1", "41", "25", "17", "34", "20", "14","27", "16", "11","17", "10", "7"],
3 | ["2", "77", "47", "32", "63", "38", "26", "48", "29", "20", "34", "20", "14"],
4 | ["3", "127", "77", "53", "101", "61", "42", "77", "47", "32", "58", "35", "24"],
5 | ["4", "187", "114", "78", "149", "90", "62", "111", "67", "46", "82", "50", "34"],
6 | ["5", "255", "154", "106", "202", "122", "84", "144", "87", "60", "106", "64", "44"],
7 | ["6", "322", "195", "134", "255", "154", "106", "178", "108", "74", "139", "84", "58"],
8 | ["7", "370", "224", "154", "293", "178", "122", "207", "125", "86", "154", "93", "64"],
9 | ["8", "461", "279", "192", "365", "221", "152", "259", "157", "108", "202", "122", "84"],
10 | ["9", "552", "335", "230", "432", "262", "180", "312", "189", "130", "235", "143", "98"],
11 | ["10", "652", "395", "271", "513", "311", "213", "364", "221", "151", "288", "174", "119"],
12 | ["11", "772", "468", "321", "604", "366", "251", "427", "259", "177", "331", "200", "137"],
13 | ["12", "883", "535", "367", "691", "419", "287", "489", "296", "203", "374", "227", "155"],
14 | ["13", "1022", "619", "425", "796", "483", "331", "580", "352", "241", "427", "259", "177"],
15 | ["14", "1101", "667", "458", "871", "528", "362", "621", "376", "258", "468", "283", "194"],
16 | ["15", "1250", "758", "520", "991", "600", "412", "703", "426", "292", "530", "321", "220"],
17 | ["16", "1408", "854", "586", "1082", "656", "450", "775", "470", "322", "602", "365", "250"],
18 | ["17", "1548", "938", "644", "1212", "734", "504", "876", "531", "364", "674", "408", "280"],
19 | ["18", "1725", "1046", "718", "1346", "816", "560", "948", "574", "394", "746", "452", "310"],
20 | ["19", "1903", "1153", "792", "1500", "909", "624", "1063", "644", "442", "813", "493", "338"],
21 | ["20", "2061", "1249", "858", "1600", "970", "666", "1159", "702", "482", "919", "557", "382"],
22 | ["21", "2232", "1352", "929", "1708", "1035", "711", "1224", "742", "509", "969", "587", "403"],
23 | ["22", "2409", "1460", "1003", "1872", "1134", "779", "1358", "823", "565", "1056", "640", "439"],
24 | ["23", "2620", "1588", "1091", "2059", "1248", "857", "1468", "890", "611", "1108", "672", "461"],
25 | ["24", "2812", "1704", "1171", "2188", "1326", "911", "1588", "963", "661", "1228", "744", "511"],
26 | ["25", "3057", "1853", "1273", "2395", "1451", "997", "1718", "1041", "715", "1286", "779", "535"],
27 | ["26", "3283", "1990", "1367", "2544", "1542", "1059", "1804", "1094", "751", "1425", "864", "593"],
28 | ["27", "3517", "2132", "1465", "2701", "1637", "1125", "1933", "1172", "805", "1501", "910", "625"],
29 | ["28", "3669", "2223", "1528", "2857", "1732", "1190", "2085", "1263", "868", "1581", "958", "658"],
30 | ["29", "3909", "2369", "1628", "3035", "1839", "1264", "2181", "1322", "908", "1677", "1016", "698"],
31 | ["30", "4158", "2520", "1732", "3289", "1994", "1370", "2358", "1429", "982", "1782", "1080", "742"],
32 | ["31", "4417", "2677", "1840", "3486", "2113", "1452", "2473", "1499", "1030", "1897", "1150", "790"],
33 | ["32", "4686", "2840", "1952", "3693", "2238", "1538", "2670", "1618", "1112", "2022", "1226", "842"],
34 | ["33", "4965", "3009", "2068", "3909", "2369", "1628", "2805", "1700", "1168", "2157", "1307", "898"],
35 | ["34", "5253", "3183", "2188", "4134", "2506", "1722", "2949", "1787", "1228", "2301", "1394", "958"],
36 | ["35", "5529", "3351", "2303", "4343", "2632", "1809", "3081", "1867", "1283", "2361", "1431", "983"],
37 | ["36", "5836", "3537", "2431", "4588", "2780", "1911", "3244", "1966", "1351", "2524", "1530", "1051"],
38 | ["37", "6153", "3729", "2563", "4775", "2894", "1989", "3417", "2071", "1423", "2625", "1591", "1093"],
39 | ["38", "6479", "3927", "2699", "5039", "3054", "2099", "3599", "2181", "1499", "2735", "1658", "1139"],
40 | ["39", "6743", "4087", "2809", "5313", "3220", "2213", "3791", "2298", "1579", "2927", "1774", "1219"],
41 | ["40", "7089", "4296", "2953", "5596", "3391", "2331", "3993", "2420", "1663", "3057", "1852", "1273"],
42 | ]
43 | Template = '''
44 | %s |
45 | %s |
46 | LOW | %s | %s | %s |
47 |
48 |
49 | MEDIUM | %s | %s | %s |
50 |
51 |
52 | QUARTILE | %s | %s | %s |
53 |
54 |
55 | HIGH | %s | %s | %s |
56 |
'''
57 |
58 | for data in Data:
59 | data = data[:]
60 | size = 4 * int(data[0]) + 17
61 | data.insert(1, "%d x %d" % (size, size))
62 | print Template % tuple(data)
63 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/QRCode/keywords.txt:
--------------------------------------------------------------------------------
1 |
2 | # Datatypes (KEYWORD1)
3 |
4 | bool KEYWORD1
5 | uint8_t KEYWORD1
6 | QRCode KEYWORD1
7 |
8 |
9 | # Methods and Functions (KEYWORD2)
10 |
11 | qrcode_getBufferSize KEYWORD2
12 | qrcode_initText KEYWORD2
13 | qrcode_initBytes KEYWORD2
14 | qrcode_getModule KEYWORD2
15 |
16 |
17 | # Instances (KEYWORD2)
18 |
19 |
20 | # Constants (LITERAL1)
21 |
22 | false LITERAL1
23 | true LITERAL1
24 |
25 | ECC_LOW LITERAL1
26 | ECC_MEDIUM LITERAL1
27 | ECC_QUARTILE LITERAL1
28 | ECC_HIGH LITERAL1
29 | MODE_NUMERIC LITERAL1
30 | MODE_ALPHANUMERIC LITERAL1
31 | MODE_BYTE LITERAL1
32 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/QRCode/library.properties:
--------------------------------------------------------------------------------
1 | name=QRCode
2 | version=0.0.1
3 | author=Richard Moore
4 | maintainer=Richard Moore
5 | sentence=A simple QR code generation library.
6 | paragraph=A simple QR code generation library.
7 | category=Other
8 | url=https://github.com/ricmoo/qrcode/
9 | architectures=*
10 | includes=qrcode.h
11 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/QRCode/src/qrcode.h:
--------------------------------------------------------------------------------
1 | /**
2 | * The MIT License (MIT)
3 | *
4 | * This library is written and maintained by Richard Moore.
5 | * Major parts were derived from Project Nayuki's library.
6 | *
7 | * Copyright (c) 2017 Richard Moore (https://github.com/ricmoo/QRCode)
8 | * Copyright (c) 2017 Project Nayuki (https://www.nayuki.io/page/qr-code-generator-library)
9 | *
10 | * Permission is hereby granted, free of charge, to any person obtaining a copy
11 | * of this software and associated documentation files (the "Software"), to deal
12 | * in the Software without restriction, including without limitation the rights
13 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14 | * copies of the Software, and to permit persons to whom the Software is
15 | * furnished to do so, subject to the following conditions:
16 | *
17 | * The above copyright notice and this permission notice shall be included in
18 | * all copies or substantial portions of the Software.
19 | *
20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26 | * THE SOFTWARE.
27 | */
28 |
29 | /**
30 | * Special thanks to Nayuki (https://www.nayuki.io/) from which this library was
31 | * heavily inspired and compared against.
32 | *
33 | * See: https://github.com/nayuki/QR-Code-generator/tree/master/cpp
34 | */
35 |
36 |
37 | #ifndef __QRCODE_H_
38 | #define __QRCODE_H_
39 |
40 | #ifndef __cplusplus
41 | typedef unsigned char bool;
42 | static const bool false = 0;
43 | static const bool true = 1;
44 | #endif
45 |
46 | #include
47 |
48 |
49 | // QR Code Format Encoding
50 | #define MODE_NUMERIC 0
51 | #define MODE_ALPHANUMERIC 1
52 | #define MODE_BYTE 2
53 |
54 |
55 | // Error Correction Code Levels
56 | #define ECC_LOW 0
57 | #define ECC_MEDIUM 1
58 | #define ECC_QUARTILE 2
59 | #define ECC_HIGH 3
60 |
61 |
62 | // If set to non-zero, this library can ONLY produce QR codes at that version
63 | // This saves a lot of dynamic memory, as the codeword tables are skipped
64 | #ifndef LOCK_VERSION
65 | #define LOCK_VERSION 0
66 | #endif
67 |
68 |
69 | typedef struct QRCode {
70 | uint8_t version;
71 | uint8_t size;
72 | uint8_t ecc;
73 | uint8_t mode;
74 | uint8_t mask;
75 | uint8_t *modules;
76 | } QRCode;
77 |
78 |
79 | #ifdef __cplusplus
80 | extern "C"{
81 | #endif /* __cplusplus */
82 |
83 |
84 |
85 | uint16_t qrcode_getBufferSize(uint8_t version);
86 |
87 | int8_t qrcode_initText(QRCode *qrcode, uint8_t *modules, uint8_t version, uint8_t ecc, const char *data);
88 | int8_t qrcode_initBytes(QRCode *qrcode, uint8_t *modules, uint8_t version, uint8_t ecc, uint8_t *data, uint16_t length);
89 |
90 | bool qrcode_getModule(QRCode *qrcode, uint8_t x, uint8_t y);
91 |
92 |
93 |
94 | #ifdef __cplusplus
95 | }
96 | #endif /* __cplusplus */
97 |
98 |
99 | #endif /* __QRCODE_H_ */
100 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/QRCode/tests/BitBuffer.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * QR Code generator library (C++)
3 | *
4 | * Copyright (c) Project Nayuki
5 | * https://www.nayuki.io/page/qr-code-generator-library
6 | *
7 | * (MIT License)
8 | * Permission is hereby granted, free of charge, to any person obtaining a copy of
9 | * this software and associated documentation files (the "Software"), to deal in
10 | * the Software without restriction, including without limitation the rights to
11 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
12 | * the Software, and to permit persons to whom the Software is furnished to do so,
13 | * subject to the following conditions:
14 | * - The above copyright notice and this permission notice shall be included in
15 | * all copies or substantial portions of the Software.
16 | * - The Software is provided "as is", without warranty of any kind, express or
17 | * implied, including but not limited to the warranties of merchantability,
18 | * fitness for a particular purpose and noninfringement. In no event shall the
19 | * authors or copyright holders be liable for any claim, damages or other
20 | * liability, whether in an action of contract, tort or otherwise, arising from,
21 | * out of or in connection with the Software or the use or other dealings in the
22 | * Software.
23 | */
24 |
25 | #include
26 | #include "BitBuffer.hpp"
27 |
28 |
29 | qrcodegen::BitBuffer::BitBuffer() :
30 | data(),
31 | bitLength(0) {}
32 |
33 |
34 | int qrcodegen::BitBuffer::getBitLength() const {
35 | return bitLength;
36 | }
37 |
38 |
39 | std::vector qrcodegen::BitBuffer::getBytes() const {
40 | return data;
41 | }
42 |
43 |
44 | void qrcodegen::BitBuffer::appendBits(uint32_t val, int len) {
45 | if (len < 0 || len > 32 || (len < 32 && (val >> len) != 0))
46 | throw "Value out of range";
47 | size_t newBitLen = bitLength + len;
48 | while (data.size() * 8 < newBitLen)
49 | data.push_back(0);
50 | for (int i = len - 1; i >= 0; i--, bitLength++) // Append bit by bit
51 | data.at(bitLength >> 3) |= ((val >> i) & 1) << (7 - (bitLength & 7));
52 | }
53 |
54 |
55 | void qrcodegen::BitBuffer::appendData(const QrSegment &seg) {
56 | size_t newBitLen = bitLength + seg.bitLength;
57 | while (data.size() * 8 < newBitLen)
58 | data.push_back(0);
59 | for (int i = 0; i < seg.bitLength; i++, bitLength++) { // Append bit by bit
60 | int bit = (seg.data.at(i >> 3) >> (7 - (i & 7))) & 1;
61 | data.at(bitLength >> 3) |= bit << (7 - (bitLength & 7));
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/QRCode/tests/BitBuffer.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * QR Code generator library (C++)
3 | *
4 | * Copyright (c) Project Nayuki
5 | * https://www.nayuki.io/page/qr-code-generator-library
6 | *
7 | * (MIT License)
8 | * Permission is hereby granted, free of charge, to any person obtaining a copy of
9 | * this software and associated documentation files (the "Software"), to deal in
10 | * the Software without restriction, including without limitation the rights to
11 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
12 | * the Software, and to permit persons to whom the Software is furnished to do so,
13 | * subject to the following conditions:
14 | * - The above copyright notice and this permission notice shall be included in
15 | * all copies or substantial portions of the Software.
16 | * - The Software is provided "as is", without warranty of any kind, express or
17 | * implied, including but not limited to the warranties of merchantability,
18 | * fitness for a particular purpose and noninfringement. In no event shall the
19 | * authors or copyright holders be liable for any claim, damages or other
20 | * liability, whether in an action of contract, tort or otherwise, arising from,
21 | * out of or in connection with the Software or the use or other dealings in the
22 | * Software.
23 | */
24 |
25 | #pragma once
26 |
27 | #include
28 | #include
29 | #include "QrSegment.hpp"
30 |
31 |
32 | namespace qrcodegen {
33 |
34 | /*
35 | * An appendable sequence of bits. Bits are packed in big endian within a byte.
36 | */
37 | class BitBuffer {
38 |
39 | /*---- Fields ----*/
40 | private:
41 |
42 | std::vector data;
43 | int bitLength;
44 |
45 |
46 |
47 | /*---- Constructor ----*/
48 | public:
49 |
50 | // Creates an empty bit buffer (length 0).
51 | BitBuffer();
52 |
53 |
54 |
55 | /*---- Methods ----*/
56 | public:
57 |
58 | // Returns the number of bits in the buffer, which is a non-negative value.
59 | int getBitLength() const;
60 |
61 |
62 | // Returns a copy of all bytes, padding up to the nearest byte.
63 | std::vector getBytes() const;
64 |
65 |
66 | // Appends the given number of bits of the given value to this sequence.
67 | // If 0 <= len <= 31, then this requires 0 <= val < 2^len.
68 | void appendBits(uint32_t val, int len);
69 |
70 |
71 | // Appends the data of the given segment to this bit buffer.
72 | void appendData(const QrSegment &seg);
73 |
74 | };
75 |
76 | }
77 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/QRCode/tests/README.md:
--------------------------------------------------------------------------------
1 | Testing
2 | =======
3 |
4 | The testcases work by using the Nayuki QR code generating library, generating a QR code
5 | in both libraries and comparing them.
6 |
7 | Running
8 | -------
9 |
10 | ```
11 | ./run.sh
12 | ```
13 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/QRCode/tests/run-tests.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include "../src/qrcode.h"
5 | #include "QrCode.hpp"
6 |
7 | static uint32_t check(const qrcodegen::QrCode &nayuki, QRCode *ricmoo) {
8 | uint32_t wrong = 0;
9 |
10 | if (nayuki.size != ricmoo->size) { wrong += (1 << 20); }
11 |
12 | int border = 4;
13 | for (int y = -border; y < nayuki.size + border; y++) {
14 | for (int x = -border; x < nayuki.size + border; x++) {
15 | if (!!nayuki.getModule(x, y) != qrcode_getModule(ricmoo, x, y)) {
16 | wrong++;
17 | }
18 | }
19 | }
20 |
21 | return wrong;
22 | }
23 |
24 | int main() {
25 | std::clock_t t0, totalNayuki, totalRicMoo;
26 |
27 | int total = 0, passed = 0;
28 | for (char version = 1; version <= 40; version++) {
29 | if (LOCK_VERSION != 0 && LOCK_VERSION != version) { continue; }
30 |
31 | for (char ecc = 0; ecc < 4; ecc++) {
32 | const qrcodegen::QrCode::Ecc *errCorLvl;
33 | switch (ecc) {
34 | case 0:
35 | errCorLvl = &qrcodegen::QrCode::Ecc::LOW;
36 | break;
37 | case 1:
38 | errCorLvl = &qrcodegen::QrCode::Ecc::MEDIUM;
39 | break;
40 | case 2:
41 | errCorLvl = &qrcodegen::QrCode::Ecc::QUARTILE;
42 | break;
43 | case 3:
44 | errCorLvl = &qrcodegen::QrCode::Ecc::HIGH;
45 | break;
46 | }
47 |
48 | for (char tc = 0; tc < 3; tc++) {
49 | char *data;
50 | switch(tc) {
51 | case 0:
52 | data = (char*)"HELLO";
53 | break;
54 | case 1:
55 | data = (char*)"Hello";
56 | break;
57 | case 2:
58 | data = (char*)"1234";
59 | break;
60 | }
61 | t0 = std::clock();
62 | const qrcodegen::QrCode nayuki = qrcodegen::QrCode::encodeText(data, version, *errCorLvl);
63 | totalNayuki += std::clock() - t0;
64 |
65 | t0 = std::clock();
66 | QRCode ricmoo;
67 | uint8_t ricmooBytes[qrcode_getBufferSize(version)];
68 | qrcode_initText(&ricmoo, ricmooBytes, version, ecc, data);
69 | totalRicMoo += std::clock() - t0;
70 |
71 | uint32_t badModules = check(nayuki, &ricmoo);
72 | if (badModules) {
73 | printf("Failed test case: version=%d, ecc=%d, data=\"%s\", faliured=%d\n", version, ecc, data, badModules);
74 | } else {
75 | passed++;
76 | }
77 |
78 | total++;
79 | }
80 | }
81 | }
82 |
83 | printf("Tests complete: %d passed (out of %d)\n", passed, total);
84 | printf("Timing: Nayuki=%lu, RicMoo=%lu\n", totalNayuki, totalRicMoo);
85 | }
86 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/QRCode/tests/run.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | clang++ run-tests.cpp QrCode.cpp QrSegment.cpp BitBuffer.cpp ../src/qrcode.c -o test && ./test
4 | clang++ run-tests.cpp QrCode.cpp QrSegment.cpp BitBuffer.cpp ../src/qrcode.c -o test -D LOCK_VERSION=3 && ./test
5 |
6 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/README:
--------------------------------------------------------------------------------
1 |
2 | This directory is intended for project specific (private) libraries.
3 | PlatformIO will compile them to static libraries and link into executable file.
4 |
5 | The source code of each library should be placed in a an own separate directory
6 | ("lib/your_library_name/[here are source files]").
7 |
8 | For example, see a structure of the following two libraries `Foo` and `Bar`:
9 |
10 | |--lib
11 | | |
12 | | |--Bar
13 | | | |--docs
14 | | | |--examples
15 | | | |--src
16 | | | |- Bar.c
17 | | | |- Bar.h
18 | | | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html
19 | | |
20 | | |--Foo
21 | | | |- Foo.c
22 | | | |- Foo.h
23 | | |
24 | | |- README --> THIS FILE
25 | |
26 | |- platformio.ini
27 | |--src
28 | |- main.c
29 |
30 | and a contents of `src/main.c`:
31 | ```
32 | #include
33 | #include
34 |
35 | int main (void)
36 | {
37 | ...
38 | }
39 |
40 | ```
41 |
42 | PlatformIO Library Dependency Finder will find automatically dependent
43 | libraries scanning project source files.
44 |
45 | More information about PlatformIO Library Dependency Finder
46 | - https://docs.platformio.org/page/librarymanager/ldf.html
47 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/Shell/examples/Shell_Basic/Shell_Basic.ino:
--------------------------------------------------------------------------------
1 | /**
2 | * GeekFactory - "Construye tu propia tecnologia"
3 | * Distribucion de materiales para el desarrollo e innovacion tecnologica
4 | * www.geekfactory.mx
5 | *
6 | * Ejemplo de libreria Shell. Este ejemplo representa la configuracion minima
7 | * requerida para implementar la funcionalidad de interfaz de comandos. En esta
8 | * ocasion registramos 2 comandos y enviamos texto como respuesta a cada uno.
9 | *
10 | * Example for Shell library. This example shows the minimum setup needed to
11 | * implement a command line interface. This time we register 2 commands and we
12 | * send text as response for each command.
13 | */
14 |
15 | #include
16 |
17 | void setup()
18 | {
19 | // Prepare serial communication
20 | Serial.begin(9600);
21 | // Wait after reset or power on...
22 | delay(1000);
23 |
24 | // Initialize command line interface (CLI)
25 | // We pass the function pointers to the read and write functions that we implement below
26 | // We can also pass a char pointer to display a custom start message
27 | shell_init(shell_reader, shell_writer, 0);
28 |
29 | // Add commands to the shell
30 | shell_register(command_mycommand, PSTR("mycommand"));
31 | shell_register(command_othercommand, PSTR("othercommand"));
32 | }
33 |
34 | void loop()
35 | {
36 | // This should always be called to process user input
37 | shell_task();
38 | }
39 |
40 | /**
41 | * Test commands: The commands should always use this function prototype.
42 | * They receive 2 parameters: The total count of arguments (argc) and a pointer
43 | * to the begining of each one of the null-terminated argument strings.
44 | *
45 | * In this example we ignore the parameters passed to the functions
46 | */
47 | int command_mycommand(int argc, char** argv)
48 | {
49 | shell_println("Running \"mycommand\" now");
50 | shell_println("Exit...");
51 | return SHELL_RET_SUCCESS;
52 | }
53 |
54 | int command_othercommand(int argc, char** argv)
55 | {
56 | shell_println("Running \"othercommand\" now");
57 | shell_println("Exit...");
58 | return SHELL_RET_SUCCESS;
59 | }
60 |
61 | /**
62 | * Function to read data from serial port
63 | * Functions to read from physical media should use this prototype:
64 | * int my_reader_function(char * data)
65 | */
66 | int shell_reader(char * data)
67 | {
68 | // Wrapper for Serial.read() method
69 | if (Serial.available()) {
70 | *data = Serial.read();
71 | return 1;
72 | }
73 | return 0;
74 | }
75 |
76 | /**
77 | * Function to write data to serial port
78 | * Functions to write to physical media should use this prototype:
79 | * void my_writer_function(char data)
80 | */
81 | void shell_writer(char data)
82 | {
83 | // Wrapper for Serial.write() method
84 | Serial.write(data);
85 | }
86 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/Shell/examples/Shell_Command_Args/Shell_Command_Args.ino:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Firmware/OpenHeat-fw/lib/Shell/examples/Shell_Command_Args/Shell_Command_Args.ino
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/Shell/examples/Shell_IO_Control/Shell_IO_Control.ino:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | void setup()
4 | {
5 | // Prepare serial communication
6 | Serial.begin(9600);
7 | // Wait after reset or power on...
8 | delay(1000);
9 |
10 | // Initialize command line interface (CLI)
11 | // We pass the function pointers to the read and write functions that we implement below
12 | // We can also pass a char pointer to display a custom start message
13 | shell_init(shell_reader, shell_writer, 0);
14 |
15 | // Add commands to the shell
16 | shell_register(command_ioctrl, PSTR("ioctrl"));
17 | }
18 |
19 | void loop()
20 | {
21 | // This should always be called to process user input
22 | shell_task();
23 | }
24 |
25 | int command_ioctrl(int argc, char** argv)
26 | {
27 | enum ioctrl_switches {
28 | E_PIN_MODE,
29 | E_DIGITAL_WRITE,
30 | E_DIGITAL_READ,
31 | };
32 |
33 | int i;
34 | int pin=0xFF, mode =0xFF, val=0xFF;
35 | int op = 0;
36 |
37 | // If only the program name is given show message to the user about program usage
38 | if(argc == 1) {
39 | shell_println("SHELL IO CONTROL UTILITY");
40 | shell_println("This tool can manipulate the IO pins on the arduino boards using text commands");
41 | shell_println("Type ioctrl -help for more information.");
42 | shell_println("");
43 | return SHELL_RET_SUCCESS;
44 | }
45 |
46 | // Parse command arguments
47 | for(i = 0; i \"Sets\" the pin (PIN_NUMBER) to perform other operations on the pin");
57 | shell_println(" -m [INPUT|OUTPUT] -> \"Configures\" PIN mode as INPUT or OUTPUT");
58 | shell_println(" -w [LOW|HIGH] -> \"Writes\" a digital output value LOW or HIGH");
59 | shell_println(" -r -> \"Reads\" the state of a digital input or output");
60 | shell_println(" -help -> Shows this help message");
61 | shell_println("");
62 | return SHELL_RET_SUCCESS;
63 | }
64 | // Asign pin to read / write or configure
65 | else if(!strcmp(argv[i], (const char *) "-p")) {
66 | if(i+1 >argc)
67 | goto argerror;
68 | pin =strtol(argv[i+1],0,0);
69 | shell_printf("#ioctrl-selpin:%d\r\n", pin);
70 | }
71 | // Configure the pin mode as input or output
72 | else if(!strcmp(argv[i], (const char *) "-m")) {
73 | if(i+1 > argc)
74 | goto argerror;
75 | op = E_PIN_MODE;
76 | if(!strcmp(argv[i+1], (const char *) "INPUT"))
77 | mode = INPUT;
78 | else if(!strcmp(argv[i+1], (const char *) "OUTPUT"))
79 | mode = OUTPUT;
80 | }
81 | // Writes a digital value to IO pin
82 | else if(!strcmp(argv[i], (const char *) "-w")) {
83 | if(i+1 > argc)
84 | goto argerror;
85 | op = E_DIGITAL_WRITE;
86 | if(!strcmp(argv[i+1], (const char *) "LOW"))
87 | val = LOW;
88 | else if(!strcmp(argv[i+1], (const char *) "HIGH"))
89 | val = HIGH;
90 | }
91 | else if(!strcmp(argv[i], (const char *) "-r")) {
92 | op = E_DIGITAL_READ;
93 | }
94 | }
95 | // Check valid pin number
96 | if(pin == 0xFF) {
97 | shell_print_error(E_SHELL_ERR_VALUE, 0);
98 | return SHELL_RET_FAILURE;
99 | }
100 |
101 | // Perform operations on the IO pins with the provided information
102 | switch(op) {
103 | case E_PIN_MODE:
104 | shell_print("#ioctrl-mode:");
105 | if(mode == INPUT)
106 | shell_println("INTPUT");
107 | else if( mode == OUTPUT )
108 | shell_println("OUTPUT");
109 | else {
110 | shell_print_error(E_SHELL_ERR_VALUE, "Mode");
111 | return SHELL_RET_FAILURE;
112 | }
113 | pinMode(pin, mode);
114 | break;
115 |
116 | case E_DIGITAL_WRITE:
117 | shell_print("#ioctrl-write:");
118 | if(val == HIGH)
119 | shell_println("HIGH");
120 | else if(val == LOW)
121 | shell_println("LOW");
122 | else {
123 | shell_print_error(E_SHELL_ERR_VALUE, "Value");
124 | return SHELL_RET_FAILURE;
125 | }
126 | digitalWrite(pin,val);
127 | break;
128 |
129 | case E_DIGITAL_READ:
130 | shell_print("#ioctrl-read:");
131 | if(digitalRead(pin) == HIGH)
132 | shell_println("HIGH");
133 | else
134 | shell_println("LOW");
135 | break;
136 | }
137 |
138 | return SHELL_RET_SUCCESS;
139 | // Exit point for missing arguments in any part of the function
140 | argerror:
141 | shell_print_error(E_SHELL_ERR_ARGCOUNT,0);
142 | shell_println("");
143 | return SHELL_RET_FAILURE;
144 |
145 | }
146 |
147 | /**
148 | * Function to read data from serial port
149 | * Functions to read from physical media should use this prototype:
150 | * int my_reader_function(char * data)
151 | */
152 | int shell_reader(char * data)
153 | {
154 | // Wrapper for Serial.read() method
155 | if (Serial.available()) {
156 | *data = Serial.read();
157 | return 1;
158 | }
159 | return 0;
160 | }
161 |
162 | /**
163 | * Function to write data to serial port
164 | * Functions to write to physical media should use this prototype
165 | * void my_writer_function(char data)
166 | */
167 | void shell_writer(char data)
168 | {
169 | // Wrapper for Serial.write() method
170 | Serial.write(data);
171 | }
172 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/Shell/examples/Shell_Minimum/Shell_Minimum.ino:
--------------------------------------------------------------------------------
1 | /**
2 | * GeekFactory - "Construye tu propia tecnologia"
3 | * Distribucion de materiales para el desarrollo e innovacion tecnologica
4 | * www.geekfactory.mx
5 | *
6 | * Ejemplo de libreria Shell. Este ejemplo representa la configuracion minima
7 | * requerida para implementar la funcionalidad de interfaz de comandos.
8 | *
9 | * Example for Shell library. This example shows the minimum setup needed to
10 | * implement a command line interface.
11 | */
12 |
13 | #include
14 |
15 | void setup()
16 | {
17 | // Prepare serial communication
18 | Serial.begin(9600);
19 | // Wait after reset or power on...
20 | delay(1000);
21 |
22 | // Initialize command line interface (CLI)
23 | // We pass the function pointers to the read and write functions that we implement below
24 | // We can also pass a char pointer to display a custom start message
25 | shell_init(shell_reader, shell_writer, 0);
26 |
27 | // Add commands to the shell
28 | shell_register(command_example, PSTR("example"));
29 | }
30 |
31 | void loop()
32 | {
33 | // This should always be called to process user input
34 | shell_task();
35 | }
36 |
37 | int command_example(int argc, char** argv)
38 | {
39 | // Do something here...
40 |
41 | // And exit
42 | return SHELL_RET_SUCCESS;
43 | }
44 |
45 | /**
46 | * Function to read data from serial port
47 | * Functions to read from physical media should use this prototype:
48 | * int my_reader_function(char * data)
49 | */
50 | int shell_reader(char * data)
51 | {
52 | // Wrapper for Serial.read() method
53 | if (Serial.available()) {
54 | *data = Serial.read();
55 | return 1;
56 | }
57 | return 0;
58 | }
59 |
60 | /**
61 | * Function to write data to serial port
62 | * Functions to write to physical media should use this prototype:
63 | * void my_writer_function(char data)
64 | */
65 | void shell_writer(char data)
66 | {
67 | // Wrapper for Serial.write() method
68 | Serial.write(data);
69 | }
70 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/Shell/examples/Shell_RGB_Control/Shell_RGB_Control.ino:
--------------------------------------------------------------------------------
1 | /**
2 | * GeekFactory - "Construye tu propia tecnologia"
3 | * Distribucion de materiales para el desarrollo e innovacion tecnologica
4 | * www.geekfactory.mx
5 | *
6 | * Ejemplo de libreria Shell. Este ejemplo permite controlar el color mostrado
7 | * en un led RGB conectado a los pines PWM mediante comandos de texto. El programa
8 | * admite 3 parametros de 0 a 255 que representan la intensidad de cada led (RGB).
9 | *
10 | * Example for Shell library. This example controls the color displayed on the RGB
11 | * led connected to PWM pins using text commands. The program accepts 3 parameters
12 | * in a range from 0 to 255 that represent the intensity of each led.
13 | */
14 |
15 | #include
16 |
17 | void setup()
18 | {
19 | // Prepare serial communication
20 | Serial.begin(9600);
21 | // Wait after reset or power on...
22 | delay(1000);
23 |
24 | // Pins to connect RGB led (PWM outputs)
25 | pinMode(3,OUTPUT);
26 | pinMode(5,OUTPUT);
27 | pinMode(6,OUTPUT);
28 | pinMode(9,OUTPUT);
29 |
30 | // Initialize command line interface (CLI)
31 | // We pass the function pointers to the read and write functions that we implement below
32 | // We can also pass a char pointer to display a custom start message
33 | shell_init(shell_reader, shell_writer, 0);
34 |
35 | // Add commands to the shell
36 | shell_register(command_rgbled, PSTR("rgbled"));
37 | }
38 |
39 | void loop()
40 | {
41 | // This should always be called to process user input
42 | shell_task();
43 | }
44 |
45 | /**
46 | * This function implements the rgbled command and parses the required args
47 | * Type: rgbled 255 255 255 to set led to maximum brigtness
48 | * Type: rgbled 0 0 0 to set led to minimum brightess
49 | */
50 | int command_rgbled(int argc, char** argv)
51 | {
52 | // Variables that store parameter values
53 | uint8_t val_R, val_G, val_B;
54 |
55 | // Parse RGB values and write to PWM pins
56 | val_R = strtol(argv[1],NULL,0);
57 | analogWrite(3, val_R);
58 |
59 | val_G = strtol(argv[2],NULL,0);
60 | analogWrite(5, val_G);
61 |
62 | val_B = strtol(argv[3],NULL,0);
63 | analogWrite(6, val_B);
64 |
65 | val_B = strtol(argv[4],NULL,0);
66 | analogWrite(9, val_B);
67 |
68 | // Print the received falues to the terminal screen
69 | shell_printf("#RGB-COMPONENTS:%d,%d,%d\r\n", val_R, val_G, val_B);
70 |
71 | // Return success code
72 | return SHELL_RET_SUCCESS;
73 | }
74 |
75 | /**
76 | * Function to read data from serial port
77 | * Functions to read from physical media should use this prototype:
78 | * int my_reader_function(char * data)
79 | */
80 | int shell_reader(char * data)
81 | {
82 | // Wrapper for Serial.read() method
83 | if (Serial.available()) {
84 | *data = Serial.read();
85 | return 1;
86 | }
87 | return 0;
88 | }
89 |
90 | /**
91 | * Function to write data to serial port
92 | * Functions to write to physical media should use this prototype:
93 | * void my_writer_function(char data)
94 | */
95 | void shell_writer(char data)
96 | {
97 | // Wrapper for Serial.write() method
98 | Serial.write(data);
99 | }
100 |
101 |
102 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/Shell/examples/Shell_Telnet/Shell_Telnet.ino:
--------------------------------------------------------------------------------
1 | /**
2 | * GeekFactory - "Construye tu propia tecnologia"
3 | * Distribucion de materiales para el desarrollo e innovacion tecnologica
4 | * www.geekfactory.mx
5 | *
6 | * Ejemplo de libreria Shell. Este ejemplo permite controlar el color mostrado
7 | * en un led RGB conectado a los pines PWM mediante comandos de texto. El programa
8 | * admite 3 parametros de 0 a 255 que representan la intensidad de cada led (RGB).
9 | * Esta version del programa permite el control remoto a traves de un shield Ethernet
10 | * y demuestra la capacidad de la libreria para redirigir la entrada y salida de datos
11 | * desde y hacia cualquier medio.
12 | *
13 | * Example for Shell library. This example controls the color displayed on the RGB
14 | * led connected to PWM pins using text commands. The program accepts 3 parameters
15 | * in a range from 0 to 255 that represent the intensity of each led.
16 | * This version of the program allows the remote control through the Ethernet Shield
17 | * and shows the capacity of the library to redirect data input and output to any
18 | * physical medium.
19 | */
20 |
21 | #include
22 | #include
23 | #include
24 |
25 | // Ethernet and TCP/IP protocol configuration
26 | byte mac[] = {
27 | 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
28 |
29 | byte ip[] = {
30 | 192, 168, 1, 177 };
31 |
32 | byte gateway[] = {
33 | 192, 168, 1, 254 };
34 |
35 | byte subnet[] = {
36 | 255, 255, 255, 0 };
37 |
38 | // Create the server instance on port 23 (default port for telnet protocol)
39 | EthernetServer server = EthernetServer(23);
40 | // The client that is willing to connect to server
41 | EthernetClient client;
42 |
43 |
44 | void setup()
45 | {
46 | // Prepare serial communication
47 | Serial.begin(9600);
48 | // Setup ethernet shield
49 | Ethernet.begin(mac, ip, gateway, subnet);
50 | // Start TCP Server on port 23
51 | server.begin();
52 | // Wait after reset or power on...
53 | delay(1000);
54 |
55 | // Pins to connect RGB led (PWM outputs)
56 | pinMode(3,OUTPUT);
57 | pinMode(5,OUTPUT);
58 | pinMode(6,OUTPUT);
59 |
60 | // Initialize command line interface (CLI)
61 | // We pass the function pointers to the read and write functions that we implement below
62 | // We can also pass a char pointer to display a custom start message
63 | shell_init(shell_reader, shell_writer, 0);
64 |
65 | // Add commands to the shell
66 | shell_register(command_rgbled, PSTR("rgbled"));
67 |
68 | }
69 |
70 | void loop()
71 | {
72 | // Check if a client is willing to connect and get client object
73 | client = server.available();
74 | // This should always be called to process user input
75 | shell_task();
76 | }
77 |
78 | /**
79 | * This function implements the rgbled command and parses the required args
80 | * Type: rgbled 255 255 255 to set led to maximum brigtness
81 | * Type: rgbled 0 0 0 to set led to minimum brightess
82 | */
83 | int command_rgbled(int argc, char** argv)
84 | {
85 | // Variables that store parameter values
86 | uint8_t val_R, val_G, val_B;
87 |
88 | // Parse RGB values and write to PWM pins
89 | val_R = strtol(argv[1],NULL,0);
90 | analogWrite(3, val_R);
91 |
92 | val_G = strtol(argv[2],NULL,0);
93 | analogWrite(5, val_G);
94 |
95 | val_B = strtol(argv[3],NULL,0);
96 | analogWrite(6, val_B);
97 |
98 | // Print the received falues to the terminal screen
99 | shell_printf("#RGB-COMPONENTS:%d,%d,%d\r\n", val_R, val_G, val_B);
100 |
101 | // Return success code
102 | return SHELL_RET_SUCCESS;
103 | }
104 |
105 | /**
106 | * Function to read data from serial port
107 | * Functions to read from physical media should use this prototype:
108 | * int my_reader_function(char * data)
109 | */
110 | int shell_reader(char * data)
111 | {
112 | int ret = 0;
113 | // If a client is available and it´s connected
114 | if (client==true && client.connected()) {
115 | // Client has data?
116 | if (client.available()) {
117 | // Read data from client
118 | *data = client.read();
119 | ret = 1;
120 | }
121 | }
122 | else
123 | {
124 | client.stop();
125 | }
126 | return ret;
127 | }
128 |
129 | /**
130 | * Function to write data to serial port
131 | * Functions to write to physical media should use this prototype:
132 | * void my_writer_function(char data)
133 | */
134 | void shell_writer(char data)
135 | {
136 | // If we can write to a client
137 | if(client==true && client.connected())
138 | {
139 | // Wrapper for Serial.write() method
140 | client.write(data);
141 | }
142 | }
143 |
144 |
145 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/Shell/keywords.txt:
--------------------------------------------------------------------------------
1 | #######################################
2 | # Syntax Coloring Map for Shell
3 | #######################################
4 |
5 | #######################################
6 | # Datatypes (KEYWORD1)
7 | #######################################
8 |
9 | #######################################
10 | # Methods and Functions (KEYWORD2)
11 | #######################################
12 | shell_init KEYWORD2
13 | shell_use_buffered_output KEYWORD2
14 | shell_register KEYWORD2
15 | shell_unregister_all KEYWORD2
16 | shell_putc KEYWORD2
17 | shell_print KEYWORD2
18 | shell_println KEYWORD2
19 | shell_printf KEYWORD2
20 | shell_print_commands KEYWORD2
21 | shell_print_error KEYWORD2
22 | shell_task KEYWORD2
23 | shell_print_pm KEYWORD2
24 | shell_println_pm KEYWORD2
25 | shell_printf_pm KEYWORD2
26 |
27 | #######################################
28 | # Instances (KEYWORD2)
29 | #######################################
30 |
31 | #######################################
32 | # Constants (LITERAL1)
33 | #######################################
34 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/Shell/library.properties:
--------------------------------------------------------------------------------
1 | name=GeekFactory Shell Library
2 | version=1.2.0
3 | author=www.geekfactory.mx
4 | maintainer=Jesus Ruben Santa Anna Zamudio
5 | sentence=Library to create a simple Command Line Interface (CLI).
6 | paragraph=This library allows the user to control the device using simple text commands, the library is written in pure C so it can be easily ported to other microcontrollers.
7 | category=Communication
8 | url=https://github.com/geekfactory/Shell
9 | architectures=*
10 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/U8g2/LICENSE:
--------------------------------------------------------------------------------
1 |
2 | The U8g2lib code (http://code.google.com/p/u8g2/ and
3 | https://github.com/olikraus/U8g2_Arduino) is licensed under the terms of
4 | the new-bsd license (two-clause bsd license).
5 | See also: http://www.opensource.org/licenses/bsd-license.php
6 |
7 | The repository and optionally the releases contain icons, which are
8 | derived from the WPZOOM Developer Icon Set:
9 | http://www.wpzoom.com/wpzoom/new-freebie-wpzoom-developer-icon-set-154-free-icons/
10 | WPZOOM Developer Icon Set by WPZOOM is licensed under a Creative Commons
11 | Attribution-ShareAlike 3.0 Unported License.
12 |
13 | Fonts are licensed under different conditions.
14 | See
15 | https://github.com/olikraus/u8g2/wiki/fntgrp
16 | for detailed information on the licensing conditions for each font.
17 |
18 | ============ X11 Fonts COUR, HELV, NCEN, TIM, SYMB ============
19 |
20 | For fonts derived from the following files, the license below applies.
21 | COURB08.BDF COURB10.BDF COURB12.BDF COURB14.BDF COURB18.BDF
22 | COURB24.BDF COURR08.BDF COURR10.BDF COURR12.BDF COURR14.BDF
23 | COURR18.BDF COURR24.BDF HELVB08.BDF HELVB10.BDF HELVB12.BDF HELVB14.BDF
24 | HELVB18.BDF HELVB24.BDF HELVR08.BDF HELVR10.BDF HELVR12.BDF HELVR14.BDF
25 | HELVR18.BDF HELVR24.BDF NCENB08.BDF NCENB10.BDF NCENB12.BDF
26 | NCENB14.BDF NCENB18.BDF NCENB24.BDF NCENR08.BDF NCENR10.BDF
27 | NCENR12.BDF NCENR14.BDF NCENR18.BDF NCENR24.BDF SYMB08.BDF SYMB10.BDF
28 | SYMB12.BDF SYMB14.BDF SYMB18.BDF SYMB24.BDF TIMB08.BDF TIMB10.BDF
29 | TIMB12.BDF TIMB14.BDF TIMB18.BDF TIMB24.BDF TIMR08.BDF TIMR10.BDF
30 | TIMR12.BDF TIMR14.BDF TIMR18.BDF TIMR24.BDF
31 |
32 | Copyright 1984-1989, 1994 Adobe Systems Incorporated.
33 | Copyright 1988, 1994 Digital Equipment Corporation.
34 |
35 | Adobe is a trademark of Adobe Systems Incorporated which may be
36 | registered in certain jurisdictions.
37 | Permission to use these trademarks is hereby granted only in
38 | association with the images described in this file.
39 |
40 | Permission to use, copy, modify, distribute and sell this software
41 | and its documentation for any purpose and without fee is hereby
42 | granted, provided that the above copyright notices appear in all
43 | copies and that both those copyright notices and this permission
44 | notice appear in supporting documentation, and that the names of
45 | Adobe Systems and Digital Equipment Corporation not be used in
46 | advertising or publicity pertaining to distribution of the software
47 | without specific, written prior permission. Adobe Systems and
48 | Digital Equipment Corporation make no representations about the
49 | suitability of this software for any purpose. It is provided "as
50 | is" without express or implied warranty.
51 |
52 |
53 | ============ BSD License for U8g2lib Code ============
54 |
55 | Universal 8bit Graphics Library (http://code.google.com/p/u8g2/ and
56 | https://github.com/olikraus/U8g2_Arduino)
57 |
58 | Copyright (c) 2016, olikraus@gmail.com
59 | All rights reserved.
60 |
61 | Redistribution and use in source and binary forms, with or without modification,
62 | are permitted provided that the following conditions are met:
63 |
64 | * Redistributions of source code must retain the above copyright notice, this list
65 | of conditions and the following disclaimer.
66 |
67 | * Redistributions in binary form must reproduce the above copyright notice, this
68 | list of conditions and the following disclaimer in the documentation and/or other
69 | materials provided with the distribution.
70 |
71 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
72 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
73 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
74 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
75 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
76 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
77 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
78 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
79 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
80 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
81 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
82 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
83 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
84 |
85 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/U8g2/README.md:
--------------------------------------------------------------------------------
1 | # U8g2_Arduino: Arduino Monochrome Graphics Library
2 |
3 | 
4 |
5 | U8glib V2 library for Arduino
6 |
7 | Description: https://github.com/olikraus/u8g2/wiki
8 |
9 | Issue Tracker: https://github.com/olikraus/u8g2/issues
10 |
11 | Download (2.25.10): https://github.com/olikraus/U8g2_Arduino/archive/master.zip
12 |
13 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/U8g2/examples/page_buffer/A2Printer/A2Printer.ino:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | A2Printer.ino
4 |
5 | This is a special example for the A2 Thermo Printer
6 | This example can NOT be used with LCDs and OLEDs
7 |
8 | Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
9 |
10 | Copyright (c) 2016, olikraus@gmail.com
11 | All rights reserved.
12 |
13 | Redistribution and use in source and binary forms, with or without modification,
14 | are permitted provided that the following conditions are met:
15 |
16 | * Redistributions of source code must retain the above copyright notice, this list
17 | of conditions and the following disclaimer.
18 |
19 | * Redistributions in binary form must reproduce the above copyright notice, this
20 | list of conditions and the following disclaimer in the documentation and/or other
21 | materials provided with the distribution.
22 |
23 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
24 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
25 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
26 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
28 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
29 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
30 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
33 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
35 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 |
37 | */
38 |
39 | // use this serial interface
40 | #define PRINTER_SERIAL Serial
41 | // #define PRINTER_SERIAL Serial1
42 |
43 |
44 | #include
45 | #include
46 |
47 | #ifdef U8X8_HAVE_HW_SPI
48 | #include
49 | #endif
50 | #ifdef U8X8_HAVE_HW_I2C
51 | #include
52 | #endif
53 |
54 |
55 |
56 | /* define our own serial function, this will be assigned later */
57 |
58 | extern "C" uint8_t u8x8_byte_arduino_serial(u8x8_t *u8g2, uint8_t msg, uint8_t arg_int, void *arg_ptr)
59 | {
60 | uint8_t *data;
61 |
62 | switch(msg)
63 | {
64 | case U8X8_MSG_BYTE_SEND:
65 | data = (uint8_t *)arg_ptr;
66 | while( arg_int > 0 )
67 | {
68 | while(PRINTER_SERIAL.available() > 0)
69 | PRINTER_SERIAL.read();
70 | PRINTER_SERIAL.write((uint8_t)*data);
71 | data++;
72 | arg_int--;
73 | }
74 | break;
75 |
76 | case U8X8_MSG_BYTE_INIT:
77 | delay(1000);
78 | PRINTER_SERIAL.begin(19200);
79 | /* send something.... */
80 | //PRINTER_SERIAL.begin(9600);
81 | PRINTER_SERIAL.write(27); /* ESC */
82 | PRINTER_SERIAL.write(64); /* @ --> reset printer */
83 | delay(1000);
84 |
85 | break;
86 |
87 | case U8X8_MSG_BYTE_SET_DC:
88 | break;
89 |
90 | case U8X8_MSG_BYTE_START_TRANSFER:
91 | break;
92 |
93 | case U8X8_MSG_BYTE_END_TRANSFER:
94 | break;
95 |
96 | default:
97 | return 0;
98 | }
99 | return 1;
100 | }
101 |
102 | /* define a u8g2 object just with the base class */
103 | /* the baseclass will be configured for the A2 printer in the setup() procedure */
104 | class U8G2 u8g2;
105 |
106 | void setup(void) {
107 |
108 | u8g2_Setup_a2printer_384x240_1( /* several different a2 printer procs exist... */
109 | u8g2.getU8g2(), /* this is a c call, so use the u8g2 struct instead of the class */
110 | U8G2_R0, /* this defines the usual rotation of the bitmap */
111 | u8x8_byte_arduino_serial, /* this is the new procedure from above */
112 | u8x8_gpio_and_delay_arduino); /* standard arduino low level proc, used only for delay */
113 |
114 | u8g2.beginSimple(); /* Do not clear the display, wake is not required */
115 | }
116 |
117 | #define XO 10
118 |
119 | void drawLogo(void)
120 | {
121 |
122 | u8g2.setFontMode(1); // Transparent
123 | u8g2.setFontDirection(0);
124 | u8g2.setFont(u8g2_font_inb24_mf);
125 | u8g2.drawStr(0+XO, 30, "U");
126 |
127 | u8g2.setFontDirection(1);
128 | u8g2.setFont(u8g2_font_inb30_mn);
129 | u8g2.drawStr(21+XO,8,"8");
130 |
131 | u8g2.setFontDirection(0);
132 | u8g2.setFont(u8g2_font_inb24_mf);
133 | u8g2.drawStr(51+XO,30,"g");
134 | u8g2.drawStr(67+XO,30,"\xb2");
135 |
136 | u8g2.drawHLine(2+XO, 35, 47);
137 | u8g2.drawHLine(3+XO, 36, 47);
138 | u8g2.drawVLine(45+XO, 32, 12);
139 | u8g2.drawVLine(46+XO, 33, 12);
140 | }
141 |
142 | void drawURL(void)
143 | {
144 | u8g2.setFont(u8g2_font_6x12_tr);
145 | u8g2.drawStr(1+XO,54,"github.com/olikraus/u8g2");
146 | }
147 |
148 | void loop(void) {
149 | u8g2.firstPage();
150 | do {
151 | drawLogo();
152 | drawURL();
153 |
154 | /* worst case heating test */
155 | u8g2.drawRBox(4,90,384-8,20, 8);
156 |
157 | /* heating test with some text */
158 | u8g2.setFont(u8g2_font_inb24_mf);
159 | u8g2.drawStr(10,160,"Hello World!");
160 |
161 | /* draw a frame around the picture */
162 | u8g2.drawFrame(0,0,384,240);
163 | u8g2.drawFrame(1,1,384-2,240-2);
164 | } while ( u8g2.nextPage() );
165 | delay(1000);
166 | }
167 |
168 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/U8g2/examples/u8x8/ArduboyTest/ArduboyTest.ino:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Arduboy.ino
4 |
5 | Arduboy Test Example with U8x8
6 |
7 | Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
8 |
9 | Copyright (c) 2016, olikraus@gmail.com
10 | All rights reserved.
11 |
12 | Redistribution and use in source and binary forms, with or without modification,
13 | are permitted provided that the following conditions are met:
14 |
15 | * Redistributions of source code must retain the above copyright notice, this list
16 | of conditions and the following disclaimer.
17 |
18 | * Redistributions in binary form must reproduce the above copyright notice, this
19 | list of conditions and the following disclaimer in the documentation and/or other
20 | materials provided with the distribution.
21 |
22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
23 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
24 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
27 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
29 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
32 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
34 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 |
36 | */
37 |
38 | #include
39 | #include
40 | #include
41 |
42 | #ifdef U8X8_HAVE_HW_SPI
43 | #include
44 | #endif
45 |
46 | // Arduboy 10 (Production, Kickstarter Edition)
47 | U8X8_SSD1306_128X64_NONAME_4W_HW_SPI u8x8(/* cs=*/ 12, /* dc=*/ 4, /* reset=*/ 6);
48 |
49 | ArduboyCore arduboyCore;
50 | ArduboyAudio arduboyAudio;
51 | ArduboyTunes arduboyTunes;
52 |
53 | void setup(void)
54 | {
55 | //u8x8.begin(/*Select=*/ A0, /*Right/Next=*/ 5, /*Left/Prev=*/ 9, /*Up=*/ 8, /*Down=*/ 10, /*Home/Cancel=*/ A1); // Arduboy DevKit
56 | u8x8.begin(/*Select=*/ 7, /*Right/Next=*/ A1, /*Left/Prev=*/ A2, /*Up=*/ A0, /*Down=*/ A3, /*Home/Cancel=*/ 8); // Arduboy 10 (Production)
57 |
58 | arduboyTunes.initChannel(PIN_SPEAKER_1);
59 | arduboyTunes.initChannel(PIN_SPEAKER_2);
60 | arduboyAudio.begin();
61 | }
62 |
63 | void msg(const char *txt)
64 | {
65 | u8x8.clear();
66 | u8x8.print(txt);
67 | }
68 |
69 | void loop(void)
70 | {
71 | static uint8_t c = 1;
72 | static uint8_t b = 0;
73 | u8x8.setFont(u8x8_font_chroma48medium8_r);
74 | c = u8x8.userInterfaceSelectionList("Arduboy Test\n", c, "LED Test\nButton Test\nSpeaker Test");
75 | if ( c == 1 )
76 | {
77 | msg("LED Test");
78 | arduboyCore.setRGBled(255, 0, 0);
79 | delay(500);
80 | arduboyCore.setRGBled(0, 255, 0); // green is not there ???
81 | delay(500);
82 | arduboyCore.setRGBled(0, 0, 255);
83 | delay(500);
84 | arduboyCore.setRGBled(0, 0, 0);
85 | }
86 | else if ( c == 2 )
87 | {
88 | u8x8.clear();
89 | for(;;)
90 | {
91 | u8x8.drawUTF8(0, 0, "Button Test");
92 | b = arduboyCore.buttonsState();
93 |
94 | u8x8.noInverse();
95 | if ( b & A_BUTTON )
96 | u8x8.inverse();
97 | u8x8.drawUTF8(0, 1, "A Button");
98 |
99 | u8x8.noInverse();
100 | if ( b & B_BUTTON )
101 | u8x8.inverse();
102 | u8x8.drawUTF8(0, 2, "B Button");
103 |
104 | u8x8.noInverse();
105 | if ( b & UP_BUTTON )
106 | u8x8.inverse();
107 | u8x8.drawUTF8(0, 3, "UP Button");
108 |
109 | u8x8.noInverse();
110 | if ( b & DOWN_BUTTON )
111 | u8x8.inverse();
112 | u8x8.drawUTF8(0, 4, "DOWN Button");
113 |
114 | u8x8.noInverse();
115 | if ( b & LEFT_BUTTON )
116 | u8x8.inverse();
117 | u8x8.drawUTF8(0, 5, "LEFT Button");
118 |
119 | u8x8.noInverse();
120 | if ( b & RIGHT_BUTTON )
121 | u8x8.inverse();
122 | u8x8.drawUTF8(0, 6, "RIGHT Button");
123 |
124 | u8x8.noInverse();
125 | u8x8.drawUTF8(0, 7, "Quit: A&B Button");
126 |
127 | if ( (b & A_BUTTON) && (b & B_BUTTON) )
128 | break;
129 | }
130 | }
131 | else if ( c == 3 )
132 | {
133 | u8x8.clear();
134 | u8x8.drawUTF8(0, 0, "Speaker Test");
135 | arduboyTunes.tone(1000, 1000);
136 | delay(1000);
137 | arduboyTunes.tone(2000, 1000);
138 | delay(1000);
139 | }
140 | }
141 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/U8g2/library.properties:
--------------------------------------------------------------------------------
1 | name=U8g2
2 | version=2.25.10
3 | author=oliver
4 | maintainer=oliver
5 | sentence=Monochrome LCD, OLED and eInk Library. Display controller: SSD1305, SSD1306, SSD1309, SSD1322, SSD1325, SSD1327, SSD1329, SSD1606, SSD1607, SH1106, SH1107, SH1108, SH1122, T6963, RA8835, LC7981, PCD8544, PCF8812, HX1230, UC1601, UC1604, UC1608, UC1610, UC1611, UC1701, ST7565, ST7567, ST7588, ST75256, NT7534, IST3020, ST7920, LD7032, KS0108, SED1520, SBN1661, IL3820, MAX7219. Interfaces: I2C, SPI, Parallel.
6 | paragraph=Monochrome LCD, OLED and eInk Library. Successor of U8glib. Supported display controller: SSD1305, SSD1306, SSD1309, SSD1322, SSD1325, SSD1327, SSD1329, SSD1606, SSD1607, SH1106, SH1107, SH1108, SH1122, T6963, RA8835, LC7981, PCD8544, PCF8812, HX1230, UC1601, UC1604, UC1608, UC1610, UC1611, UC1701, ST7565, ST7567, ST7588, ST75256, NT7534, IST3020, ST7920, LD7032, KS0108, SED1520, SBN1661, IL3820, MAX7219. Supported interfaces: I2C, SPI, Parallel. Features: UTF8, >700 fonts, U8x8 char output.
7 | category=Display
8 | url=https://github.com/olikraus/u8g2
9 | architectures=*
10 | license=BSD-2-Clause
11 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8g2_cleardisplay.c:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | u8g2_cleardisplay.c
4 |
5 | Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
6 |
7 | Copyright (c) 2016, olikraus@gmail.com
8 | All rights reserved.
9 |
10 | Redistribution and use in source and binary forms, with or without modification,
11 | are permitted provided that the following conditions are met:
12 |
13 | * Redistributions of source code must retain the above copyright notice, this list
14 | of conditions and the following disclaimer.
15 |
16 | * Redistributions in binary form must reproduce the above copyright notice, this
17 | list of conditions and the following disclaimer in the documentation and/or other
18 | materials provided with the distribution.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
22 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
25 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 |
34 | */
35 | #include "u8g2.h"
36 |
37 | /* Clear screen buffer & display reliable for all u8g2 displays. */
38 | /* This is done with u8g2 picture loop, because we can not use the u8x8 function in all cases */
39 | void u8g2_ClearDisplay(u8g2_t *u8g2)
40 | {
41 | u8g2_FirstPage(u8g2);
42 | do {
43 | } while ( u8g2_NextPage(u8g2) );
44 | /*
45 | This function is usually called during startup (u8g2.begin()).
46 | However the user might want to use full buffer mode with clear and
47 | send commands.
48 | This will not work because the current tile row is modified by the picture
49 | loop above. To fix this, reset the tile row to 0, issue #370
50 | A workaround would be, that the user sets the current tile row to 0 manually.
51 | */
52 | u8g2_SetBufferCurrTileRow(u8g2, 0);
53 | }
54 |
55 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8g2_fonts.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8g2_fonts.c
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8g2_input_value.c:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | u8g2_input_value.c
4 |
5 | Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
6 |
7 | Copyright (c) 2016, olikraus@gmail.com
8 | All rights reserved.
9 |
10 | Redistribution and use in source and binary forms, with or without modification,
11 | are permitted provided that the following conditions are met:
12 |
13 | * Redistributions of source code must retain the above copyright notice, this list
14 | of conditions and the following disclaimer.
15 |
16 | * Redistributions in binary form must reproduce the above copyright notice, this
17 | list of conditions and the following disclaimer in the documentation and/or other
18 | materials provided with the distribution.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
22 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
25 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 |
34 | */
35 |
36 | #include "u8g2.h"
37 |
38 | /*
39 | return:
40 | 0: value is not changed (HOME/Break Button pressed)
41 | 1: value has been updated
42 | */
43 |
44 | uint8_t u8g2_UserInterfaceInputValue(u8g2_t *u8g2, const char *title, const char *pre, uint8_t *value, uint8_t lo, uint8_t hi, uint8_t digits, const char *post)
45 | {
46 | uint8_t line_height;
47 | uint8_t height;
48 | u8g2_uint_t pixel_height;
49 | u8g2_uint_t y, yy;
50 | u8g2_uint_t pixel_width;
51 | u8g2_uint_t x, xx;
52 |
53 | uint8_t local_value = *value;
54 | //uint8_t r; /* not used ??? */
55 | uint8_t event;
56 |
57 | /* only horizontal strings are supported, so force this here */
58 | u8g2_SetFontDirection(u8g2, 0);
59 |
60 | /* force baseline position */
61 | u8g2_SetFontPosBaseline(u8g2);
62 |
63 | /* calculate line height */
64 | line_height = u8g2_GetAscent(u8g2);
65 | line_height -= u8g2_GetDescent(u8g2);
66 |
67 |
68 | /* calculate overall height of the input value box */
69 | height = 1; /* value input line */
70 | height += u8x8_GetStringLineCnt(title);
71 |
72 | /* calculate the height in pixel */
73 | pixel_height = height;
74 | pixel_height *= line_height;
75 |
76 |
77 | /* calculate offset from top */
78 | y = 0;
79 | if ( pixel_height < u8g2_GetDisplayHeight(u8g2) )
80 | {
81 | y = u8g2_GetDisplayHeight(u8g2);
82 | y -= pixel_height;
83 | y /= 2;
84 | }
85 |
86 | /* calculate offset from left for the label */
87 | x = 0;
88 | pixel_width = u8g2_GetUTF8Width(u8g2, pre);
89 | pixel_width += u8g2_GetUTF8Width(u8g2, "0") * digits;
90 | pixel_width += u8g2_GetUTF8Width(u8g2, post);
91 | if ( pixel_width < u8g2_GetDisplayWidth(u8g2) )
92 | {
93 | x = u8g2_GetDisplayWidth(u8g2);
94 | x -= pixel_width;
95 | x /= 2;
96 | }
97 |
98 | /* event loop */
99 | for(;;)
100 | {
101 | u8g2_FirstPage(u8g2);
102 | do
103 | {
104 | /* render */
105 | yy = y;
106 | yy += u8g2_DrawUTF8Lines(u8g2, 0, yy, u8g2_GetDisplayWidth(u8g2), line_height, title);
107 | xx = x;
108 | xx += u8g2_DrawUTF8(u8g2, xx, yy, pre);
109 | xx += u8g2_DrawUTF8(u8g2, xx, yy, u8x8_u8toa(local_value, digits));
110 | u8g2_DrawUTF8(u8g2, xx, yy, post);
111 | } while( u8g2_NextPage(u8g2) );
112 |
113 | #ifdef U8G2_REF_MAN_PIC
114 | return 0;
115 | #endif
116 |
117 | for(;;)
118 | {
119 | event = u8x8_GetMenuEvent(u8g2_GetU8x8(u8g2));
120 | if ( event == U8X8_MSG_GPIO_MENU_SELECT )
121 | {
122 | *value = local_value;
123 | return 1;
124 | }
125 | else if ( event == U8X8_MSG_GPIO_MENU_HOME )
126 | {
127 | return 0;
128 | }
129 | else if ( event == U8X8_MSG_GPIO_MENU_NEXT || event == U8X8_MSG_GPIO_MENU_UP )
130 | {
131 | if ( local_value >= hi )
132 | local_value = lo;
133 | else
134 | local_value++;
135 | break;
136 | }
137 | else if ( event == U8X8_MSG_GPIO_MENU_PREV || event == U8X8_MSG_GPIO_MENU_DOWN )
138 | {
139 | if ( local_value <= lo )
140 | local_value = hi;
141 | else
142 | local_value--;
143 | break;
144 | }
145 | }
146 | }
147 |
148 | /* never reached */
149 | //return r;
150 | }
151 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8g2_intersection.c:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | u8g2_intersection.c
4 |
5 | Intersection calculation, code taken from u8g_clip.c
6 |
7 | Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
8 |
9 | Copyright (c) 2016, olikraus@gmail.com
10 | All rights reserved.
11 |
12 | Redistribution and use in source and binary forms, with or without modification,
13 | are permitted provided that the following conditions are met:
14 |
15 | * Redistributions of source code must retain the above copyright notice, this list
16 | of conditions and the following disclaimer.
17 |
18 | * Redistributions in binary form must reproduce the above copyright notice, this
19 | list of conditions and the following disclaimer in the documentation and/or other
20 | materials provided with the distribution.
21 |
22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
23 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
24 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
27 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
29 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
32 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
34 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 |
36 | */
37 |
38 | #include "u8g2.h"
39 |
40 | #ifdef __GNUC__
41 | #define U8G2_ALWAYS_INLINE __inline__ __attribute__((always_inline))
42 | #else
43 | #define U8G2_ALWAYS_INLINE
44 | #endif
45 |
46 |
47 | #if defined(U8G2_WITH_INTERSECTION) || defined(U8G2_WITH_CLIP_WINDOW_SUPPORT)
48 |
49 | #ifdef OLD_VERSION_WITH_SYMETRIC_BOUNDARIES
50 |
51 | /*
52 | intersection assumptions:
53 | a1 <= a2 is always true
54 |
55 | minimized version
56 | ---1----0 1 b1 <= a2 && b1 > b2
57 | -----1--0 1 b2 >= a1 && b1 > b2
58 | ---1-1--- 1 b1 <= a2 && b2 >= a1
59 | */
60 |
61 |
62 | /*
63 | calculate the intersection between a0/a1 and v0/v1
64 | The intersection check returns one if the range of a0/a1 has an intersection with v0/v1.
65 | The intersection check includes the boundary values v1 and a1.
66 |
67 | The following asserts will succeed:
68 | assert( u8g2_is_intersection_decision_tree(4, 6, 7, 9) == 0 );
69 | assert( u8g2_is_intersection_decision_tree(4, 6, 6, 9) != 0 );
70 | assert( u8g2_is_intersection_decision_tree(6, 9, 4, 6) != 0 );
71 | assert( u8g2_is_intersection_decision_tree(7, 9, 4, 6) == 0 );
72 | */
73 |
74 | //static uint8_t U8G2_ALWAYS_INLINE u8g2_is_intersection_decision_tree(u8g_uint_t a0, u8g_uint_t a1, u8g_uint_t v0, u8g_uint_t v1)
75 | static uint8_t u8g2_is_intersection_decision_tree(u8g2_uint_t a0, u8g2_uint_t a1, u8g2_uint_t v0, u8g2_uint_t v1)
76 | {
77 | if ( v0 <= a1 )
78 | {
79 | if ( v1 >= a0 )
80 | {
81 | return 1;
82 | }
83 | else
84 | {
85 | if ( v0 > v1 )
86 | {
87 | return 1;
88 | }
89 | else
90 | {
91 | return 0;
92 | }
93 | }
94 | }
95 | else
96 | {
97 | if ( v1 >= a0 )
98 | {
99 | if ( v0 > v1 )
100 | {
101 | return 1;
102 | }
103 | else
104 | {
105 | return 0;
106 | }
107 | }
108 | else
109 | {
110 | return 0;
111 | }
112 | }
113 | }
114 |
115 | #endif /* OLD_VERSION_WITH_SYMETRIC_BOUNDARIES */
116 |
117 |
118 | /*
119 | version with asymetric boundaries.
120 | a1 and v1 are excluded
121 | v0 == v1 is not support end return 1
122 | */
123 | uint8_t u8g2_is_intersection_decision_tree(u8g2_uint_t a0, u8g2_uint_t a1, u8g2_uint_t v0, u8g2_uint_t v1)
124 | {
125 | if ( v0 < a1 ) // v0 <= a1
126 | {
127 | if ( v1 > a0 ) // v1 >= a0
128 | {
129 | return 1;
130 | }
131 | else
132 | {
133 | if ( v0 > v1 ) // v0 > v1
134 | {
135 | return 1;
136 | }
137 | else
138 | {
139 | return 0;
140 | }
141 | }
142 | }
143 | else
144 | {
145 | if ( v1 > a0 ) // v1 >= a0
146 | {
147 | if ( v0 > v1 ) // v0 > v1
148 | {
149 | return 1;
150 | }
151 | else
152 | {
153 | return 0;
154 | }
155 | }
156 | else
157 | {
158 | return 0;
159 | }
160 | }
161 | }
162 |
163 |
164 |
165 | /* upper limits are not included (asymetric boundaries) */
166 | uint8_t u8g2_IsIntersection(u8g2_t *u8g2, u8g2_uint_t x0, u8g2_uint_t y0, u8g2_uint_t x1, u8g2_uint_t y1)
167 | {
168 | if ( u8g2_is_intersection_decision_tree(u8g2->user_y0, u8g2->user_y1, y0, y1) == 0 )
169 | return 0;
170 |
171 | return u8g2_is_intersection_decision_tree(u8g2->user_x0, u8g2->user_x1, x0, x1);
172 | }
173 |
174 |
175 | #endif /* U8G2_WITH_INTERSECTION */
176 |
177 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8g2_kerning.c:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | u8g2_kerning.c
4 |
5 | Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
6 |
7 | Copyright (c) 2016, olikraus@gmail.com
8 | All rights reserved.
9 |
10 | Redistribution and use in source and binary forms, with or without modification,
11 | are permitted provided that the following conditions are met:
12 |
13 | * Redistributions of source code must retain the above copyright notice, this list
14 | of conditions and the following disclaimer.
15 |
16 | * Redistributions in binary form must reproduce the above copyright notice, this
17 | list of conditions and the following disclaimer in the documentation and/or other
18 | materials provided with the distribution.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
22 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
25 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 |
34 | */
35 |
36 | #include "u8g2.h"
37 |
38 | /* this function is used as "u8g2_get_kerning_cb" */
39 | /*
40 | uint8_t u8g2_GetNullKerning(u8g2_t *u8g2, uint16_t e1, uint16_t e2)
41 | {
42 | return 0;
43 | }
44 | */
45 |
46 | /* this function is used as "u8g2_get_kerning_cb" */
47 | uint8_t u8g2_GetKerning(U8X8_UNUSED u8g2_t *u8g2, u8g2_kerning_t *kerning, uint16_t e1, uint16_t e2)
48 | {
49 | uint16_t i1, i2, cnt, end;
50 | if ( kerning == NULL )
51 | return 0;
52 |
53 | /* search for the encoding in the first table */
54 | cnt = kerning->first_table_cnt;
55 | cnt--; /* ignore the last element of the table, which is 0x0ffff */
56 | for( i1 = 0; i1 < cnt; i1++ )
57 | {
58 | if ( kerning->first_encoding_table[i1] == e1 )
59 | break;
60 | }
61 | if ( i1 >= cnt )
62 | return 0; /* e1 not part of the kerning table, return 0 */
63 |
64 | /* get the upper index for i2 */
65 | end = kerning->index_to_second_table[i1+1];
66 | for( i2 = kerning->index_to_second_table[i1]; i2 < end; i2++ )
67 | {
68 | if ( kerning->second_encoding_table[i2] == e2 )
69 | break;
70 | }
71 |
72 | if ( i2 >= end )
73 | return 0; /* e2 not part of any pair with e1, return 0 */
74 |
75 | return kerning->kerning_values[i2];
76 | }
77 |
78 | uint8_t u8g2_GetKerningByTable(U8X8_UNUSED u8g2_t *u8g2, const uint16_t *kt, uint16_t e1, uint16_t e2)
79 | {
80 | uint16_t i;
81 | i = 0;
82 | if ( kt == NULL )
83 | return 0;
84 | for(;;)
85 | {
86 | if ( kt[i] == 0x0ffff )
87 | break;
88 | if ( kt[i] == e1 && kt[i+1] == e2 )
89 | return kt[i+2];
90 | i+=3;
91 | }
92 | return 0;
93 | }
94 |
95 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8g2_line.c:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | u8g2_box.c
4 |
5 | Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
6 |
7 | Copyright (c) 2016, olikraus@gmail.com
8 | All rights reserved.
9 |
10 | Redistribution and use in source and binary forms, with or without modification,
11 | are permitted provided that the following conditions are met:
12 |
13 | * Redistributions of source code must retain the above copyright notice, this list
14 | of conditions and the following disclaimer.
15 |
16 | * Redistributions in binary form must reproduce the above copyright notice, this
17 | list of conditions and the following disclaimer in the documentation and/or other
18 | materials provided with the distribution.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
22 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
25 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 |
34 | */
35 |
36 | #include "u8g2.h"
37 |
38 |
39 | void u8g2_DrawLine(u8g2_t *u8g2, u8g2_uint_t x1, u8g2_uint_t y1, u8g2_uint_t x2, u8g2_uint_t y2)
40 | {
41 | u8g2_uint_t tmp;
42 | u8g2_uint_t x,y;
43 | u8g2_uint_t dx, dy;
44 | u8g2_int_t err;
45 | u8g2_int_t ystep;
46 |
47 | uint8_t swapxy = 0;
48 |
49 | /* no intersection check at the moment, should be added... */
50 |
51 | if ( x1 > x2 ) dx = x1-x2; else dx = x2-x1;
52 | if ( y1 > y2 ) dy = y1-y2; else dy = y2-y1;
53 |
54 | if ( dy > dx )
55 | {
56 | swapxy = 1;
57 | tmp = dx; dx =dy; dy = tmp;
58 | tmp = x1; x1 =y1; y1 = tmp;
59 | tmp = x2; x2 =y2; y2 = tmp;
60 | }
61 | if ( x1 > x2 )
62 | {
63 | tmp = x1; x1 =x2; x2 = tmp;
64 | tmp = y1; y1 =y2; y2 = tmp;
65 | }
66 | err = dx >> 1;
67 | if ( y2 > y1 ) ystep = 1; else ystep = -1;
68 | y = y1;
69 |
70 | #ifndef U8G2_16BIT
71 | if ( x2 == 255 )
72 | x2--;
73 | #else
74 | if ( x2 == 0xffff )
75 | x2--;
76 | #endif
77 |
78 | for( x = x1; x <= x2; x++ )
79 | {
80 | if ( swapxy == 0 )
81 | u8g2_DrawPixel(u8g2, x, y);
82 | else
83 | u8g2_DrawPixel(u8g2, y, x);
84 | err -= (uint8_t)dy;
85 | if ( err < 0 )
86 | {
87 | y += (u8g2_uint_t)ystep;
88 | err += (u8g2_uint_t)dx;
89 | }
90 | }
91 | }
92 |
93 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8log_u8g2.c:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | u8log_u8g2.c
4 |
5 |
6 | Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
7 |
8 | Copyright (c) 2018, olikraus@gmail.com
9 | All rights reserved.
10 |
11 | Redistribution and use in source and binary forms, with or without modification,
12 | are permitted provided that the following conditions are met:
13 |
14 | * Redistributions of source code must retain the above copyright notice, this list
15 | of conditions and the following disclaimer.
16 |
17 | * Redistributions in binary form must reproduce the above copyright notice, this
18 | list of conditions and the following disclaimer in the documentation and/or other
19 | materials provided with the distribution.
20 |
21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
22 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
24 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
26 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
28 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
31 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
33 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 |
35 | */
36 |
37 | #include "u8g2.h"
38 | /*
39 | Draw the u8log text at the specified x/y position.
40 | x/y position is the reference position of the first char of the first line.
41 | the line height is
42 | u8g2_GetAscent(u8g2) - u8g2_GetDescent(u8g2) + line_height_offset;
43 | line_height_offset can be set with u8log_SetLineHeightOffset()
44 | Use
45 | u8g2_SetFontRefHeightText(u8g2_t *u8g2);
46 | u8g2_SetFontRefHeightExtendedText(u8g2_t *u8g2);
47 | u8g2_SetFontRefHeightAll(u8g2_t *u8g2);
48 | to change the return values for u8g2_GetAscent and u8g2_GetDescent
49 |
50 | */
51 | void u8g2_DrawLog(u8g2_t *u8g2, u8g2_uint_t x, u8g2_uint_t y, u8log_t *u8log)
52 | {
53 | u8g2_uint_t disp_x, disp_y;
54 | uint8_t buf_x, buf_y;
55 | uint8_t c;
56 |
57 | disp_y = y;
58 | u8g2_SetFontDirection(u8g2, 0);
59 | for( buf_y = 0; buf_y < u8log->height; buf_y++ )
60 | {
61 | disp_x = x;
62 | for( buf_x = 0; buf_x < u8log->width; buf_x++ )
63 | {
64 | c = u8log->screen_buffer[buf_y * u8log->width + buf_x];
65 | disp_x += u8g2_DrawGlyph(u8g2, disp_x, disp_y, c);
66 | }
67 | disp_y += u8g2_GetAscent(u8g2) - u8g2_GetDescent(u8g2);
68 | disp_y += u8log->line_height_offset;
69 | }
70 | }
71 |
72 | /*
73 | u8lib callback for u8g2
74 |
75 | Only font direction 0 is supported: u8g2_SetFontDirection(u8g2, 0)
76 | Use
77 | u8g2_SetFontRefHeightText(u8g2_t *u8g2);
78 | u8g2_SetFontRefHeightExtendedText(u8g2_t *u8g2);
79 | u8g2_SetFontRefHeightAll(u8g2_t *u8g2);
80 | to change the top offset and the line height and
81 | u8log_SetLineHeightOffset(u8log_t *u8log, int8_t line_height_offset)
82 | to change the line height.
83 |
84 | */
85 | void u8log_u8g2_cb(u8log_t * u8log)
86 | {
87 | u8g2_t *u8g2 = (u8g2_t *)(u8log->aux_data);
88 | if ( u8log->is_redraw_line || u8log->is_redraw_all )
89 | {
90 | u8g2_FirstPage(u8g2);
91 | do
92 | {
93 | u8g2_DrawLog( u8g2, 0, u8g2_GetAscent(u8g2), u8log);
94 | }
95 | while( u8g2_NextPage(u8g2) );
96 | }
97 | }
98 |
99 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8log_u8x8.c:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | u8log_u8x8.c
4 |
5 |
6 | Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
7 |
8 | Copyright (c) 2018, olikraus@gmail.com
9 | All rights reserved.
10 |
11 | Redistribution and use in source and binary forms, with or without modification,
12 | are permitted provided that the following conditions are met:
13 |
14 | * Redistributions of source code must retain the above copyright notice, this list
15 | of conditions and the following disclaimer.
16 |
17 | * Redistributions in binary form must reproduce the above copyright notice, this
18 | list of conditions and the following disclaimer in the documentation and/or other
19 | materials provided with the distribution.
20 |
21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
22 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
24 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
26 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
28 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
31 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
33 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 |
35 | */
36 |
37 | #include "u8x8.h"
38 |
39 | static void u8x8_DrawLogLine(u8x8_t *u8x8, uint8_t disp_x, uint8_t disp_y, uint8_t buf_y, u8log_t *u8log) U8X8_NOINLINE;
40 | static void u8x8_DrawLogLine(u8x8_t *u8x8, uint8_t disp_x, uint8_t disp_y, uint8_t buf_y, u8log_t *u8log)
41 | {
42 | uint8_t buf_x;
43 | uint8_t c;
44 | for( buf_x = 0; buf_x < u8log->width; buf_x++ )
45 | {
46 | c = u8log->screen_buffer[buf_y * u8log->width + buf_x];
47 | u8x8_DrawGlyph(u8x8, disp_x, disp_y, c);
48 | disp_x++;
49 | }
50 | }
51 |
52 | void u8x8_DrawLog(u8x8_t *u8x8, uint8_t x, uint8_t y, u8log_t *u8log)
53 | {
54 | uint8_t buf_y;
55 | for( buf_y = 0; buf_y < u8log->height; buf_y++ )
56 | {
57 | u8x8_DrawLogLine(u8x8, x, y, buf_y, u8log);
58 | y++;
59 | }
60 | }
61 |
62 |
63 | void u8log_u8x8_cb(u8log_t * u8log)
64 | {
65 | u8x8_t *u8x8 = (u8x8_t *)(u8log->aux_data);
66 | if ( u8log->is_redraw_all )
67 | {
68 | u8x8_DrawLog(u8x8, 0, 0, u8log);
69 | }
70 | else if ( u8log->is_redraw_line )
71 | {
72 | u8x8_DrawLogLine(u8x8, 0, u8log->redraw_line, u8log->redraw_line, u8log);
73 | }
74 | }
75 |
76 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8x8_d_stdio.c:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | u8x8_d_stdio.c
4 |
5 | Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
6 |
7 | Copyright (c) 2016, olikraus@gmail.com
8 | All rights reserved.
9 |
10 | Redistribution and use in source and binary forms, with or without modification,
11 | are permitted provided that the following conditions are met:
12 |
13 | * Redistributions of source code must retain the above copyright notice, this list
14 | of conditions and the following disclaimer.
15 |
16 | * Redistributions in binary form must reproduce the above copyright notice, this
17 | list of conditions and the following disclaimer in the documentation and/or other
18 | materials provided with the distribution.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
22 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
25 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 |
34 | */
35 |
36 | #include "u8x8.h"
37 |
38 | #include
39 |
40 | #define W 8
41 | #define H 2
42 |
43 | uint8_t bitmap[W * H * 8];
44 |
45 | void bitmap_place_tile(uint8_t x, uint8_t y, uint8_t *tile)
46 | {
47 | uint8_t i;
48 | for (i = 0; i < 8; i++)
49 | bitmap[x * 8 + y * W * 8 + i] = tile[i];
50 | }
51 |
52 | void bitmap_show(void)
53 | {
54 | int x, y;
55 | for (y = 0; y < H * 8; y++)
56 | {
57 | for (x = 0; x < W * 8; x++)
58 | {
59 | if ((bitmap[x + (y / 8) * W * 8] & (1 << ((y & 7)))) != 0)
60 | {
61 | printf("*");
62 | } else
63 | {
64 | printf(".");
65 | }
66 | }
67 | printf("\n");
68 | }
69 | }
70 |
71 |
72 | uint8_t u8x8_d_stdio(U8X8_UNUSED u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)
73 | {
74 | switch (msg)
75 | {
76 | case U8X8_MSG_DISPLAY_INIT:
77 | break;
78 | case U8X8_MSG_DISPLAY_SET_POWER_SAVE:
79 | if (arg_int == 0)
80 | bitmap_show();
81 | break;
82 | case U8X8_MSG_DISPLAY_SET_CONTRAST:
83 | break;
84 | case U8X8_MSG_DISPLAY_DRAW_TILE:
85 | bitmap_place_tile(((u8x8_tile_t *) arg_ptr)->x_pos, ((u8x8_tile_t *) arg_ptr)->y_pos,
86 | ((u8x8_tile_t *) arg_ptr)->tile_ptr);
87 | break;
88 | default:
89 | break;
90 | }
91 | return 1;
92 | }
93 |
94 |
95 | void u8x8_SetupStdio(u8x8_t *u8x8)
96 | {
97 | u8x8_SetupDefaults(u8x8);
98 | u8x8->display_cb = u8x8_d_stdio;
99 | }
100 |
101 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8x8_fonts.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8x8_fonts.c
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8x8_gpio.c:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | u8x8_gpio.c
4 |
5 | Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
6 |
7 | Copyright (c) 2016, olikraus@gmail.com
8 | All rights reserved.
9 |
10 | Redistribution and use in source and binary forms, with or without modification,
11 | are permitted provided that the following conditions are met:
12 |
13 | * Redistributions of source code must retain the above copyright notice, this list
14 | of conditions and the following disclaimer.
15 |
16 | * Redistributions in binary form must reproduce the above copyright notice, this
17 | list of conditions and the following disclaimer in the documentation and/or other
18 | materials provided with the distribution.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
22 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
25 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 |
34 | */
35 |
36 |
37 | #include "u8x8.h"
38 |
39 |
40 | void u8x8_gpio_call(u8x8_t *u8x8, uint8_t msg, uint8_t arg)
41 | {
42 | u8x8->gpio_and_delay_cb(u8x8, msg, arg, NULL);
43 | }
44 |
45 | /*
46 | void u8x8_gpio_Delay(u8x8_t *u8x8, uint8_t msg, uint8_t dly)
47 | {
48 | u8x8->gpio_and_delay_cb(u8x8, msg, dly, NULL);
49 | }
50 | */
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8x8_input_value.c:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | u8x8_input_value.c
4 |
5 | Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
6 |
7 | Copyright (c) 2016, olikraus@gmail.com
8 | All rights reserved.
9 |
10 | Redistribution and use in source and binary forms, with or without modification,
11 | are permitted provided that the following conditions are met:
12 |
13 | * Redistributions of source code must retain the above copyright notice, this list
14 | of conditions and the following disclaimer.
15 |
16 | * Redistributions in binary form must reproduce the above copyright notice, this
17 | list of conditions and the following disclaimer in the documentation and/or other
18 | materials provided with the distribution.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
22 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
25 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 |
34 | */
35 |
36 | #include "u8x8.h"
37 |
38 | /*
39 | return:
40 | 0: value is not changed (HOME/Break Button pressed)
41 | 1: value has been updated
42 | */
43 |
44 | uint8_t u8x8_UserInterfaceInputValue(u8x8_t *u8x8, const char *title, const char *pre, uint8_t *value, uint8_t lo, uint8_t hi, uint8_t digits, const char *post)
45 | {
46 | uint8_t height;
47 | uint8_t y;
48 | uint8_t width;
49 | uint8_t x;
50 | uint8_t local_value = *value;
51 | uint8_t r;
52 | uint8_t event;
53 |
54 | /* calculate overall height of the input value box */
55 | height = 1; /* button line */
56 | height += u8x8_GetStringLineCnt(title);
57 |
58 | /* calculate offset from top */
59 | y = 0;
60 | if ( height < u8x8_GetRows(u8x8) )
61 | {
62 | y = u8x8_GetRows(u8x8);
63 | y -= height;
64 | y /= 2;
65 | }
66 |
67 | /* calculate offset from left for the label */
68 | x = 0;
69 | width = u8x8_GetUTF8Len(u8x8, pre);
70 | width += digits;
71 | width += u8x8_GetUTF8Len(u8x8, post);
72 | if ( width < u8x8_GetCols(u8x8) )
73 | {
74 | x = u8x8_GetCols(u8x8);
75 | x -= width;
76 | x /= 2;
77 | }
78 |
79 | /* render */
80 | u8x8_ClearDisplay(u8x8); /* required, because not everything is filled */
81 | u8x8_SetInverseFont(u8x8, 0);
82 | y += u8x8_DrawUTF8Lines(u8x8, 0, y, u8x8_GetCols(u8x8), title);
83 | x += u8x8_DrawUTF8(u8x8, x, y, pre);
84 | u8x8_DrawUTF8(u8x8, x+digits, y, post);
85 | u8x8_SetInverseFont(u8x8, 1);
86 |
87 | /* event loop */
88 | u8x8_DrawUTF8(u8x8, x, y, u8x8_u8toa(local_value, digits));
89 | for(;;)
90 | {
91 | event = u8x8_GetMenuEvent(u8x8);
92 | if ( event == U8X8_MSG_GPIO_MENU_SELECT )
93 | {
94 | *value = local_value;
95 | r = 1;
96 | break;
97 | }
98 | else if ( event == U8X8_MSG_GPIO_MENU_HOME )
99 | {
100 | r = 0;
101 | break;
102 | }
103 | else if ( event == U8X8_MSG_GPIO_MENU_NEXT || event == U8X8_MSG_GPIO_MENU_UP )
104 | {
105 | if ( local_value >= hi )
106 | local_value = lo;
107 | else
108 | local_value++;
109 | u8x8_DrawUTF8(u8x8, x, y, u8x8_u8toa(local_value, digits));
110 | }
111 | else if ( event == U8X8_MSG_GPIO_MENU_PREV || event == U8X8_MSG_GPIO_MENU_DOWN )
112 | {
113 | if ( local_value <= lo )
114 | local_value = hi;
115 | else
116 | local_value--;
117 | u8x8_DrawUTF8(u8x8, x, y, u8x8_u8toa(local_value, digits));
118 | }
119 | }
120 |
121 | u8x8_SetInverseFont(u8x8, 0);
122 | return r;
123 | }
124 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8x8_message.c:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | u8x8_message.c
4 |
5 | Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
6 |
7 | Copyright (c) 2016, olikraus@gmail.com
8 | All rights reserved.
9 |
10 | Redistribution and use in source and binary forms, with or without modification,
11 | are permitted provided that the following conditions are met:
12 |
13 | * Redistributions of source code must retain the above copyright notice, this list
14 | of conditions and the following disclaimer.
15 |
16 | * Redistributions in binary form must reproduce the above copyright notice, this
17 | list of conditions and the following disclaimer in the documentation and/or other
18 | materials provided with the distribution.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
22 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
25 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 |
34 | */
35 |
36 | #include "u8x8.h"
37 |
38 | uint8_t u8x8_draw_button_line(u8x8_t *u8x8, uint8_t y, uint8_t w, uint8_t cursor, const char *s)
39 | {
40 | uint8_t i;
41 | uint8_t cnt;
42 | uint8_t total;
43 | uint8_t d;
44 | uint8_t x;
45 | cnt = u8x8_GetStringLineCnt(s);
46 |
47 | /* calculate the width of the button */
48 | total = 0;
49 | for( i = 0; i < cnt; i++ )
50 | {
51 | total += u8x8_GetUTF8Len(u8x8, u8x8_GetStringLineStart(i, s));
52 | }
53 | total += (cnt-1); /* had one space between the buttons */
54 |
55 | /* calculate the left offset */
56 | d = 0;
57 | if ( total < w )
58 | {
59 | d = w;
60 | d -= total;
61 | d /= 2;
62 | }
63 |
64 | /* draw the buttons */
65 | x = d;
66 | u8x8_SetInverseFont(u8x8, 0);
67 | for( i = 0; i < cnt; i++ )
68 | {
69 | if ( i == cursor )
70 | u8x8_SetInverseFont(u8x8, 1);
71 |
72 | x+=u8x8_DrawUTF8(u8x8, x, y, u8x8_GetStringLineStart(i, s));
73 | u8x8_SetInverseFont(u8x8, 0);
74 | x+=u8x8_DrawUTF8(u8x8, x, y, " ");
75 | }
76 |
77 | /* return the number of buttons */
78 | return cnt;
79 | }
80 |
81 | /*
82 | title1: Multiple lines,separated by '\n'
83 | title2: A single line/string which is terminated by '\0' or '\n' . "title2" accepts the return value from u8x8_GetStringLineStart()
84 | title3: Multiple lines,separated by '\n'
85 | buttons: one more more buttons separated by '\n' and terminated with '\0'
86 | */
87 |
88 | uint8_t u8x8_UserInterfaceMessage(u8x8_t *u8x8, const char *title1, const char *title2, const char *title3, const char *buttons)
89 | {
90 | uint8_t height;
91 | uint8_t y;
92 | uint8_t cursor = 0;
93 | uint8_t button_cnt;
94 | uint8_t event;
95 |
96 | u8x8_SetInverseFont(u8x8, 0);
97 |
98 | /* calculate overall height of the message box */
99 | height = 1; /* button line */
100 | height += u8x8_GetStringLineCnt(title1);
101 | if ( title2 != NULL )
102 | height ++;
103 | height += u8x8_GetStringLineCnt(title3);
104 |
105 | /* calculate offset from top */
106 | y = 0;
107 | if ( height < u8x8_GetRows(u8x8) )
108 | {
109 | y = u8x8_GetRows(u8x8);
110 | y -= height;
111 | y /= 2;
112 | }
113 |
114 | /* draw message box */
115 |
116 | u8x8_ClearDisplay(u8x8); /* required, because not everything is filled */
117 |
118 | y += u8x8_DrawUTF8Lines(u8x8, 0, y, u8x8_GetCols(u8x8), title1);
119 | if ( title2 != NULL )
120 | {
121 | u8x8_DrawUTF8Line(u8x8, 0, y, u8x8_GetCols(u8x8), title2);
122 | y++;
123 | }
124 | y += u8x8_DrawUTF8Lines(u8x8, 0, y, u8x8_GetCols(u8x8), title3);
125 |
126 | button_cnt = u8x8_draw_button_line(u8x8, y, u8x8_GetCols(u8x8), cursor, buttons);
127 |
128 | for(;;)
129 | {
130 | event = u8x8_GetMenuEvent(u8x8);
131 | if ( event == U8X8_MSG_GPIO_MENU_SELECT )
132 | return cursor+1;
133 | else if ( event == U8X8_MSG_GPIO_MENU_HOME )
134 | break;
135 | else if ( event == U8X8_MSG_GPIO_MENU_NEXT || event == U8X8_MSG_GPIO_MENU_UP )
136 | {
137 | cursor++;
138 | if ( cursor >= button_cnt )
139 | cursor = 0;
140 | u8x8_draw_button_line(u8x8, y, u8x8_GetCols(u8x8), cursor, buttons);
141 | }
142 | else if ( event == U8X8_MSG_GPIO_MENU_PREV || event == U8X8_MSG_GPIO_MENU_DOWN )
143 | {
144 | if ( cursor == 0 )
145 | cursor = button_cnt;
146 | cursor--;
147 | u8x8_draw_button_line(u8x8, y, u8x8_GetCols(u8x8), cursor, buttons);
148 | }
149 | }
150 | return 0;
151 | }
152 |
153 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8x8_setup.c:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | u8x8_setup.c
4 |
5 | Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
6 |
7 | Copyright (c) 2016, olikraus@gmail.com
8 | All rights reserved.
9 |
10 | Redistribution and use in source and binary forms, with or without modification,
11 | are permitted provided that the following conditions are met:
12 |
13 | * Redistributions of source code must retain the above copyright notice, this list
14 | of conditions and the following disclaimer.
15 |
16 | * Redistributions in binary form must reproduce the above copyright notice, this
17 | list of conditions and the following disclaimer in the documentation and/or other
18 | materials provided with the distribution.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
22 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
25 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 |
34 | */
35 |
36 |
37 | #include "u8x8.h"
38 |
39 | /* universal dummy callback, which will be default for all callbacks */
40 | uint8_t u8x8_dummy_cb(U8X8_UNUSED u8x8_t *u8x8, U8X8_UNUSED uint8_t msg, U8X8_UNUSED uint8_t arg_int, U8X8_UNUSED void *arg_ptr)
41 | {
42 | /* the dummy callback will not handle any message and will fail for all messages */
43 | return 0;
44 | }
45 |
46 |
47 | static const u8x8_display_info_t u8x8_null_display_info =
48 | {
49 | /* chip_enable_level = */ 0,
50 | /* chip_disable_level = */ 1,
51 |
52 | /* post_chip_enable_wait_ns = */ 0,
53 | /* pre_chip_disable_wait_ns = */ 0,
54 | /* reset_pulse_width_ms = */ 0,
55 | /* post_reset_wait_ms = */ 0,
56 | /* sda_setup_time_ns = */ 0,
57 | /* sck_pulse_width_ns = */ 0, /* half of cycle time (100ns according to datasheet), AVR: below 70: 8 MHz, >= 70 --> 4MHz clock */
58 | /* sck_clock_hz = */ 4000000UL, /* since Arduino 1.6.0, the SPI bus speed in Hz. Should be 1000000000/sck_pulse_width_ns */
59 | /* spi_mode = */ 0, /* active high, rising edge */
60 | /* i2c_bus_clock_100kHz = */ 4,
61 | /* data_setup_time_ns = */ 0,
62 | /* write_pulse_width_ns = */ 0,
63 | /* tile_width = */ 1, /* 8x8 */
64 | /* tile_hight = */ 1,
65 | /* default_x_offset = */ 0,
66 | /* flipmode_x_offset = */ 0,
67 | /* pixel_width = */ 8,
68 | /* pixel_height = */ 8
69 | };
70 |
71 |
72 | /* a special null device */
73 | uint8_t u8x8_d_null_cb(u8x8_t *u8x8, uint8_t msg, U8X8_UNUSED uint8_t arg_int, U8X8_UNUSED void *arg_ptr)
74 | {
75 | switch(msg)
76 | {
77 | case U8X8_MSG_DISPLAY_SETUP_MEMORY:
78 | u8x8_d_helper_display_setup_memory(u8x8, &u8x8_null_display_info);
79 | break;
80 | case U8X8_MSG_DISPLAY_INIT:
81 | u8x8_d_helper_display_init(u8x8);
82 | break;
83 | }
84 | /* the null device callback will succeed for all messages */
85 | return 1;
86 | }
87 |
88 |
89 | /*
90 | Description:
91 | Setup u8x8
92 | Args:
93 | u8x8 An empty u8x8 structure
94 | */
95 | void u8x8_SetupDefaults(u8x8_t *u8x8)
96 | {
97 | u8x8->display_info = NULL;
98 | u8x8->display_cb = u8x8_dummy_cb;
99 | u8x8->cad_cb = u8x8_dummy_cb;
100 | u8x8->byte_cb = u8x8_dummy_cb;
101 | u8x8->gpio_and_delay_cb = u8x8_dummy_cb;
102 | u8x8->is_font_inverse_mode = 0;
103 | //u8x8->device_address = 0;
104 | u8x8->utf8_state = 0; /* also reset by u8x8_utf8_init */
105 | u8x8->bus_clock = 0; /* issue 769 */
106 | u8x8->i2c_address = 255;
107 | u8x8->debounce_default_pin_state = 255; /* assume all low active buttons */
108 |
109 | #ifdef U8X8_USE_PINS
110 | {
111 | uint8_t i;
112 | for( i = 0; i < U8X8_PIN_CNT; i++ )
113 | u8x8->pins[i] = U8X8_PIN_NONE;
114 | }
115 | #endif
116 | }
117 |
118 |
119 | /*
120 | Description:
121 | Setup u8x8 and assign the callback function. The dummy
122 | callback "u8x8_dummy_cb" can be used, if no callback is required.
123 | This setup will not communicate with the display itself.
124 | Use u8x8_InitDisplay() to send the startup code to the Display.
125 | Args:
126 | u8x8 An empty u8x8 structure
127 | display_cb Display/controller specific callback function
128 | cad_cb Display controller specific communication callback function
129 | byte_cb Display controller/communication specific callback funtion
130 | gpio_and_delay_cb Environment specific callback function
131 |
132 | */
133 | void u8x8_Setup(u8x8_t *u8x8, u8x8_msg_cb display_cb, u8x8_msg_cb cad_cb, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb)
134 | {
135 | /* setup defaults and reset pins to U8X8_PIN_NONE */
136 | u8x8_SetupDefaults(u8x8);
137 |
138 | /* setup specific callbacks */
139 | u8x8->display_cb = display_cb;
140 | u8x8->cad_cb = cad_cb;
141 | u8x8->byte_cb = byte_cb;
142 | u8x8->gpio_and_delay_cb = gpio_and_delay_cb;
143 |
144 | /* setup display info */
145 | u8x8_SetupMemory(u8x8);
146 | }
147 |
148 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8x8_string.c:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | u8x8_string.c
4 |
5 | string line procedures
6 |
7 | Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
8 |
9 | Copyright (c) 2016, olikraus@gmail.com
10 | All rights reserved.
11 |
12 | Redistribution and use in source and binary forms, with or without modification,
13 | are permitted provided that the following conditions are met:
14 |
15 | * Redistributions of source code must retain the above copyright notice, this list
16 | of conditions and the following disclaimer.
17 |
18 | * Redistributions in binary form must reproduce the above copyright notice, this
19 | list of conditions and the following disclaimer in the documentation and/or other
20 | materials provided with the distribution.
21 |
22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
23 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
24 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
27 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
29 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
32 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
34 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 |
36 | */
37 |
38 | #include "u8x8.h"
39 |
40 | uint8_t u8x8_GetStringLineCnt(const char *str)
41 | {
42 | char e;
43 | uint8_t line_cnt = 1;
44 | if ( str == NULL )
45 | return 0;
46 | for(;;)
47 | {
48 | e = *str;
49 | if ( e == '\0' )
50 | break;
51 | str++;
52 | if ( e == '\n' )
53 | line_cnt++;
54 | }
55 | return line_cnt;
56 | }
57 |
58 |
59 | /*
60 | Assumes strings, separated by '\n' in "str".
61 | Returns the string at index "line_idx". First strng has line_idx = 0
62 | Example:
63 | Returns "xyz" for line_idx = 1 with str = "abc\nxyz"
64 | Support both UTF8 and normal strings.
65 | */
66 | const char *u8x8_GetStringLineStart(uint8_t line_idx, const char *str )
67 | {
68 | char e;
69 | uint8_t line_cnt = 1;
70 |
71 | if ( line_idx == 0 )
72 | return str;
73 |
74 | for(;;)
75 | {
76 | e = *str;
77 | if ( e == '\0' )
78 | break;
79 | str++;
80 | if ( e == '\n' )
81 | {
82 | if ( line_cnt == line_idx )
83 | return str;
84 | line_cnt++;
85 | }
86 | }
87 | return NULL; /* line not found */
88 | }
89 |
90 | /* copy until first '\n' or '\0' in str */
91 | /* Important: There is no string overflow check, ensure */
92 | /* that the destination buffer is large enough */
93 | void u8x8_CopyStringLine(char *dest, uint8_t line_idx, const char *str)
94 | {
95 | if ( dest == NULL )
96 | return;
97 | str = u8x8_GetStringLineStart( line_idx, str );
98 | if ( str != NULL )
99 | {
100 | for(;;)
101 | {
102 | if ( *str == '\n' || *str == '\0' )
103 | break;
104 | *dest = *str;
105 | dest++;
106 | str++;
107 | }
108 | }
109 | *dest = '\0';
110 | }
111 |
112 | /*
113 | Draw a string
114 | Extend the string to size "w"
115 | Center the string within "w"
116 | return the size of the string
117 |
118 | */
119 | uint8_t u8x8_DrawUTF8Line(u8x8_t *u8x8, uint8_t x, uint8_t y, uint8_t w, const char *s)
120 | {
121 | uint8_t d, lw;
122 | uint8_t cx, dx;
123 |
124 | d = 0;
125 |
126 | lw = u8x8_GetUTF8Len(u8x8, s);
127 | if ( lw < w )
128 | {
129 | d = w;
130 | d -=lw;
131 | d /= 2;
132 | }
133 |
134 | cx = x;
135 | dx = cx + d;
136 | while( cx < dx )
137 | {
138 | u8x8_DrawUTF8(u8x8, cx, y, " ");
139 | cx++;
140 | }
141 | cx += u8x8_DrawUTF8(u8x8, cx, y, s);
142 | dx = x + w;
143 | while( cx < dx )
144 | {
145 | u8x8_DrawUTF8(u8x8, cx, y, " ");
146 | cx++;
147 | }
148 | cx -= x;
149 | return cx;
150 | }
151 |
152 | /*
153 | draw several lines at position x,y.
154 | lines are stored in s and must be separated with '\n'.
155 | lines can be centered with respect to "w"
156 | if s == NULL nothing is drawn and 0 is returned
157 | returns the number of lines in s
158 | */
159 | uint8_t u8x8_DrawUTF8Lines(u8x8_t *u8x8, uint8_t x, uint8_t y, uint8_t w, const char *s)
160 | {
161 | uint8_t i;
162 | uint8_t cnt;
163 | cnt = u8x8_GetStringLineCnt(s);
164 | for( i = 0; i < cnt; i++ )
165 | {
166 | u8x8_DrawUTF8Line(u8x8, x, y, w, u8x8_GetStringLineStart(i, s));
167 | y++;
168 | }
169 | return cnt;
170 | }
171 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8x8_u16toa.c:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | u8x8_u16toa.c
4 |
5 | Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
6 |
7 | Copyright (c) 2016, olikraus@gmail.com
8 | All rights reserved.
9 |
10 | Redistribution and use in source and binary forms, with or without modification,
11 | are permitted provided that the following conditions are met:
12 |
13 | * Redistributions of source code must retain the above copyright notice, this list
14 | of conditions and the following disclaimer.
15 |
16 | * Redistributions in binary form must reproduce the above copyright notice, this
17 | list of conditions and the following disclaimer in the documentation and/or other
18 | materials provided with the distribution.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
22 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
25 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 |
34 |
35 | */
36 |
37 |
38 | #include "u8x8.h"
39 |
40 | const char *u8x8_u16toap(char * dest, uint16_t v)
41 | {
42 | uint8_t pos;
43 | uint8_t d;
44 | uint16_t c;
45 | c = 10000;
46 | for( pos = 0; pos < 5; pos++ )
47 | {
48 | d = '0';
49 | while( v >= c )
50 | {
51 | v -= c;
52 | d++;
53 | }
54 | dest[pos] = d;
55 | c /= 10;
56 | }
57 | dest[5] = '\0';
58 | return dest;
59 | }
60 |
61 | /* v = value, d = number of digits */
62 | const char *u8x8_u16toa(uint16_t v, uint8_t d)
63 | {
64 | static char buf[6];
65 | d = 5-d;
66 | return u8x8_u16toap(buf, v) + d;
67 | }
68 |
69 | const char *u8x8_utoa(uint16_t v)
70 | {
71 | const char *s = u8x8_u16toa(v, 5);
72 | while( *s == '0' )
73 | s++;
74 | if ( *s == '\0' )
75 | s--;
76 | return s;
77 | }
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/lib/U8g2/src/clib/u8x8_u8toa.c:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | u8x8_u8toa.c
4 |
5 | Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/)
6 |
7 | Copyright (c) 2016, olikraus@gmail.com
8 | All rights reserved.
9 |
10 | Redistribution and use in source and binary forms, with or without modification,
11 | are permitted provided that the following conditions are met:
12 |
13 | * Redistributions of source code must retain the above copyright notice, this list
14 | of conditions and the following disclaimer.
15 |
16 | * Redistributions in binary form must reproduce the above copyright notice, this
17 | list of conditions and the following disclaimer in the documentation and/or other
18 | materials provided with the distribution.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
22 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
25 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 |
34 | */
35 |
36 |
37 | #include "u8x8.h"
38 |
39 | static const unsigned char u8x8_u8toa_tab[3] = { 100, 10, 1 } ;
40 | const char *u8x8_u8toap(char * dest, uint8_t v)
41 | {
42 | uint8_t pos;
43 | uint8_t d;
44 | uint8_t c;
45 | for( pos = 0; pos < 3; pos++ )
46 | {
47 | d = '0';
48 | c = *(u8x8_u8toa_tab+pos);
49 | while( v >= c )
50 | {
51 | v -= c;
52 | d++;
53 | }
54 | dest[pos] = d;
55 | }
56 | dest[3] = '\0';
57 | return dest;
58 | }
59 |
60 | /* v = value, d = number of digits */
61 | const char *u8x8_u8toa(uint8_t v, uint8_t d)
62 | {
63 | static char buf[4];
64 | d = 3-d;
65 | return u8x8_u8toap(buf, v) + d;
66 | }
67 |
68 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/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 | ; https://docs.platformio.org/page/projectconf.html
10 |
11 | [env:pico32]
12 | platform = espressif32
13 | framework = arduino
14 | board = pico32
15 | upload_speed = 921600
16 | board_build.partitions = min_spiffs.csv
17 | monitor_speed = 115200
18 | lib_deps = adafruit/MAX6675 library@^1.1.0
19 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/src/BLE.cpp:
--------------------------------------------------------------------------------
1 | #include "OpenT12.h"
2 |
3 | char BLE_name[20] = "OpenHeat-BT";
4 | uint8_t BLE_State = true;
5 |
6 | void BLE_Init(void)
7 | {
8 |
9 | if (!BLE_State) return;
10 |
11 | SerialBT.begin(BLE_name);
12 | }
13 |
14 | void BLE_Restart(void)
15 | {
16 | SerialBT.end();
17 | BLE_Init();
18 | }
19 |
20 | void BLE_Rename(void)
21 | {
22 | TextEditor("蓝牙设备名", BLE_name);
23 | BLE_Restart();
24 | }
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/src/BLE.h:
--------------------------------------------------------------------------------
1 | #ifndef BLE_H
2 | #define BLE_H
3 |
4 | #include "Type.h"
5 |
6 | extern char BLE_name[20];
7 | extern uint8_t BLE_State;
8 |
9 | void BLE_Init(void);
10 | void BLE_Restart(void);
11 | void BLE_Rename(void);
12 |
13 | #endif
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/src/Beep.cpp:
--------------------------------------------------------------------------------
1 | #include "OpenT12.h"
2 |
3 | //BEEP
4 | uint8_t BEEP_Channel = 2; // 通道
5 |
6 | void BeepInit(void)
7 | {
8 | pinMode(BEEP_PIN, OUTPUT);
9 | ledcAttachPin(BEEP_PIN, BEEP_Channel); //将通道与对应的引脚连接
10 | ledcSetup(BEEP_Channel, 0, 8); // 设置通道
11 | }
12 |
13 | void SetTone(double freq)
14 | {
15 | ledcWriteTone(BEEP_Channel, freq);
16 | }
17 |
18 |
19 | void SetNote(note_t note, uint8_t rp)
20 | {
21 | SetTone(GetNote(note, rp));
22 | }
23 |
24 |
25 | /***
26 | * @description: 发出指定音符的音调
27 | * @param {note_t} note 绝对音高
28 | * @param {uint8_t} rp 相对音高(全音)
29 | * @return {*}
30 | * https://www.zhihu.com/question/27166538/answer/35507740
31 | * 王赟 Maigo :
32 | * 音名是用字母CDEFGAB表示的,它表示的是绝对音高。一个八度中有12个音,分别是C, #C, D, #D, E, F, #F, G, #G, A, #A, B,相邻两个音之间的距离叫一个半音,两个半音叫一个全音。在最常见的定律法——十二平均律中,中央C(钢琴最中间的C音)右边的第一个A音被定义为440 Hz,然后其它音的频率用等比数列推出,相隔半音的两个音的频率之比为pow(2,1/12.0)。由此可以推断出中央C的频率为261 Hz,它右边的#C的频率为277 Hz,D的频率为293 Hz,等等等等。
33 | 唱名指的是do, re, mi这些,可以用数字1234567表示。一个八度中也有12个音,分别是1, #1, 2, #2, 3, 4, #4, 5, #5, 6, #6, 7,相邻两个音之间的距离也是半音。一首曲子是什么调,就是说哪个音名对应着唱名1。所以,唱名表示的是相对音高。比如C调就是说C音是1,这样1的频率就是261 Hz,#1的频率就是277 Hz,2的频率就是293 Hz,等等。而在#C调中,就变成了1是277 Hz,#1是293 Hz,等等。调式总共有12种,你可以按上述方法自己推算。
34 | */
35 |
36 | double GetNote(note_t note, uint8_t rp)
37 | {
38 | const uint16_t noteFrequencyBase[12] = {
39 | // C C# D Eb E F F# G G# A Bb B
40 | 4186, 4435, 4699, 4978, 5274, 5588, 5920, 6272, 6645, 7040, 7459, 7902
41 | };
42 | const uint8_t octave = 4;
43 | const double FreqRatio = 1.059463094; // pow(2,1/12.0);
44 | const double FreqRatioDouble = 1.122462048; // pow(2,1/6.0);
45 | double noteFreq = ((double) noteFrequencyBase[note] / (double) (1 << (8 - octave))) * pow(FreqRatio, rp);
46 | //SetTone(noteFreq);
47 | return noteFreq;
48 | }
49 |
50 | //////////////////////////////////////////////////////////////////////////////////////////////////////
51 |
52 | uint32_t PlayTonesTimer = 0;
53 | uint16_t PlayTonesDelayTime = 0;
54 | uint16_t PlayTones_Schedule = 0;
55 | TONE* MySound = NULL;
56 |
57 | // extern struct Slide_Bar Slide_space[];
58 | // void VolumeTest(void) {
59 | // if (PlayTones(sound1, &PlayTones_Schedule, Slide_space[2].x)) {
60 | // //播放完成,回到进度条起点循环播放
61 | // PlayTones_Schedule = 0;
62 | // }
63 | // }
64 | TONE testSound[]{
65 | {NOTE_D, CMT_9, 250},
66 | {NOTE_D, CMT_7, 250},
67 | {NOTE_D, CMT_5, 250},
68 | {NOTE_D, CMT_9, 250},
69 | {NOTE_D, CMT_8, 250},
70 | {NOTE_D, CMT_7, 250},
71 | {NOTE_D, CMT_NULL, 250},
72 |
73 | {NOTE_D, CMT_7, 250},
74 | {NOTE_D, CMT_5, 250},
75 | {NOTE_D, CMT_9, 250},
76 | {NOTE_D, CMT_4, 250},
77 | {NOTE_D, CMT_5, 250},
78 | {NOTE_D, CMT_NULL, 250},
79 |
80 | {NOTE_D, CMT_7, 250},
81 | {NOTE_D, CMT_5, 250},
82 | {NOTE_D, CMT_9, 250},
83 | {NOTE_D, CMT_7, 250},
84 | {NOTE_D, CMT_M, 250},
85 | {NOTE_D, CMT_NULL, 250},
86 |
87 | {NOTE_MAX, 255, 0},
88 | };
89 |
90 | TONE BootSound[]{
91 | {NOTE_D, CMT_5, 230},
92 | {NOTE_D, CMT_7, 230},
93 | {NOTE_D, CMT_9, 215},
94 | {NOTE_D, CMT_M, 215},
95 | {NOTE_MAX, 0, 0},
96 | };
97 |
98 | TONE TipInstall[]{
99 | {NOTE_D, CMT_7, 250},
100 | {NOTE_D, CMT_M, 250},
101 | {NOTE_MAX, 0, 0},
102 | };
103 |
104 | TONE TipRemove[]{
105 | {NOTE_D, CMT_9, 250},
106 | {NOTE_D, CMT_5, 250},
107 | {NOTE_MAX, 0, 0},
108 | };
109 |
110 | TONE Beep1[]{
111 | {NOTE_D, CMT_8, 50},
112 | {NOTE_MAX, 0, 0},
113 | };
114 |
115 | TONE Beep2[]{
116 | {NOTE_D, CMT_M, 50},
117 | {NOTE_D, CMT_NULL, 50},
118 | {NOTE_D, CMT_M, 50},
119 | {NOTE_MAX, 0, 0},
120 | };
121 |
122 | TONE Beep3[]{
123 | {NOTE_D, CMT_7, 50},
124 | {NOTE_D, CMT_9, 50},
125 | {NOTE_D, CMT_M, 50},
126 | {NOTE_MAX, 0, 0},
127 | };
128 |
129 | void SetSound(TONE sound[])
130 | {
131 | MySound = sound;
132 | PlayTones_Schedule = 0;
133 | }
134 |
135 | void ICACHE_RAM_ATTR PlaySoundLoop(void)
136 | {
137 | if (!Volume)
138 | {
139 | MySound = NULL;
140 | SetTone(0);
141 | }
142 | if (MySound == NULL) return;
143 |
144 | PlayTones(MySound, &PlayTones_Schedule);
145 | }
146 |
147 |
148 | uint8_t PlayTones(TONE* sound, uint16_t* Schedule)
149 | {
150 | if (millis() - PlayTonesTimer > PlayTonesDelayTime)
151 | {
152 |
153 | if (sound == NULL || Schedule == NULL || sound[*Schedule].note == NOTE_MAX || !Volume)
154 | {
155 | if (Volume && sound[*Schedule].rp == 255)
156 | {
157 | *Schedule = 0; //循环播放
158 | } else
159 | {
160 | SetTone(0);
161 | return 1;
162 | }
163 | }
164 |
165 | //下一个音符
166 | if (sound[*Schedule].rp == CMT_NULL) SetTone(0);
167 | else SetTone(GetNote(sound[*Schedule].note, sound[*Schedule].rp));
168 |
169 | PlayTonesTimer = millis();
170 | //设置延时时间
171 | PlayTonesDelayTime = sound[*Schedule].delay;
172 | (*Schedule)++;
173 | }
174 |
175 | return 0;
176 | }
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/src/Beep.h:
--------------------------------------------------------------------------------
1 | #ifndef BEEP_H
2 | #define BEEP_H
3 |
4 | #include "Type.h"
5 |
6 | enum CALCULATORMUSICTONE
7 | {
8 | CMT_NULL = 255,
9 | CMT_1 = 0,
10 | CMT_2 = 2,
11 | CMT_3 = 3,
12 | CMT_4 = 5,
13 | CMT_5 = 7,
14 | CMT_6 = 9,
15 | CMT_7 = 11,
16 | CMT_8 = 12,
17 | CMT_9 = 14,
18 | CMT_P = 15,
19 | CMT_S = 17,
20 | CMT_M = 18,
21 | CMT_D = 21,
22 | CMT_E = 22,
23 | };
24 | struct TONE
25 | {
26 | note_t note;
27 | uint8_t rp;
28 | uint16_t delay;
29 | };
30 | extern TONE testSound[];
31 | extern TONE BootSound[];
32 | extern TONE TipInstall[];
33 | extern TONE TipRemove[];
34 | extern TONE Beep1[];
35 | extern TONE Beep2[];
36 | extern TONE Beep3[];
37 |
38 | extern uint32_t PlayTonesTimer;
39 | extern uint16_t PlayTonesDelayTime;
40 | extern uint16_t PlayTones_Schedule;
41 | extern TONE* MySound;
42 | //�ײ㺯��
43 | void BeepInit(void);
44 | void SetTone(double freq);
45 | double GetNote(note_t note, uint8_t rp);
46 | void SetNote(note_t note, uint8_t rp);
47 | //�߲�Ӧ��
48 | void SetSound(TONE sound[]);
49 | void PlaySoundLoop(void);
50 | uint8_t PlayTones(TONE sound[], uint16_t* Schedule);
51 |
52 | #endif
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/src/Bezier.cpp:
--------------------------------------------------------------------------------
1 | #include "OpenT12.h"
2 |
3 | //https://github.com/ArduboyCollection/arduboy-moire
4 |
5 | const int screenWidth = 128;
6 | const int screenHeight = 64;
7 |
8 | const int numberOfLines = 20;
9 |
10 | const int maxSpeed = 6;
11 |
12 | /*
13 | * structs that describe the scene
14 | */
15 |
16 | struct Point
17 | {
18 | int x;
19 | int y;
20 | };
21 |
22 | struct Velocity
23 | {
24 | int dx;
25 | int dy;
26 | };
27 |
28 | struct End
29 | {
30 | Point p;
31 | Velocity v;
32 | };
33 |
34 | struct Line
35 | {
36 | End e0;
37 | End e1;
38 | };
39 |
40 | struct Scene
41 | {
42 | Line lines[numberOfLines];
43 | int indexOfHeadLine = numberOfLines - 1;
44 | };
45 |
46 | /*
47 | * scene initialization
48 | */
49 |
50 | static Point randomPoint()
51 | {
52 | return {random(screenWidth), random(screenHeight)};
53 | }
54 |
55 | static int randomSpeed()
56 | {
57 | return random(1, maxSpeed);
58 | }
59 |
60 | static Velocity randomVelocity()
61 | {
62 | return {randomSpeed(), randomSpeed()};
63 | }
64 |
65 | static End randomEnd()
66 | {
67 | return {randomPoint(), randomVelocity()};
68 | }
69 |
70 | static Line randomLine()
71 | {
72 | return {randomEnd(), randomEnd()};
73 | }
74 |
75 | static Point PointZero = {0, 0};
76 | static Velocity VelocityZero = {0, 0};
77 | static End EndZero = {PointZero, VelocityZero};
78 | static Line LineZero = {EndZero, EndZero};
79 |
80 |
81 | /*
82 | * functions to advance basic value types
83 | */
84 | static End endByAdvancingEnd(End en)
85 | {
86 |
87 | int ndx = en.v.dx;
88 | int ndy = en.v.dy;
89 |
90 | int nx = en.p.x + ndx;
91 | int ny = en.p.y + ndy;
92 |
93 | if (nx < 0 || nx > screenWidth)
94 | {
95 | ndx = -1 * sign(ndx) * randomSpeed();
96 | nx = en.p.x + ndx;
97 | }
98 | if (ny < 0 || ny > screenHeight)
99 | {
100 | ndy = -1 * sign(ndy) * randomSpeed();
101 | ny = en.p.y + ndy;
102 | }
103 |
104 | return {
105 | {nx, ny},
106 | {ndx, ndy}
107 | };
108 | }
109 |
110 | static Line lineByAdvancingLine(Line line)
111 | {
112 | return {
113 | endByAdvancingEnd(line.e0),
114 | endByAdvancingEnd(line.e1)
115 | };
116 | }
117 |
118 | /*
119 | * functions to operate on pointer to scene
120 | */
121 |
122 | static void sceneInit(Scene* scene)
123 | {
124 | for (int i = 0; i < numberOfLines; i++)
125 | {
126 | scene->lines[i] = LineZero;
127 | }
128 | scene->lines[scene->indexOfHeadLine] = randomLine();
129 | }
130 |
131 | static Line* sceneLine(Scene* scene, int index)
132 | {
133 | int j = (scene->indexOfHeadLine + 1 + index) % numberOfLines;
134 | return &(scene->lines[j]);
135 | }
136 |
137 | static void sceneAdvance(Scene* scene)
138 | {
139 | Line head = scene->lines[scene->indexOfHeadLine];
140 | Line nextHead = lineByAdvancingLine(head);
141 | scene->indexOfHeadLine = (scene->indexOfHeadLine + 1) % numberOfLines;
142 | scene->lines[scene->indexOfHeadLine] = nextHead;
143 | }
144 |
145 |
146 | static void drawLine(Line* line, uint16_t color)
147 | {
148 | Disp.drawLine(line->e0.p.x, line->e0.p.y, line->e1.p.x, line->e1.p.y);
149 | }
150 |
151 |
152 | void RunSleepLoop(void)
153 | {
154 | static Scene scene;
155 |
156 | static bool SleepScreenInit = false;
157 | if (!SleepScreenInit)
158 | {
159 | sceneInit(&scene);
160 | SleepScreenInit = true;
161 | }
162 |
163 | if (!SleepEvent) return;
164 |
165 | Line* tail = sceneLine(&scene, 0);
166 | drawLine(tail, 0);
167 | sceneAdvance(&scene);
168 | for (int i = 0; i < numberOfLines; i++)
169 | {
170 | Line* line = sceneLine(&scene, i);
171 | drawLine(line, 1);
172 | }
173 | }
174 |
175 |
176 |
177 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/src/Bezier.h:
--------------------------------------------------------------------------------
1 | #ifndef Bezier_H
2 | #define Bezier_H
3 | void RunSleepLoop(void);
4 | #endif
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/src/Bitmap.h:
--------------------------------------------------------------------------------
1 | #ifndef BITMAP_H
2 | #define BITMAP_H
3 |
4 | #include "Type.h"
5 |
6 | //128x64
7 | extern uint8_t Logo[];
8 | // width: 170, height: 128
9 | extern uint8_t Logo2[];
10 |
11 | extern uint8_t TranAnimation[];
12 | extern uint8_t TranAnimation2[];
13 |
14 | extern uint8_t QRC[];
15 | extern uint8_t Set0[];
16 | extern uint8_t Set1[];
17 | extern uint8_t Set2[];
18 | extern uint8_t Set3[];
19 | extern uint8_t Set4[];
20 | extern uint8_t Set4F[];
21 | extern uint8_t Set4FF[];
22 | extern uint8_t Set5[];
23 | extern uint8_t Set5_1[];
24 | extern uint8_t Set6[];
25 | extern uint8_t Set_LANG[];
26 | extern uint8_t Set7[];
27 | extern uint8_t Set11[];
28 | extern uint8_t Set8[];
29 | extern uint8_t Set9[];
30 | extern uint8_t Set10[];
31 | extern uint8_t Set13[];
32 | extern uint8_t Set12[];
33 | extern uint8_t Set14[];
34 | extern uint8_t Set15[];
35 | extern uint8_t Set16[];
36 | extern uint8_t Set17[];
37 | extern uint8_t Set18[];
38 | extern uint8_t Set20[];
39 | extern uint8_t Lang_CN[];
40 | extern uint8_t Lang_EN[];
41 | extern uint8_t Lang_JP[];
42 | extern uint8_t Save[];
43 | extern uint8_t Load[];
44 | extern uint8_t Lock[];
45 | extern uint8_t Set19[];
46 | extern uint8_t IMG_Pen[];
47 | extern uint8_t IMG_Pen2[];
48 | //extern uint8_t IMG_Tip[];
49 | extern uint8_t IMG_Bed[];
50 | extern uint8_t IMG_Files[];
51 | extern uint8_t IMG_Flip[];
52 | extern uint8_t IMG_Sun[];
53 | extern uint8_t IMG_Size[];
54 | extern uint8_t IMG_Animation[];
55 | extern uint8_t IMG_Animation_DISABLE[];
56 | extern uint8_t IMG_Trigger[];
57 | extern uint8_t IMG_VibrationSwitch[];
58 | extern uint8_t IMG_ReedSwitch[];
59 | extern uint8_t IMG_BLE[];
60 | extern uint8_t IMG_ListMode[];
61 |
62 | extern uint8_t IMG_Load[];
63 | extern uint8_t PositioningCursor[];
64 | extern uint8_t Pointer[];
65 | extern uint8_t Lightning[];
66 | extern uint8_t Battery_NoPower[];
67 | extern uint8_t IMG_BLE_S[];
68 | //状态提示图标
69 | //width:14,height:14
70 | extern uint8_t c1[];
71 | extern uint8_t c2[];
72 | extern uint8_t c3[];
73 | extern uint8_t c5[];
74 | extern uint8_t c6[];
75 | extern uint8_t c7[];
76 | extern uint8_t* C_table[];
77 |
78 | #endif
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/src/Calibration.h:
--------------------------------------------------------------------------------
1 | #ifndef Calibration_H
2 | #define Calibration_H
3 |
4 | #include "Type.h"
5 | //温度拟合
6 | /*
7 | 50-50
8 | 100-70
9 | 150-134
10 | 200-221
11 | 250-300
12 | 300-379
13 | 350-460
14 | 400-520
15 | 450-579
16 | */
17 |
18 | //温度拟合经验常数:按照实际情况通过拟合得到
19 | #define TempP1 51.6128997803
20 | #define TempP2 0.1443523616
21 | #define TempP3 0.0000061750
22 | #define TempP4 -0.0000000001
23 |
24 | #define FixNum 10
25 | extern double PTemp[FixNum]; //温度拟合系数
26 | extern long Calibration_Base[FixNum];
27 | extern long Calibration_Input[FixNum];
28 |
29 | void ShowCurveCoefficient(void);
30 | void DrawTempCurve(void);
31 | void CalibrationTemperature(void);
32 | void gauss_solve(long n, double A[], double x[], double b[]);
33 | void polyfit(long n, long x[], long y[], long poly_n, double p[]);
34 | #endif
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/src/Event.h:
--------------------------------------------------------------------------------
1 | #ifndef SYSEvent_H
2 | #define SYSEvent_H
3 |
4 | #include "Type.h"
5 |
6 | extern uint32_t BoostTimer;
7 |
8 | extern uint32_t EventTimerUpdate;
9 | void TimerUpdateEvent(void);
10 |
11 | void BoostButton_EventLoop(void);
12 | void FastPID_MenuSummon_EventLoop(void);
13 | void ShutdownEventLoop(void);
14 |
15 | bool EnterPasswd(void);
16 | void SetPasswd(void);
17 |
18 | void TimerEventLoop(void);
19 | void SYS_StateCode_Update(void);
20 |
21 | void SW_IRQHandler(void);
22 | void SW_WakeLOOP(void);
23 | #endif
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/src/ExternDraw.h:
--------------------------------------------------------------------------------
1 | #ifndef ExternDraw
2 | #define ExternDraw
3 |
4 | #include "Type.h"
5 |
6 | void EnterLogo(void);
7 | void ShowBootMsg(void);
8 |
9 |
10 | extern uint8_t DisplayFlashTick;
11 | void Clear(void);
12 | void Display(void);
13 |
14 | void Draw_Utf(int x, int y, char* s);
15 | void Blur(int sx, int sy, int ex, int ey, int f, int delay);
16 | void Draw_Scale(int x, int y, int w, int h, int s, int v);
17 | void Draw_Num_Bar(float i, float a, float b, int x, int y, int w, int h, int c);
18 | void Draw_Pixel_Resize(int x, int y, int ox, int oy, int w, int h);
19 | void Draw_Slow_Bitmap(int x, int y, const unsigned char* bitmap, unsigned char w, unsigned char h);
20 | void Draw_Slow_Bitmap_Resize(int x, int y, uint8_t* bitmap, int w1, int h1, int w2, int h2);
21 | void DrawStatusBar(bool color);
22 |
23 | void DrawIntensiveComputingLine(void);
24 | void DrawIntensiveComputing(void);
25 |
26 | void DrawMsgBox(char* s);
27 | void DrawHighLightText(int x, int y, char* s);
28 |
29 |
30 | void TextEditor(char* title, char* text);
31 | #endif
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/src/FilesSystem.h:
--------------------------------------------------------------------------------
1 | #ifndef FILESSYSTEM_H
2 | #define FILESSYSTEM_H
3 |
4 | #include "Type.h"
5 | #include "FS.h"
6 | #include "SPIFFS.h"
7 |
8 | extern char SYS_SVAE_PATH[];
9 |
10 | void FilesSystemInit(void);
11 |
12 | void SYS_Save(void);
13 | void SYS_Load(void);
14 |
15 | void listDir(fs::FS &fs, const char* dirname, uint8_t levels);
16 | void readFile(fs::FS &fs, const char* path);
17 | void writeFile(fs::FS &fs, const char* path, const char* message);
18 | void appendFile(fs::FS &fs, const char* path, const char* message);
19 | void renameFile(fs::FS &fs, const char* path1, const char* path2);
20 | void deleteFile(fs::FS &fs, const char* path);
21 | void testFileIO(fs::FS &fs, const char* path);
22 | #endif
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/src/MathFun.cpp:
--------------------------------------------------------------------------------
1 | #include "OpenT12.h"
2 |
3 | extern U8G2_SSD1306_128X64_NONAME_F_HW_I2C Disp;
4 | /*
5 | @作用 获取数值某一位
6 | @传入 数值 指定位数
7 | @传出 数值指定位数的十进制值
8 | */
9 | int get_Dec_Bit(int x, int n)
10 | {
11 | return (int) (x / pow(10.0, n)) % 10;
12 | }
13 |
14 | /*
15 | @作用 获取数值长度
16 | @传入 数值
17 | @传出 数值长度
18 | */
19 | int Get_Dec_Deep(int x)
20 | {
21 | int i = 0;
22 | do
23 | {
24 | i++;
25 | x /= 10;
26 | } while (x != 0);
27 | return i;
28 | }
29 |
30 | /*
31 | @作用 获取数字每一位的和
32 | @传入 数字
33 | @输出 数字每一位的和
34 | */
35 | int Get_Int_Bit_Sum(int x)
36 | {
37 | int sum = 0;
38 | for (int i = 0; i < Get_Dec_Deep(x); i++)
39 | sum += get_Dec_Bit(x, i);
40 | return sum;
41 | }
42 |
43 |
44 | void GetUtf8Length(char const* str, int* cnt)
45 | {
46 | while (*str != '\0')
47 | {
48 | if (*str & 1 << 7)
49 | {/* 第8位(从右到左)为1*/
50 | if (*str & (1 << 6))
51 | {/*第7位为1*/
52 | if (*str & (1 << 5))
53 | {/*第6位为1*/
54 | if (*str & (1 << 4))
55 | {/*第5位为1 11110xxx*/
56 | cnt[4]++, cnt[0]++, str += 4;/*4字节的字符总数加1,各种长度总数加1,指针向后移动4位*/
57 | continue;/*开始下次循环*/
58 | }
59 |
60 | cnt[3]++, cnt[0]++, str += 3;/* 1110xxxx*/
61 | continue;
62 |
63 | }
64 |
65 | cnt[2]++, cnt[0]++, str += 2;/*110xxxxx*/
66 | continue;
67 |
68 | }
69 | }
70 | cnt[1]++, cnt[0]++, str += 1;/*0xxxxxxx*/
71 | continue;
72 | }
73 | }
74 |
75 | uint32_t Get_UTF8_Ascii_Pix_Len(uint8_t size, char* s)
76 | {
77 | return Disp.getUTF8Width(s);
78 | }
79 |
80 | /*
81 | @作用 UTF8混合字符串计算水平居中
82 | @输入:UTF8字符串
83 | @输出:居中位置
84 | */
85 | uint32_t UTF8_HMiddle(uint32_t x, uint32_t w, uint8_t size, char* s)
86 | {
87 | return x + (w - Get_UTF8_Ascii_Pix_Len(size, s)) / 2;
88 | }
89 |
90 | //串口打印内存
91 | void ShowBuffer(uint8_t* buffer, uint32_t size)
92 | {
93 | uint8_t AsciiBuffer[17];
94 | uint32_t OutputSize = 0;
95 | for (uint32_t i = 0; i < size; i++)
96 | {
97 | if (i % 16 == 0)
98 | {
99 | memcpy(AsciiBuffer, buffer + i, 16);
100 | AsciiBuffer[16] = '\0';
101 | printf("\n0X%08X | ", i + &(*buffer));
102 | for (uint8_t j = 0; j < 16; j++)
103 | {
104 | OutputSize++;
105 | if (OutputSize > size) break;
106 | printf("%02X ", buffer[i + j]);
107 | }
108 |
109 | printf("| %s", AsciiBuffer);
110 | }
111 | }
112 | printf("\n\n\n%s", buffer);
113 | }
114 |
115 |
116 | /**
117 | *卡尔曼滤波器
118 | *@param KFP *kfp 卡尔曼结构体参数
119 | * float input 需要滤波的参数的测量值(即传感器的采集值)
120 | *@return 滤波后的参数(最优值)
121 | */
122 | float kalmanFilter(KFP* kfp, float input)
123 | {
124 | //预测协方差方程:k时刻系统估算协方差 = k-1时刻的系统协方差 + 过程噪声协方差
125 | kfp->Now_P = kfp->LastP + kfp->Q;
126 | //卡尔曼增益方程:卡尔曼增益 = k时刻系统估算协方差 / (k时刻系统估算协方差 + 观测噪声协方差)
127 | kfp->Kg = kfp->Now_P / (kfp->Now_P + kfp->R);
128 | //更新最优值方程:k时刻状态变量的最优值 = 状态变量的预测值 + 卡尔曼增益 * (测量值 - 状态变量的预测值)
129 | kfp->out = kfp->out + kfp->Kg * (input - kfp->out);//因为这一次的预测值就是上一次的输出值
130 | //更新协方差方程: 本次的系统协方差付给 kfp->LastP 威下一次运算准备。
131 | kfp->LastP = (1 - kfp->Kg) * kfp->Now_P;
132 | return kfp->out;
133 | }
134 |
135 | /***
136 | * @description: 把ESP32的原生ADC采样数据通过经验公式转换为电压
137 | * @param {uint16_t} adc
138 | * @return 电压(单位:V)
139 | */
140 | #define ADC1_MinVol 0.128
141 | #define ADC1_MaxVol 3.11
142 | double ESP32_ADC2Vol(uint16_t adc)
143 | {
144 | //return ((adc / 4095.0) * (ADC1_MaxVol - ADC1_MinVol)) + ADC1_MinVol;
145 | return (adc / 4095.0) * 3.3;
146 | }
147 |
148 | /***
149 | * @description: 分钟转毫秒
150 | * @param {uint32_t} min
151 | * @return {*}
152 | */
153 | uint32_t Minute2Millis(float min)
154 | {
155 | return min * 60 * 1000;
156 | }
157 | /***
158 | * @description: 判断符号正负
159 | * @param {int} x
160 | * @return {*}
161 | */
162 | int sign(int x)
163 | {
164 | return (x > 0) - (x < 0);
165 | }
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/src/MathFun.h:
--------------------------------------------------------------------------------
1 | #ifndef MathFun_H
2 | #define MathFun_H
3 |
4 | #include "Type.h"
5 |
6 | int get_Dec_Bit(int x, int n);
7 | int Get_Dec_Deep(int x);
8 | int Get_Int_Bit_Sum(int x);
9 | uint32_t Get_UTF8_Ascii_Pix_Len(uint8_t size, char* s);
10 | uint32_t UTF8_HMiddle(uint32_t x, uint32_t w, uint8_t size, char* s);
11 | uint32_t Minute2Millis(float min);
12 |
13 | void ShowBuffer(uint8_t* buffer, uint32_t size);
14 |
15 | //卡尔曼滤波
16 | typedef struct
17 | {
18 | float LastP;//上次估算协方差 初始化值为0.02
19 | float Now_P;//当前估算协方差 初始化值为0
20 | float out;//卡尔曼滤波器输出 初始化值为0
21 | float Kg;//卡尔曼增益 初始化值为0
22 | float Q;//过程噪声协方差 初始化值为0.001
23 | float R;//观测噪声协方差 初始化值为0.543
24 | } KFP;//Kalman Filter parameter
25 | float kalmanFilter(KFP* kfp, float input);
26 |
27 | double ESP32_ADC2Vol(uint16_t adc);
28 | int sign(int x);
29 |
30 | #endif
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/src/Menu.h:
--------------------------------------------------------------------------------
1 | #ifndef __MENU_H
2 | #define __MENU_H
3 |
4 | #include
5 | #include "Type.h"
6 |
7 | extern uint8_t Menu_System_State;
8 | extern uint32_t pages_Tip_Display_timer;
9 | extern uint8_t Menu_JumpAndExit;
10 | extern uint8_t Menu_JumpAndExit_Level;
11 |
12 | void System_TipMenu_Init(void);
13 | void System_PIDMenu_Init(void);
14 | void System_Menu_Init(void);
15 | void System_UI_Init(void);
16 | void System_UI(void);
17 |
18 | int Get_Real_Menu_Level_Id(uint8_t id);
19 | int Get_Menu_Id(uint8_t lid, uint8_t id);
20 |
21 |
22 | void Menu_Control(void);
23 | void Draw_APP(int x, int y, char* bitmap);
24 | void Page_Footnotes(int a, int b);
25 | void Text_Reader(char* s);
26 | void Run_Menu_Id(uint8_t lid, uint8_t id);
27 | void Next_Menu(void);
28 | void Pop_Windows(char* s);
29 | void Exit_Menu_System(void);
30 | void Save_Exit_Menu_System(void);
31 | void JumpWithTitle(void);
32 | void SmoothAnimationSystem_Clean(void);
33 |
34 | void Smooth_Animation_System(void);
35 |
36 | void Update_OLED_Light_Level(void);
37 | void Update_OLED_Flip(void);
38 |
39 | void PopMsg_RotaryDirection(void);
40 | void PopMsg_ScreenFlip(void);
41 | void PopMsg_ListMode(void);
42 | void SYS_About(void);
43 |
44 | /*
45 | @名称 Smooth_Animation
46 | @变量
47 | x 过渡值
48 | last 上次的值
49 | val 目标值
50 | w 平滑权重
51 | */
52 | struct Smooth_Animation
53 | {
54 | float x; //过渡值
55 | int last; //上次的值
56 | int val; //目标值
57 | float w; //平滑权重
58 | uint8_t a; //是否允许累加
59 | uint8_t b; //选择过渡动画计算函数
60 | };
61 | extern struct Smooth_Animation Menu_Smooth_Animation[];
62 | /*
63 | @名称 Slide_Bar
64 | @变量
65 | x 值
66 | min 最小值
67 | max 最大值
68 | step 步进
69 | */
70 | struct Slide_Bar
71 | {
72 | float* x; //值
73 | float min;
74 | float max;
75 | float step;
76 | };
77 | extern struct Slide_Bar Slide_space[];
78 |
79 | struct Menu_Level_System
80 | {
81 | uint8_t id; //当前层id
82 | int x; //当前层所指选项
83 | uint8_t min; //最小页
84 | uint8_t max; //最大页
85 | uint8_t a; //参数A 0:无动作 1:开启图标化菜单
86 | };
87 |
88 | struct Menu_System
89 | {
90 | uint8_t lid; //层id
91 | uint8_t id; //选项id
92 | uint8_t x; //执行操作 0-跳转到菜单 1-执行函数 2-菜单名 3-开关控件 4-滑动条控件
93 | char* name; //选项名称
94 | uint8_t* icon;
95 | uint8_t a; //附加参数_1 (0-jump_Level_id) (3-开关id) (4-滑动条id)
96 | uint8_t b; //附加参数_2 (0-jump_id) (4-滑动条:true?执行函数:无操作)
97 | void (* function)();
98 | };
99 |
100 | extern struct Menu_System Menu[];
101 | extern struct Menu_Level_System MenuLevel[];
102 |
103 | #endif
104 |
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/src/MyShell.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Firmware/OpenHeat-fw/src/MyShell.h
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/src/OpenT12.h:
--------------------------------------------------------------------------------
1 | #ifndef OPENT12_H
2 | #define OPENT12_H
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include "BluetoothSerial.h"
12 | #include "Type.h"
13 | #include "serial_putc.h"
14 | #include "MyShell.h"
15 | #include "Rotary.h"
16 | #include "MathFun.h"
17 | #include "ExternDraw.h"
18 | #include "Event.h"
19 | #include "Menu.h"
20 | #include "Calibration.h"
21 | #include "TipControl.h"
22 | #include "Beep.h"
23 | #include "Bezier.h"
24 | #include "TipManager.h"
25 | #include "FilesSystem.h"
26 | #include "qrcode.h"
27 | #include "BLE.h"
28 | #include "Bitmap.h"
29 | #include "max6675.h"
30 | #include
31 |
32 | #define setbit(x, y) x|=(1<> (y)&1)
36 |
37 | //注意Pin36与Pin39连接了内部霍尔传感器,不建议复用高敏感用途
38 | //另外,建议给ADC输入串联一个0.1uF的电容,有利于减少噪声
39 | #define LED_Pin 2
40 | #define BEEP_PIN 25
41 |
42 | #define ROTARY_PIN1 27
43 | #define ROTARY_PIN2 14
44 | #define BUTTON_PIN 33
45 |
46 | #define TIP_ADC_PIN -1
47 | #define NTC_ADC -1
48 | #define POWER_ADC_PIN 4
49 | #define CUR_ADC -1
50 |
51 | #define PWM1_PIN 26
52 | #define PWM2_PIN -1
53 | #define SW_PIN -1
54 |
55 | //计算主电源电压
56 | #define POWER_ADC_VCC_R1 10000
57 | #define POWER_ADC_R2_GND 1000
58 |
59 | #define CNSize 12
60 | #define SCREEN_COLUMN 128
61 | #define SCREEN_ROW 64
62 | #define SCREEN_PAGE_NUM 8
63 | #define SCREEN_FONT_ROW 4
64 |
65 | //温度限制
66 | #define TipMaxTemp 260
67 | #define TipMinTemp 0
68 |
69 | //烙铁安装移除事件计时器冷却时间:防止事件临界值抖动
70 | #define TipEvent_CoolTime 1500
71 | //到温提示声播放稳定期:防止温度没有稳定下来就播放到温音效
72 | #define TempToneStabilitytime 1000
73 |
74 | enum SYSLANG
75 | {
76 | LANG_English = 0,
77 | LANG_Chinese,
78 | LANG_Russian,
79 | };
80 |
81 | enum PANELSET
82 | {
83 | PANELSET_Simple = 0,
84 | PANELSET_Detailed,
85 | };
86 |
87 | enum HANDLETRIGGER
88 | {
89 | HANDLETRIGGER_VibrationSwitch = 0,
90 | HANDLETRIGGER_ReedSwitch,
91 | };
92 |
93 | enum MESSAGETYPE
94 | {
95 | LOG_INFO = 0,
96 | LOG_OK,
97 | LOG_FAILED,
98 | LOG_WARNING,
99 | LOG_ERROR,
100 | };
101 |
102 | void Log(MESSAGETYPE type, char* s);
103 | void SYS_Reboot(void);
104 | void About(void);
105 |
106 |
107 | extern uint64_t ChipMAC;
108 | extern char ChipMAC_S[19];
109 | extern char CompileTime[20];
110 |
111 | extern BluetoothSerial SerialBT;
112 | extern OneButton RButton;
113 | extern U8G2_SSD1306_128X64_NONAME_F_HW_I2C Disp;
114 | extern PID MyPID;
115 | extern KFP KFP_Temp;
116 |
117 | extern uint8_t DEBUG_MODE;
118 |
119 | extern char* TipName;
120 |
121 | extern float ReadyTemp;
122 | extern double offset_ReadyTemp;
123 | extern float BootTemp;
124 | extern float SleepTemp;
125 | extern float ScreenProtectorTime;
126 | extern float BoostTemp;
127 |
128 | extern float ShutdownTime;
129 | extern float SleepTime;
130 | extern float BoostTime;
131 |
132 | extern bool SYS_Ready;
133 |
134 | extern bool TipInstallEvent;
135 | extern bool TipCallSleepEvent;
136 | extern bool TempToneFlag;
137 | extern bool SleepScreenProtectFlag;
138 |
139 | extern bool ERROREvent;
140 | extern bool ShutdownEvent;
141 | extern bool SleepEvent;
142 | extern bool BoostEvent;
143 | extern bool UnderVoltageEvent;
144 |
145 | extern bool PWM_WORKY;
146 |
147 |
148 | extern uint8_t PIDMode;
149 | extern uint8_t Use_KFP;
150 |
151 | extern uint8_t PanelSettings;
152 | extern uint8_t ScreenFlip;
153 | extern uint8_t SmoothAnimation_Flag;
154 | extern float ScreenBrightness;
155 | extern uint8_t OptionStripFixedLength_Flag;
156 |
157 | extern uint8_t Volume;
158 | extern uint8_t RotaryDirection;
159 | extern uint8_t HandleTrigger;
160 |
161 | extern double SYS_Voltage;
162 | extern float UndervoltageAlert;
163 | extern char BootPasswd[20];
164 | extern uint8_t Language;
165 | extern uint8_t MenuListMode;
166 |
167 | extern float ADC_PID_Cycle;
168 |
169 | extern double Get_MainPowerVoltage(void);
170 |
171 | enum TEMP_CTRL_STATUS_CODE
172 | {
173 | TEMP_STATUS_ERROR = 0,
174 | TEMP_STATUS_OFF,
175 | TEMP_STATUS_SLEEP,
176 | TEMP_STATUS_BOOST,
177 | TEMP_STATUS_WORKY,
178 | TEMP_STATUS_HEAT,
179 | TEMP_STATUS_HOLD,
180 | };
181 | extern uint8_t TempCTRL_Status;
182 | extern char* TempCTRL_Status_Mes[];
183 |
184 |
185 | #endif
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/src/Rotary.h:
--------------------------------------------------------------------------------
1 | #ifndef sys_Counter_H
2 | #define sys_Counter_H
3 |
4 | #include
5 | #include "Type.h"
6 |
7 | #define ROTARY_TYPE 2
8 |
9 | extern uint8_t SYSKey;
10 | extern bool Counter_LOCK_Flag;
11 |
12 | void sys_RotaryInit(void);
13 | void sys_Counter_Set(double min, double max, double step, double c);
14 | void sys_Counter_SetVal(double c);
15 | void RotaryUp(void);
16 | void RotaryDown(void);
17 |
18 | void sys_Counter_click(void);
19 | void sys_Counter_doubleclick(void);
20 | void sys_Counter_longclick(void);
21 | void sys_Counter_IRQHandler(void);
22 | double sys_Counter_Get(void);
23 | uint8_t sys_Counter_Change(void);
24 |
25 | void Clear_RButton_FIFO(void);
26 | uint8_t sys_KeyProcess(void);
27 | #endif
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/src/TipControl.h:
--------------------------------------------------------------------------------
1 | #ifndef TipControl_H
2 | #define TipControl_H
3 |
4 | #include "Type.h"
5 | #include "max6675.h"
6 |
7 | extern uint8_t MyMOS;
8 | extern uint8_t POWER;
9 | extern uint8_t PWM;
10 | extern uint8_t LastPWM;
11 | extern uint16_t LastADC;
12 | extern double TipTemperature;
13 | extern double PID_Output;
14 | extern double PID_Setpoint;
15 | extern double *ptr_PID_Setpoint;
16 | extern double TempGap;
17 |
18 | extern float SamplingRatioWork;
19 | extern float ADC_PID_Cycle_List[3];
20 |
21 | extern float readyKp, readyKi, readyKd;
22 | extern float aggKp, aggKi, aggKd;
23 | extern float consKp, consKi, consKd;
24 |
25 | extern uint8_t PWMOutput_Lock;
26 |
27 | void TipControlInit(void);
28 | void PWMOutput(uint8_t pin, uint8_t pwm);
29 | int GetADC0(void);
30 | double CalculateTemp(double ADC, double P[]);
31 | void SetPOWER(uint8_t POWER);
32 |
33 | void TemperatureControlLoop(MAX6675 *thermocouple);
34 |
35 | #endif
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/src/TipManager.cpp:
--------------------------------------------------------------------------------
1 | #include "OpenT12.h"
2 |
3 | uint8_t TipID = 0;
4 | uint8_t TipTotal = 1;
5 |
6 | TIPCONFIG MyTip[MaxTipConfig] = {
7 | {
8 | {51.6128997803, 0.1443523616, 0.0000061750, -0.0000000001},
9 | {
10 | {2.5, 0, 0.15}, //上电瞬间防止开关电源短路保护的预备参数
11 | {30.0, 0, 0.5},
12 | {20.0, 0, 0.5}
13 | },
14 | "智能加热台"
15 | },
16 | };
17 |
18 | /***
19 | * @description: 载入烙铁头配置到系统环境
20 | * @param {*}
21 | * @return {*}
22 | */
23 | void LoadTipConfig(void)
24 | {
25 | //载入温度系数
26 | for (uint8_t i = 0; i < 4; i++)
27 | {
28 | PTemp[i] = MyTip[TipID].PTemp[i];
29 | }
30 | //载入PID参数
31 | readyKp = MyTip[TipID].PID[0][0];
32 | readyKi = MyTip[TipID].PID[0][1];
33 | readyKd = MyTip[TipID].PID[0][2];
34 |
35 | aggKp = MyTip[TipID].PID[1][0];
36 | aggKi = MyTip[TipID].PID[1][1];
37 | aggKd = MyTip[TipID].PID[1][2];
38 |
39 | consKp = MyTip[TipID].PID[2][0];
40 | consKi = MyTip[TipID].PID[2][1];
41 | consKd = MyTip[TipID].PID[2][2];
42 | //载入名称
43 | TipName = MyTip[TipID].name;
44 |
45 | }
46 |
47 | /***
48 | * @description: 保存烙铁头配置到系统环境
49 | * @param {*}
50 | * @return {*}
51 | */
52 | void SaveTipConfig(void)
53 | {
54 | //载入温度系数
55 | for (uint8_t i = 0; i < 4; i++)
56 | {
57 | MyTip[TipID].PTemp[i] = PTemp[i];
58 | }
59 | //载入PID参数
60 | MyTip[TipID].PID[0][0] = readyKp;
61 | MyTip[TipID].PID[0][1] = readyKi;
62 | MyTip[TipID].PID[0][2] = readyKd;
63 |
64 | MyTip[TipID].PID[1][0] = aggKp;
65 | MyTip[TipID].PID[1][1] = aggKi;
66 | MyTip[TipID].PID[1][2] = aggKd;
67 |
68 | MyTip[TipID].PID[2][0] = consKp;
69 | MyTip[TipID].PID[2][1] = consKi;
70 | MyTip[TipID].PID[2][2] = consKd;
71 |
72 | //由于名称是用指针传递,所以不需要重新赋值
73 | }
74 |
75 | /***
76 | * @description: 更新菜单配置列表
77 | * @param {*}
78 | * @return {*}
79 | */
80 | void FlashTipMenu(void)
81 | {
82 | uint8_t MLID = Get_Real_Menu_Level_Id(15); //查询配置列表所在的菜单系统层级
83 | uint8_t MID;
84 |
85 | MenuLevel[MLID].max = TipTotal; //修改菜单最大项目数量
86 |
87 | for (uint8_t i = 0; i < TipTotal; i++)
88 | {
89 | MID = Get_Menu_Id(MLID, i + (1)); //查询配置列表项目id,另外 +(1)是为了跳过标题
90 | Menu[MID].name = MyTip[i].name; //刷新名称
91 |
92 | }
93 | }
94 | /***
95 | * @description: 新建配置
96 | * @param {*}
97 | * @return {*}
98 | */
99 | void NewTipConfig(void)
100 | {
101 | if (TipTotal < MaxTipConfig)
102 | {
103 | TipID = TipTotal;
104 |
105 | // char NewName = "---未命名---";
106 | strcpy(MyTip[TipTotal].name, "NewTip");
107 |
108 | for (uint8_t i = 0; i < 4; i++)
109 | {
110 | MyTip[TipID].PTemp[i] = 0;
111 | }
112 |
113 | MyTip[TipID].PID[0][0] = 0;
114 | MyTip[TipID].PID[0][1] = 0;
115 | MyTip[TipID].PID[0][2] = 0;
116 | MyTip[TipID].PID[1][0] = 0;
117 | MyTip[TipID].PID[1][1] = 0;
118 | MyTip[TipID].PID[1][2] = 0;
119 |
120 |
121 | TipTotal++;
122 | Pop_Windows("新建成功");
123 |
124 | TipRename();
125 | } else Pop_Windows("达到上限");
126 |
127 | //重新加载烙铁头参数
128 | LoadTipConfig();
129 | }
130 |
131 | /***
132 | * @description: 重命名当前的配置
133 | * @param {*}
134 | * @return {*}
135 | */
136 | void TipRename(void)
137 | {
138 | TextEditor("[重命名]", MyTip[TipID].name);
139 | }
140 |
141 | /***
142 | * @description: 删除配置
143 | * @param {*}
144 | * @return {*}
145 | */
146 | void TipDel(void)
147 | {
148 | if (TipTotal > 1)
149 | {
150 | //覆盖并移动配置
151 | for (uint8_t i = TipID; i < TipTotal - 1; i++)
152 | {
153 | MyTip[i] = MyTip[i + 1];
154 | }
155 | TipTotal--;
156 | Pop_Windows("删除成功");
157 | } else Pop_Windows("这是最后一个配置");
158 |
159 | //重新加载烙铁头参数
160 | LoadTipConfig();
161 | }
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/src/TipManager.h:
--------------------------------------------------------------------------------
1 | #ifndef TIPMANAGER_H
2 | #define TIPMANAGER_H
3 |
4 | #include "Type.h"
5 |
6 | //最大烙铁头配置数量
7 | #define MaxTipConfig 10
8 | extern uint8_t TipID; //当前选择的烙铁头
9 | extern uint8_t TipTotal; //有效烙铁头配置总数
10 |
11 | struct TIPCONFIG
12 | {
13 | double PTemp[4]; //温度系数
14 | float PID[3][3]; //PID系数{远PID,近PID}
15 | char name[20]; //名称
16 | };
17 |
18 | extern TIPCONFIG MyTip[MaxTipConfig];
19 |
20 | void LoadTipConfig(void);
21 | void SaveTipConfig(void);
22 |
23 | void FlashTipMenu(void);
24 |
25 | void NewTipConfig(void);
26 | void TipRename(void);
27 | void TipDel(void);
28 |
29 | #endif
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/src/Type.h:
--------------------------------------------------------------------------------
1 | #ifndef TYPE_H
2 | #define TYPE_H
3 |
4 | #include
5 |
6 | static const uint8_t D0 = 16;
7 | static const uint8_t D1 = 5;
8 | static const uint8_t D2 = 4;
9 | static const uint8_t D3 = 0;
10 | static const uint8_t D4 = 2;
11 | static const uint8_t D5 = 14;
12 | static const uint8_t D6 = 12;
13 | static const uint8_t D7 = 13;
14 | static const uint8_t D8 = 15;
15 | static const uint8_t D9 = 3;
16 | static const uint8_t D10 = 1;
17 |
18 | #endif
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/src/serial_putc.cpp:
--------------------------------------------------------------------------------
1 | #include "OpenT12.h"
2 |
3 | int fputc(int c, FILE* f)
4 | {
5 | Serial.write(c);
6 | //SerialBT.write(c);
7 | return c;
8 | }
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/src/serial_putc.h:
--------------------------------------------------------------------------------
1 | #ifndef PRINTF_H
2 | #define PRINTF_H
3 | int fputc(int ch, FILE* f);
4 | #endif
--------------------------------------------------------------------------------
/Firmware/OpenHeat-fw/test/README:
--------------------------------------------------------------------------------
1 |
2 | This directory is intended for PlatformIO Unit Testing and project tests.
3 |
4 | Unit Testing is a software testing method by which individual units of
5 | source code, sets of one or more MCU program modules together with associated
6 | control data, usage procedures, and operating procedures, are tested to
7 | determine whether they are fit for use. Unit testing finds problems early
8 | in the development cycle.
9 |
10 | More information about PlatformIO Unit Testing:
11 | - https://docs.platformio.org/page/plus/unit-testing.html
12 |
--------------------------------------------------------------------------------
/Hardware/AD_Project/Gerber/OpenHeat_20220117-1427.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/AD_Project/Gerber/OpenHeat_20220117-1427.zip
--------------------------------------------------------------------------------
/Hardware/AD_Project/relflow_bed.PCB:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/AD_Project/relflow_bed.PCB
--------------------------------------------------------------------------------
/Hardware/AD_Project/relflow_bed.PcbDoc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/AD_Project/relflow_bed.PcbDoc
--------------------------------------------------------------------------------
/Hardware/AD_Project/relflow_bed.SchDoc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/AD_Project/relflow_bed.SchDoc
--------------------------------------------------------------------------------
/Hardware/AD_Project/relflow_bed.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/AD_Project/relflow_bed.pdf
--------------------------------------------------------------------------------
/Hardware/Datasheets/5566连接器2x2p_molex-039281043_sd.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/Datasheets/5566连接器2x2p_molex-039281043_sd.pdf
--------------------------------------------------------------------------------
/Hardware/Datasheets/5569连接器2x2p_molex-026013115_sd.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/Datasheets/5569连接器2x2p_molex-026013115_sd.pdf
--------------------------------------------------------------------------------
/Hardware/Datasheets/74LVC1G08_ Single 2-input AND gate.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/Datasheets/74LVC1G08_ Single 2-input AND gate.pdf
--------------------------------------------------------------------------------
/Hardware/Datasheets/CH340DS1.PDF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/Datasheets/CH340DS1.PDF
--------------------------------------------------------------------------------
/Hardware/Datasheets/CLP0212FPEX5Z03A.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/Datasheets/CLP0212FPEX5Z03A.pdf
--------------------------------------------------------------------------------
/Hardware/Datasheets/DCDC_ME3116_降压型_2017-03-22.PDF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/Datasheets/DCDC_ME3116_降压型_2017-03-22.PDF
--------------------------------------------------------------------------------
/Hardware/Datasheets/DCDC_MP2451.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/Datasheets/DCDC_MP2451.pdf
--------------------------------------------------------------------------------
/Hardware/Datasheets/DCDC_MP2456GJ-Z.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/Datasheets/DCDC_MP2456GJ-Z.pdf
--------------------------------------------------------------------------------
/Hardware/Datasheets/IND_NRS3015T6R8MNGHM_C2880382_6.8UH±20%_2019-03-29.PDF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/Datasheets/IND_NRS3015T6R8MNGHM_C2880382_6.8UH±20%_2019-03-29.PDF
--------------------------------------------------------------------------------
/Hardware/Datasheets/MAX31855.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/Datasheets/MAX31855.pdf
--------------------------------------------------------------------------------
/Hardware/Datasheets/MAX6675.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/Datasheets/MAX6675.pdf
--------------------------------------------------------------------------------
/Hardware/Datasheets/MOS_HY210N06_N沟道60V210A10V4mR-乐积mos控制板使用.PDF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/Datasheets/MOS_HY210N06_N沟道60V210A10V4mR-乐积mos控制板使用.PDF
--------------------------------------------------------------------------------
/Hardware/Datasheets/MOS_Infineon-IRFP064N-DataSheet-v01_01-EN.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/Datasheets/MOS_Infineon-IRFP064N-DataSheet-v01_01-EN.pdf
--------------------------------------------------------------------------------
/Hardware/Datasheets/MOS_Infineon-IRFP4410Z-DataSheet-v01_01-EN.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/Datasheets/MOS_Infineon-IRFP4410Z-DataSheet-v01_01-EN.pdf
--------------------------------------------------------------------------------
/Hardware/Datasheets/MOS_Infineon-IRFP4468-DataSheet-v01_01-EN.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/Datasheets/MOS_Infineon-IRFP4468-DataSheet-v01_01-EN.pdf
--------------------------------------------------------------------------------
/Hardware/Datasheets/OMEGA_SMPW_SMP_HMP_HMPW.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/Datasheets/OMEGA_SMPW_SMP_HMP_HMPW.pdf
--------------------------------------------------------------------------------
/Hardware/Datasheets/Sharp_PC817XxNSZ1B_e.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/Datasheets/Sharp_PC817XxNSZ1B_e.pdf
--------------------------------------------------------------------------------
/Hardware/Datasheets/TVS_NUP2105L-D.PDF:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/Datasheets/TVS_NUP2105L-D.PDF
--------------------------------------------------------------------------------
/Hardware/Datasheets/umh3-SOT363-双npn晶体管.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/Datasheets/umh3-SOT363-双npn晶体管.pdf
--------------------------------------------------------------------------------
/Hardware/LCEDA_Project/GSH_Bed_100x100_12Vor24V_PogoPin版本/12Vor24V探针位置.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/LCEDA_Project/GSH_Bed_100x100_12Vor24V_PogoPin版本/12Vor24V探针位置.PNG
--------------------------------------------------------------------------------
/Hardware/LCEDA_Project/GSH_Bed_100x100_12Vor24V_PogoPin版本/2D预览图-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/LCEDA_Project/GSH_Bed_100x100_12Vor24V_PogoPin版本/2D预览图-2.png
--------------------------------------------------------------------------------
/Hardware/LCEDA_Project/GSH_Bed_100x100_12Vor24V_PogoPin版本/2D预览图.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/LCEDA_Project/GSH_Bed_100x100_12Vor24V_PogoPin版本/2D预览图.png
--------------------------------------------------------------------------------
/Hardware/LCEDA_Project/GSH_Bed_100x100_12Vor24V_PogoPin版本/Gerber_GSH_Bed_100X100_12V150W_W45mil.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/LCEDA_Project/GSH_Bed_100x100_12Vor24V_PogoPin版本/Gerber_GSH_Bed_100X100_12V150W_W45mil.zip
--------------------------------------------------------------------------------
/Hardware/LCEDA_Project/GSH_Bed_100x100_12Vor24V_PogoPin版本/README.md:
--------------------------------------------------------------------------------
1 | ## 热床
2 |
3 | 下单选择铝基板(单层)
4 | PCB尺寸99.82mm x 99.82mm
5 | m3固定孔,孔距93.2x93.2mm
6 | 附立创EDA工程文件
7 |
8 | 原作者:
9 | [GSH_Bed 铝基板加热平台](https://oshwhub.com/GeekStartzhan-shuo/GSH_Bed-lv-ji-ban-jia-re-ping-tai)
10 |
11 |
--------------------------------------------------------------------------------
/Hardware/LCEDA_Project/GSH_Bed_100x100_12Vor24V_PogoPin版本/pcb_layout.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/LCEDA_Project/GSH_Bed_100x100_12Vor24V_PogoPin版本/pcb_layout.png
--------------------------------------------------------------------------------
/Hardware/POG_PIN_Board/Gerber/POG_PIN_Board_2layer_220212-1921.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/POG_PIN_Board/Gerber/POG_PIN_Board_2layer_220212-1921.zip
--------------------------------------------------------------------------------
/Hardware/POG_PIN_Board/Gerber/POG_PIN_Board_4layer_220212-1921.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/POG_PIN_Board/Gerber/POG_PIN_Board_4layer_220212-1921.zip
--------------------------------------------------------------------------------
/Hardware/POG_PIN_Board/Images/Pogo_Pin_Board_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/POG_PIN_Board/Images/Pogo_Pin_Board_1.png
--------------------------------------------------------------------------------
/Hardware/POG_PIN_Board/Images/Pogo_Pin_Board_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/POG_PIN_Board/Images/Pogo_Pin_Board_2.png
--------------------------------------------------------------------------------
/Hardware/POG_PIN_Board/Images/Pogo_Pin_Board_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/POG_PIN_Board/Images/Pogo_Pin_Board_3.png
--------------------------------------------------------------------------------
/Hardware/POG_PIN_Board/POG_PIN_Board.PcbDoc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/POG_PIN_Board/POG_PIN_Board.PcbDoc
--------------------------------------------------------------------------------
/Hardware/POG_PIN_Board/POG_PIN_Board.SchDoc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/POG_PIN_Board/POG_PIN_Board.SchDoc
--------------------------------------------------------------------------------
/Hardware/开孔尺寸图纸CAD/125X51-铝壳-前面板.DWG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/开孔尺寸图纸CAD/125X51-铝壳-前面板.DWG
--------------------------------------------------------------------------------
/Hardware/开孔尺寸图纸CAD/125X51-铝壳-后面板.DWG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/开孔尺寸图纸CAD/125X51-铝壳-后面板.DWG
--------------------------------------------------------------------------------
/Hardware/开孔尺寸图纸CAD/125X51-铝壳-壳体.DWG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/开孔尺寸图纸CAD/125X51-铝壳-壳体.DWG
--------------------------------------------------------------------------------
/Hardware/开孔尺寸图纸CAD/单面玻纤板121x100x1.DWG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/开孔尺寸图纸CAD/单面玻纤板121x100x1.DWG
--------------------------------------------------------------------------------
/Hardware/开孔尺寸图纸CAD/开孔图AD.PcbDoc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Hardware/开孔尺寸图纸CAD/开孔图AD.PcbDoc
--------------------------------------------------------------------------------
/Images/12.7V供电_线宽28mil热床温度功率测试(2级PID限制).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/12.7V供电_线宽28mil热床温度功率测试(2级PID限制).png
--------------------------------------------------------------------------------
/Images/12.7V供电_线宽43mil热床温度功率测试(3级PID限制).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/12.7V供电_线宽43mil热床温度功率测试(3级PID限制).png
--------------------------------------------------------------------------------
/Images/AD_2Dview_PCB.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/AD_2Dview_PCB.png
--------------------------------------------------------------------------------
/Images/AD_3Dview_BUTTOM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/AD_3Dview_BUTTOM.png
--------------------------------------------------------------------------------
/Images/AD_3Dview_PCB_BUTTOM.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/AD_3Dview_PCB_BUTTOM.png
--------------------------------------------------------------------------------
/Images/AD_3Dview_PCB_TOP.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/AD_3Dview_PCB_TOP.png
--------------------------------------------------------------------------------
/Images/AD_3Dview_TOP.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/AD_3Dview_TOP.png
--------------------------------------------------------------------------------
/Images/PCB绝缘层承受的温度限制.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/PCB绝缘层承受的温度限制.png
--------------------------------------------------------------------------------
/Images/主界面.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/主界面.png
--------------------------------------------------------------------------------
/Images/保护温度图标.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/保护温度图标.bmp
--------------------------------------------------------------------------------
/Images/初号机1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/初号机1.jpg
--------------------------------------------------------------------------------
/Images/初号机2.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/初号机2.JPG
--------------------------------------------------------------------------------
/Images/初号机3.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/初号机3.JPG
--------------------------------------------------------------------------------
/Images/初号机4.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/初号机4.JPG
--------------------------------------------------------------------------------
/Images/初号机5.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/初号机5.JPG
--------------------------------------------------------------------------------
/Images/初号机6.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/初号机6.JPG
--------------------------------------------------------------------------------
/Images/安装-上壳体3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/安装-上壳体3.png
--------------------------------------------------------------------------------
/Images/安装-下壳体1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/安装-下壳体1.png
--------------------------------------------------------------------------------
/Images/开孔-前面板.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/开孔-前面板.png
--------------------------------------------------------------------------------
/Images/开孔-单面玻纤板厚1.5mm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/开孔-单面玻纤板厚1.5mm.png
--------------------------------------------------------------------------------
/Images/开孔-后面板.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/开孔-后面板.png
--------------------------------------------------------------------------------
/Images/开孔-铝壳体.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/开孔-铝壳体.png
--------------------------------------------------------------------------------
/Images/手搓螺柱顶针是咋回事.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/手搓螺柱顶针是咋回事.mp4
--------------------------------------------------------------------------------
/Images/控制板1.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/控制板1.JPG
--------------------------------------------------------------------------------
/Images/控制板2.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/控制板2.JPG
--------------------------------------------------------------------------------
/Images/控制板3.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/控制板3.JPG
--------------------------------------------------------------------------------
/Images/注释安装-上壳体2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/注释安装-上壳体2.png
--------------------------------------------------------------------------------
/Images/注释安装-下壳体2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/注释安装-下壳体2.png
--------------------------------------------------------------------------------
/Images/注释安装-前面板2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/注释安装-前面板2.png
--------------------------------------------------------------------------------
/Images/注释安装-前面板3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/注释安装-前面板3.png
--------------------------------------------------------------------------------
/Images/注释安装-后面板2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/注释安装-后面板2.png
--------------------------------------------------------------------------------
/Images/注释安装-后面板3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/注释安装-后面板3.png
--------------------------------------------------------------------------------
/Images/注释安装-玻纤板抽拉示意.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/注释安装-玻纤板抽拉示意.png
--------------------------------------------------------------------------------
/Images/烧150ml水触发电源过热保护,全程功率200W.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/烧150ml水触发电源过热保护,全程功率200W.PNG
--------------------------------------------------------------------------------
/Images/热床希尔伯特曲线图标.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/热床希尔伯特曲线图标.bmp
--------------------------------------------------------------------------------
/Images/组装1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/组装1.png
--------------------------------------------------------------------------------
/Images/轴测1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/轴测1.png
--------------------------------------------------------------------------------
/Images/轴测2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/oldgerman/OpenHeat-Split/72944457dee73ea2654936068131c66d197d9615/Images/轴测2.png
--------------------------------------------------------------------------------