├── .gitattributes ├── .gitignore ├── Hardware ├── HeatPlatform.PcbLib ├── HeatPlatform.SchLib ├── HeatPlatform_SMT.PrjPcb ├── HeatPlatform_SMT_V1.0.pdf ├── HeatPlatform_V1.1.PcbDoc ├── HeatPlatform_V1.1.SchDoc └── README.md ├── Image ├── Back_16x16.BMP ├── CursorImage_16x16.BMP ├── CursorImage_8x8.BMP ├── Curve_16x16.BMP ├── EC11_sequential.jpg ├── HeatPlatform_Entity.jpg ├── HeatPlatform_PCB.jpg ├── HeatPlatform_PCB_Back.jpg ├── Heat_16x16.BMP ├── Info_16x16.BMP ├── Knobs_16x16.BMP ├── PID_16x16.BMP ├── Set_16x16.bmp ├── UNUnCursorImage_16x16.BMP ├── UnCursorImage_8x8.BMP ├── 升温32x32.bmp ├── 发热丝-弃.bmp └── 错误32x32.bmp ├── LICENSE ├── Model ├── HeatPlaform_SMT.stl ├── HeatPlatform_SMT_PCB.step └── 模型说明.md ├── README.md ├── Software ├── Firmware │ └── esp8266-20210202-v1.14.bin ├── README.md ├── config.json ├── font.py ├── knobs.py ├── main.py ├── max6675.py ├── microWebSocket.py ├── microWebSrv.py ├── pid.py ├── ssd1306.py ├── ssd1306_esp.py ├── surface.py └── wifi.py ├── Software_C ├── .gitignore ├── README.md ├── include │ └── README ├── lib │ ├── Adafruit-GFX-Library │ │ ├── .github │ │ │ ├── ISSUE_TEMPLATE.md │ │ │ ├── PULL_REQUEST_TEMPLATE.md │ │ │ └── workflows │ │ │ │ └── githubci.yml │ │ ├── .gitignore │ │ ├── Adafruit_GFX.cpp │ │ ├── Adafruit_GFX.h │ │ ├── Adafruit_GrayOLED.cpp │ │ ├── Adafruit_GrayOLED.h │ │ ├── Adafruit_SPITFT.cpp │ │ ├── Adafruit_SPITFT.h │ │ ├── Adafruit_SPITFT_Macros.h │ │ ├── Fonts │ │ │ ├── FreeMono12pt7b.h │ │ │ ├── FreeMono18pt7b.h │ │ │ ├── FreeMono24pt7b.h │ │ │ ├── FreeMono9pt7b.h │ │ │ ├── FreeMonoBold12pt7b.h │ │ │ ├── FreeMonoBold18pt7b.h │ │ │ ├── FreeMonoBold24pt7b.h │ │ │ ├── FreeMonoBold9pt7b.h │ │ │ ├── FreeMonoBoldOblique12pt7b.h │ │ │ ├── FreeMonoBoldOblique18pt7b.h │ │ │ ├── FreeMonoBoldOblique24pt7b.h │ │ │ ├── FreeMonoBoldOblique9pt7b.h │ │ │ ├── FreeMonoOblique12pt7b.h │ │ │ ├── FreeMonoOblique18pt7b.h │ │ │ ├── FreeMonoOblique24pt7b.h │ │ │ ├── FreeMonoOblique9pt7b.h │ │ │ ├── FreeSans12pt7b.h │ │ │ ├── FreeSans18pt7b.h │ │ │ ├── FreeSans24pt7b.h │ │ │ ├── FreeSans9pt7b.h │ │ │ ├── FreeSansBold12pt7b.h │ │ │ ├── FreeSansBold18pt7b.h │ │ │ ├── FreeSansBold24pt7b.h │ │ │ ├── FreeSansBold9pt7b.h │ │ │ ├── FreeSansBoldOblique12pt7b.h │ │ │ ├── FreeSansBoldOblique18pt7b.h │ │ │ ├── FreeSansBoldOblique24pt7b.h │ │ │ ├── FreeSansBoldOblique9pt7b.h │ │ │ ├── FreeSansOblique12pt7b.h │ │ │ ├── FreeSansOblique18pt7b.h │ │ │ ├── FreeSansOblique24pt7b.h │ │ │ ├── FreeSansOblique9pt7b.h │ │ │ ├── FreeSerif12pt7b.h │ │ │ ├── FreeSerif18pt7b.h │ │ │ ├── FreeSerif24pt7b.h │ │ │ ├── FreeSerif9pt7b.h │ │ │ ├── FreeSerifBold12pt7b.h │ │ │ ├── FreeSerifBold18pt7b.h │ │ │ ├── FreeSerifBold24pt7b.h │ │ │ ├── FreeSerifBold9pt7b.h │ │ │ ├── FreeSerifBoldItalic12pt7b.h │ │ │ ├── FreeSerifBoldItalic18pt7b.h │ │ │ ├── FreeSerifBoldItalic24pt7b.h │ │ │ ├── FreeSerifBoldItalic9pt7b.h │ │ │ ├── FreeSerifItalic12pt7b.h │ │ │ ├── FreeSerifItalic18pt7b.h │ │ │ ├── FreeSerifItalic24pt7b.h │ │ │ ├── FreeSerifItalic9pt7b.h │ │ │ ├── Org_01.h │ │ │ ├── Picopixel.h │ │ │ ├── Tiny3x3a2pt7b.h │ │ │ └── TomThumb.h │ │ ├── README.md │ │ ├── examples │ │ │ ├── GFXcanvas │ │ │ │ ├── GFXcanvas.ino │ │ │ │ ├── GFXcanvasSerialDemo.cpp │ │ │ │ └── GFXcanvasSerialDemo.h │ │ │ └── mock_ili9341 │ │ │ │ └── mock_ili9341.ino │ │ ├── fontconvert │ │ │ ├── Makefile │ │ │ ├── fontconvert.c │ │ │ ├── fontconvert_win.md │ │ │ └── makefonts.sh │ │ ├── gfxfont.h │ │ ├── glcdfont.c │ │ ├── library.properties │ │ └── license.txt │ ├── Adafruit_BusIO │ │ ├── .github │ │ │ ├── ISSUE_TEMPLATE.md │ │ │ ├── PULL_REQUEST_TEMPLATE.md │ │ │ └── workflows │ │ │ │ └── githubci.yml │ │ ├── Adafruit_BusIO_Register.cpp │ │ ├── Adafruit_BusIO_Register.h │ │ ├── Adafruit_I2CDevice.cpp │ │ ├── Adafruit_I2CDevice.h │ │ ├── Adafruit_I2CRegister.h │ │ ├── Adafruit_SPIDevice.cpp │ │ ├── Adafruit_SPIDevice.h │ │ ├── LICENSE │ │ ├── README.md │ │ ├── examples │ │ │ ├── i2c_address_detect │ │ │ │ └── i2c_address_detect.ino │ │ │ ├── i2c_readwrite │ │ │ │ └── i2c_readwrite.ino │ │ │ ├── i2c_registers │ │ │ │ └── i2c_registers.ino │ │ │ ├── i2corspi_register │ │ │ │ └── i2corspi_register.ino │ │ │ ├── spi_modetest │ │ │ │ └── spi_modetest.ino │ │ │ ├── spi_readwrite │ │ │ │ └── spi_readwrite.ino │ │ │ ├── spi_register_bits │ │ │ │ └── spi_register_bits.ino │ │ │ └── spi_registers │ │ │ │ └── spi_registers.ino │ │ └── library.properties │ ├── Adafruit_SSD1306 │ │ ├── .github │ │ │ ├── ISSUE_TEMPLATE.md │ │ │ ├── PULL_REQUEST_TEMPLATE.md │ │ │ └── workflows │ │ │ │ └── githubci.yml │ │ ├── .gitignore │ │ ├── Adafruit_SSD1306.cpp │ │ ├── Adafruit_SSD1306.h │ │ ├── README.md │ │ ├── examples │ │ │ ├── OLED_featherwing │ │ │ │ └── OLED_featherwing.ino │ │ │ ├── ssd1306_128x32_i2c │ │ │ │ └── ssd1306_128x32_i2c.ino │ │ │ ├── ssd1306_128x32_spi │ │ │ │ └── ssd1306_128x32_spi.ino │ │ │ ├── ssd1306_128x64_i2c │ │ │ │ └── ssd1306_128x64_i2c.ino │ │ │ └── ssd1306_128x64_spi │ │ │ │ └── ssd1306_128x64_spi.ino │ │ ├── library.properties │ │ ├── license.txt │ │ ├── scripts │ │ │ ├── Makefile │ │ │ ├── make_splash.py │ │ │ ├── splash1.png │ │ │ └── splash2.png │ │ └── splash.h │ ├── ESP8266TimerInterrupt │ │ ├── .github │ │ │ ├── ISSUE_TEMPLATE │ │ │ │ ├── bug_report.md │ │ │ │ └── feature_request.md │ │ │ └── workflows │ │ │ │ └── auto-github-actions.yml │ │ ├── .gitignore │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── examples │ │ │ ├── Argument_None │ │ │ │ └── Argument_None.ino │ │ │ ├── Change_Interval │ │ │ │ └── Change_Interval.ino │ │ │ ├── ISR_16_Timers_Array │ │ │ │ └── ISR_16_Timers_Array.ino │ │ │ ├── ISR_16_Timers_Array_Complex │ │ │ │ └── ISR_16_Timers_Array_Complex.ino │ │ │ ├── ISR_RPM_Measure │ │ │ │ └── ISR_RPM_Measure.ino │ │ │ ├── ISR_Switch │ │ │ │ └── ISR_Switch.ino │ │ │ ├── ISR_Timer_4_Switches │ │ │ │ └── ISR_Timer_4_Switches.ino │ │ │ ├── ISR_Timer_Complex │ │ │ │ └── ISR_Timer_Complex.ino │ │ │ ├── ISR_Timer_Switch │ │ │ │ └── ISR_Timer_Switch.ino │ │ │ ├── ISR_Timer_Switches │ │ │ │ └── ISR_Timer_Switches.ino │ │ │ ├── RPM_Measure │ │ │ │ └── RPM_Measure.ino │ │ │ ├── SwitchDebounce │ │ │ │ └── SwitchDebounce.ino │ │ │ └── TimerInterruptTest │ │ │ │ └── TimerInterruptTest.ino │ │ ├── keywords.txt │ │ ├── library.json │ │ ├── library.properties │ │ ├── src │ │ │ ├── ESP8266TimerInterrupt.h │ │ │ ├── ESP8266_ISR_Timer-Impl.h │ │ │ ├── ESP8266_ISR_Timer.h │ │ │ └── TimerInterrupt_Generic_Debug.h │ │ ├── src_cpp │ │ │ ├── ESP8266TimerInterrupt.h │ │ │ ├── ESP8266_ISR_Timer.cpp │ │ │ ├── ESP8266_ISR_Timer.h │ │ │ └── TimerInterrupt_Generic_Debug.h │ │ └── src_h │ │ │ ├── ESP8266TimerInterrupt.h │ │ │ ├── ESP8266_ISR_Timer-Impl.h │ │ │ ├── ESP8266_ISR_Timer.h │ │ │ └── TimerInterrupt_Generic_Debug.h │ └── README ├── partitions-no-ota.csv ├── pin_map.png ├── platformio.ini ├── src │ ├── buzzer.cpp │ ├── buzzer.h │ ├── common.h │ ├── knobs.cpp │ ├── knobs.h │ ├── main.cpp │ ├── main.h │ ├── max6675.cpp │ ├── max6675.h │ ├── pid.cpp │ ├── pid.h │ ├── surface.cpp │ └── surface.h └── test │ └── README ├── Tool ├── HeatPlatform_tool.py └── esptool │ ├── .github │ ├── ISSUE_TEMPLATE │ │ ├── bug-report-no-hardware.md │ │ ├── config.yml │ │ ├── feature_request.md │ │ └── issue-with-attached-hardware.md │ └── pull_request_template.md │ ├── .gitlab-ci.yml │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── MANIFEST.in │ ├── README.md │ ├── esp_rfc2217_server.py │ ├── espefuse.py │ ├── espressif │ ├── __init__.py │ └── efuse │ │ ├── __init__.py │ │ ├── base_fields.py │ │ ├── base_operations.py │ │ ├── emulate_efuse_controller_base.py │ │ ├── esp32 │ │ ├── __init__.py │ │ ├── emulate_efuse_controller.py │ │ ├── fields.py │ │ ├── mem_definition.py │ │ └── operations.py │ │ ├── esp32c3 │ │ ├── __init__.py │ │ ├── emulate_efuse_controller.py │ │ ├── fields.py │ │ ├── mem_definition.py │ │ └── operations.py │ │ ├── esp32s2 │ │ ├── __init__.py │ │ ├── emulate_efuse_controller.py │ │ ├── fields.py │ │ ├── mem_definition.py │ │ └── operations.py │ │ ├── esp32s3beta2 │ │ ├── __init__.py │ │ ├── emulate_efuse_controller.py │ │ ├── fields.py │ │ ├── mem_definition.py │ │ └── operations.py │ │ ├── mem_definition_base.py │ │ └── util.py │ ├── espsecure.py │ ├── esptool.py │ ├── flasher_stub │ ├── Makefile │ ├── README.md │ ├── compare_stubs.py │ ├── esptool_test_stub.py │ ├── include │ │ ├── miniz.h │ │ ├── rom_functions.h │ │ ├── slip.h │ │ ├── soc_support.h │ │ ├── stub_commands.h │ │ ├── stub_flasher.h │ │ ├── stub_io.h │ │ └── stub_write_flash.h │ ├── ld │ │ ├── rom_32.ld │ │ ├── rom_32c3.ld │ │ ├── rom_32s2.ld │ │ ├── rom_32s3.ld │ │ ├── rom_8266.ld │ │ ├── stub_32.ld │ │ ├── stub_32c3.ld │ │ ├── stub_32s2.ld │ │ ├── stub_32s3.ld │ │ └── stub_8266.ld │ ├── miniz.c │ ├── run_tests_with_stub.sh │ ├── slip.c │ ├── stub_commands.c │ ├── stub_flasher.c │ ├── stub_io.c │ ├── stub_write_flash.c │ └── wrap_stub.py │ ├── setup.cfg │ ├── setup.py │ └── test │ ├── README.md │ ├── ci │ ├── multirun_with_pyenv.sh │ ├── run_test_on_chips_parallel.sh │ └── setup_ci_build_env.sh │ ├── ecdsa_secure_boot_signing_key2.pem │ ├── elf2image │ ├── esp32-app-cust-ver-info.elf │ ├── esp32-app-template.elf │ ├── esp32-bootloader.elf │ ├── esp32-too-many-sections.elf │ ├── esp8266-nonossdkv12-example.elf │ ├── esp8266-nonossdkv20-at-v2.elf │ ├── esp8266-nonosssdk20-iotdemo.elf │ └── esp8266-openrtos-blink-v2.elf │ ├── images │ ├── aes_key.bin │ ├── bootloader_esp32.bin │ ├── bootloader_esp32c3.bin │ ├── bootloader_esp32s2.bin │ ├── bootloader_esp32s3.bin │ ├── efuse │ │ ├── 128bit │ │ ├── 192bit │ │ ├── 192bit_1 │ │ ├── 192bit_2 │ │ ├── 224bit │ │ ├── 256bit │ │ ├── 256bit_1 │ │ └── 256bit_2 │ ├── esp8266_deepsleep.bin │ ├── esp8266_sdk │ │ ├── 4096_user1.bin │ │ ├── blank.bin │ │ ├── boot_v1.4(b1).bin │ │ └── esp_init_data_default.bin │ ├── fifty_kb.bin │ ├── helloworld-esp32.bin │ ├── helloworld-esp32_edit.bin │ ├── helloworld-esp8266.bin │ ├── nodemcu-master-7-modules-2017-01-19-11-10-03-integer.bin │ ├── one_kb.bin │ ├── one_kb_all_ef.bin │ ├── one_mb.bin │ ├── one_mb_zeroes.bin │ ├── onebyte.bin │ ├── partitions_singleapp.bin │ ├── sector.bin │ ├── unaligned.bin │ └── zerolength.bin │ ├── secure_images │ ├── 256bit_iv.bin │ ├── 256bit_key.bin │ ├── bootloader-encrypted-conf0.bin │ ├── bootloader-encrypted-conf3.bin │ ├── bootloader-encrypted-conf9.bin │ ├── bootloader-encrypted-confc.bin │ ├── bootloader-encrypted.bin │ ├── bootloader.bin │ ├── bootloader_digested.bin │ ├── bootloader_multi_signed_v2.bin │ ├── bootloader_signed.bin │ ├── bootloader_signed_v2.bin │ ├── bootloader_unsigned_v2.bin │ ├── digest_iv.bin │ ├── ecdsa_secure_boot_signing_key.pem │ ├── ecdsa_secure_boot_signing_key2.pem │ ├── ecdsa_secure_boot_signing_key_pkcs8.pem │ ├── ecdsa_secure_boot_signing_pubkey.pem │ ├── ecdsa_secure_boot_signing_pubkey2.pem │ ├── ef-flashencryption-key.bin │ ├── hello-world-signed-encrypted.bin │ ├── hello-world-signed.bin │ ├── rsa_public_key_digest.bin │ ├── rsa_secure_boot_signing_key.pem │ ├── rsa_secure_boot_signing_key2.pem │ ├── rsa_secure_boot_signing_key3.pem │ ├── rsa_secure_boot_signing_key4.pem │ ├── rsa_secure_boot_signing_pubkey.pem │ ├── rsa_secure_boot_signing_pubkey2.pem │ └── rsa_secure_boot_signing_pubkey4.pem │ ├── test_espefuse.py │ ├── test_espefuse_host.py │ ├── test_espsecure.py │ ├── test_esptool.py │ └── test_imagegen.py ├── update_log.md └── webrepl-ctrl.zip /.gitattributes: -------------------------------------------------------------------------------- 1 | *.c linguist-language=Python 2 | *.h linguist-language=Python 3 | *.cpp linguist-language=Python 4 | *.hpp linguist-language=Python 5 | *.css linguist-language=Python -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Data/ 2 | ESP8266_MicroPython/ 3 | webrepl-master/ -------------------------------------------------------------------------------- /Hardware/HeatPlatform.PcbLib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Hardware/HeatPlatform.PcbLib -------------------------------------------------------------------------------- /Hardware/HeatPlatform.SchLib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Hardware/HeatPlatform.SchLib -------------------------------------------------------------------------------- /Hardware/HeatPlatform_SMT.PrjPcb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Hardware/HeatPlatform_SMT.PrjPcb -------------------------------------------------------------------------------- /Hardware/HeatPlatform_SMT_V1.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Hardware/HeatPlatform_SMT_V1.0.pdf -------------------------------------------------------------------------------- /Hardware/HeatPlatform_V1.1.PcbDoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Hardware/HeatPlatform_V1.1.PcbDoc -------------------------------------------------------------------------------- /Hardware/HeatPlatform_V1.1.SchDoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Hardware/HeatPlatform_V1.1.SchDoc -------------------------------------------------------------------------------- /Hardware/README.md: -------------------------------------------------------------------------------- 1 | # PCB工程 2 | 此PCB工程使用AD20绘制 -------------------------------------------------------------------------------- /Image/Back_16x16.BMP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Image/Back_16x16.BMP -------------------------------------------------------------------------------- /Image/CursorImage_16x16.BMP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Image/CursorImage_16x16.BMP -------------------------------------------------------------------------------- /Image/CursorImage_8x8.BMP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Image/CursorImage_8x8.BMP -------------------------------------------------------------------------------- /Image/Curve_16x16.BMP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Image/Curve_16x16.BMP -------------------------------------------------------------------------------- /Image/EC11_sequential.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Image/EC11_sequential.jpg -------------------------------------------------------------------------------- /Image/HeatPlatform_Entity.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Image/HeatPlatform_Entity.jpg -------------------------------------------------------------------------------- /Image/HeatPlatform_PCB.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Image/HeatPlatform_PCB.jpg -------------------------------------------------------------------------------- /Image/HeatPlatform_PCB_Back.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Image/HeatPlatform_PCB_Back.jpg -------------------------------------------------------------------------------- /Image/Heat_16x16.BMP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Image/Heat_16x16.BMP -------------------------------------------------------------------------------- /Image/Info_16x16.BMP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Image/Info_16x16.BMP -------------------------------------------------------------------------------- /Image/Knobs_16x16.BMP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Image/Knobs_16x16.BMP -------------------------------------------------------------------------------- /Image/PID_16x16.BMP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Image/PID_16x16.BMP -------------------------------------------------------------------------------- /Image/Set_16x16.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Image/Set_16x16.bmp -------------------------------------------------------------------------------- /Image/UNUnCursorImage_16x16.BMP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Image/UNUnCursorImage_16x16.BMP -------------------------------------------------------------------------------- /Image/UnCursorImage_8x8.BMP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Image/UnCursorImage_8x8.BMP -------------------------------------------------------------------------------- /Image/升温32x32.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Image/升温32x32.bmp -------------------------------------------------------------------------------- /Image/发热丝-弃.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Image/发热丝-弃.bmp -------------------------------------------------------------------------------- /Image/错误32x32.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Image/错误32x32.bmp -------------------------------------------------------------------------------- /Model/HeatPlaform_SMT.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Model/HeatPlaform_SMT.stl -------------------------------------------------------------------------------- /Model/HeatPlatform_SMT_PCB.step: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Model/HeatPlatform_SMT_PCB.step -------------------------------------------------------------------------------- /Model/模型说明.md: -------------------------------------------------------------------------------- 1 | ### 模型说明 2 | 3 | 1. 航空头选用的是GX16-8。 4 | 2. 开关使用的是AC220的船型开关,开孔尺寸为19*13mm。 5 | 3. 品字接口是不带耳的,开孔尺寸为22*27mm。 6 | 4. 固定PCB板的螺丝为M2。 7 | 8 | 注: 由于外壳需要安装PCB面板,3D打印时材料收缩性不同,可能会出现尺寸不刚好的问题。我使用PLA打印时,长设置为102%,宽为102%。 -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # HeatPlatform_SMT 2 | DIY个人分体式SMT平板加热台。ps:二代已经在开发中了 https://github.com/ClimbSnail/SuperHeat 3 | 4 | Github项目最新地址[链接](https://github.com/ClimbSnail/HeatPlatform_SMT) https://github.com/ClimbSnail/HeatPlatform_SMT 5 | 6 | Gitee地址(可能不是最新的)[链接](https://gitee.com/ClimbSnailQ/HeatPlatform_SMT) https://gitee.com/ClimbSnailQ/HeatPlatform_SMT 7 | 8 | Bilibli视频预览[链接](https://www.bilibili.com/video/BV1ky4y1m7ZF) https://www.bilibili.com/video/BV1ky4y1m7ZF 9 | 10 | ![HeatPlatform_Entity](https://gitee.com/ClimbSnailQ/Project_Image/raw/master/Note/HeatPlatform_Entity.jpg) 11 | 12 | ![HeatPlatform_Entity](Image/HeatPlatform_Entity.jpg) 13 | 14 | 15 | ##### 免责声明 16 | 由于本项目涉及AC220电压,谨慎触碰可控硅附件的走线,只建议有经验的伙伴制作。本人不负责任何由于本项目所引发的安全问题。 17 | 18 | ### 项目起因 19 | 20 | 平板加热台可以方便手工对PCB进行贴片焊接。本人是一名北漂软件工程师,同时也是一名电子爱好者,为了搬家时方便,工具的选择总是偏向于便捷化。网络上成品的平板加热台往往较为厚重,故自己动手实现一台。 21 | 22 | ### 交流群 23 | 添加这个qq群`148563337`,需要的朋友多的话,可以考虑一起做。 24 | 25 | ### 功能介绍 26 | 1. 使用PID控制算法,控制器的控温范围为室温~1000摄氏度。(实际温度上限需考虑加热台材料) 27 | 2. 目前稳定支持2000w功率的加热板。(可修改为支持更大功率的) 28 | 3. 屏幕使用0.96寸的OLED(SSD1306)液晶显示屏。 29 | 4. 使用旋转编码器代替按键式操作,提高用户体验。 30 | 5. 支持温度曲线的控制。(即将支持) 31 | 32 | ### 工程包含 33 | 1. B站全套自作教程(等待更新)。Bilibli视频[链接](https://www.bilibili.com/video/BV1ky4y1m7ZF) https://www.bilibili.com/video/BV1ky4y1m7ZF 34 | 2. 基于ESP8266的温控系统。 35 | 3. 控温系统的硬件控制电路。 36 | 4. 控制器的外壳3D结构图。 37 | 5. 一键刷机工具。 38 | 39 | 40 | # ESP8266温控器 41 | 42 | ![HeatPlatform_PCB](https://gitee.com/ClimbSnailQ/Project_Image/raw/master/Note/HeatPlatform_PCB.jpg) 43 | 44 | ![HeatPlatform_PCB](Image/HeatPlatform_PCB.jpg) 45 | 46 | ![HeatPlatform_PCB_Back](https://gitee.com/ClimbSnailQ/Project_Image/raw/master/Note/HeatPlatform_PCB_Back.jpg) 47 | 48 | ![HeatPlatform_PCB_Back](Image/HeatPlatform_PCB_Back.jpg) 49 | 50 | 1. 总体使用AC220的铝加热板。控温器的温度范围是室温~1000摄氏度,当前铝加热板最好不要超过400度。 51 | 2. 主控使用的是ESP8266-12F。 52 | 3. 使用MAX6675驱动K型热电偶。 53 | 4. 使用PID控制算法控制双向可控硅的导通状态。 54 | 5. 使用5脚的EC11旋转编码器作为用户操作的按钮。 55 | 56 | ### 硬件设计要点 57 | 1. 天线附近要保持足够的净空区,否则影响天线的性能。 58 | 2. bootloader启动加载程序时,GPIO0为低电平,则进入固件烧录模式。 59 | 3. 正常启动时,GPIO0高、GPIO2高、GPIO15低、EN高、RST高。 60 | 4. GPIO16不支持中断、PWM、I2C以及One-Wire功能,只能作为普通的输入、输出端口。 61 | 5. 光耦的输入触发信号电流要大于5ma,不然光耦的输出端将不能导通。 62 | 6. 光耦信号的输出端要接可控硅的1脚。 63 | 64 | 65 | ### 控制器安装说明 66 | 1. 热电偶选择K型,最好选择带金属外皮的。 67 | 2. 加热台推荐使用铝加热台(纯电阻稳定)。 68 | 3. 航空头推荐使用GX16-8的(GX12安全间距不够,8脚是为了后期升级准备)。 69 | 4. `AC220`标识的接口连接AC220V的市电。不分零线火线(建议靠外侧的焊盘接火线)。 70 | 5. `HOT`是连接加热板的接口,随意接,不分正负。 71 | 6. `K`为连接K型热电偶的接口,靠近`AMS1117`稳压芯片那端为负极,改处也是同时用来接地使用(也可不接地)。 72 | 7. 航空头接线标准推荐。 73 | * 2、8脚接GND。 74 | * 1脚接热电偶正极。 75 | * 3、4目前留空。 76 | * 5目前留空。 77 | * 6、7接加热板供电线。 78 | 79 | ### 固件刷写 80 | 1. 使用USB-TTL下载器链接板子的下载接口(已标识引脚,RXD TXD需要反接)。 81 | 2. 本工程附送"一键刷机工具",双击工具无需任何操作即可刷机。 82 | 83 | 注:旧版的micropython版本的刷机参考`Software`目录下的`README.md` 84 | 85 | ### 操作说明 86 | 在加热台控制界面长按旋转编码器按钮1秒(实际可能要2s),即可进入设置界面。设置界面长按旋钮1s即可退回加热控制界面。 87 | 88 | 在设置界面中:"空心三角形"为未选中,此时可以切换设置项,按下旋钮即变成选中状态。"实心三角形"未选中状态,可对通过旋钮对选中的设置项进行设置,按下即为"取消选中"。 89 | 90 | ``` 91 | 设置界面参数详解: 92 | ST: 开机后的默认"目标温度",默认值为20 93 | 94 | MD: 模式(预留给后期版本固件使用) 95 | 96 | DC: 名为"Encoder direction"旋转编码器的方向。0为默认方向,1为方向。 97 | 98 | ET: 名为"Error Temperature"实际与显示的温度差,校准时使用。 99 | ET = 读取的温度-实际真实温度,ET校准时请设置为0, 100 | 然后开启后观察屏幕的温度(读取的温度),在加热状态下 真实温度就等于室温(实际真实温度),进而求得ET,然后设置。 101 | 102 | OT: 名为"Overflow Temperature"检测到的温度超出设置温度多少度时报警。 103 | 常规值都为正数,当然也可以为负数。 104 | 105 | Ptv: 名为"PID Value"PID接近设定值多少度时开始调控。 106 | PTC加热板建议设置成10(度),普通铝板设置为3(度)。 107 | 注:通常值设定与PID参数相关。 108 | 109 | Kp: PID的p参数。步进为0.1,最大值为9.9,且不能设置为负数。 110 | Ki: PID的i参数。步进为0.1,最大值为9.9,且不能设置为负数。 111 | Kd: PID的d参数。步进为0.1,最大值为9.9,且不能设置为负数。 112 | Kt: PID的t参数,表示PID的控制周期(秒)。步进为0.1,最大值为9.9,且不能设置为负数。 113 | 114 | DF: 名为"Default",表示默认值,短按即可将参数恢复到固件默认设置。 115 | 116 | SR: 名为"Save and Reset"保存并重启,短按该项,加热台立即进入重启状态(大约1s后重启), 117 | 所有当前页面的设置参数将会被保存。 118 | ``` 119 | 120 | ### 资料 121 | [PID动画演示](https://rossning92.github.io/pid-simulation/) -------------------------------------------------------------------------------- /Software/Firmware/esp8266-20210202-v1.14.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Software/Firmware/esp8266-20210202-v1.14.bin -------------------------------------------------------------------------------- /Software/README.md: -------------------------------------------------------------------------------- 1 | ### 固件刷写 2 | 3 | ##### 完全刷写 4 | 1. 使用USB-TTL下载器链接板子的下载接口(已标识引脚,RXD TXD需要反接)。 5 | 2. `uPyCraft`是代码编写工具,同时也是固件刷写工具,打开`uPyCraft`工具,会提示安装字体(随意安装就行)。 6 | 3. 打开软件后,选择工具栏`Tools`->`BurnFirmware`,打开固件烧录的提示框。 7 | * `board`选择`esp8266` 8 | * `burn_addr`保持默认 9 | * `erase_flash`可以选择`yes` 10 | * `com`选择你TTL下载器的`com口` 11 | * `Firmware_Choose`中选择`Users`,然后点击`Choose`去选择`Firmware`文件夹中找后缀名为`bin`的固件。 12 | 4. 点击`OK`后,弹出刷写固件的页面。 13 | 5. 可以看到进度条始终不动。这时按住控制板上的旋钮,接着按下`RST`键(之后松开),紧接着松开刚刚按住的旋钮。这时候可以看到`EraseFlash`进度条开始变化了。 14 | 6. 等`EraseFlash`进度条走完,会发现`Burn`进度条卡住了,这时候再按住旋钮,然后再按一下`RST`松开,之后再松开旋钮按键,等进度条走完就刷写成功了。 15 | 7. 选择`Tools`->`Serial`中下载器对应的端口之后,下方输出区出现`>>`就表示`uPyCraft`工具自动连接了我们的控制器,即表示第6步的固件刷写过程是成功的。 16 | 8. 上传代码文件:双击`uPyCraft`工具左侧的`workSpace`文件夹(第一次),会让选择一个文件夹,这时我们浏览到`Software`文件夹的上级目录就行。随后点击`File`->`reflush`刷新下左侧的文件目录。再次点开`workSpace`就可以看到`Software`里的程序文件了。 17 | 9. 双击打开任意除`main.py`外的文件,点击`Tools`->`Download`,若上传成功 可以在下方的输出区看到`download ok`字样。重复此过程,使`Software`中的文件依次上传。 18 | 10. `uPyCraft`工具左侧的`device`目录中显示的是当前控制器中已有的程序,由此可以判断文件是否上传成功。在等到上传结束,最后再上传`main.py`的文件。 19 | 11. 完成。控制板接上铝加热板就可以工作了。当然不需要铝加热板也可以简单接上oled屏幕,重新上电或者按下RST复位,看oled是否正常显示。 20 | 21 | ##### 更新程序 22 | 更新程序是建立在之前进行过_"固件刷写"_操作。 23 | 24 | 按住控制器上的`MODE`按键,然后按下`RST`松开,`MODE`按键需等待背部ESP8266的指示灯常亮`(5-7s)`左右再松开,控制器即可进入程序更新模式。可跳过前6步骤,直接从第7步开始 更新想要更新的程序文件。 25 | 26 | 27 | ### 在线更新固件脚本(在计划中) 28 | 1. 使用webrepl进行更新固件(双击webrepl工具里的"webrepl.html") 29 | 2. [链接](ws://192.168.4.1:8266/) ws://192.168.4.1:8266/(链接加热控制器的wifi后方可链接) 30 | 3. 密码预设为`88888888`(在config.json文件中已注明) 31 | 32 | 33 | ### 学习资料传送门 34 | 1. [教程 in Github](https://github.com/lvidarte/esp8266/wiki) 35 | 2. [ESP8266固件](http://micropython.org/download#esp8266) 36 | 3. [uPyCraft IDE](http://docs.dfrobot.com.cn/upycraft/) 37 | 4. [官方参考文档](https://docs.micropython.org/en/latest/esp8266/quickref.html#pins-and-gpio) 38 | 5. [MicroPython API](https://makeblock-micropython-api.readthedocs.io/zh/latest/library/) 39 | 40 | -------------------------------------------------------------------------------- /Software/config.json: -------------------------------------------------------------------------------- 1 | {"sta-password": "orangepi", "sta-essid": "orangepi", "ap-password": "", "ap-essid": "Heat_Platform", "webrepl-password": "88888888"} 2 | 3 | -------------------------------------------------------------------------------- /Software/font.py: -------------------------------------------------------------------------------- 1 | # RunImage = b"\x00\x80\xC0\xE0\xF8\xFF\xFE\xFC\x70\x00\x00\xC0\x80\x00\x00\x00\x00\x1F\x3F\x7F\x9F\x07\x03\xE1\xF0\xF8\xFE\xFF\xFF\x7F\x3C\x00" 2 | # HeatImage = b"\x00\xC0\xE0\xB8\x88\x88\x88\x88\x88\x88\x88\xC8\x78\x18\x08\x00\x00\x30\x38\x2E\x22\x22\x22\x22\x22\x22\x32\x1A\x0E\x02\x00\x00" 3 | # CurveImage = b"\x00\x00\x00\x80\xC0\x30\x30\xE0\x00\x00\x80\xC0\x60\x30\x0C\x06\x1C\x06\x03\x01\x00\x00\x00\x01\x07\x07\x01\x00\x00\x00\x00\x00" 4 | # SettingImage = b"\x80\xC0\xDC\xFC\xFC\x38\x1E\x1F\x1F\x1E\x38\xFC\xFC\xDC\xC0\x80\x01\x03\x3B\x3F\x3F\x1C\x78\xF8\xF8\x78\x1C\x3F\x3F\x3B\x03\x01" 5 | # HeatingImage = b"\x00\x00\x88\x54\x22\x00\x00\xFE\xFE\x00\x00\x22\x54\x88\x00\x00\x00\x00\x08\x15\x22\x00\x00\x7F\x7F\x00\x00\x22\x15\x08\x00\x00" 6 | # PIDImage = b"\x00\x08\x1C\x14\x1C\x08\x08\x08\x08\x08\x08\x88\x88\x88\x08\x00\x00\x11\x39\x29\x39\x11\x11\x11\x11\x11\x11\x13\x12\x13\x11\x00" 7 | # BackImage = b"\x00\x00\x00\x00\x80\xC0\xE0\x70\x70\xFE\xFC\xF8\x70\x20\x00\x00\x00\x30\x1C\x07\x03\x01\x00\x00\x00\x03\x01\x00\x00\x00\x00\x00" 8 | # KnobsImage = b"\x00\x00\x30\xF8\x08\x08\xCC\x4C\x4C\xCC\x08\x08\xF8\x30\x00\x00\x00\x00\x0C\x1F\x10\x10\x33\x32\x32\x33\x10\x10\x1F\x0C\x00\x00" 9 | # InfoImage = b"\x00\x00\x00\x18\x30\x60\xC0\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18\x0C\x06\x33\x31\x30\x30\x30\x30\x30\x30\x00\x00" 10 | # UnCursorImage_8x8 = b"\xFF\xC3\x42\x66\x24\x3C\x18\x18" 11 | # CursorImage_8x8 = b"\xFF\xFF\x7E\x7E\x3C\x3C\x18\x18" 12 | 13 | bytearray = [b'\x00\xE0\x10\x08\x08\x10\xE0\x00\x00\x0F\x10\x20\x20\x10\x0F\x00', #0 14 | b'\x00\x00\x10\x10\xF8\x00\x00\x00\x00\x00\x20\x20\x3F\x20\x20\x00', 15 | b'\x00\x70\x08\x08\x08\x08\xF0\x00\x00\x30\x28\x24\x22\x21\x30\x00', 16 | b'\x00\x30\x08\x08\x08\x88\x70\x00\x00\x18\x20\x21\x21\x22\x1C\x00', 17 | b'\x00\x00\x80\x40\x30\xF8\x00\x00\x00\x06\x05\x24\x24\x3F\x24\x24', 18 | b'\x00\xF8\x88\x88\x88\x08\x08\x00\x00\x19\x20\x20\x20\x11\x0E\x00', 19 | b'\x00\xE0\x10\x88\x88\x90\x00\x00\x00\x0F\x11\x20\x20\x20\x1F\x00', 20 | b'\x00\x18\x08\x08\x88\x68\x18\x00\x00\x00\x00\x3E\x01\x00\x00\x00', 21 | b'\x00\x70\x88\x08\x08\x88\x70\x00\x00\x1C\x22\x21\x21\x22\x1C\x00', 22 | b'\x00\xF0\x08\x08\x08\x10\xE0\x00\x00\x01\x12\x22\x22\x11\x0F\x00', #9 23 | b'\x08\x18\x68\x80\x80\x68\x18\x08\x20\x30\x2C\x03\x03\x2C\x30\x20', #X 24 | b'\x00\x00\x00\xF8\x00\x00\x00\x00\x00\x00\x00\x33\x00\x00\x00\x00' #! 25 | ] 26 | -------------------------------------------------------------------------------- /Software/knobs.py: -------------------------------------------------------------------------------- 1 | from machine import Pin 2 | import gc 3 | import time 4 | 5 | """ 6 | 开关编码器功能文件 7 | """ 8 | 9 | """ 10 | 外部中断mode: 11 | Pin.IN 输入 12 | Pin.OUT 输出 13 | value:输出电平 14 | Pin.value([value])不带参数时是读取输入电平,带参数时是设置输出电平,参数是1/0. 15 | Pin.irq(*,trigger, handler=None) 16 | 中断irq接口 17 | trigger,触发方式(不指定 默认为上升下降沿) 18 | Pin.IRQ_FALLING,下降沿 19 | Pin.IRQ_RISING,上升沿 20 | Pin.IRQ_RISING | Pin.IRQ_FALLING,上升下降沿 21 | handler,回调函数 22 | """ 23 | 24 | 25 | class EC11: 26 | def __init__(self, pinA_num, pinB_num, pinSw_num=None): 27 | """ 28 | 编码器类的初始化 注:在大多数情况下,只能使用引脚0、2、4、5、12、13、14、15和16 29 | :param pinA_num: 接收编码器脉冲的引脚A 30 | :param pinB_num: 接收编码器脉冲的引脚B 31 | :param pinSw_num: 按键触发的引脚(此为可选参数) 32 | """ 33 | self.pinA_Status = 0 34 | self.pinB_Status = 0 35 | self.pulse_count = 0 36 | self.switch_status = 0 37 | 38 | # self.cnt_value = 0 # 编码器距离上一轮的脉冲增量 39 | self.pinA = Pin(pinA_num, Pin.IN, Pin.PULL_UP) 40 | self.pinA.irq(trigger=Pin.IRQ_RISING | Pin.IRQ_FALLING, 41 | handler=self.interruter_funcA) 42 | self.pinB = Pin(pinB_num, Pin.IN, Pin.PULL_UP) 43 | self.pinSw = None 44 | if pinSw_num != None: 45 | self.pinSw = Pin(pinSw_num, Pin.IN, Pin.PULL_UP) 46 | self.pinSw.irq(trigger=Pin.IRQ_FALLING, 47 | handler=self.interruter_funcSW) 48 | gc.collect() 49 | 50 | def interruter_funcA(self, events): 51 | """ 52 | 发生外部中断后执行的函数 53 | :return: 54 | """ 55 | cnt = 0 56 | while self.pinA.value() and cnt < 5: 57 | cnt += 1 58 | if self.pinA.value() == 1: 59 | return None 60 | 61 | if self.pinB.value() == 1: 62 | self.pulse_count += 1 63 | else: 64 | self.pulse_count -= 1 65 | 66 | gc.collect() 67 | 68 | def interruter_funcSW(self, events): 69 | """ 70 | 发生外部中断后执行的函数 71 | :return: 72 | """ 73 | self.switch_status = 1 74 | 75 | def get_data(self): 76 | """ 77 | 获取本次检测到的脉冲数量 78 | :return: 距离上一次获取所产生的脉冲数、按键状态 79 | """ 80 | pulse = self.pulse_count 81 | self.pulse_count = 0 # clear 82 | sw_status = self.switch_status 83 | self.switch_status = 0 # clear 84 | gc.collect() 85 | return pulse, sw_status 86 | 87 | 88 | """ 89 | This is demo 90 | """ 91 | 92 | 93 | def main(): 94 | import gc 95 | gc.collect() 96 | knobs = EC11(4, 5, 0) 97 | import time 98 | while True: 99 | print(knobs.get_data()) 100 | time.sleep(0.2) 101 | 102 | 103 | if __name__ == "test": 104 | # if __name__ == '__main__': 105 | main() 106 | -------------------------------------------------------------------------------- /Software/max6675.py: -------------------------------------------------------------------------------- 1 | """ 2 | 热电偶测温 3 | """ 4 | 5 | from machine import SPI, Pin 6 | import time 7 | import gc 8 | 9 | MAX6675_CONNECT = 0x04 10 | 11 | # SPI API 12 | # SPI.read(len, data=0x00) # 读取len个数据的同时写入len个data数据,以数组的形式返回读取到的数据。 13 | # SPI.readinto(buf, data=0x00) # 读取buf.len个数据并存入buf中,同时写入buf.len个data数据,函数返回None。 14 | # SPI.write(buf) # 将 buf 中的所有数据写入到总线。 15 | # SPI.write_readinto(write_buf, read_buf) # 写入write_buf并读取到 read_buf,写入并读取的长度为buf长度,要求两个缓冲区长度相同。 16 | 17 | 18 | class MAX6675: 19 | def __init__(self, sck, mosi, miso, cs): 20 | ''' 21 | self.spi = SPI(1, baudrate=200000, polarity=0, phase=0) 22 | self.spi.init(baudrate=200000) # set the baudrate 23 | # (SPI(0) 仅用于内部的 FlashROM。) 24 | ''' 25 | self.cs = cs 26 | self.cs.on() # 使能引脚拉高self.cs = cs 27 | self.spi = SPI(1, baudrate=100000, polarity=1, phase=0) 28 | # self.spi = SPI(-1, baudrate=1000000, polarity=1, 29 | # phase=0, sck=sck, mosi=mosi, miso=miso) 30 | self.connect = False 31 | 32 | def read_temperature(self, ): 33 | """ 34 | 读取一次温度(摄氏度),读取错误或者热电偶异常均返回4095 35 | """ 36 | self.cs.off() # CS引脚检测到下降沿后停止转换。随后在sck时钟控制下输出16位数据 37 | value = self.spi.read(2) # 读取两个字节 38 | self.cs.on() 39 | 40 | temp = value[0] << 8 | value[1] 41 | self.connect = True if (temp & MAX6675_CONNECT) == 0 else False 42 | gc.collect() 43 | if self.connect == True: # 没检测到电热偶 44 | return ((temp & 0x7FFF) >> 3) >> 2 # 测得的温度单位是0.25,所以要乘以0.25(即除以4) 45 | else: 46 | return 4095 47 | 48 | def __del__(self, ): 49 | self.spi.deinit() # 关闭spi 50 | 51 | 52 | def main(): 53 | import gc 54 | gc.collect() 55 | max6675 = MAX6675(Pin(0), Pin(2), Pin(13), Pin(16, Pin.OUT)) 56 | while True: 57 | val = max6675.read_temperature() 58 | print(val) 59 | time.sleep(1) 60 | 61 | 62 | """ 63 | This is demo 64 | """ 65 | if __name__ == "test": 66 | # if __name__ == "__main__": 67 | main() 68 | -------------------------------------------------------------------------------- /Software/pid.py: -------------------------------------------------------------------------------- 1 | import gc 2 | 3 | 4 | class PID: 5 | def __init__(self, Kp, Ki, Kd, Dt): 6 | """ 7 | PID类的初始化并传递必要的参数 8 | :param Kp: 比例参数 浮点数 9 | :param Ki: 积分参数 浮点数 10 | :param Kd: 微分参数 浮点数 11 | :param Dt: PID调节周期 浮点数(s) 12 | """ 13 | self.Kp = Kp 14 | self.Ki = Ki 15 | self.Kd = Kd 16 | self.Dt = Dt 17 | self.previous_error = 0 18 | self.integral = 0 19 | 20 | def set_pidparam(self, Kp, Ki, Kd, Dt): 21 | """ 22 | 控制过程中PID参数的设定 23 | :param Kp: 比例参数 浮点数 24 | :param Ki: 积分参数 浮点数 25 | :param Kd: 微分参数 浮点数 26 | :param Dt: PID调节周期 浮点数(s) 27 | :return: None 28 | """ 29 | self.Kp = Kp 30 | self.Ki = Ki 31 | self.Kd = Kd 32 | self.Dt = Dt 33 | 34 | def set_data(self, pre_error, integral=0): 35 | """ 36 | 清空数据 37 | """ 38 | self.previous_error = pre_error 39 | self.integral = integral 40 | 41 | def get_output(self, target_value, now_value): 42 | """ 43 | 获取将要调节的控制量 44 | :param target_value: 目标值 45 | :param now_value: 当前监测到的值 46 | :return: 调节量 47 | """ 48 | error = target_value - now_value 49 | self.integral = self.integral + error * self.Dt 50 | derivative = (error - self.previous_error) / self.Dt 51 | output = self.Kp*error + self.Ki*self.integral + self.Kd*derivative 52 | self.previous_error = error 53 | gc.collect() 54 | return output 55 | 56 | def __del__(self, ): 57 | pass 58 | 59 | 60 | class Auto_PID(PID): 61 | pass 62 | 63 | 64 | """ 65 | This is demo 66 | """ 67 | 68 | 69 | def main(): 70 | import gc 71 | gc.collect() 72 | from machine import Timer 73 | 74 | pid_contorller = PID(0.1, 0.1, 0.1, 0.01) 75 | 76 | tim = Timer(-1) 77 | # mode: Timer.ONE_SHOT / Timer.PERIODIC 78 | tim.init(period=2000, mode=Timer.PERIODIC, callback=lambda t: print(2)) 79 | while True: 80 | output_val = pid_contorller.get_output(100, 200) 81 | 82 | 83 | if __name__ == "test": 84 | # if __name__ == '__main__': 85 | main() 86 | -------------------------------------------------------------------------------- /Software/wifi.py: -------------------------------------------------------------------------------- 1 | import network 2 | import time 3 | import gc 4 | 5 | 6 | class WifiController(object): 7 | 8 | def __init__(self): 9 | self.__wlan = network.WLAN(network.STA_IF) 10 | self.__ap = None 11 | 12 | def do_sta(self, sta_id, sta_passwd): 13 | """ 14 | 连接wifi 15 | :param sta_id: wifi的名称 16 | :param sta_passwd: wifi的密码 17 | :return: True成功 False失败 18 | """ 19 | # 以下为正常的WIFI连接流程 20 | self.__wlan.active(True) 21 | if self.__wlan.isconnected(): 22 | self.__wlan.disconnect() 23 | if not self.__wlan.isconnected(): 24 | print('WifiController:connecting to network...') 25 | # self.__wlan.active(False) 26 | self.__wlan.connect(sta_id, sta_passwd) 27 | import time 28 | time.sleep(10) # 一般睡个5-10秒,应该绰绰有余 29 | 30 | if not self.__wlan.isconnected(): 31 | self.__wlan.active(False) # 关掉连接,免得repl死循环输出 32 | print('WifiController:wifi connection error, please reconnect') 33 | return False 34 | else: 35 | print('WifiController:wifi config:', self.__wlan.ifconfig()) 36 | return True 37 | 38 | def close_sta(self): 39 | self.__wlan.disconnect() 40 | self.__wlan.active(False) 41 | 42 | def create_ap(self, ap_id, ap_passwd=""): 43 | """ 44 | 打开AP模式,并创建 45 | :param ap_id: AP的名称 46 | :param ap_passwd: AP的连接密码(可以为空字符串) 47 | :return: True 48 | """ 49 | import network 50 | if self.__ap == None: 51 | # create access-point interface 52 | self.__ap = network.WLAN(network.AP_IF) 53 | 54 | print('WifiController:AP config:', self.__ap.config("essid")) 55 | self.__ap.active(True) 56 | """ 57 | AUTH_OPEN -- 0 58 | AUTH_WEP -- 1 59 | AUTH_WPA_PSK -- 2 60 | AUTH_WPA2_PSK -- 3 61 | AUTH_WPA_WPA2_PSK -- 4 62 | """ 63 | # 先进行一次认证方式的修改,缺少这一步后面修改将会不生效 64 | self.__ap.config(essid=ap_id, authmode=network.AUTH_WPA2_PSK) 65 | # self.__ap.config(password=ap_passwd) 66 | if ap_passwd.strip() == "": 67 | self.__ap.config(essid=ap_id, authmode=network.AUTH_OPEN) 68 | else: 69 | self.__ap.config( 70 | essid=ap_id, authmode=network.AUTH_WPA_WPA2_PSK, password=ap_passwd) 71 | print('WifiController:AP config:', self.__ap.ifconfig()) 72 | print('WifiController:AP config:', self.__ap.config("essid")) 73 | # gc.collect() 74 | return True 75 | 76 | def close_ap(self): 77 | self.__ap.active(False) 78 | 79 | def get_valid_bs_list(self, bs_list): 80 | """ 81 | 传入欲判断有无效的WiFi名称列表 82 | :param bs_list: WiFi名称列表 83 | :return: 有效的wifi列表 84 | """ 85 | self.__wlan.active(True) 86 | valid_bs_list = [] 87 | search_tuple = self.__wlan.scan() # scan for access points 88 | #search_list = [ str(each[0], encoding = "utf-8") for each in search_tuple] 89 | search_list = [each[0].decode() for each in search_tuple] 90 | print(search_list) 91 | for bs in bs_list: 92 | if bs in search_list: 93 | valid_bs_list.append(bs) 94 | gc.collect() 95 | return valid_bs_list 96 | 97 | 98 | """ 99 | This is demo 100 | """ 101 | 102 | 103 | def main(): 104 | wifi = WifiController() 105 | ret = wifi.get_valid_bs_list(["orangepi"]) 106 | print(ret) 107 | #ret = wifi.do_sta("Test", "88888888") 108 | ret = wifi.do_sta("orangepi", "orangepi") 109 | if ret == True: 110 | print("do_sta succ") 111 | wifi.close_sta() 112 | ret = wifi.create_ap("Heat_Platform", "") 113 | if ret == True: 114 | print("do_ap succ") 115 | wifi.close_ap() 116 | while True: 117 | time.sleep(1) 118 | 119 | 120 | if __name__ == "test": 121 | # if __name__ == '__main__': 122 | main() 123 | -------------------------------------------------------------------------------- /Software_C/.gitignore: -------------------------------------------------------------------------------- 1 | .pio 2 | .vscode/.browse.c_cpp.db* 3 | .vscode/c_cpp_properties.json 4 | .vscode/launch.json 5 | .vscode/ipch 6 | -------------------------------------------------------------------------------- /Software_C/README.md: -------------------------------------------------------------------------------- 1 | #### 参考资料 2 | ###### EC11编码器 3 | https://www.geek-workshop.com/thread-28165-1-1.html 4 | 5 | ###### 定时器 6 | https://github.com/khoih-prog/TimerInterrupt_Generic 7 | 8 | https://github.com/khoih-prog/ESP8266TimerInterrupt 9 | 10 | 11 | ##### 打包刷机工具 12 | `pyinstaller -F HeatPlatform_tool.py` -------------------------------------------------------------------------------- /Software_C/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 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit-GFX-Library/.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Thank you for opening an issue on an Adafruit Arduino library repository. To 2 | improve the speed of resolution please review the following guidelines and 3 | common troubleshooting steps below before creating the issue: 4 | 5 | - **Do not use GitHub issues for troubleshooting projects and issues.** Instead use 6 | the forums at http://forums.adafruit.com to ask questions and troubleshoot why 7 | something isn't working as expected. In many cases the problem is a common issue 8 | that you will more quickly receive help from the forum community. GitHub issues 9 | are meant for known defects in the code. If you don't know if there is a defect 10 | in the code then start with troubleshooting on the forum first. 11 | 12 | - **If following a tutorial or guide be sure you didn't miss a step.** Carefully 13 | check all of the steps and commands to run have been followed. Consult the 14 | forum if you're unsure or have questions about steps in a guide/tutorial. 15 | 16 | - **For Arduino projects check these very common issues to ensure they don't apply**: 17 | 18 | - For uploading sketches or communicating with the board make sure you're using 19 | a **USB data cable** and **not** a **USB charge-only cable**. It is sometimes 20 | very hard to tell the difference between a data and charge cable! Try using the 21 | cable with other devices or swapping to another cable to confirm it is not 22 | the problem. 23 | 24 | - **Be sure you are supplying adequate power to the board.** Check the specs of 25 | your board and plug in an external power supply. In many cases just 26 | plugging a board into your computer is not enough to power it and other 27 | peripherals. 28 | 29 | - **Double check all soldering joints and connections.** Flakey connections 30 | cause many mysterious problems. See the [guide to excellent soldering](https://learn.adafruit.com/adafruit-guide-excellent-soldering/tools) for examples of good solder joints. 31 | 32 | - **Ensure you are using an official Arduino or Adafruit board.** We can't 33 | guarantee a clone board will have the same functionality and work as expected 34 | with this code and don't support them. 35 | 36 | If you're sure this issue is a defect in the code and checked the steps above 37 | please fill in the following fields to provide enough troubleshooting information. 38 | You may delete the guideline and text above to just leave the following details: 39 | 40 | - Arduino board: **INSERT ARDUINO BOARD NAME/TYPE HERE** 41 | 42 | - Arduino IDE version (found in Arduino -> About Arduino menu): **INSERT ARDUINO 43 | VERSION HERE** 44 | 45 | - List the steps to reproduce the problem below (if possible attach a sketch or 46 | copy the sketch code in too): **LIST REPRO STEPS BELOW** 47 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit-GFX-Library/.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Thank you for creating a pull request to contribute to Adafruit's GitHub code! 2 | Before you open the request please review the following guidelines and tips to 3 | help it be more easily integrated: 4 | 5 | - **Describe the scope of your change--i.e. what the change does and what parts 6 | of the code were modified.** This will help us understand any risks of integrating 7 | the code. 8 | 9 | - **Describe any known limitations with your change.** For example if the change 10 | doesn't apply to a supported platform of the library please mention it. 11 | 12 | - **Please run any tests or examples that can exercise your modified code.** We 13 | strive to not break users of the code and running tests/examples helps with this 14 | process. 15 | 16 | Thank you again for contributing! We will try to test and integrate the change 17 | as soon as we can, but be aware we have many GitHub repositories to manage and 18 | can't immediately respond to every request. There is no need to bump or check in 19 | on a pull request (it will clutter the discussion of the request). 20 | 21 | Also don't be worried if the request is closed or not integrated--sometimes the 22 | priorities of Adafruit's GitHub code (education, ease of use) might not match the 23 | priorities of the pull request. Don't fret, the open source community thrives on 24 | forks and GitHub makes it easy to keep your changes in a forked repo. 25 | 26 | After reviewing the guidelines above you can delete this text from the pull request. 27 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit-GFX-Library/.github/workflows/githubci.yml: -------------------------------------------------------------------------------- 1 | name: Arduino Library CI 2 | 3 | on: [pull_request, push, repository_dispatch] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | 9 | steps: 10 | - uses: actions/setup-python@v1 11 | with: 12 | python-version: '3.x' 13 | - uses: actions/checkout@v2 14 | - uses: actions/checkout@v2 15 | with: 16 | repository: adafruit/ci-arduino 17 | path: ci 18 | 19 | - name: pre-install 20 | run: bash ci/actions_install.sh 21 | 22 | - name: extra libraries 23 | run: | 24 | git clone --quiet https://github.com/adafruit/Adafruit_ILI9341.git /home/runner/Arduino/libraries/Adafruit_ILI9341 25 | 26 | - name: test platforms 27 | run: python3 ci/build_platform.py main_platforms 28 | 29 | - name: clang 30 | run: python3 ci/run-clang-format.py -e "ci/*" -e "bin/*" -r . 31 | 32 | - name: doxygen 33 | env: 34 | GH_REPO_TOKEN: ${{ secrets.GH_REPO_TOKEN }} 35 | PRETTYNAME : "Adafruit GFX Library" 36 | run: bash ci/doxy_gen_and_deploy.sh 37 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit-GFX-Library/.gitignore: -------------------------------------------------------------------------------- 1 | default.vim 2 | fontconvert/fontconvert 3 | # Our handy .gitignore for automation ease 4 | Doxyfile* 5 | doxygen_sqlite3.db 6 | html -------------------------------------------------------------------------------- /Software_C/lib/Adafruit-GFX-Library/Adafruit_SPITFT_Macros.h: -------------------------------------------------------------------------------- 1 | // THIS FILE INTENTIONALLY LEFT BLANK. 2 | 3 | // Macros previously #defined here have been made into (mostly) inline 4 | // functions in the Adafruit_SPITFT class. Other libraries might still 5 | // contain code trying to #include this header file, so until everything's 6 | // updated this file still exists (but doing nothing) to avoid trouble. 7 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit-GFX-Library/README.md: -------------------------------------------------------------------------------- 1 | # Adafruit GFX Library ![Build Status](https://github.com/adafruit/Adafruit-GFX-Library/workflows/Arduino%20Library%20CI/badge.svg) 2 | 3 | This is the core graphics library for all our displays, providing a common set of graphics primitives (points, lines, circles, etc.). It needs to be paired with a hardware-specific library for each display device we carry (to handle the lower-level functions). 4 | 5 | Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit! 6 | 7 | Written by Limor Fried/Ladyada for Adafruit Industries. 8 | BSD license, check license.txt for more information. 9 | All text above must be included in any redistribution. 10 | 11 | Recent Arduino IDE releases include the Library Manager for easy installation. Otherwise, to download, click the DOWNLOAD ZIP button, uncompress and rename the uncompressed folder Adafruit_GFX. Confirm that the Adafruit_GFX folder contains Adafruit_GFX.cpp and Adafruit_GFX.h. Place the Adafruit_GFX library folder your ArduinoSketchFolder/Libraries/ folder. You may need to create the Libraries subfolder if its your first library. Restart the IDE. 12 | 13 | **You will also need to install the latest Adafruit BusIO library.** Search for "Adafruit BusIO" in the library manager, or install by hand from https://github.com/adafruit/Adafruit_BusIO 14 | 15 | # Useful Resources 16 | 17 | - Image2Code: This is a handy Java GUI utility to convert a BMP file into the array code necessary to display the image with the drawBitmap function. Check out the code at ehubin's GitHub repository: https://github.com/ehubin/Adafruit-GFX-Library/tree/master/Img2Code 18 | 19 | - drawXBitmap function: You can use the GIMP photo editor to save a .xbm file and use the array saved in the file to draw a bitmap with the drawXBitmap function. See the pull request here for more details: https://github.com/adafruit/Adafruit-GFX-Library/pull/31 20 | 21 | - 'Fonts' folder contains bitmap fonts for use with recent (1.1 and later) Adafruit_GFX. To use a font in your Arduino sketch, \#include the corresponding .h file and pass address of GFXfont struct to setFont(). Pass NULL to revert to 'classic' fixed-space bitmap font. 22 | 23 | - 'fontconvert' folder contains a command-line tool for converting TTF fonts to Adafruit_GFX header format. 24 | 25 | - You can also use [this GFX Font Customiser tool](https://github.com/tchapi/Adafruit-GFX-Font-Customiser) (_web version [here](https://tchapi.github.io/Adafruit-GFX-Font-Customiser/)_) to customize or correct the output from [fontconvert](https://github.com/adafruit/Adafruit-GFX-Library/tree/master/fontconvert), and create fonts with only a subset of characters to optimize size. 26 | 27 | --- 28 | 29 | ### Roadmap 30 | 31 | The PRIME DIRECTIVE is to maintain backward compatibility with existing Arduino sketches -- many are hosted elsewhere and don't track changes here, some are in print and can never be changed! This "little" library has grown organically over time and sometimes we paint ourselves into a design corner and just have to live with it or add ungainly workarounds. 32 | 33 | Highly unlikely to merge any changes for additional or incompatible font formats (see Prime Directive above). There are already two formats and the code is quite bloaty there as it is (this also creates liabilities for tools and documentation). If you *must* have a more sophisticated font format, consider creating a fork with the features required for your project. For similar reasons, also unlikely to add any more bitmap formats, it's getting messy. 34 | 35 | Please don't reformat code for the sake of reformatting code. The resulting large "visual diff" makes it impossible to untangle actual bug fixes from merely rearranged lines. 36 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit-GFX-Library/examples/GFXcanvas/GFXcanvasSerialDemo.cpp: -------------------------------------------------------------------------------- 1 | #include "GFXcanvasSerialDemo.h" 2 | #include 3 | 4 | GFXcanvas1SerialDemo::GFXcanvas1SerialDemo(uint16_t w, uint16_t h) 5 | : GFXcanvas1(w, h) {} 6 | 7 | void GFXcanvas1SerialDemo::print(bool rotated) { 8 | char pixel_buffer[8]; 9 | uint16_t width, height; 10 | 11 | if (rotated) { 12 | width = this->width(); 13 | height = this->height(); 14 | } else { 15 | width = this->WIDTH; 16 | height = this->HEIGHT; 17 | } 18 | 19 | for (uint16_t y = 0; y < height; y++) { 20 | for (uint16_t x = 0; x < width; x++) { 21 | bool pixel; 22 | if (rotated) { 23 | pixel = this->getPixel(x, y); 24 | } else { 25 | pixel = this->getRawPixel(x, y); 26 | } 27 | sprintf(pixel_buffer, " %d", pixel); 28 | Serial.print(pixel_buffer); 29 | } 30 | Serial.print("\n"); 31 | } 32 | } 33 | 34 | GFXcanvas8SerialDemo::GFXcanvas8SerialDemo(uint16_t w, uint16_t h) 35 | : GFXcanvas8(w, h) {} 36 | 37 | void GFXcanvas8SerialDemo::print(bool rotated) { 38 | char pixel_buffer[8]; 39 | uint16_t width, height; 40 | 41 | if (rotated) { 42 | width = this->width(); 43 | height = this->height(); 44 | } else { 45 | width = this->WIDTH; 46 | height = this->HEIGHT; 47 | } 48 | 49 | for (uint16_t y = 0; y < height; y++) { 50 | for (uint16_t x = 0; x < width; x++) { 51 | uint8_t pixel; 52 | if (rotated) { 53 | pixel = this->getPixel(x, y); 54 | } else { 55 | pixel = this->getRawPixel(x, y); 56 | } 57 | sprintf(pixel_buffer, " %02x", pixel); 58 | Serial.print(pixel_buffer); 59 | } 60 | Serial.print("\n"); 61 | } 62 | } 63 | 64 | GFXcanvas16SerialDemo::GFXcanvas16SerialDemo(uint16_t w, uint16_t h) 65 | : GFXcanvas16(w, h) {} 66 | 67 | void GFXcanvas16SerialDemo::print(bool rotated) { 68 | char pixel_buffer[8]; 69 | uint16_t width, height; 70 | 71 | if (rotated) { 72 | width = this->width(); 73 | height = this->height(); 74 | } else { 75 | width = this->WIDTH; 76 | height = this->HEIGHT; 77 | } 78 | 79 | for (uint16_t y = 0; y < height; y++) { 80 | for (uint16_t x = 0; x < width; x++) { 81 | uint16_t pixel; 82 | if (rotated) { 83 | pixel = this->getPixel(x, y); 84 | } else { 85 | pixel = this->getRawPixel(x, y); 86 | } 87 | sprintf(pixel_buffer, " %04x", pixel); 88 | Serial.print(pixel_buffer); 89 | } 90 | Serial.print("\n"); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit-GFX-Library/examples/GFXcanvas/GFXcanvasSerialDemo.h: -------------------------------------------------------------------------------- 1 | #ifndef __GFXcanvasSerialDemo__ 2 | #define __GFXcanvasSerialDemo__ 3 | #include 4 | 5 | /**********************************************************************/ 6 | /*! 7 | @brief Demonstrates using the GFXconvas classes as the backing store 8 | for a device driver. 9 | */ 10 | /**********************************************************************/ 11 | class GFXcanvas1SerialDemo : public GFXcanvas1 { 12 | public: 13 | GFXcanvas1SerialDemo(uint16_t w, uint16_t h); 14 | 15 | /**********************************************************************/ 16 | /*! 17 | @brief Prints the current contents of the canvas to Serial 18 | @param rotated true to print according to the current GFX rotation, 19 | false to print to the native rotation of the canvas (or unrotated). 20 | */ 21 | /**********************************************************************/ 22 | void print(bool rotated); 23 | }; 24 | 25 | /**********************************************************************/ 26 | /*! 27 | @brief Demonstrates using the GFXconvas classes as the backing store 28 | for a device driver. 29 | */ 30 | /**********************************************************************/ 31 | class GFXcanvas8SerialDemo : public GFXcanvas8 { 32 | public: 33 | GFXcanvas8SerialDemo(uint16_t w, uint16_t h); 34 | 35 | /**********************************************************************/ 36 | /*! 37 | @brief Prints the current contents of the canvas to Serial 38 | @param rotated true to print according to the current GFX rotation, 39 | false to print to the native rotation of the canvas (or unrotated). 40 | */ 41 | /**********************************************************************/ 42 | void print(bool rotated); 43 | }; 44 | 45 | /**********************************************************************/ 46 | /*! 47 | @brief Demonstrates using the GFXconvas classes as the backing store 48 | for a device driver. 49 | */ 50 | /**********************************************************************/ 51 | class GFXcanvas16SerialDemo : public GFXcanvas16 { 52 | public: 53 | GFXcanvas16SerialDemo(uint16_t w, uint16_t h); 54 | 55 | /**********************************************************************/ 56 | /*! 57 | @brief Prints the current contents of the canvas to Serial 58 | @param rotated true to print according to the current GFX rotation, 59 | false to print to the native rotation of the canvas (or unrotated). 60 | */ 61 | /**********************************************************************/ 62 | void print(bool rotated); 63 | }; 64 | 65 | #endif // __GFXcanvasSerialDemo__ 66 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit-GFX-Library/fontconvert/Makefile: -------------------------------------------------------------------------------- 1 | all: fontconvert 2 | 3 | CC = gcc 4 | CFLAGS = -Wall -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I/usr/include 5 | LIBS = -lfreetype 6 | 7 | fontconvert: fontconvert.c 8 | $(CC) $(CFLAGS) $< $(LIBS) -o $@ 9 | strip $@ 10 | 11 | clean: 12 | rm -f fontconvert 13 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit-GFX-Library/fontconvert/fontconvert_win.md: -------------------------------------------------------------------------------- 1 | ### A short guide to use fontconvert.c to create your own fonts using MinGW. 2 | 3 | #### STEP 1: INSTALL MinGW 4 | 5 | Install MinGW (Minimalist GNU for Windows) from [MinGW.org](http://www.mingw.org/). 6 | Please read carefully the instructions found on [Getting started page](http://www.mingw.org/wiki/Getting_Started). 7 | I suggest installing with the "Graphical User Interface Installer". 8 | To complete your initial installation you should further install some "packages". 9 | For our purpose you should only install the "Basic Setup" packages. 10 | To do that: 11 | 12 | 1. Open the MinGW Installation Manager 13 | 2. From the left panel click "Basic Setup". 14 | 3. On the right panel choose "mingw32-base", "mingw-gcc-g++", "mingw-gcc-objc" and "msys-base" 15 | and click "Mark for installation" 16 | 4. From the Menu click "Installation" and then "Apply changes". In the pop-up window select "Apply". 17 | 18 | 19 | #### STEP 2: INSTALL Freetype Library 20 | 21 | To read about the freetype project visit [freetype.org](https://www.freetype.org/). 22 | To Download the latest version of freetype go to [download page](http://download.savannah.gnu.org/releases/freetype/) 23 | and choose "freetype-2.7.tar.gz" file (or a newer version if available). 24 | To avoid long cd commands later in the command prompt, I suggest you unzip the file in the C:\ directory. 25 | (I also renamed the folder to "ft27") 26 | Before you build the library it's good to read these articles: 27 | * [Using MSYS with MinGW](http://www.mingw.org/wiki/MSYS) 28 | * [Installation and Use of Supplementary Libraries with MinGW](http://www.mingw.org/wiki/LibraryPathHOWTO) 29 | * [Include Path](http://www.mingw.org/wiki/IncludePathHOWTO) 30 | 31 | Inside the unzipped folder there is another folder named "docs". Open it and read the INSTALL.UNIX (using notepad). 32 | Pay attention to paragraph 3 (Build and Install the Library). So, let's begin the installation. 33 | To give the appropriate commands we will use the MSYS command prompt (not cmd.exe of windows) which is UNIX like. 34 | Follow the path C:\MinGW\msys\1.0 and double click "msys.bat". The command prompt environment appears. 35 | Enter "ft27" directory using the cd commands: 36 | ``` 37 | cd /c 38 | cd ft27 39 | ``` 40 | 41 | and then type one by one the commands: 42 | ``` 43 | ./configure --prefix=/mingw 44 | make 45 | make install 46 | ``` 47 | Once you're finished, go inside "C:\MinGW\include" and there should be a new folder named "freetype2". 48 | That, hopefully, means that you have installed the library correctly !! 49 | 50 | #### STEP 3: Build fontconvert.c 51 | 52 | Before proceeding I suggest you make a copy of Adafruit_GFX_library folder in C:\ directory. 53 | Then, inside "fontconvert" folder open the "makefile" with an editor ( I used notepad++). 54 | Change the commands so in the end the program looks like : 55 | ``` 56 | all: fontconvert 57 | 58 | CC = gcc 59 | CFLAGS = -Wall -I c:/mingw/include/freetype2 60 | LIBS = -lfreetype 61 | 62 | fontconvert: fontconvert.c 63 | $(CC) $(CFLAGS) $< $(LIBS) -o $@ 64 | 65 | clean: 66 | rm -f fontconvert 67 | ``` 68 | Go back in the command prompt and with a cd command enter the fontconvert directory. 69 | ``` 70 | cd /c/adafruit_gfx_library\fontconvert 71 | ``` 72 | Give the command: 73 | ``` 74 | make 75 | ``` 76 | This command will, eventually, create a "fontconvert.exe" file inside fontconvert directory. 77 | 78 | #### STEP 4: Create your own font header files 79 | 80 | Now that you have an executable file, you can use it to create your own fonts to work with Adafruit GFX lib. 81 | So, if we suppose that you already have a .ttf file with your favorite fonts, jump to the command prompt and type: 82 | ``` 83 | ./fontconvert yourfonts.ttf 9 > yourfonts9pt7b.h 84 | ``` 85 | You can read more details at: [learn.adafruit](https://learn.adafruit.com/adafruit-gfx-graphics-library/using-fonts). 86 | 87 | Taraaaaaammm !! you've just created your new font header file. Put it inside the "Fonts" folder, grab a cup of coffee 88 | and start playing with your Arduino (or whatever else ....)+ display module project. 89 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit-GFX-Library/fontconvert/makefonts.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Ugly little Bash script, generates a set of .h files for GFX using 4 | # GNU FreeFont sources. There are three fonts: 'Mono' (Courier-like), 5 | # 'Sans' (Helvetica-like) and 'Serif' (Times-like); four styles: regular, 6 | # bold, oblique or italic, and bold+oblique or bold+italic; and four 7 | # sizes: 9, 12, 18 and 24 point. No real error checking or anything, 8 | # this just powers through all the combinations, calling the fontconvert 9 | # utility and redirecting the output to a .h file for each combo. 10 | 11 | # Adafruit_GFX repository does not include the source outline fonts 12 | # (huge zipfile, different license) but they're easily acquired: 13 | # http://savannah.gnu.org/projects/freefont/ 14 | 15 | convert=./fontconvert 16 | inpath=~/Desktop/freefont/ 17 | outpath=../Fonts/ 18 | fonts=(FreeMono FreeSans FreeSerif) 19 | styles=("" Bold Italic BoldItalic Oblique BoldOblique) 20 | sizes=(9 12 18 24) 21 | 22 | for f in ${fonts[*]} 23 | do 24 | for index in ${!styles[*]} 25 | do 26 | st=${styles[$index]} 27 | for si in ${sizes[*]} 28 | do 29 | infile=$inpath$f$st".ttf" 30 | if [ -f $infile ] # Does source combination exist? 31 | then 32 | outfile=$outpath$f$st$si"pt7b.h" 33 | # printf "%s %s %s > %s\n" $convert $infile $si $outfile 34 | $convert $infile $si > $outfile 35 | fi 36 | done 37 | done 38 | done 39 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit-GFX-Library/gfxfont.h: -------------------------------------------------------------------------------- 1 | // Font structures for newer Adafruit_GFX (1.1 and later). 2 | // Example fonts are included in 'Fonts' directory. 3 | // To use a font in your Arduino sketch, #include the corresponding .h 4 | // file and pass address of GFXfont struct to setFont(). Pass NULL to 5 | // revert to 'classic' fixed-space bitmap font. 6 | 7 | #ifndef _GFXFONT_H_ 8 | #define _GFXFONT_H_ 9 | 10 | /// Font data stored PER GLYPH 11 | typedef struct { 12 | uint16_t bitmapOffset; ///< Pointer into GFXfont->bitmap 13 | uint8_t width; ///< Bitmap dimensions in pixels 14 | uint8_t height; ///< Bitmap dimensions in pixels 15 | uint8_t xAdvance; ///< Distance to advance cursor (x axis) 16 | int8_t xOffset; ///< X dist from cursor pos to UL corner 17 | int8_t yOffset; ///< Y dist from cursor pos to UL corner 18 | } GFXglyph; 19 | 20 | /// Data stored for FONT AS A WHOLE 21 | typedef struct { 22 | uint8_t *bitmap; ///< Glyph bitmaps, concatenated 23 | GFXglyph *glyph; ///< Glyph array 24 | uint16_t first; ///< ASCII extents (first char) 25 | uint16_t last; ///< ASCII extents (last char) 26 | uint8_t yAdvance; ///< Newline distance (y axis) 27 | } GFXfont; 28 | 29 | #endif // _GFXFONT_H_ 30 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit-GFX-Library/library.properties: -------------------------------------------------------------------------------- 1 | name=Adafruit GFX Library 2 | version=1.10.10 3 | author=Adafruit 4 | maintainer=Adafruit 5 | sentence=Adafruit GFX graphics core library, this is the 'core' class that all our other graphics libraries derive from. 6 | paragraph=Install this library in addition to the display library for your hardware. 7 | category=Display 8 | url=https://github.com/adafruit/Adafruit-GFX-Library 9 | architectures=* 10 | depends=Adafruit BusIO 11 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit-GFX-Library/license.txt: -------------------------------------------------------------------------------- 1 | Software License Agreement (BSD License) 2 | 3 | Copyright (c) 2012 Adafruit Industries. All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | - Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | - Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit_BusIO/.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Thank you for opening an issue on an Adafruit Arduino library repository. To 2 | improve the speed of resolution please review the following guidelines and 3 | common troubleshooting steps below before creating the issue: 4 | 5 | - **Do not use GitHub issues for troubleshooting projects and issues.** Instead use 6 | the forums at http://forums.adafruit.com to ask questions and troubleshoot why 7 | something isn't working as expected. In many cases the problem is a common issue 8 | that you will more quickly receive help from the forum community. GitHub issues 9 | are meant for known defects in the code. If you don't know if there is a defect 10 | in the code then start with troubleshooting on the forum first. 11 | 12 | - **If following a tutorial or guide be sure you didn't miss a step.** Carefully 13 | check all of the steps and commands to run have been followed. Consult the 14 | forum if you're unsure or have questions about steps in a guide/tutorial. 15 | 16 | - **For Arduino projects check these very common issues to ensure they don't apply**: 17 | 18 | - For uploading sketches or communicating with the board make sure you're using 19 | a **USB data cable** and **not** a **USB charge-only cable**. It is sometimes 20 | very hard to tell the difference between a data and charge cable! Try using the 21 | cable with other devices or swapping to another cable to confirm it is not 22 | the problem. 23 | 24 | - **Be sure you are supplying adequate power to the board.** Check the specs of 25 | your board and plug in an external power supply. In many cases just 26 | plugging a board into your computer is not enough to power it and other 27 | peripherals. 28 | 29 | - **Double check all soldering joints and connections.** Flakey connections 30 | cause many mysterious problems. See the [guide to excellent soldering](https://learn.adafruit.com/adafruit-guide-excellent-soldering/tools) for examples of good solder joints. 31 | 32 | - **Ensure you are using an official Arduino or Adafruit board.** We can't 33 | guarantee a clone board will have the same functionality and work as expected 34 | with this code and don't support them. 35 | 36 | If you're sure this issue is a defect in the code and checked the steps above 37 | please fill in the following fields to provide enough troubleshooting information. 38 | You may delete the guideline and text above to just leave the following details: 39 | 40 | - Arduino board: **INSERT ARDUINO BOARD NAME/TYPE HERE** 41 | 42 | - Arduino IDE version (found in Arduino -> About Arduino menu): **INSERT ARDUINO 43 | VERSION HERE** 44 | 45 | - List the steps to reproduce the problem below (if possible attach a sketch or 46 | copy the sketch code in too): **LIST REPRO STEPS BELOW** 47 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit_BusIO/.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Thank you for creating a pull request to contribute to Adafruit's GitHub code! 2 | Before you open the request please review the following guidelines and tips to 3 | help it be more easily integrated: 4 | 5 | - **Describe the scope of your change--i.e. what the change does and what parts 6 | of the code were modified.** This will help us understand any risks of integrating 7 | the code. 8 | 9 | - **Describe any known limitations with your change.** For example if the change 10 | doesn't apply to a supported platform of the library please mention it. 11 | 12 | - **Please run any tests or examples that can exercise your modified code.** We 13 | strive to not break users of the code and running tests/examples helps with this 14 | process. 15 | 16 | Thank you again for contributing! We will try to test and integrate the change 17 | as soon as we can, but be aware we have many GitHub repositories to manage and 18 | can't immediately respond to every request. There is no need to bump or check in 19 | on a pull request (it will clutter the discussion of the request). 20 | 21 | Also don't be worried if the request is closed or not integrated--sometimes the 22 | priorities of Adafruit's GitHub code (education, ease of use) might not match the 23 | priorities of the pull request. Don't fret, the open source community thrives on 24 | forks and GitHub makes it easy to keep your changes in a forked repo. 25 | 26 | After reviewing the guidelines above you can delete this text from the pull request. 27 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit_BusIO/.github/workflows/githubci.yml: -------------------------------------------------------------------------------- 1 | name: Arduino Library CI 2 | 3 | on: [pull_request, push, repository_dispatch] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | 9 | steps: 10 | - uses: actions/setup-python@v1 11 | with: 12 | python-version: '3.x' 13 | - uses: actions/checkout@v2 14 | - uses: actions/checkout@v2 15 | with: 16 | repository: adafruit/ci-arduino 17 | path: ci 18 | 19 | - name: pre-install 20 | run: bash ci/actions_install.sh 21 | 22 | - name: test platforms 23 | run: python3 ci/build_platform.py main_platforms 24 | 25 | - name: clang 26 | run: python3 ci/run-clang-format.py -e "ci/*" -e "bin/*" -r . 27 | 28 | - name: doxygen 29 | env: 30 | GH_REPO_TOKEN: ${{ secrets.GH_REPO_TOKEN }} 31 | PRETTYNAME : "Adafruit Bus IO Library" 32 | run: bash ci/doxy_gen_and_deploy.sh 33 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit_BusIO/Adafruit_BusIO_Register.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #if !defined(SPI_INTERFACES_COUNT) || \ 6 | (defined(SPI_INTERFACES_COUNT) && (SPI_INTERFACES_COUNT > 0)) 7 | 8 | #ifndef Adafruit_BusIO_Register_h 9 | #define Adafruit_BusIO_Register_h 10 | 11 | typedef enum _Adafruit_BusIO_SPIRegType { 12 | ADDRBIT8_HIGH_TOREAD = 0, 13 | /*!< 14 | * ADDRBIT8_HIGH_TOREAD 15 | * When reading a register you must actually send the value 0x80 + register 16 | * address to the device. e.g. To read the register 0x0B the register value 17 | * 0x8B is sent and to write 0x0B is sent. 18 | */ 19 | AD8_HIGH_TOREAD_AD7_HIGH_TOINC = 1, 20 | 21 | /*!< 22 | * ADDRBIT8_HIGH_TOWRITE 23 | * When writing to a register you must actually send the value 0x80 + 24 | * the register address to the device. e.g. To write to the register 0x19 the 25 | * register value 0x99 is sent and to read 0x19 is sent. 26 | */ 27 | ADDRBIT8_HIGH_TOWRITE = 2, 28 | 29 | /*!< 30 | * ADDRESSED_OPCODE_LOWBIT_TO_WRITE 31 | * Used by the MCP23S series, we send 0x40 |'rd with the opcode 32 | * Then set the lowest bit to write 33 | */ 34 | ADDRESSED_OPCODE_BIT0_LOW_TO_WRITE = 3, 35 | 36 | } Adafruit_BusIO_SPIRegType; 37 | 38 | /*! 39 | * @brief The class which defines a device register (a location to read/write 40 | * data from) 41 | */ 42 | class Adafruit_BusIO_Register { 43 | public: 44 | Adafruit_BusIO_Register(Adafruit_I2CDevice *i2cdevice, uint16_t reg_addr, 45 | uint8_t width = 1, uint8_t byteorder = LSBFIRST, 46 | uint8_t address_width = 1); 47 | 48 | Adafruit_BusIO_Register(Adafruit_SPIDevice *spidevice, uint16_t reg_addr, 49 | Adafruit_BusIO_SPIRegType type, uint8_t width = 1, 50 | uint8_t byteorder = LSBFIRST, 51 | uint8_t address_width = 1); 52 | 53 | Adafruit_BusIO_Register(Adafruit_I2CDevice *i2cdevice, 54 | Adafruit_SPIDevice *spidevice, 55 | Adafruit_BusIO_SPIRegType type, uint16_t reg_addr, 56 | uint8_t width = 1, uint8_t byteorder = LSBFIRST, 57 | uint8_t address_width = 1); 58 | 59 | bool read(uint8_t *buffer, uint8_t len); 60 | bool read(uint8_t *value); 61 | bool read(uint16_t *value); 62 | uint32_t read(void); 63 | uint32_t readCached(void); 64 | bool write(uint8_t *buffer, uint8_t len); 65 | bool write(uint32_t value, uint8_t numbytes = 0); 66 | 67 | uint8_t width(void); 68 | 69 | void setWidth(uint8_t width); 70 | void setAddress(uint16_t address); 71 | void setAddressWidth(uint16_t address_width); 72 | 73 | void print(Stream *s = &Serial); 74 | void println(Stream *s = &Serial); 75 | 76 | private: 77 | Adafruit_I2CDevice *_i2cdevice; 78 | Adafruit_SPIDevice *_spidevice; 79 | Adafruit_BusIO_SPIRegType _spiregtype; 80 | uint16_t _address; 81 | uint8_t _width, _addrwidth, _byteorder; 82 | uint8_t _buffer[4]; // we wont support anything larger than uint32 for 83 | // non-buffered read 84 | uint32_t _cached = 0; 85 | }; 86 | 87 | /*! 88 | * @brief The class which defines a slice of bits from within a device register 89 | * (a location to read/write data from) 90 | */ 91 | class Adafruit_BusIO_RegisterBits { 92 | public: 93 | Adafruit_BusIO_RegisterBits(Adafruit_BusIO_Register *reg, uint8_t bits, 94 | uint8_t shift); 95 | bool write(uint32_t value); 96 | uint32_t read(void); 97 | 98 | private: 99 | Adafruit_BusIO_Register *_register; 100 | uint8_t _bits, _shift; 101 | }; 102 | 103 | #endif // BusIO_Register_h 104 | 105 | #endif // SPI exists 106 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit_BusIO/Adafruit_I2CDevice.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #ifndef Adafruit_I2CDevice_h 4 | #define Adafruit_I2CDevice_h 5 | 6 | ///< The class which defines how we will talk to this device over I2C 7 | class Adafruit_I2CDevice { 8 | public: 9 | Adafruit_I2CDevice(uint8_t addr, TwoWire *theWire = &Wire); 10 | uint8_t address(void); 11 | bool begin(bool addr_detect = true); 12 | bool detected(void); 13 | 14 | bool read(uint8_t *buffer, size_t len, bool stop = true); 15 | bool write(const uint8_t *buffer, size_t len, bool stop = true, 16 | const uint8_t *prefix_buffer = NULL, size_t prefix_len = 0); 17 | bool write_then_read(const uint8_t *write_buffer, size_t write_len, 18 | uint8_t *read_buffer, size_t read_len, 19 | bool stop = false); 20 | bool setSpeed(uint32_t desiredclk); 21 | 22 | /*! @brief How many bytes we can read in a transaction 23 | * @return The size of the Wire receive/transmit buffer */ 24 | size_t maxBufferSize() { return _maxBufferSize; } 25 | 26 | private: 27 | uint8_t _addr; 28 | TwoWire *_wire; 29 | bool _begun; 30 | size_t _maxBufferSize; 31 | }; 32 | 33 | #endif // Adafruit_I2CDevice_h 34 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit_BusIO/Adafruit_I2CRegister.h: -------------------------------------------------------------------------------- 1 | #include "Adafruit_BusIO_Register.h" 2 | #ifndef _ADAFRUIT_I2C_REGISTER_H_ 3 | #define _ADAFRUIT_I2C_REGISTER_H_ 4 | 5 | typedef Adafruit_BusIO_Register Adafruit_I2CRegister; 6 | typedef Adafruit_BusIO_RegisterBits Adafruit_I2CRegisterBits; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit_BusIO/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Adafruit Industries 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /Software_C/lib/Adafruit_BusIO/README.md: -------------------------------------------------------------------------------- 1 | # Adafruit Bus IO Library [![Build Status](https://github.com/adafruit/Adafruit_BusIO/workflows/Arduino%20Library%20CI/badge.svg)](https://github.com/adafruit/Adafruit_BusIO/actions) 2 | 3 | 4 | This is a helper libary to abstract away I2C & SPI transactions and registers 5 | 6 | Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit! 7 | 8 | MIT license, all text above must be included in any redistribution 9 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit_BusIO/examples/i2c_address_detect/i2c_address_detect.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | Adafruit_I2CDevice i2c_dev = Adafruit_I2CDevice(0x10); 4 | 5 | void setup() { 6 | while (!Serial) { delay(10); } 7 | Serial.begin(115200); 8 | Serial.println("I2C address detection test"); 9 | 10 | if (!i2c_dev.begin()) { 11 | Serial.print("Did not find device at 0x"); 12 | Serial.println(i2c_dev.address(), HEX); 13 | while (1); 14 | } 15 | Serial.print("Device found on address 0x"); 16 | Serial.println(i2c_dev.address(), HEX); 17 | } 18 | 19 | void loop() { 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit_BusIO/examples/i2c_readwrite/i2c_readwrite.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define I2C_ADDRESS 0x60 4 | Adafruit_I2CDevice i2c_dev = Adafruit_I2CDevice(I2C_ADDRESS); 5 | 6 | 7 | void setup() { 8 | while (!Serial) { delay(10); } 9 | Serial.begin(115200); 10 | Serial.println("I2C device read and write test"); 11 | 12 | if (!i2c_dev.begin()) { 13 | Serial.print("Did not find device at 0x"); 14 | Serial.println(i2c_dev.address(), HEX); 15 | while (1); 16 | } 17 | Serial.print("Device found on address 0x"); 18 | Serial.println(i2c_dev.address(), HEX); 19 | 20 | uint8_t buffer[32]; 21 | // Try to read 32 bytes 22 | i2c_dev.read(buffer, 32); 23 | Serial.print("Read: "); 24 | for (uint8_t i=0; i<32; i++) { 25 | Serial.print("0x"); Serial.print(buffer[i], HEX); Serial.print(", "); 26 | } 27 | Serial.println(); 28 | 29 | // read a register by writing first, then reading 30 | buffer[0] = 0x0C; // we'll reuse the same buffer 31 | i2c_dev.write_then_read(buffer, 1, buffer, 2, false); 32 | Serial.print("Write then Read: "); 33 | for (uint8_t i=0; i<2; i++) { 34 | Serial.print("0x"); Serial.print(buffer[i], HEX); Serial.print(", "); 35 | } 36 | Serial.println(); 37 | } 38 | 39 | void loop() { 40 | 41 | } 42 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit_BusIO/examples/i2c_registers/i2c_registers.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define I2C_ADDRESS 0x60 5 | Adafruit_I2CDevice i2c_dev = Adafruit_I2CDevice(I2C_ADDRESS); 6 | 7 | 8 | void setup() { 9 | while (!Serial) { delay(10); } 10 | Serial.begin(115200); 11 | Serial.println("I2C device register test"); 12 | 13 | if (!i2c_dev.begin()) { 14 | Serial.print("Did not find device at 0x"); 15 | Serial.println(i2c_dev.address(), HEX); 16 | while (1); 17 | } 18 | Serial.print("Device found on address 0x"); 19 | Serial.println(i2c_dev.address(), HEX); 20 | 21 | Adafruit_BusIO_Register id_reg = Adafruit_BusIO_Register(&i2c_dev, 0x0C, 2, LSBFIRST); 22 | uint16_t id; 23 | id_reg.read(&id); 24 | Serial.print("ID register = 0x"); Serial.println(id, HEX); 25 | 26 | Adafruit_BusIO_Register thresh_reg = Adafruit_BusIO_Register(&i2c_dev, 0x01, 2, LSBFIRST); 27 | uint16_t thresh; 28 | thresh_reg.read(&thresh); 29 | Serial.print("Initial threshold register = 0x"); Serial.println(thresh, HEX); 30 | 31 | thresh_reg.write(~thresh); 32 | 33 | Serial.print("Post threshold register = 0x"); Serial.println(thresh_reg.read(), HEX); 34 | } 35 | 36 | void loop() { 37 | 38 | } -------------------------------------------------------------------------------- /Software_C/lib/Adafruit_BusIO/examples/i2corspi_register/i2corspi_register.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | // Define which interface to use by setting the unused interface to NULL! 4 | 5 | #define SPIDEVICE_CS 10 6 | Adafruit_SPIDevice *spi_dev = NULL; // new Adafruit_SPIDevice(SPIDEVICE_CS); 7 | 8 | #define I2C_ADDRESS 0x5D 9 | Adafruit_I2CDevice *i2c_dev = new Adafruit_I2CDevice(I2C_ADDRESS); 10 | 11 | void setup() { 12 | while (!Serial) { delay(10); } 13 | Serial.begin(115200); 14 | Serial.println("I2C or SPI device register test"); 15 | 16 | if (spi_dev && !spi_dev->begin()) { 17 | Serial.println("Could not initialize SPI device"); 18 | } 19 | 20 | if (i2c_dev) { 21 | if (i2c_dev->begin()) { 22 | Serial.print("Device found on I2C address 0x"); 23 | Serial.println(i2c_dev->address(), HEX); 24 | } else { 25 | Serial.print("Did not find I2C device at 0x"); 26 | Serial.println(i2c_dev->address(), HEX); 27 | } 28 | } 29 | 30 | Adafruit_BusIO_Register id_reg = Adafruit_BusIO_Register(i2c_dev, spi_dev, ADDRBIT8_HIGH_TOREAD, 0x0F); 31 | uint8_t id=0; 32 | id_reg.read(&id); 33 | Serial.print("ID register = 0x"); Serial.println(id, HEX); 34 | } 35 | 36 | void loop() { 37 | 38 | } 39 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit_BusIO/examples/spi_modetest/spi_modetest.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define SPIDEVICE_CS 10 4 | Adafruit_SPIDevice spi_dev = Adafruit_SPIDevice(SPIDEVICE_CS, 100000, SPI_BITORDER_MSBFIRST, SPI_MODE1); 5 | //Adafruit_SPIDevice spi_dev = Adafruit_SPIDevice(SPIDEVICE_CS, 13, 12, 11, 100000, SPI_BITORDER_MSBFIRST, SPI_MODE1); 6 | 7 | 8 | void setup() { 9 | while (!Serial) { delay(10); } 10 | Serial.begin(115200); 11 | Serial.println("SPI device mode test"); 12 | 13 | if (!spi_dev.begin()) { 14 | Serial.println("Could not initialize SPI device"); 15 | while (1); 16 | } 17 | } 18 | 19 | void loop() { 20 | Serial.println("\n\nTransfer test"); 21 | for (uint16_t x=0; x<=0xFF; x++) { 22 | uint8_t i = x; 23 | Serial.print("0x"); Serial.print(i, HEX); 24 | spi_dev.read(&i, 1, i); 25 | Serial.print("/"); Serial.print(i, HEX); 26 | Serial.print(", "); 27 | delay(25); 28 | } 29 | } -------------------------------------------------------------------------------- /Software_C/lib/Adafruit_BusIO/examples/spi_readwrite/spi_readwrite.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define SPIDEVICE_CS 10 4 | Adafruit_SPIDevice spi_dev = Adafruit_SPIDevice(SPIDEVICE_CS); 5 | 6 | 7 | void setup() { 8 | while (!Serial) { delay(10); } 9 | Serial.begin(115200); 10 | Serial.println("SPI device read and write test"); 11 | 12 | if (!spi_dev.begin()) { 13 | Serial.println("Could not initialize SPI device"); 14 | while (1); 15 | } 16 | 17 | uint8_t buffer[32]; 18 | 19 | // Try to read 32 bytes 20 | spi_dev.read(buffer, 32); 21 | Serial.print("Read: "); 22 | for (uint8_t i=0; i<32; i++) { 23 | Serial.print("0x"); Serial.print(buffer[i], HEX); Serial.print(", "); 24 | } 25 | Serial.println(); 26 | 27 | // read a register by writing first, then reading 28 | buffer[0] = 0x8F; // we'll reuse the same buffer 29 | spi_dev.write_then_read(buffer, 1, buffer, 2, false); 30 | Serial.print("Write then Read: "); 31 | for (uint8_t i=0; i<2; i++) { 32 | Serial.print("0x"); Serial.print(buffer[i], HEX); Serial.print(", "); 33 | } 34 | Serial.println(); 35 | } 36 | 37 | void loop() { 38 | 39 | } 40 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit_BusIO/examples/spi_registers/spi_registers.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define SPIDEVICE_CS 10 5 | Adafruit_SPIDevice spi_dev = Adafruit_SPIDevice(SPIDEVICE_CS); 6 | 7 | void setup() { 8 | while (!Serial) { delay(10); } 9 | Serial.begin(115200); 10 | Serial.println("SPI device register test"); 11 | 12 | if (!spi_dev.begin()) { 13 | Serial.println("Could not initialize SPI device"); 14 | while (1); 15 | } 16 | 17 | Adafruit_BusIO_Register id_reg = Adafruit_BusIO_Register(&spi_dev, 0x0F, ADDRBIT8_HIGH_TOREAD); 18 | uint8_t id = 0; 19 | id_reg.read(&id); 20 | Serial.print("ID register = 0x"); Serial.println(id, HEX); 21 | 22 | Adafruit_BusIO_Register thresh_reg = Adafruit_BusIO_Register(&spi_dev, 0x0C, ADDRBIT8_HIGH_TOREAD, 2, LSBFIRST); 23 | uint16_t thresh = 0; 24 | thresh_reg.read(&thresh); 25 | Serial.print("Initial threshold register = 0x"); Serial.println(thresh, HEX); 26 | 27 | thresh_reg.write(~thresh); 28 | 29 | Serial.print("Post threshold register = 0x"); Serial.println(thresh_reg.read(), HEX); 30 | } 31 | 32 | void loop() { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit_BusIO/library.properties: -------------------------------------------------------------------------------- 1 | name=Adafruit BusIO 2 | version=1.8.3 3 | author=Adafruit 4 | maintainer=Adafruit 5 | sentence=This is a library for abstracting away UART, I2C and SPI interfacing 6 | paragraph=This is a library for abstracting away UART, I2C and SPI interfacing 7 | category=Signal Input/Output 8 | url=https://github.com/adafruit/Adafruit_BusIO 9 | architectures=* 10 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit_SSD1306/.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Thank you for opening an issue on an Adafruit Arduino library repository. To 2 | improve the speed of resolution please review the following guidelines and 3 | common troubleshooting steps below before creating the issue: 4 | 5 | - **Do not use GitHub issues for troubleshooting projects and issues.** Instead use 6 | the forums at http://forums.adafruit.com to ask questions and troubleshoot why 7 | something isn't working as expected. In many cases the problem is a common issue 8 | that you will more quickly receive help from the forum community. GitHub issues 9 | are meant for known defects in the code. If you don't know if there is a defect 10 | in the code then start with troubleshooting on the forum first. 11 | 12 | - **If following a tutorial or guide be sure you didn't miss a step.** Carefully 13 | check all of the steps and commands to run have been followed. Consult the 14 | forum if you're unsure or have questions about steps in a guide/tutorial. 15 | 16 | - **For Arduino projects check these very common issues to ensure they don't apply**: 17 | 18 | - For uploading sketches or communicating with the board make sure you're using 19 | a **USB data cable** and **not** a **USB charge-only cable**. It is sometimes 20 | very hard to tell the difference between a data and charge cable! Try using the 21 | cable with other devices or swapping to another cable to confirm it is not 22 | the problem. 23 | 24 | - **Be sure you are supplying adequate power to the board.** Check the specs of 25 | your board and plug in an external power supply. In many cases just 26 | plugging a board into your computer is not enough to power it and other 27 | peripherals. 28 | 29 | - **Double check all soldering joints and connections.** Flakey connections 30 | cause many mysterious problems. See the [guide to excellent soldering](https://learn.adafruit.com/adafruit-guide-excellent-soldering/tools) for examples of good solder joints. 31 | 32 | - **Ensure you are using an official Arduino or Adafruit board.** We can't 33 | guarantee a clone board will have the same functionality and work as expected 34 | with this code and don't support them. 35 | 36 | If you're sure this issue is a defect in the code and checked the steps above 37 | please fill in the following fields to provide enough troubleshooting information. 38 | You may delete the guideline and text above to just leave the following details: 39 | 40 | - Arduino board: **INSERT ARDUINO BOARD NAME/TYPE HERE** 41 | 42 | - Arduino IDE version (found in Arduino -> About Arduino menu): **INSERT ARDUINO 43 | VERSION HERE** 44 | 45 | - List the steps to reproduce the problem below (if possible attach a sketch or 46 | copy the sketch code in too): **LIST REPRO STEPS BELOW** 47 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit_SSD1306/.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | Thank you for creating a pull request to contribute to Adafruit's GitHub code! 2 | Before you open the request please review the following guidelines and tips to 3 | help it be more easily integrated: 4 | 5 | - **Describe the scope of your change--i.e. what the change does and what parts 6 | of the code were modified.** This will help us understand any risks of integrating 7 | the code. 8 | 9 | - **Describe any known limitations with your change.** For example if the change 10 | doesn't apply to a supported platform of the library please mention it. 11 | 12 | - **Please run any tests or examples that can exercise your modified code.** We 13 | strive to not break users of the code and running tests/examples helps with this 14 | process. 15 | 16 | Thank you again for contributing! We will try to test and integrate the change 17 | as soon as we can, but be aware we have many GitHub repositories to manage and 18 | can't immediately respond to every request. There is no need to bump or check in 19 | on a pull request (it will clutter the discussion of the request). 20 | 21 | Also don't be worried if the request is closed or not integrated--sometimes the 22 | priorities of Adafruit's GitHub code (education, ease of use) might not match the 23 | priorities of the pull request. Don't fret, the open source community thrives on 24 | forks and GitHub makes it easy to keep your changes in a forked repo. 25 | 26 | After reviewing the guidelines above you can delete this text from the pull request. 27 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit_SSD1306/.github/workflows/githubci.yml: -------------------------------------------------------------------------------- 1 | name: Arduino Library CI 2 | 3 | on: [pull_request, push, repository_dispatch] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | 9 | steps: 10 | - uses: actions/setup-python@v1 11 | with: 12 | python-version: '3.x' 13 | - uses: actions/checkout@v2 14 | - uses: actions/checkout@v2 15 | with: 16 | repository: adafruit/ci-arduino 17 | path: ci 18 | 19 | - name: pre-install 20 | run: bash ci/actions_install.sh 21 | 22 | - name: test platforms 23 | run: python3 ci/build_platform.py main_platforms 24 | 25 | - name: clang 26 | run: python3 ci/run-clang-format.py -e "ci/*" -e "bin/*" -r . 27 | 28 | - name: doxygen 29 | env: 30 | GH_REPO_TOKEN: ${{ secrets.GH_REPO_TOKEN }} 31 | PRETTYNAME : "Adafruit SSD1306" 32 | run: bash ci/doxy_gen_and_deploy.sh 33 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit_SSD1306/.gitignore: -------------------------------------------------------------------------------- 1 | # Our handy .gitignore for automation ease 2 | Doxyfile* 3 | doxygen_sqlite3.db 4 | html 5 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit_SSD1306/README.md: -------------------------------------------------------------------------------- 1 | # Adafruit_SSD1306 [![Build Status](https://github.com/adafruit/Adafruit_SSD1306/workflows/Arduino%20Library%20CI/badge.svg)](https://github.com/adafruit/Adafruit_SSD1306/actions)[![Documentation](https://github.com/adafruit/ci-arduino/blob/master/assets/doxygen_badge.svg)](http://adafruit.github.io/Adafruit_SSD1306/html/index.html) 2 | 3 | This is a library for our Monochrome OLEDs based on SSD1306 drivers 4 | 5 | Pick one up today in the adafruit shop! 6 | ------> http://www.adafruit.com/category/63_98 7 | 8 | These displays use I2C or SPI to communicate, 2 to 5 pins are required to interface. 9 | 10 | Adafruit invests time and resources providing this open source code, 11 | please support Adafruit and open-source hardware by purchasing 12 | products from Adafruit! 13 | 14 | Written by Limor Fried/Ladyada for Adafruit Industries, with contributions from the open source community. Scrolling code contributed by Michael Gregg. Dynamic buffer allocation based on work by Andrew Canaday. 15 | BSD license, check license.txt for more information. All text above must be included in any redistribution 16 | 17 | Preferred installation method is to use the Arduino IDE Library Manager. To download the source from Github instead, click "Clone or download" above, then "Download ZIP." After uncompressing, rename the resulting folder Adafruit_SSD1306. Check that the Adafruit_SSD1306 folder contains Adafruit_SSD1306.cpp and Adafruit_SSD1306.h. 18 | 19 | You will also have to install the **Adafruit GFX library** which provides graphics primitves such as lines, circles, text, etc. This also can be found in the Arduino Library Manager, or you can get the source from https://github.com/adafruit/Adafruit-GFX-Library 20 | 21 | ## Changes 22 | Pull Request: 23 | (September 2019) 24 | * new #defines for SSD1306_BLACK, SSD1306_WHITE and SSD1306_INVERSE that match existing #define naming scheme and won't conflict with common color names 25 | * old #defines for BLACK, WHITE and INVERSE kept for backwards compat (opt-out with #define NO_ADAFRUIT_SSD1306_COLOR_COMPATIBILITY) 26 | 27 | Version 1.2 (November 2018) introduces some significant changes: 28 | 29 | * Display dimensions are now specified in the constructor...you no longer need to edit the .h file for different screens (though old sketches can continue to work that way). 30 | * SPI transactions are used and SPI bitrate can be specified (both require Arduino 1.6 or later). 31 | * SPI and Wire (I2C) interfaces other than the defaults are supported. 32 | 33 | 34 | 35 | ## Compatibility 36 | 37 | MCU |Tested Works|Doesn't Work|Not Tested|Notes 38 | ------------|:----------:|:----------:|:--------:|----- 39 | Atmega328 | X | | | 40 | Atmega32u4 | X | | | 41 | Atmega2560 | X | | | 42 | ESP8266 | X | | | Change OLED_RESET to different pin if using default I2C pins D4/D5. 43 | ESP32 | X | | | 44 | ATSAM3X8E | X | | | 45 | ATSAMD21 | X | | | 46 | Intel Curie | X | | | 47 | WICED | X | | | No hardware SPI - bitbang only 48 | ATtiny85 | | X | | 49 | Particle | X | | | 50 | 51 | * ATmega328 : Arduino UNO, Adafruit Pro Trinket, Adafruit Metro 328, Adafruit Metro Mini 52 | * ATmega32u4 : Arduino Leonardo, Arduino Micro, Arduino Yun, Teensy 2.0, Adafruit Flora, Bluefruit Micro 53 | * ATmega2560 : Arduino Mega 54 | * ESP8266 : Adafruit Huzzah 55 | * ATSAM3X8E : Arduino Due 56 | * ATSAMD21 : Arduino Zero, M0 Pro, Adafruit Metro Express, Feather M0 57 | * ATtiny85 : Adafruit Gemma, Arduino Gemma, Adafruit Trinket 58 | * Particle: Particle Argon 59 | 60 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit_SSD1306/examples/OLED_featherwing/OLED_featherwing.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | Adafruit_SSD1306 display = Adafruit_SSD1306(128, 32, &Wire); 7 | 8 | // OLED FeatherWing buttons map to different pins depending on board: 9 | #if defined(ESP8266) 10 | #define BUTTON_A 0 11 | #define BUTTON_B 16 12 | #define BUTTON_C 2 13 | #elif defined(ESP32) 14 | #define BUTTON_A 15 15 | #define BUTTON_B 32 16 | #define BUTTON_C 14 17 | #elif defined(ARDUINO_STM32_FEATHER) 18 | #define BUTTON_A PA15 19 | #define BUTTON_B PC7 20 | #define BUTTON_C PC5 21 | #elif defined(TEENSYDUINO) 22 | #define BUTTON_A 4 23 | #define BUTTON_B 3 24 | #define BUTTON_C 8 25 | #elif defined(ARDUINO_FEATHER52832) 26 | #define BUTTON_A 31 27 | #define BUTTON_B 30 28 | #define BUTTON_C 27 29 | #else // 32u4, M0, M4, nrf52840 and 328p 30 | #define BUTTON_A 9 31 | #define BUTTON_B 6 32 | #define BUTTON_C 5 33 | #endif 34 | 35 | void setup() { 36 | Serial.begin(9600); 37 | 38 | Serial.println("OLED FeatherWing test"); 39 | // SSD1306_SWITCHCAPVCC = generate display voltage from 3.3V internally 40 | display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // Address 0x3C for 128x32 41 | 42 | Serial.println("OLED begun"); 43 | 44 | // Show image buffer on the display hardware. 45 | // Since the buffer is intialized with an Adafruit splashscreen 46 | // internally, this will display the splashscreen. 47 | display.display(); 48 | delay(1000); 49 | 50 | // Clear the buffer. 51 | display.clearDisplay(); 52 | display.display(); 53 | 54 | Serial.println("IO test"); 55 | 56 | pinMode(BUTTON_A, INPUT_PULLUP); 57 | pinMode(BUTTON_B, INPUT_PULLUP); 58 | pinMode(BUTTON_C, INPUT_PULLUP); 59 | 60 | // text display tests 61 | display.setTextSize(1); 62 | display.setTextColor(SSD1306_WHITE); 63 | display.setCursor(0,0); 64 | display.print("Connecting to SSID\n'adafruit':"); 65 | display.print("connected!"); 66 | display.println("IP: 10.0.1.23"); 67 | display.println("Sending val #0"); 68 | display.setCursor(0,0); 69 | display.display(); // actually display all of the above 70 | } 71 | 72 | void loop() { 73 | if(!digitalRead(BUTTON_A)) display.print("A"); 74 | if(!digitalRead(BUTTON_B)) display.print("B"); 75 | if(!digitalRead(BUTTON_C)) display.print("C"); 76 | delay(10); 77 | yield(); 78 | display.display(); 79 | } 80 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit_SSD1306/library.properties: -------------------------------------------------------------------------------- 1 | name=Adafruit SSD1306 2 | version=2.4.6 3 | author=Adafruit 4 | maintainer=Adafruit 5 | sentence=SSD1306 oled driver library for monochrome 128x64 and 128x32 displays 6 | paragraph=SSD1306 oled driver library for monochrome 128x64 and 128x32 displays 7 | category=Display 8 | url=https://github.com/adafruit/Adafruit_SSD1306 9 | architectures=* 10 | depends=Adafruit GFX Library 11 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit_SSD1306/license.txt: -------------------------------------------------------------------------------- 1 | Software License Agreement (BSD License) 2 | 3 | Copyright (c) 2012, Adafruit Industries 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 1. Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | 2. Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 3. Neither the name of the copyright holders nor the 14 | names of its contributors may be used to endorse or promote products 15 | derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 18 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 21 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit_SSD1306/scripts/Makefile: -------------------------------------------------------------------------------- 1 | 2 | PY=python3 3 | 4 | splash.h: make_splash.py splash1.png splash2.png 5 | ${PY} make_splash.py splash1.png splash1 >$@ 6 | ${PY} make_splash.py splash2.png splash2 >>$@ 7 | 8 | clean: 9 | rm -f splash.h 10 | 11 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit_SSD1306/scripts/make_splash.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # pip install pillow to get the PIL module 3 | 4 | import sys 5 | from PIL import Image 6 | 7 | def main(fn, id): 8 | image = Image.open(fn) 9 | print("\n" 10 | "#define {id}_width {w}\n" 11 | "#define {id}_height {h}\n" 12 | "\n" 13 | "const uint8_t PROGMEM {id}_data[] = {{\n" 14 | .format(id=id, w=image.width, h=image.height), end='') 15 | for y in range(0, image.height): 16 | for x in range(0, (image.width + 7)//8 * 8): 17 | if x == 0: 18 | print(" ", end='') 19 | if x % 8 == 0: 20 | print("0b", end='') 21 | 22 | bit = '0' 23 | if x < image.width and image.getpixel((x,y)) != 0: 24 | bit = '1' 25 | print(bit, end='') 26 | 27 | if x % 8 == 7: 28 | print(",", end='') 29 | print() 30 | print("};") 31 | 32 | if __name__ == '__main__': 33 | if len(sys.argv) < 3: 34 | print("Usage: {} \n".format(sys.argv[0]), file=sys.stderr); 35 | sys.exit(1) 36 | fn = sys.argv[1] 37 | id = sys.argv[2] 38 | main(fn, id) 39 | -------------------------------------------------------------------------------- /Software_C/lib/Adafruit_SSD1306/scripts/splash1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Software_C/lib/Adafruit_SSD1306/scripts/splash1.png -------------------------------------------------------------------------------- /Software_C/lib/Adafruit_SSD1306/scripts/splash2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Software_C/lib/Adafruit_SSD1306/scripts/splash2.png -------------------------------------------------------------------------------- /Software_C/lib/ESP8266TimerInterrupt/.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | ### Describe the bug 11 | 12 | A clear and concise description of what the bug is. 13 | 14 | ### Steps to Reproduce 15 | 16 | Steps to reproduce the behavior. Including the [MRE](https://stackoverflow.com/help/minimal-reproducible-example) sketches 17 | 18 | ### Expected behavior 19 | 20 | A clear and concise description of what you expected to happen. 21 | 22 | ### Actual behavior 23 | 24 | A clear and concise description of what you expected to happen. 25 | 26 | ### Debug and AT-command log (if applicable) 27 | 28 | A clear and concise description of what you expected to happen. 29 | 30 | ### Screenshots 31 | 32 | If applicable, add screenshots to help explain your problem. 33 | 34 | ### Information 35 | 36 | Please ensure to specify the following: 37 | 38 | * Arduino IDE version (e.g. 1.8.13) or Platform.io version 39 | * `ESP8266`,`ESP32` or `STM32` Core Version (e.g. ESP8266 core v2.7.4, ESP32 v1.0.5 or STM32 v1.9.0) 40 | * Contextual information (e.g. what you were trying to achieve) 41 | * Simplest possible steps to reproduce 42 | * Anything that might be relevant in your opinion, such as: 43 | * Operating system (Windows, Ubuntu, etc.) and the output of `uname -a` 44 | * Network configuration 45 | 46 | ### Example 47 | 48 | ``` 49 | Arduino IDE version: 1.8.13 50 | ESP32 Core Version 1.0.5 51 | OS: Ubuntu 20.04 LTS 52 | Linux xy-Inspiron-3593 5.4.0-66-generic #74-Ubuntu SMP Wed Jan 27 22:54:38 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux 53 | 54 | Context: 55 | I encountered an endless loop while trying to connect to Local WiFi. 56 | 57 | Steps to reproduce: 58 | 1. ... 59 | 2. ... 60 | 3. ... 61 | 4. ... 62 | ``` 63 | 64 | ### Additional context 65 | 66 | Add any other context about the problem here. 67 | -------------------------------------------------------------------------------- /Software_C/lib/ESP8266TimerInterrupt/.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | ### Is your feature request related to a problem? Please describe. 11 | 12 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 13 | 14 | ### Describe the solution you'd like 15 | 16 | A clear and concise description of what you want to happen. 17 | 18 | ### Describe alternatives you've considered 19 | A clear and concise description of any alternative solutions or features you've considered. 20 | 21 | ### Additional context 22 | 23 | Add any other context or screenshots about the feature request here. 24 | -------------------------------------------------------------------------------- /Software_C/lib/ESP8266TimerInterrupt/.github/workflows/auto-github-actions.yml: -------------------------------------------------------------------------------- 1 | name: auto-github-actions 2 | on: [push] 3 | jobs: 4 | check-bats-version: 5 | runs-on: ubuntu-latest 6 | steps: 7 | - uses: actions/checkout@v2 8 | - uses: actions/setup-node@v2 9 | with: 10 | node-version: '14' 11 | - run: npm install -g bats 12 | - run: bats -v 13 | -------------------------------------------------------------------------------- /Software_C/lib/ESP8266TimerInterrupt/.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | -------------------------------------------------------------------------------- /Software_C/lib/ESP8266TimerInterrupt/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing to ESP8266TimerInterrupt 2 | 3 | ### Reporting Bugs 4 | 5 | Please report bugs in [ESP8266TimerInterrupt Issues](https://github.com/khoih-prog/ESP8266TimerInterrupt/issues) if you find them. 6 | 7 | However, before reporting a bug please check through the following: 8 | 9 | * [Existing Open Issues](https://github.com/khoih-prog/ESP8266TimerInterrupt/issues) - someone might have already encountered this. 10 | 11 | If you don't find anything, please [open a new issue](https://github.com/khoih-prog/ESP8266TimerInterrupt/issues/new). 12 | 13 | ### How to submit a bug report 14 | 15 | Please ensure to specify the following: 16 | 17 | * Arduino IDE version (e.g. 1.8.15) or Platform.io version 18 | * `ESP8266` Core Version (e.g. ESP8266 core v3.0.0) 19 | * Contextual information (e.g. what you were trying to achieve) 20 | * Simplest possible steps to reproduce 21 | * Anything that might be relevant in your opinion, such as: 22 | * Operating system (Windows, Ubuntu, etc.) and the output of `uname -a` 23 | * Network configuration 24 | 25 | 26 | ### Example 27 | 28 | ``` 29 | Arduino IDE version: v1.8.15 30 | ESP8266 Core Version v3.0.0 31 | ESP8266_NODEMCU 32 | OS: Ubuntu 20.04 LTS 33 | Linux xy-Inspiron-3593 5.4.0-73-generic #82-Ubuntu SMP Wed Apr 14 17:39:42 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux 34 | 35 | Context: 36 | I encountered a crash while trying to use the Timer Interrupt. 37 | 38 | Steps to reproduce: 39 | 1. ... 40 | 2. ... 41 | 3. ... 42 | 4. ... 43 | ``` 44 | ### Sending Feature Requests 45 | 46 | Feel free to post feature requests. It's helpful if you can explain exactly why the feature would be useful. 47 | 48 | There are usually some outstanding feature requests in the [existing issues list](https://github.com/khoih-prog/ESP8266TimerInterrupt/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement), feel free to add comments to them. 49 | 50 | ### Sending Pull Requests 51 | 52 | Pull Requests with changes and fixes are also welcome! 53 | -------------------------------------------------------------------------------- /Software_C/lib/ESP8266TimerInterrupt/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Khoi Hoang 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Software_C/lib/ESP8266TimerInterrupt/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Datatypes (KEYWORD1) 3 | ####################################### 4 | 5 | ESP8266TimerInterrupt KEYWORD1 6 | ESP8266Timer KEYWORD1 7 | ESP8266_ISR_Timer KEYWORD1 8 | ISRTimer KEYWORD1 9 | 10 | ####################################### 11 | # Methods and Functions (KEYWORD2) 12 | ####################################### 13 | 14 | setFrequency KEYWORD2 15 | setInterval KEYWORD2 16 | attachInterrupt KEYWORD2 17 | attachInterruptInterval KEYWORD2 18 | detachInterrupt KEYWORD2 19 | disableTimer KEYWORD2 20 | reattachInterrupt KEYWORD2 21 | enableTimer KEYWORD2 22 | stopTimer KEYWORD2 23 | restartTimer KEYWORD2 24 | init KEYWORD2 25 | run KEYWORD2 26 | setTimeout KEYWORD2 27 | setTimer KEYWORD2 28 | changeInterval KEYWORD2 29 | deleteTimer KEYWORD2 30 | restartTimer KEYWORD2 31 | isEnabled KEYWORD2 32 | enable KEYWORD2 33 | disable KEYWORD2 34 | enableAll KEYWORD2 35 | disableAll KEYWORD2 36 | toggle KEYWORD2 37 | getNumTimers KEYWORD2 38 | getNumAvailableTimers KEYWORD2 39 | 40 | ####################################### 41 | # Constants (LITERAL1) 42 | ####################################### 43 | -------------------------------------------------------------------------------- /Software_C/lib/ESP8266TimerInterrupt/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ESP8266TimerInterrupt", 3 | "version": "1.4.0", 4 | "keywords": "timing, device, control, timer, interrupt, hardware, isr, isr-based, hardware-timer, isr-timer, isr-based-timer, mission-critical, accuracy, precise, non-blocking, esp8266", 5 | "description": "This library enables you to use Interrupt from Hardware Timers on an ESP8266-based board. It now supports 16 ISR-based timers, while consuming only 1 Hardware Timer. Timers' interval is very long (ulong millisecs). The most important feature is they're ISR-based timers. Therefore, their executions are not blocked by bad-behaving functions or tasks. This important feature is absolutely necessary for mission-critical tasks. These hardware timers, using interrupt, still work even if other functions are blocking. Moreover, they are much more precise (certainly depending on clock frequency accuracy) than other software timers using millis() or micros(). That's necessary if you need to measure some data requiring better accuracy.", 6 | "authors": 7 | { 8 | "name": "Khoi Hoang", 9 | "url": "https://github.com/khoih-prog", 10 | "maintainer": true 11 | }, 12 | "repository": 13 | { 14 | "type": "git", 15 | "url": "//https://github.com/khoih-prog/ESP8266TimerInterrupt" 16 | }, 17 | "homepage": "https://github.com/khoih-prog/ESP8266TimerInterrupt", 18 | "export": { 19 | "exclude": [ 20 | "linux", 21 | "extras", 22 | "tests" 23 | ] 24 | }, 25 | "frameworks": "*", 26 | "platforms": "espressif8266", 27 | "examples": "examples/*/*/*.ino", 28 | "license": "MIT" 29 | } 30 | -------------------------------------------------------------------------------- /Software_C/lib/ESP8266TimerInterrupt/library.properties: -------------------------------------------------------------------------------- 1 | name=ESP8266TimerInterrupt 2 | version=1.4.0 3 | author=Khoi Hoang 4 | maintainer=Khoi Hoang 5 | sentence=This library enables you to use Interrupt from Hardware Timers on an ESP8266-based board. 6 | paragraph=These ESP8266 Hardware Timers, using Interrupt, still work even if other functions are blocking. Moreover, they are much more precise (certainly depending on clock frequency accuracy) than other software timers using millis() or micros(). That's mandatory if you need to measure some data requiring better accuracy. It now supports 16 ISR-based Timers, while consuming only 1 Hardware Timer. Timers' interval is very long (ulong millisecs). The most important feature is they're ISR-based Timers. Therefore, their executions are not blocked by bad-behaving functions or tasks. This important feature is absolutely necessary for mission-critical tasks. 7 | category=Timing,Control,Device,Time,Timer,esp8266,Interrupt,ISR 8 | url=https://github.com/khoih-prog/ESP8266TimerInterrupt 9 | architectures=esp8266 10 | repository=https://github.com/khoih-prog/ESP8266TimerInterrupt 11 | license=MIT 12 | includes=ESP8266TimerInterrupt.h,ESP8266_ISR_Timer.h 13 | -------------------------------------------------------------------------------- /Software_C/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 | -------------------------------------------------------------------------------- /Software_C/partitions-no-ota.csv: -------------------------------------------------------------------------------- 1 | # Name, Type, SubType, Offset, Size, Flags 2 | nvs, data, nvs, 0x9000, 0x6000 3 | phy_init, data, phy, 0xf000, 0x1000 4 | factory, app, factory, 0x10000, 0xF0000 5 | -------------------------------------------------------------------------------- /Software_C/pin_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Software_C/pin_map.png -------------------------------------------------------------------------------- /Software_C/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:esp12e] 12 | platform = espressif8266 13 | ; board = nodemcuv2 14 | board = esp12e 15 | framework = arduino 16 | 17 | monitor_speed = 74880 18 | ; monitor_speed = 115200 19 | upload_speed = 460800 20 | upload_port = COM10 21 | ; board_build.partitions = partitions-no-ota.csv -------------------------------------------------------------------------------- /Software_C/src/buzzer.cpp: -------------------------------------------------------------------------------- 1 | #include "buzzer.h" 2 | 3 | uint16 Buzzer::m_count = 0; 4 | uint16 Buzzer::m_cycle_time = 1; 5 | uint8 Buzzer::m_pin_num = 0; 6 | 7 | /*************************************************** 8 | * 初始化 9 | * buzzer_num为蜂鸣器的引脚 10 | * cycle_time为蜂鸣器控制的精度 ms 11 | */ 12 | Buzzer::Buzzer(uint8_t buzzer_num, uint16 cycle_time) 13 | { 14 | m_count = 0; 15 | m_pin_num = buzzer_num; 16 | m_cycle_time = cycle_time != 0 ? cycle_time : 1; 17 | 18 | pinMode(m_pin_num, OUTPUT); 19 | digitalWrite(m_pin_num, HIGH); // 默认关闭蜂鸣器 20 | } 21 | 22 | void Buzzer::timer_handler(void) 23 | { 24 | if (0 != m_count) 25 | { 26 | --m_count; 27 | } 28 | else 29 | { 30 | digitalWrite(m_pin_num, HIGH); // 定时时间到了 关闭蜂鸣器 31 | } 32 | } 33 | 34 | Buzzer::~Buzzer() 35 | { 36 | } 37 | 38 | /**************************************** 39 | * 设置长鸣时间 40 | * time为长鸣时间 ms 41 | *****************************************/ 42 | void Buzzer::set_beep_time(uint16 time) 43 | { 44 | m_count = time / m_cycle_time; 45 | if (0 != m_count) 46 | { 47 | digitalWrite(m_pin_num, LOW); // 开始定时 开启蜂鸣器 48 | } 49 | } -------------------------------------------------------------------------------- /Software_C/src/buzzer.h: -------------------------------------------------------------------------------- 1 | #ifndef __BUZZER_H 2 | #define __BUZZER_H 3 | 4 | #include 5 | 6 | /********************************** 7 | * 蜂鸣器控制器 8 | */ 9 | class Buzzer 10 | { 11 | public: 12 | static uint16 m_count; 13 | static uint16 m_cycle_time; 14 | static uint8_t m_pin_num; 15 | 16 | public: 17 | Buzzer(uint8_t buzzer_num, uint16 cycle_time = 10); 18 | ~Buzzer(); 19 | IRAM_ATTR void static timer_handler(void); 20 | void set_beep_time(uint16 time); 21 | }; 22 | 23 | #endif -------------------------------------------------------------------------------- /Software_C/src/common.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include //导入Flash库文件 3 | #define USER_SET_PARAM_NUM 10 // 用户的设置项保存参数的数量(UserData) 4 | 5 | struct UserData 6 | { 7 | int save_temperature; // 保存的温度 8 | int mode; // 9 | int direction; // 编码器方向 0正 1反 10 | int err_temperature; // 误差温度 11 | int overflow_temperature; // 超温度的报警温差 12 | int pid_threshold_value; // PID开始控制的阈值范围 13 | double kp; 14 | double ki; 15 | double kd; 16 | double kt; 17 | }; 18 | 19 | UserData user_data = {0, 0, 0, 0, 0, 0, 0, 0}; 20 | 21 | void init_user_data(void) 22 | { 23 | user_data.save_temperature = 20; 24 | user_data.mode = 0; 25 | user_data.direction = 0; 26 | user_data.err_temperature = 0; 27 | user_data.overflow_temperature = 20; 28 | user_data.pid_threshold_value = 3; 29 | user_data.kp = 4.5; 30 | user_data.ki = 0.15; 31 | user_data.kd = 0.2; 32 | user_data.kt = 0.2; 33 | } 34 | 35 | void save_config() //保存函数 36 | { 37 | // EEPROM.begin(512); //向系统申请1024kb ROM 38 | //开始写入 39 | EEPROM.put(0, user_data); 40 | EEPROM.commit(); //执行写入ROM 41 | } 42 | 43 | void load_config() //读取函数 44 | { 45 | EEPROM.begin(512); 46 | user_data = EEPROM.get(0, user_data); 47 | if (user_data.save_temperature < 0 || user_data.save_temperature > 1000) 48 | { 49 | init_user_data(); 50 | save_config(); 51 | } 52 | // for (int i = 0; i < sizeof(UserData); i++) 53 | // { 54 | // *(p + i) = EEPROM.read(i); 55 | // } 56 | // EEPROM.commit(); 57 | } 58 | 59 | boolean doDelayMillisTime(unsigned long interval, unsigned long *previousMillis, boolean state) 60 | { 61 | unsigned long currentMillis = millis(); 62 | if (currentMillis - *previousMillis >= interval) 63 | { 64 | *previousMillis = currentMillis; 65 | state = !state; 66 | } 67 | return state; 68 | } -------------------------------------------------------------------------------- /Software_C/src/knobs.cpp: -------------------------------------------------------------------------------- 1 | #include "knobs.h" 2 | 3 | KeyInfo Knobs::m_key_info = {0, 0}; 4 | uint8_t Knobs::m_pinA_num = 0; 5 | uint8_t Knobs::m_pinB_num = 0; 6 | uint8_t Knobs::m_pinSw_num = 0; 7 | uint8_t Knobs::m_pinA_Status = 0; 8 | uint8_t Knobs::m_pinB_Status = 0; 9 | unsigned long Knobs::m_previousMillis = 0; 10 | uint8_t Knobs::flag = 0; 11 | 12 | /*********************************************************** 13 | * 编码器类的初始化 注:在大多数情况下, 14 | * 只能使用引脚0、2、4、5、12、13、14、15和16 15 | * 16 | */ 17 | Knobs::Knobs(uint8_t pinA_num, uint8_t pinB_num, uint8_t pinSw_num) 18 | { 19 | m_pinA_num = pinA_num; 20 | m_pinB_num = pinB_num; 21 | m_pinSw_num = pinSw_num; 22 | m_pinA_Status = 0; 23 | m_pinB_Status = 0; 24 | m_key_info.pulse_count = 0; 25 | m_key_info.switch_status = 0; 26 | flag = 0; 27 | 28 | pinMode(m_pinA_num, INPUT_PULLUP); 29 | pinMode(m_pinB_num, INPUT_PULLUP); 30 | pinMode(m_pinSw_num, INPUT_PULLUP); 31 | 32 | // 下降沿触发,触发中断0,调用blink函数 33 | attachInterrupt(digitalPinToInterrupt(m_pinA_num), interruter_funcA, CHANGE); 34 | // 按下与松开 35 | attachInterrupt(digitalPinToInterrupt(m_pinSw_num), interruter_funcSW_ON, CHANGE); 36 | } 37 | 38 | void Knobs::interruter_funcA(void) 39 | { 40 | // 发生外部中断后执行的函数 41 | if (m_pinA_Status == 0 && digitalRead(m_pinA_num) == 0) //第一次中断,并且A相是下降沿 42 | { 43 | flag = 0; 44 | if (digitalRead(m_pinB_num)) 45 | { 46 | flag = 1; //根据B相,设定标志 47 | } 48 | m_pinA_Status = 1; //中断计数 49 | } 50 | if (m_pinA_Status && digitalRead(m_pinA_num)) //第二次中断,并且A相是上升沿 51 | { 52 | m_pinB_Status = digitalRead(m_pinB_num); 53 | if (m_pinB_Status == 0 && flag == 1) 54 | { 55 | ++(m_key_info.pulse_count); 56 | } 57 | if (m_pinB_Status && flag == 0) 58 | { 59 | --(m_key_info.pulse_count); 60 | } 61 | m_pinA_Status = 0; //中断计数复位,准备下一次 62 | } 63 | } 64 | 65 | void Knobs::interruter_funcSW_ON(void) 66 | { 67 | // 发生外部中断后执行的函数 68 | int status = digitalRead(m_pinSw_num); 69 | if (0 == status) // 按下 70 | { 71 | // delay(10); // 不能加延时,会发生终端异常 72 | status = digitalRead(m_pinSw_num); 73 | if (0 == status) 74 | { 75 | m_previousMillis = millis(); 76 | } 77 | } 78 | else{ // 松开 79 | 80 | status = digitalRead(m_pinSw_num); 81 | if (false || 1 == status) 82 | { 83 | m_key_info.switch_status = 1; 84 | m_key_info.switch_time = millis() - m_previousMillis; 85 | } 86 | } 87 | } 88 | 89 | KeyInfo Knobs::get_data(void) 90 | { 91 | KeyInfo ret_info = m_key_info; 92 | m_key_info.pulse_count = 0; // clear 93 | m_key_info.switch_status = 0; // clear 94 | m_key_info.switch_time = 0; 95 | return ret_info; 96 | } 97 | 98 | Knobs::~Knobs() 99 | { 100 | } -------------------------------------------------------------------------------- /Software_C/src/knobs.h: -------------------------------------------------------------------------------- 1 | #ifndef __KNOBS_H 2 | #define __KNOBS_H 3 | 4 | #include 5 | 6 | #define uint8_t unsigned char 7 | #define uint16_t unsigned int 8 | 9 | struct KeyInfo 10 | { 11 | int16_t pulse_count; 12 | uint8_t switch_status; 13 | // 按钮按下的时间 14 | unsigned long switch_time; 15 | }; 16 | 17 | class Knobs 18 | { 19 | public: 20 | static KeyInfo m_key_info; 21 | static uint8_t m_pinA_num; 22 | static uint8_t m_pinB_num; 23 | static uint8_t m_pinSw_num; 24 | static uint8_t m_pinA_Status; 25 | static uint8_t m_pinB_Status; 26 | static uint8_t flag; 27 | static unsigned long m_previousMillis; 28 | 29 | public: 30 | Knobs(uint8_t pinA_num, uint8_t pinB_num, uint8_t pinSw_num); 31 | ~Knobs(); 32 | KeyInfo get_data(void); 33 | ICACHE_RAM_ATTR void static interruter_funcA(void); 34 | ICACHE_RAM_ATTR void static interruter_funcSW_ON(void); 35 | }; 36 | 37 | #endif -------------------------------------------------------------------------------- /Software_C/src/main.h: -------------------------------------------------------------------------------- 1 | #ifndef __MAIN_H 2 | #define __MAIN_H 3 | 4 | void interrupt_read_temperature(); 5 | void interrupt_check_knobs(); 6 | void interrupt_ctrl_pid(); 7 | 8 | void interrupt_save_param(); 9 | void interrupt_pwm(); 10 | 11 | 12 | #define NONE_TYPE 0 13 | #define ENCODER_TYPE 1 14 | #define BUTTON_TYPE 2 15 | // 加热板的主控制页面 16 | void main_process(int type, int16_t value = 0); 17 | // 设置页面 18 | void setting_process(int type, int16_t value = 0); 19 | 20 | void read_temperature(); 21 | void pid_ctrl(); 22 | void knobs_deal(); 23 | 24 | 25 | #endif -------------------------------------------------------------------------------- /Software_C/src/max6675.cpp: -------------------------------------------------------------------------------- 1 | #include "max6675.h" 2 | 3 | // #include 4 | 5 | MAX6675::MAX6675(uint8_t sck, uint8_t miso, uint8_t cs) 6 | { 7 | m_sck = sck; 8 | m_miso = miso; 9 | m_cs = cs; 10 | 11 | pinMode(m_sck, OUTPUT); 12 | pinMode(m_miso, INPUT_PULLUP); 13 | pinMode(m_cs, OUTPUT); 14 | 15 | // SPI.pins(sck, miso, mosi, cs); 16 | // SPI.begin(); 17 | digitalWrite(m_cs, HIGH); 18 | } 19 | 20 | uint16_t MAX6675::read_temperature(void) 21 | { 22 | digitalWrite(m_cs, LOW); 23 | // SPI.transfer(READ_DATA); 24 | // SPI.transfer(0); 25 | digitalWrite(m_cs, HIGH); 26 | return 0; 27 | } 28 | 29 | uint16_t MAX6675::read_temperature_mock(void) 30 | { 31 | char i = 0; 32 | uint16_t dat = 0; 33 | uint16_t temperature = 0; 34 | 35 | digitalWrite(m_cs, LOW); 36 | digitalWrite(m_sck, LOW); 37 | for (i = 0; i < 16; i++) 38 | { 39 | digitalWrite(m_sck, HIGH); 40 | dat = dat << 1; 41 | if (digitalRead(m_miso)) 42 | dat = dat | 0x01; 43 | digitalWrite(m_sck, LOW); 44 | } 45 | digitalWrite(m_cs, HIGH); 46 | 47 | if ((dat & MAX6675_CONNECT) != 0) 48 | { 49 | // 没检测到数据 50 | return 4095; 51 | } 52 | 53 | //读出来的数据的D3~D14是温度值 54 | temperature = ((dat & 0x7FFF) >> 3) >> 2; 55 | return temperature; 56 | } 57 | 58 | MAX6675::~MAX6675() 59 | { 60 | } -------------------------------------------------------------------------------- /Software_C/src/max6675.h: -------------------------------------------------------------------------------- 1 | #ifndef __MAX6675_H 2 | #define __MAX6675_H 3 | 4 | #include 5 | 6 | #define uint8_t unsigned char 7 | #define MAX6675_CONNECT 0x04 8 | 9 | class MAX6675 10 | { 11 | public: 12 | MAX6675(uint8_t sck, uint8_t miso, uint8_t cs); 13 | ~MAX6675(); 14 | uint16_t read_temperature(void); 15 | uint16_t read_temperature_mock(void); 16 | 17 | private: 18 | uint8_t m_sck; 19 | uint8_t m_mosi; 20 | uint8_t m_miso; 21 | uint8_t m_cs; 22 | }; 23 | 24 | #endif -------------------------------------------------------------------------------- /Software_C/src/pid.cpp: -------------------------------------------------------------------------------- 1 | #include "pid.h" 2 | 3 | PID::PID(double kp, double ki, double kd, double dt) 4 | { 5 | m_kp = kp; 6 | m_ki = ki; 7 | m_kd = kd; 8 | m_previous_error = 0; 9 | m_integral = 0; 10 | m_dt = dt; 11 | } 12 | 13 | PID::~PID() 14 | { 15 | // 释放资源 16 | } 17 | 18 | /****************************************************************** 19 | * 设置PID参数 20 | */ 21 | void PID::set_pid_param(double kp, double ki, double kd, double dt) 22 | { 23 | m_kp = kp; 24 | m_ki = ki; 25 | m_kd = kd; 26 | m_dt = dt; 27 | } 28 | 29 | void PID::set_data(double pre_error, double integral) 30 | { 31 | m_previous_error = pre_error; 32 | m_integral = integral; 33 | } 34 | 35 | double PID::get_output(double target_value, double now_value) 36 | { 37 | double error = target_value - now_value; 38 | m_integral = m_integral + error * m_dt; 39 | double derivative = (error - m_previous_error) / m_dt; 40 | double output = m_kp * error + m_ki * m_integral + m_kd * derivative; 41 | m_previous_error = error; 42 | return output; 43 | } -------------------------------------------------------------------------------- /Software_C/src/pid.h: -------------------------------------------------------------------------------- 1 | #ifndef _PID_H_ 2 | #define _PID_H_ 3 | 4 | class PID 5 | { 6 | public: 7 | double m_kp; 8 | double m_ki; 9 | double m_kd; 10 | double m_previous_error; 11 | double m_integral; 12 | double m_dt; 13 | 14 | public: 15 | PID(double kp, double ki, double kd, double dt); 16 | ~PID(); 17 | void set_pid_param(double kp, double ki, double kd, double dt); 18 | void set_data(double pre_error, double integral); 19 | double get_output(double target_value, double now_value); 20 | }; 21 | 22 | #endif -------------------------------------------------------------------------------- /Software_C/src/surface.h: -------------------------------------------------------------------------------- 1 | #ifndef _SURFACE_H_ 2 | #define _SURFACE_H_ 3 | 4 | #include 5 | // #include 6 | // #include 7 | #include 8 | #include 9 | #include 10 | 11 | #define SCREEN_WIDTH 128 // OLED display width, in pixels 12 | #define SCREEN_HEIGHT 64 // OLED display height, in pixels 13 | 14 | // Declaration for an SSD1306 display connected to I2C (SDA, SCL pins) 15 | // The pins for I2C are defined by the Wire-library. 16 | // On an arduino UNO: A4(SDA), A5(SCL) 17 | // On an arduino MEGA 2560: 20(SDA), 21(SCL) 18 | // On an arduino LEONARDO: 2(SDA), 3(SCL), ... 19 | #define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin) 20 | #define SCREEN_ADDRESS 0x3C ///< See datasheet for Address; 0x3D for 128x64, 0x3C for 128x32 21 | 22 | class Surface 23 | { 24 | public: 25 | Adafruit_SSD1306 *display; 26 | int m_temperature_target; 27 | int m_temperature_now; 28 | int m_pwm; 29 | 30 | public: 31 | Surface(uint8 sda, uint8 scl); 32 | ~Surface(){}; 33 | void init(void); 34 | void set_now_temperature(int temp); 35 | void set_now_temperature(const char *temp); 36 | void set_target_temperature(int temp); 37 | void set_target_temperature(const char *temp); 38 | void set_pwm(int pwm); 39 | void set_temperature(int target, int now, int pwm); 40 | void display_main(void); 41 | void set_setting(int num, double *data, int chooseNum, boolean isChoose); 42 | }; 43 | 44 | #endif -------------------------------------------------------------------------------- /Software_C/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 | -------------------------------------------------------------------------------- /Tool/HeatPlatform_tool.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | import serial 4 | from esptool import esptool 5 | 6 | VERSION = "Ver1.0" 7 | 8 | 9 | if __name__ == '__main__': 10 | try: 11 | input("\n1. 刷机前请确保串口连接上控制板.\n2. 请将固件程序bin文件放在本软件的同级目录下。 \n3. 刷机过程中需要按住旋钮,接着按一下板子复位键,过0.5秒即可松开旋钮。\n\n准备好后敲下回车键继续。\n") 12 | com_obj_list = list(serial.tools.list_ports.comports()) 13 | 14 | select_com = None 15 | # 获取可用COM口名字 16 | com_list = [com_obj[0] for com_obj in com_obj_list] 17 | print("您本机的串口设备有:", end='') 18 | print(com_list) 19 | if len(com_list) == 1: 20 | select_com = com_list[0] 21 | else: 22 | select_com = input("input COM(例如 COM7): ") 23 | 24 | 25 | #列出文件夹下所有的目录与文件 26 | list_file = os.listdir("./") 27 | firmware_path = 'HeatPlatform_C_v1.0.bin' 28 | for file_name in list_file: 29 | if 'HeatPlatform_C' in file_name: 30 | firmware_path = file_name.strip() 31 | 32 | cmd = ['HeatPlatform_tool.py', '--port', select_com, 33 | '--baud', '460800', 34 | 'write_flash', 35 | '0x0', firmware_path] 36 | 37 | # sys.argv = cmd 38 | esptool.main(cmd[1:]) 39 | except Exception as err: 40 | print(err) 41 | 42 | input("刷机完毕,按回车以关闭软件。") -------------------------------------------------------------------------------- /Tool/esptool/.github/ISSUE_TEMPLATE/bug-report-no-hardware.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report - no ESP chip involved 3 | about: Report bugs or crashes which don't use any attached hardware 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | * Operating system: 11 | * Python version: (`python -V` to check this) 12 | 13 | # Full esptool.py command line as run: 14 | 15 | Example: esptool.py version 16 | 17 | 18 | # Full output from esptool.py 19 | 20 | (please copy and paste all lines of output) 21 | 22 | 23 | # What is the expected behaviour? 24 | 25 | Example: Print the version number 26 | 27 | 28 | # Do you have any other information from investigating this? 29 | 30 | Example: I tried on my friend's Windows 10 PC and the command works there 31 | 32 | 33 | # Is there any other information you can think of which will help us reproduce this problem? 34 | 35 | Example: Only crashes on first day of the month 36 | -------------------------------------------------------------------------------- /Tool/esptool/.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: ESP8266 Forum 4 | url: https://bbs.espressif.com/ 5 | about: For questions about using esptool.py with ESP8266 6 | - name: ESP32 Forum 7 | url: https://esp32.com 8 | about: For questions about using esptool.py with ESP32 9 | 10 | -------------------------------------------------------------------------------- /Tool/esptool/.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /Tool/esptool/.github/ISSUE_TEMPLATE/issue-with-attached-hardware.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: ESP chip operation fails (can't flash, can't connect, etc) 3 | about: Report a problem working with attached hardware 4 | title: '' 5 | labels: operation-failure 6 | assignees: '' 7 | 8 | --- 9 | 10 | ----------------------------- Delete below ----------------------------- 11 | 12 | Most failures to connect, flash, etc. are problems with the hardware. 13 | 14 | Please check any guide that came with your hardware, and also check these troubleshooting steps: 15 | 16 | https://github.com/espressif/esptool/#troubleshooting 17 | 18 | If still experiencing the issue, please delete the text in this box and then provide as many details as possible below about your hardware and computer setup. 19 | 20 | ----------------------------- Delete above ----------------------------- 21 | 22 | 23 | # Operating system 24 | 25 | # Python version 26 | 27 | Can run `python -V` to check this. 28 | 29 | 30 | # What Chip 31 | 32 | (For example: ESP8266, ESP32-PICO-D4, ESP32-WROOM32 module, etc) 33 | 34 | 35 | # What development board or other hardware is the chip attached to 36 | 37 | (For example: DevKitC, NodeMCU board, plain module on breadboard, etc) 38 | 39 | If your hardware is custom or unusual, please attach a photo to the issue. 40 | 41 | 42 | # Is anything else attached to the development board, except for the serial flasher connections? 43 | 44 | Example: GPIO 18 & 19 are connected to I2C devices. 45 | 46 | 47 | # Are you running esptool.py from an IDE such as Arduino or Eclipse? 48 | 49 | Example: No IDE, Windows command prompt 50 | 51 | Example 2: Arduino ESP8266 IDE version 2.5.77 52 | 53 | 54 | # Full esptool.py command line that was run: 55 | 56 | esptool.py -p COM999 write_flash 0x0 bootloader.bin 57 | 58 | 59 | # Full output from esptool.py 60 | 61 | (Please copy and paste all lines of output here) 62 | 63 | 64 | # Do you have any other information from investigating this? 65 | 66 | Example: The command succeeds 1 in every 3 tries 67 | 68 | 69 | # Is there any other information you can think of which will help us reproduce this problem? 70 | 71 | Example: I also have a Windows 95 PC, esptool command works correctly on this PC. 72 | -------------------------------------------------------------------------------- /Tool/esptool/.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | (Please delete any lines which don't apply) 2 | 3 | # Description of change 4 | 5 | # This change fixes the following bug(s): 6 | 7 | (Please put issue URLs or #number-of-issue here.) 8 | 9 | # I have tested this change with the following hardware & software combinations: 10 | 11 | (Operating system(s), development board name(s), ESP8266 and/or ESP32.) 12 | 13 | # I have run the esptool.py automated integration tests with this change and the above hardware. The results were: 14 | 15 | (Details here: https://github.com/espressif/esptool/blob/master/CONTRIBUTING.md#automated-integration-tests ) 16 | -------------------------------------------------------------------------------- /Tool/esptool/.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | # Gitlab CI config 2 | # 3 | # Note: When updating, please also update .travis.yml 4 | stages: 5 | - test 6 | 7 | # cache the pip download directory in all jobs 8 | variables: 9 | PIP_CACHE_DIR: "$CI_PROJECT_DIR/pip-cache" 10 | 11 | cache: 12 | paths: 13 | - "$CI_PROJECT_DIR/pip-cache" 14 | 15 | .test_template: &test_template 16 | stage: test 17 | image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG 18 | tags: 19 | - host_test 20 | dependencies: [] 21 | 22 | host_tests: 23 | <<: *test_template 24 | script: 25 | - ./test/ci/multirun_with_pyenv.sh python setup.py build 26 | - ./test/ci/multirun_with_pyenv.sh python test/test_imagegen.py 27 | - ./test/ci/multirun_with_pyenv.sh python test/test_espsecure.py 28 | - ./test/ci/multirun_with_pyenv.sh python test/test_espefuse_host.py esp32 29 | - ./test/ci/multirun_with_pyenv.sh python test/test_espefuse_host.py esp32s2 30 | - ./test/ci/multirun_with_pyenv.sh python test/test_espefuse_host.py esp32s3beta2 31 | - ./test/ci/multirun_with_pyenv.sh python test/test_espefuse_host.py esp32c3 32 | 33 | check_python_style: 34 | <<: *test_template 35 | script: 36 | # this step installs any 'dev' dependencies (ie flake8) that might be missing in the CI image. 37 | # The runner should cache the downloads, so still quite fast. 38 | - ./test/ci/multirun_with_pyenv.sh pip install --user -e .[dev] 39 | - ./test/ci/multirun_with_pyenv.sh python -m flake8 40 | 41 | # Check all the scripts can run when installed under all Python versions 42 | check_installation_can_run: 43 | <<: *test_template 44 | script: 45 | - ./test/ci/multirun_with_pyenv.sh python setup.py install 46 | - cd / 47 | - ${CI_PROJECT_DIR}/test/ci/multirun_with_pyenv.sh esptool.py --help 48 | - ${CI_PROJECT_DIR}/test/ci/multirun_with_pyenv.sh espefuse.py --help 49 | - ${CI_PROJECT_DIR}/test/ci/multirun_with_pyenv.sh espsecure.py --help 50 | 51 | # Check the stub can build and that a stub built in CI has the same contents 52 | # as the one embedded in esptool 53 | check_stub_build: 54 | <<: *test_template 55 | artifacts: 56 | when: on_failure 57 | paths: 58 | - flasher_stub/build/ 59 | expire_in: 1 week 60 | variables: 61 | # using this directory as the CI image probably already has an ESP32, ESP32S2, ESP32S3 and ESP32C3 toolchain downloaded into here 62 | TOOLCHAIN_DIR: "/root/.espressif/dist" 63 | 64 | ESP8266_BINDIR: "${TOOLCHAIN_DIR}/xtensa-lx106-elf/bin" 65 | ESP32_BINDIR: "${TOOLCHAIN_DIR}/xtensa-esp32-elf/bin" 66 | ESP32S2_BINDIR: "${TOOLCHAIN_DIR}/xtensa-esp32s2-elf/bin" 67 | ESP32S3_BINDIR: "${TOOLCHAIN_DIR}/xtensa-esp32s3-elf/bin" 68 | ESP32C3_BINDIR: "${TOOLCHAIN_DIR}/riscv32-esp-elf/bin" 69 | 70 | TOOLCHAIN_PATHS: "${ESP8266_BINDIR}:${ESP32_BINDIR}:${ESP32S2_BINDIR}:${ESP32S3_BINDIR}:${ESP32C3_BINDIR}" 71 | script: 72 | - ./test/ci/setup_ci_build_env.sh 73 | - make -C flasher_stub V=1 PATH="${TOOLCHAIN_PATHS}:${PATH}" 74 | - cd flasher_stub && python ./compare_stubs.py 75 | 76 | target_esptool_test: 77 | timeout: 2 hours 30 minutes 78 | stage: test 79 | image: $CI_DOCKER_REGISTRY/rpi-test-env$BOT_DOCKER_IMAGE_TAG 80 | tags: 81 | - esptool_target 82 | - internet 83 | script: 84 | - ${CI_PROJECT_DIR}/test/ci/multirun_with_pyenv.sh python -m pip install -e . 85 | - ./test/ci/run_test_on_chips_parallel.sh 86 | artifacts: 87 | reports: 88 | junit: test/report.xml 89 | when: always 90 | paths: 91 | - test/*.out 92 | expire_in: 1 week 93 | after_script: 94 | - tail -n +1 test/*.out 95 | -------------------------------------------------------------------------------- /Tool/esptool/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to esptool.py 2 | 3 | ## Development Setup 4 | 5 | To also install additional tools needed for actually developing and testing esptool, run this command to install a development copy of esptool *plus* packages useful for development: 6 | 7 | ``` 8 | pip install --user -e .[dev] 9 | ``` 10 | 11 | (This command uses the "extras" feature of setuptools.) 12 | 13 | ## Reporting Issues 14 | 15 | Please report bugs in esptool.py if you find them. 16 | 17 | However, before reporting a bug please check through the following: 18 | 19 | * [Troubleshooting Section](https://github.com/espressif/esptool/#troubleshooting) - common problems and known issues 20 | 21 | * [Existing Open Issues](https://github.com/espressif/esptool/issues) - someone might have already encountered this. 22 | 23 | If you don't find anything, please [open a new issue](https://github.com/espressif/esptool/issues/new). 24 | 25 | ## Sending Feature Requests 26 | 27 | Feel free to post feature requests. It's helpful if you can explain exactly why the feature would be useful. 28 | 29 | There are usually some outstanding feature requests in the [existing issues list](https://github.com/espressif/esptool/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement), feel free to add comments to them. 30 | 31 | ## Sending Pull Requests 32 | 33 | Pull Requests with changes and fixes are also welcome! 34 | 35 | ### Code Style & Static Analysis 36 | 37 | esptool.py complies with Flake 8 and is valid Python 2 & Python 3 code (in the same source file.) 38 | 39 | When you submit a Pull Request, the Travis automated build system will run automated checks for this, using the [flake8 tool](http://flake8.readthedocs.io/en/latest/). To check your code locally before submitting, run `python -m flake8` (the flake8 tool is installed as part of the development requirements shown at the beginning of this document.) 40 | 41 | ### Automated Integration Tests 42 | 43 | The test directory contains an integration suite with some integration tests for esptool.py: 44 | 45 | * `test_imagegen.py` tests the elf2image command and is run automatically by Travis for each Pull Request. You can run this command locally to check for regressions in the elf2image functionality. 46 | 47 | * `test_esptool.py` is a [Python unittest](https://docs.python.org/3/library/unittest.html) file that contains integration tests to be run against real ESP8266 or ESP32 hardware. These tests need real hardware so are not run automatically by Travis, they need to be run locally: 48 | 49 | `test_esptool.py` takes a command line with the following format: 50 | 51 | `./test_esptool.py [optional test name(s)]` 52 | 53 | For example, to run all tests on an ESP32 board connected to /dev/ttyUSB0, at 230400bps: 54 | 55 | `./test_esptool.py /dev/ttyUSB0 esp32 230400` 56 | 57 | Or to run the TestFlashing suite only on an ESP8266 board connected to /dev/ttyUSB2` at 460800bps: 58 | 59 | `./test_esptool.py /dev/ttyUSB2 esp8266 460800 TestFlashing` 60 | 61 | (Note that some tests will fail at higher baud rates on some hardware.) 62 | -------------------------------------------------------------------------------- /Tool/esptool/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include README.md 2 | include LICENSE 3 | # sdist includes test/test*.py by default, but esptool.py tests 4 | # are so far only intended to run from the git repo itself 5 | prune test 6 | prune flasher_stub 7 | prune .github 8 | exclude .git* 9 | exclude .travis* 10 | exclude MANIFEST* 11 | 12 | 13 | -------------------------------------------------------------------------------- /Tool/esptool/espressif/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/espressif/__init__.py -------------------------------------------------------------------------------- /Tool/esptool/espressif/efuse/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/espressif/efuse/__init__.py -------------------------------------------------------------------------------- /Tool/esptool/espressif/efuse/esp32/__init__.py: -------------------------------------------------------------------------------- 1 | from . import operations 2 | from .emulate_efuse_controller import EmulateEfuseController 3 | from .fields import EspEfuses 4 | -------------------------------------------------------------------------------- /Tool/esptool/espressif/efuse/esp32c3/__init__.py: -------------------------------------------------------------------------------- 1 | from . import operations 2 | from .emulate_efuse_controller import EmulateEfuseController 3 | from .fields import EspEfuses 4 | -------------------------------------------------------------------------------- /Tool/esptool/espressif/efuse/esp32c3/emulate_efuse_controller.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # This file describes eFuses controller for ESP32-C3 chip 3 | # 4 | # Copyright (C) 2020 Espressif Systems (Shanghai) PTE LTD 5 | # 6 | # This program is free software; you can redistribute it and/or modify it under 7 | # the terms of the GNU General Public License as published by the Free Software 8 | # Foundation; either version 2 of the License, or (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, but WITHOUT 11 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 12 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along with 15 | # this program; if not, write to the Free Software Foundation, Inc., 51 Franklin 16 | # Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | from __future__ import division, print_function 18 | 19 | import reedsolo 20 | 21 | from .mem_definition import EfuseDefineBlocks, EfuseDefineFields, EfuseDefineRegisters 22 | from ..emulate_efuse_controller_base import EmulateEfuseControllerBase, FatalError 23 | 24 | 25 | class EmulateEfuseController(EmulateEfuseControllerBase): 26 | """ The class for virtual ESP32 operation. Using for HOST_TEST. 27 | """ 28 | CHIP_NAME = "ESP32-C3" 29 | mem = None 30 | debug = False 31 | Blocks = EfuseDefineBlocks 32 | Fields = EfuseDefineFields 33 | REGS = EfuseDefineRegisters 34 | 35 | def __init__(self, efuse_file=None, debug=False): 36 | super(EmulateEfuseController, self).__init__(efuse_file, debug) 37 | self.write_reg(self.REGS.EFUSE_STATUS_REG, 1) 38 | 39 | """ esptool method start >>""" 40 | 41 | def get_chip_description(self): 42 | return "" 43 | 44 | def get_crystal_freq(self): 45 | return 40 # MHz (common for all chips) 46 | 47 | """ << esptool method end """ 48 | 49 | def handle_writing_event(self, addr, value): 50 | if addr == self.REGS.EFUSE_CMD_REG: 51 | if value & self.REGS.EFUSE_PGM_CMD: 52 | self.copy_blocks_wr_regs_to_rd_regs(updated_block=(value >> 2) & 0xF) 53 | self.clean_blocks_wr_regs() 54 | self.check_rd_protection_area() 55 | self.write_reg(addr, 0) 56 | self.write_reg(self.REGS.EFUSE_STATUS_REG, 1) 57 | elif value == self.REGS.EFUSE_READ_CMD: 58 | self.write_reg(addr, 0) 59 | self.write_reg(self.REGS.EFUSE_STATUS_REG, 1) 60 | self.save_to_file() 61 | 62 | def get_bitlen_of_block(self, blk, wr=False): 63 | if blk.id == 0: 64 | if wr: 65 | return 32 * 8 66 | else: 67 | return 32 * blk.len 68 | else: 69 | if wr: 70 | rs_coding = 32 * 3 71 | return 32 * 8 + rs_coding 72 | else: 73 | return 32 * blk.len 74 | 75 | def handle_coding_scheme(self, blk, data): 76 | if blk.id != 0: 77 | # CODING_SCHEME RS applied only for all blocks except BLK0. 78 | coded_bytes = 12 79 | data.pos = coded_bytes * 8 80 | plain_data = data.readlist('32*uint:8')[::-1] 81 | # takes 32 bytes 82 | # apply RS encoding 83 | rs = reedsolo.RSCodec(coded_bytes) 84 | # 32 byte of data + 12 bytes RS 85 | calc_encoded_data = list(rs.encode([x for x in plain_data])) 86 | data.pos = 0 87 | if calc_encoded_data != data.readlist('44*uint:8')[::-1]: 88 | raise FatalError("Error in coding scheme data") 89 | data = data[coded_bytes * 8:] 90 | if blk.len < 8: 91 | data = data[(8 - blk.len) * 32:] 92 | return data 93 | -------------------------------------------------------------------------------- /Tool/esptool/espressif/efuse/esp32s2/__init__.py: -------------------------------------------------------------------------------- 1 | from . import operations 2 | from .emulate_efuse_controller import EmulateEfuseController 3 | from .fields import EspEfuses 4 | -------------------------------------------------------------------------------- /Tool/esptool/espressif/efuse/esp32s2/emulate_efuse_controller.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # This file describes eFuses controller for ESP32-S2 chip 3 | # 4 | # Copyright (C) 2020 Espressif Systems (Shanghai) PTE LTD 5 | # 6 | # This program is free software; you can redistribute it and/or modify it under 7 | # the terms of the GNU General Public License as published by the Free Software 8 | # Foundation; either version 2 of the License, or (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, but WITHOUT 11 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 12 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along with 15 | # this program; if not, write to the Free Software Foundation, Inc., 51 Franklin 16 | # Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | from __future__ import division, print_function 18 | 19 | import reedsolo 20 | 21 | from .mem_definition import EfuseDefineBlocks, EfuseDefineFields, EfuseDefineRegisters 22 | from ..emulate_efuse_controller_base import EmulateEfuseControllerBase, FatalError 23 | 24 | 25 | class EmulateEfuseController(EmulateEfuseControllerBase): 26 | """ The class for virtual ESP32 operation. Using for HOST_TEST. 27 | """ 28 | CHIP_NAME = "ESP32-S2" 29 | mem = None 30 | debug = False 31 | Blocks = EfuseDefineBlocks 32 | Fields = EfuseDefineFields 33 | REGS = EfuseDefineRegisters 34 | 35 | def __init__(self, efuse_file=None, debug=False): 36 | super(EmulateEfuseController, self).__init__(efuse_file, debug) 37 | self.write_reg(self.REGS.EFUSE_STATUS_REG, 1) 38 | 39 | """ esptool method start >>""" 40 | 41 | def get_chip_description(self): 42 | return "" 43 | 44 | def get_crystal_freq(self): 45 | return 40 # MHz (common for all chips) 46 | 47 | """ << esptool method end """ 48 | 49 | def handle_writing_event(self, addr, value): 50 | if addr == self.REGS.EFUSE_CMD_REG: 51 | if value & self.REGS.EFUSE_PGM_CMD: 52 | self.copy_blocks_wr_regs_to_rd_regs(updated_block=(value >> 2) & 0xF) 53 | self.clean_blocks_wr_regs() 54 | self.check_rd_protection_area() 55 | self.write_reg(addr, 0) 56 | self.write_reg(self.REGS.EFUSE_STATUS_REG, 1) 57 | elif value == self.REGS.EFUSE_READ_CMD: 58 | self.write_reg(addr, 0) 59 | self.write_reg(self.REGS.EFUSE_STATUS_REG, 1) 60 | self.save_to_file() 61 | 62 | def get_bitlen_of_block(self, blk, wr=False): 63 | if blk.id == 0: 64 | if wr: 65 | return 32 * 8 66 | else: 67 | return 32 * blk.len 68 | else: 69 | if wr: 70 | rs_coding = 32 * 3 71 | return 32 * 8 + rs_coding 72 | else: 73 | return 32 * blk.len 74 | 75 | def handle_coding_scheme(self, blk, data): 76 | if blk.id != 0: 77 | # CODING_SCHEME RS applied only for all blocks except BLK0. 78 | coded_bytes = 12 79 | data.pos = coded_bytes * 8 80 | plain_data = data.readlist('32*uint:8')[::-1] 81 | # takes 32 bytes 82 | # apply RS encoding 83 | rs = reedsolo.RSCodec(coded_bytes) 84 | # 32 byte of data + 12 bytes RS 85 | calc_encoded_data = list(rs.encode([x for x in plain_data])) 86 | data.pos = 0 87 | if calc_encoded_data != data.readlist('44*uint:8')[::-1]: 88 | raise FatalError("Error in coding scheme data") 89 | data = data[coded_bytes * 8:] 90 | if blk.len < 8: 91 | data = data[(8 - blk.len) * 32:] 92 | return data 93 | -------------------------------------------------------------------------------- /Tool/esptool/espressif/efuse/esp32s3beta2/__init__.py: -------------------------------------------------------------------------------- 1 | from . import operations 2 | from .emulate_efuse_controller import EmulateEfuseController 3 | from .fields import EspEfuses 4 | -------------------------------------------------------------------------------- /Tool/esptool/espressif/efuse/esp32s3beta2/emulate_efuse_controller.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # This file describes eFuses controller for ESP32-S3(beta2) chip 3 | # 4 | # Copyright (C) 2020 Espressif Systems (Shanghai) PTE LTD 5 | # 6 | # This program is free software; you can redistribute it and/or modify it under 7 | # the terms of the GNU General Public License as published by the Free Software 8 | # Foundation; either version 2 of the License, or (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, but WITHOUT 11 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 12 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along with 15 | # this program; if not, write to the Free Software Foundation, Inc., 51 Franklin 16 | # Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | from __future__ import division, print_function 18 | 19 | import reedsolo 20 | 21 | from .mem_definition import EfuseDefineBlocks, EfuseDefineFields, EfuseDefineRegisters 22 | from ..emulate_efuse_controller_base import EmulateEfuseControllerBase, FatalError 23 | 24 | 25 | class EmulateEfuseController(EmulateEfuseControllerBase): 26 | """ The class for virtual ESP32-S3(beta2) operation. Using for HOST_TEST. 27 | """ 28 | CHIP_NAME = "ESP32-S3(beta2)" 29 | mem = None 30 | debug = False 31 | Blocks = EfuseDefineBlocks 32 | Fields = EfuseDefineFields 33 | REGS = EfuseDefineRegisters 34 | 35 | def __init__(self, efuse_file=None, debug=False): 36 | super(EmulateEfuseController, self).__init__(efuse_file, debug) 37 | self.write_reg(self.REGS.EFUSE_STATUS_REG, 1) 38 | 39 | """ esptool method start >>""" 40 | 41 | def get_chip_description(self): 42 | return "" 43 | 44 | def get_crystal_freq(self): 45 | return 40 # MHz (common for all chips) 46 | 47 | """ << esptool method end """ 48 | 49 | def handle_writing_event(self, addr, value): 50 | if addr == self.REGS.EFUSE_CMD_REG: 51 | if value & self.REGS.EFUSE_PGM_CMD: 52 | self.copy_blocks_wr_regs_to_rd_regs(updated_block=(value >> 2) & 0xF) 53 | self.clean_blocks_wr_regs() 54 | self.check_rd_protection_area() 55 | self.write_reg(addr, 0) 56 | self.write_reg(self.REGS.EFUSE_STATUS_REG, 1) 57 | elif value == self.REGS.EFUSE_READ_CMD: 58 | self.write_reg(addr, 0) 59 | self.write_reg(self.REGS.EFUSE_STATUS_REG, 1) 60 | self.save_to_file() 61 | 62 | def get_bitlen_of_block(self, blk, wr=False): 63 | if blk.id == 0: 64 | if wr: 65 | return 32 * 8 66 | else: 67 | return 32 * blk.len 68 | else: 69 | if wr: 70 | rs_coding = 32 * 3 71 | return 32 * 8 + rs_coding 72 | else: 73 | return 32 * blk.len 74 | 75 | def handle_coding_scheme(self, blk, data): 76 | if blk.id != 0: 77 | # CODING_SCHEME RS applied only for all blocks except BLK0. 78 | coded_bytes = 12 79 | data.pos = coded_bytes * 8 80 | plain_data = data.readlist('32*uint:8')[::-1] 81 | # takes 32 bytes 82 | # apply RS encoding 83 | rs = reedsolo.RSCodec(coded_bytes) 84 | # 32 byte of data + 12 bytes RS 85 | calc_encoded_data = list(rs.encode([x for x in plain_data])) 86 | data.pos = 0 87 | if calc_encoded_data != data.readlist('44*uint:8')[::-1]: 88 | raise FatalError("Error in coding scheme data") 89 | data = data[coded_bytes * 8:] 90 | if blk.len < 8: 91 | data = data[(8 - blk.len) * 32:] 92 | return data 93 | -------------------------------------------------------------------------------- /Tool/esptool/espressif/efuse/mem_definition_base.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # This file describes eFuses fields and registers for ESP32 chip 3 | # 4 | # Copyright (C) 2020 Espressif Systems (Shanghai) PTE LTD 5 | # 6 | # This program is free software; you can redistribute it and/or modify it under 7 | # the terms of the GNU General Public License as published by the Free Software 8 | # Foundation; either version 2 of the License, or (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, but WITHOUT 11 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 12 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along with 15 | # this program; if not, write to the Free Software Foundation, Inc., 51 Franklin 16 | # Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | from __future__ import division, print_function 18 | 19 | from collections import namedtuple 20 | 21 | 22 | class EfuseRegistersBase(object): 23 | # Coding Scheme values 24 | CODING_SCHEME_NONE = 0 25 | CODING_SCHEME_34 = 1 26 | CODING_SCHEME_REPEAT = 2 27 | CODING_SCHEME_NONE_RECOVERY = 3 28 | CODING_SCHEME_RS = 4 29 | 30 | EFUSE_BURN_TIMEOUT = 0.250 # seconds 31 | 32 | 33 | class EfuseBlocksBase(object): 34 | 35 | BLOCKS = None 36 | NamedtupleBlock = namedtuple('Block', 'name alias id rd_addr wr_addr write_disable_bit read_disable_bit len key_purpose') 37 | 38 | @staticmethod 39 | def get(tuple_block): 40 | return EfuseBlocksBase.NamedtupleBlock._make(tuple_block) 41 | 42 | def get_blocks_for_keys(self): 43 | list_of_names = [] 44 | for block in self.BLOCKS: 45 | blk = self.get(block) 46 | if blk.id > 0: 47 | if blk.name: 48 | list_of_names.append(blk.name) 49 | if blk.alias: 50 | for alias in blk.alias: 51 | list_of_names.append(alias) 52 | return list_of_names 53 | 54 | 55 | class EfuseFieldsBase(object): 56 | 57 | NamedtupleField = namedtuple('Efuse', 'name category block word pos type write_disable_bit read_disable_bit class_type description dictionary') 58 | 59 | @staticmethod 60 | def get(tuple_field): 61 | return EfuseFieldsBase.NamedtupleField._make(tuple_field) 62 | -------------------------------------------------------------------------------- /Tool/esptool/espressif/efuse/util.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # This file consists of the common useful functions for eFuse 3 | # 4 | # Copyright (C) 2020 Espressif Systems (Shanghai) PTE LTD 5 | # 6 | # This program is free software; you can redistribute it and/or modify it under 7 | # the terms of the GNU General Public License as published by the Free Software 8 | # Foundation; either version 2 of the License, or (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, but WITHOUT 11 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 12 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along with 15 | # this program; if not, write to the Free Software Foundation, Inc., 51 Franklin 16 | # Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | from __future__ import division, print_function 18 | 19 | import esptool 20 | 21 | 22 | def hexify(bitstring, separator=""): 23 | try: 24 | as_bytes = tuple(ord(b) for b in bitstring) 25 | except TypeError: # python 3, items in bitstring already ints 26 | as_bytes = tuple(b for b in bitstring) 27 | return separator.join(("%02x" % b) for b in as_bytes) 28 | 29 | 30 | def popcnt(b): 31 | """ Return number of "1" bits set in 'b' """ 32 | return len([x for x in bin(b) if x == "1"]) 33 | 34 | 35 | def check_duplicate_name_in_list(name_list): 36 | duples_name = [name for i, name in enumerate(name_list) if name in name_list[:i]] 37 | if duples_name != []: 38 | raise esptool.FatalError("Found repeated {} in the name list".format(duples_name)) 39 | -------------------------------------------------------------------------------- /Tool/esptool/flasher_stub/README.md: -------------------------------------------------------------------------------- 1 | This is the source of the software flasher stub. 2 | 3 | esptool.py loads the flasher stub into memory and executes it to: 4 | 5 | * Add features that the ESP8266 & ESP32 bootloader ROMs do not have. 6 | 7 | * Add features to the ESP8266 bootloader ROM which are only in the ESP32 ROM. 8 | 9 | * Improve flashing performance over the ROM bootloaders. 10 | 11 | * Work around bugs in the ESP8266 ROM bootloader. 12 | 13 | Thanks to [Cesanta](http://cesanta.com/) who provided the original ESP8266 stub loader upon which this loader is based. 14 | 15 | # To Use 16 | 17 | The stub loader is already automatically integrated into esptool.py. You don't need to do anything special to use it. 18 | 19 | # To Build 20 | 21 | If you want to build the stub to test modifications or updates, here's how: 22 | 23 | * You will need both an ESP8266 gcc toolchain (xtensa-lx106-elf-) and an ESP32 toolchain (xtensa-esp32-elf-) on your PATH. 24 | 25 | * Set the environment variables SDK_PATH to the path to an ESP8266 IoT NON-OS SDK directory (last stub was built with SDK v1.5.1). 26 | 27 | * Set the environment variable IDF_PATH to the path to an ESP-IDF directory. 28 | 29 | * Set any other environment variables you'd like to override in the Makefile. 30 | 31 | * To build type `make` 32 | 33 | # To Test 34 | 35 | To test the built stub, you can run `make embed`, which will update the stubs in `esptool.py` to the newly compiled ones. Or there are some convenience wrappers to make testing quicker to iterate on: 36 | 37 | * Running `esptool_test_stub.py` is the same as running `esptool.py`, only it uses the just-compiled stubs from the build directory. 38 | 39 | * Running `run_tests_with_stub.py` is the same as running `test/test_esptool.py`, only it uses the just-compiled stubs from the build directory. 40 | -------------------------------------------------------------------------------- /Tool/esptool/flasher_stub/compare_stubs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from __future__ import division, print_function 3 | 4 | import sys 5 | 6 | # Compare the esptool stub loaders to freshly built ones 7 | # in the build directory 8 | # 9 | # (Used by CI to verify the stubs are up to date.) 10 | 11 | 12 | def verbose_diff(new, old): 13 | for k in ["data_start", "text_start"]: 14 | if new[k] != old[k]: 15 | print("New %s 0x%x old 0%x" % (k, new[k], old[k])) 16 | 17 | for k in ["data", "text"]: 18 | if len(new[k]) != len(old[k]): 19 | print("New %s %d bytes, old stub code %d bytes" % (k, len(new[k]), len(old[k]))) 20 | if new[k] != old[k]: 21 | print("%s is different" % k) 22 | if len(new[k]) == len(old[k]): 23 | for b in range(len(new[k])): 24 | if new[k][b] != old[k][b]: 25 | print(" Byte 0x%x: new 0x%02x old 0x%02x" % (b, ord(new[k][b]), ord(old[k][b]))) 26 | 27 | 28 | if __name__ == "__main__": 29 | same = True 30 | sys.path.append("..") 31 | import esptool 32 | 33 | old_8266_stub = esptool.ESP8266ROM.STUB_CODE 34 | old_32_stub = esptool.ESP32ROM.STUB_CODE 35 | old_32s2_stub = esptool.ESP32S2ROM.STUB_CODE 36 | old_32s3_stub = esptool.ESP32S3BETA2ROM.STUB_CODE 37 | old_32c3_stub = esptool.ESP32C3ROM.STUB_CODE 38 | 39 | # hackiness: importing this module updates the loaded esptool module with the new stubs 40 | import esptool_test_stub # noqa 41 | 42 | if esptool.ESP8266ROM.STUB_CODE != old_8266_stub: 43 | print("ESP8266 stub code in esptool.py is different to just-built stub") 44 | verbose_diff(esptool.ESP8266ROM.STUB_CODE, old_8266_stub) 45 | same = False 46 | if esptool.ESP32ROM.STUB_CODE != old_32_stub: 47 | print("ESP32 stub code in esptool.py is different to just-built stub.") 48 | verbose_diff(esptool.ESP32ROM.STUB_CODE, old_32_stub) 49 | same = False 50 | if esptool.ESP32S2ROM.STUB_CODE != old_32s2_stub: 51 | print("ESP32S2 stub code in esptool.py is different to just-built stub.") 52 | verbose_diff(esptool.ESP32S2ROM.STUB_CODE, old_32s2_stub) 53 | same = False 54 | if esptool.ESP32S3BETA2ROM.STUB_CODE != old_32s3_stub: 55 | print("ESP32S3 stub code in esptool.py is different to just-built stub.") 56 | verbose_diff(esptool.ESP32S3BETA2ROM.STUB_CODE, old_32s3_stub) 57 | same = False 58 | if esptool.ESP32C3ROM.STUB_CODE != old_32c3_stub: 59 | print("ESP32C3 stub code in esptool.py is different to just-built stub.") 60 | verbose_diff(esptool.ESP32C3ROM.STUB_CODE, old_32c3_stub) 61 | same = False 62 | if same: 63 | print("Stub code is the same") 64 | 65 | sys.exit(0 if same else 1) 66 | -------------------------------------------------------------------------------- /Tool/esptool/flasher_stub/esptool_test_stub.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Trivial wrapper program to run esptool.py using the just-compiled 4 | # flasher stub in the build/ subdirectory 5 | # 6 | # For use when developing new flasher_stubs, not important otherwise. 7 | # 8 | # Copyright (C) 2014-2016 Fredrik Ahlberg, Angus Gratton, other contributors as noted. 9 | # 10 | # This program is free software; you can redistribute it and/or modify it under 11 | # the terms of the GNU General Public License as published by the Free Software 12 | # Foundation; either version 2 of the License, or (at your option) any later version. 13 | # 14 | from __future__ import division, print_function 15 | 16 | import os.path 17 | import sys 18 | 19 | THIS_DIR = os.path.dirname(sys.argv[0]) 20 | 21 | sys.path.append("..") 22 | import esptool # noqa: E402 23 | 24 | 25 | # Python hackiness: evaluate the snippet in the context of the esptool module, so it 26 | # edits the esptool's global variables 27 | exec(open("%s/build/stub_flasher_snippet.py" % THIS_DIR).read(), esptool.__dict__, esptool.__dict__) 28 | 29 | 30 | if __name__ == "__main__": 31 | try: 32 | esptool.main() 33 | except esptool.FatalError as e: 34 | print('\nA fatal error occurred: %s' % e) 35 | sys.exit(2) 36 | -------------------------------------------------------------------------------- /Tool/esptool/flasher_stub/include/slip.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Cesanta Software Limited & (c) 2016-2019 Espressif Systems (Shanghai) PTE LTD 3 | * All rights reserved 4 | * 5 | * This program is free software; you can redistribute it and/or modify it under 6 | * the terms of the GNU General Public License as published by the Free Software 7 | * Foundation; either version 2 of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along with 14 | * this program; if not, write to the Free Software Foundation, Inc., 51 Franklin 15 | * Street, Fifth Floor, Boston, MA 02110-1301 USA. 16 | */ 17 | 18 | #ifndef SLIP_H_ 19 | #define SLIP_H_ 20 | 21 | #include 22 | 23 | /* Send the SLIP frame begin/end delimiter. */ 24 | void SLIP_send_frame_delimiter(void); 25 | 26 | /* Send a single character of SLIP frame data, escaped as per SLIP escaping. */ 27 | void SLIP_send_frame_data(char ch); 28 | 29 | /* Send some SLIP frame data, escaped as per SLIP escaping. */ 30 | void SLIP_send_frame_data_buf(const void *buf, uint32_t size); 31 | 32 | /* Send a full SLIP frame, with specified contents. */ 33 | void SLIP_send(const void *pkt, uint32_t size); 34 | 35 | typedef enum { 36 | SLIP_NO_FRAME, 37 | SLIP_FRAME, 38 | SLIP_FRAME_ESCAPING 39 | } slip_state_t; 40 | 41 | int16_t SLIP_recv_byte(char byte, slip_state_t *state); 42 | 43 | #define SLIP_FINISHED_FRAME -2 44 | #define SLIP_NO_BYTE -1 45 | 46 | /* Receive a SLIP frame, with specified contents. */ 47 | uint32_t SLIP_recv(void *pkt, uint32_t max_len); 48 | 49 | #endif /* SLIP_H_ */ 50 | -------------------------------------------------------------------------------- /Tool/esptool/flasher_stub/include/stub_commands.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2019 Espressif Systems (Shanghai) PTE LTD 3 | * All rights reserved 4 | * 5 | * This file is part of the esptool.py binary flasher stub. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it under 8 | * the terms of the GNU General Public License as published by the Free Software 9 | * Foundation; either version 2 of the License, or (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along with 16 | * this program; if not, write to the Free Software Foundation, Inc., 51 Franklin 17 | * Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | /* Flasher command handlers, called from stub_flasher.c 21 | 22 | Commands related to writing flash are in stub_write_flash_xxx. 23 | */ 24 | #pragma once 25 | #include "stub_flasher.h" 26 | #include 27 | 28 | int handle_flash_erase(uint32_t addr, uint32_t len); 29 | 30 | void handle_flash_read(uint32_t addr, uint32_t len, uint32_t block_size, uint32_t max_in_flight); 31 | 32 | int handle_flash_get_md5sum(uint32_t addr, uint32_t len); 33 | 34 | int handle_flash_read_chip_id(); 35 | 36 | esp_command_error handle_spi_set_params(uint32_t *args, int *status); 37 | 38 | esp_command_error handle_spi_attach(uint32_t hspi_config_arg); 39 | 40 | esp_command_error handle_mem_begin(uint32_t size, uint32_t offset); 41 | 42 | esp_command_error handle_mem_data(void *data, uint32_t length); 43 | 44 | esp_command_error handle_mem_finish(void); 45 | -------------------------------------------------------------------------------- /Tool/esptool/flasher_stub/include/stub_flasher.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Cesanta Software Limited and 2016-2019 Espressif Systems (Shanghai) PTE LTD 3 | * 4 | * All rights reserved 5 | * 6 | * This program is free software; you can redistribute it and/or modify it under 7 | * the terms of the GNU General Public License as published by the Free Software 8 | * Foundation; either version 2 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, but WITHOUT 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 12 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 51 Franklin 16 | * Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | */ 18 | 19 | #ifndef STUB_FLASHER_H_ 20 | #define STUB_FLASHER_H_ 21 | 22 | #include 23 | 24 | /* Maximum write block size, used for various buffers. */ 25 | #define MAX_WRITE_BLOCK 0x4000 26 | 27 | /* Flash geometry constants */ 28 | #define FLASH_SECTOR_SIZE 4096 29 | #define FLASH_BLOCK_SIZE 65536 30 | #define FLASH_PAGE_SIZE 256 31 | #define FLASH_STATUS_MASK 0xFFFF 32 | #define SECTORS_PER_BLOCK (FLASH_BLOCK_SIZE / FLASH_SECTOR_SIZE) 33 | 34 | /* Full set of protocol commands */ 35 | typedef enum { 36 | /* Commands supported by the ESP8266 & ESP32 bootloaders */ 37 | ESP_FLASH_BEGIN = 0x02, 38 | ESP_FLASH_DATA = 0x03, 39 | ESP_FLASH_END = 0x04, 40 | ESP_MEM_BEGIN = 0x05, 41 | ESP_MEM_END = 0x06, 42 | ESP_MEM_DATA = 0x07, 43 | ESP_SYNC = 0x08, 44 | ESP_WRITE_REG = 0x09, 45 | ESP_READ_REG = 0x0a, 46 | 47 | /* Commands supported by the ESP32 bootloader */ 48 | ESP_SPI_SET_PARAMS = 0x0b, 49 | ESP_PIN_READ = 0x0c, /* ??? */ 50 | ESP_SPI_ATTACH = 0x0d, 51 | ESP_SPI_READ = 0x0e, 52 | ESP_SET_BAUD = 0x0f, 53 | ESP_FLASH_DEFLATED_BEGIN = 0x10, 54 | ESP_FLASH_DEFLATED_DATA = 0x11, 55 | ESP_FLASH_DEFLATED_END = 0x12, 56 | ESP_FLASH_VERIFY_MD5 = 0x13, 57 | 58 | /* Stub-only commands */ 59 | ESP_ERASE_FLASH = 0xD0, 60 | ESP_ERASE_REGION = 0xD1, 61 | ESP_READ_FLASH = 0xD2, 62 | ESP_RUN_USER_CODE = 0xD3, 63 | 64 | /* Flash encryption debug mode supported command */ 65 | ESP_FLASH_ENCRYPT_DATA = 0xD4, 66 | } esp_command; 67 | 68 | /* Command request header */ 69 | typedef struct __attribute__((packed)) { 70 | uint8_t zero; 71 | uint8_t op; /* maps to esp_command enum */ 72 | uint16_t data_len; 73 | int32_t checksum; 74 | uint8_t data_buf[32]; /* actually variable length, determined by data_len */ 75 | } esp_command_req_t; 76 | 77 | /* Command response header */ 78 | typedef struct __attribute__((packed)) { 79 | uint8_t resp; /* should be '1' */ 80 | uint8_t op_ret; /* Should match 'op' */ 81 | uint16_t len_ret; /* Length of result data (can be ignored as SLIP framing helps) */ 82 | int32_t value; /* 32-bit response used by some commands */ 83 | } esp_command_response_t; 84 | 85 | 86 | /* command response has some (optional) data after it, then 2 (or 4 on ESP32 ROM) 87 | bytes of status. 88 | */ 89 | typedef struct __attribute__((packed)) { 90 | uint8_t error; /* non-zero = failed */ 91 | uint8_t status; /* status of a failure */ 92 | } esp_command_data_status_t; 93 | 94 | /* Error codes */ 95 | typedef enum { 96 | ESP_OK = 0, 97 | 98 | ESP_BAD_DATA_LEN = 0xC0, 99 | ESP_BAD_DATA_CHECKSUM = 0xC1, 100 | ESP_BAD_BLOCKSIZE = 0xC2, 101 | ESP_INVALID_COMMAND = 0xC3, 102 | ESP_FAILED_SPI_OP = 0xC4, 103 | ESP_FAILED_SPI_UNLOCK = 0xC5, 104 | ESP_NOT_IN_FLASH_MODE = 0xC6, 105 | ESP_INFLATE_ERROR = 0xC7, 106 | ESP_NOT_ENOUGH_DATA = 0xC8, 107 | ESP_TOO_MUCH_DATA = 0xC9, 108 | 109 | ESP_CMD_NOT_IMPLEMENTED = 0xFF, 110 | } esp_command_error; 111 | 112 | #endif /* STUB_FLASHER_H_ */ 113 | -------------------------------------------------------------------------------- /Tool/esptool/flasher_stub/include/stub_io.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Cesanta Software Limited and 2016-2020 Espressif Systems (Shanghai) PTE LTD 3 | * 4 | * All rights reserved 5 | * 6 | * This program is free software; you can redistribute it and/or modify it under 7 | * the terms of the GNU General Public License as published by the Free Software 8 | * Foundation; either version 2 of the License, or (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, but WITHOUT 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 12 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License along with 15 | * this program; if not, write to the Free Software Foundation, Inc., 51 Franklin 16 | * Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | */ 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | /* Call to initialize the I/O (either UART or USB CDC at this point). 25 | * The argument is a callback function which will handle received characters, 26 | * when asynchronous (interrupt-driven) RX is used. 27 | * It will be called in an interrupt context. 28 | */ 29 | void stub_io_init(void(*rx_cb_func)(char)); 30 | 31 | /* Enable or disable asynchronous (interrupt-driven) RX, for UART or USB. 32 | * Currently needed only for the read_flash command. 33 | */ 34 | void stub_rx_async_enable(bool enable); 35 | 36 | /* Wrapper for either uart_tx_one_char or the USB CDC output function. 37 | * (uart_tx_one_char in ROM can also handle USB CDC, but it is really 38 | * slow because it flushes the FIFO after every byte). 39 | */ 40 | void stub_tx_one_char(char c); 41 | 42 | /* A blocking (polling) function to receive one character. 43 | * Should only be used when async (interrupt-driven) RX is disabled. 44 | * Currently only needed for the read_flash command. 45 | */ 46 | char stub_rx_one_char(void); 47 | 48 | /* Returns after making sure that all output has been sent to the host */ 49 | void stub_tx_flush(void); 50 | 51 | /* Updates the baud rate divider based on the current baud rate (from host perspective) 52 | * and the requested baud rate. 53 | * No-op for USB CDC. 54 | */ 55 | void stub_io_set_baudrate(uint32_t current_baud, uint32_t new_baud); 56 | 57 | /* To be called periodically while waiting for a command. 58 | * No-op for UART, handles DTR/RTS reset for USB CDC. 59 | */ 60 | void stub_io_idle_hook(void); 61 | 62 | 63 | -------------------------------------------------------------------------------- /Tool/esptool/flasher_stub/include/stub_write_flash.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016-2019 Espressif Systems (Shanghai) PTE LTD 3 | * All rights reserved 4 | * 5 | * This file is part of the esptool.py binary flasher stub. 6 | * 7 | * This program is free software; you can redistribute it and/or modify it under 8 | * the terms of the GNU General Public License as published by the Free Software 9 | * Foundation; either version 2 of the License, or (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 13 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License along with 16 | * this program; if not, write to the Free Software Foundation, Inc., 51 Franklin 17 | * Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | */ 19 | 20 | /* Flasher commands related to writing flash */ 21 | #pragma once 22 | #include "stub_flasher.h" 23 | #include 24 | 25 | bool is_in_flash_mode(void); 26 | 27 | esp_command_error get_flash_error(void); 28 | 29 | esp_command_error handle_flash_begin(uint32_t total_size, uint32_t offset); 30 | 31 | esp_command_error handle_flash_deflated_begin(uint32_t uncompressed_size, uint32_t compressed_size, uint32_t offset); 32 | 33 | void handle_flash_data(void *data_buf, uint32_t length); 34 | 35 | #if !ESP8266 36 | void handle_flash_encrypt_data(void *data_buf, uint32_t length); 37 | #endif 38 | 39 | void handle_flash_deflated_data(void *data_buf, uint32_t length); 40 | 41 | /* same command used for deflated or non-deflated mode */ 42 | esp_command_error handle_flash_end(void); 43 | 44 | -------------------------------------------------------------------------------- /Tool/esptool/flasher_stub/ld/stub_32.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Cesanta Software Limited 3 | * All rights reserved 4 | * 5 | * This program is free software; you can redistribute it and/or modify it under 6 | * the terms of the GNU General Public License as published by the Free Software 7 | * Foundation; either version 2 of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along with 14 | * this program; if not, write to the Free Software Foundation, Inc., 51 Franklin 15 | * Street, Fifth Floor, Boston, MA 02110-1301 USA. 16 | */ 17 | 18 | /* Note: stub is deliberately loaded close to the very top 19 | of available RAM, to reduce change of colliding with anything 20 | else... */ 21 | MEMORY { 22 | iram : org = 0x400BE000, len = 0x1000 23 | dram : org = 0x3ffcc000, len = 0x14000 24 | } 25 | 26 | ENTRY(stub_main) 27 | 28 | SECTIONS { 29 | .text : ALIGN(4) { 30 | *(.literal) 31 | *(.text .text.*) 32 | } > iram 33 | 34 | .bss : ALIGN(4) { 35 | _bss_start = ABSOLUTE(.); 36 | *(.bss) 37 | _bss_end = ABSOLUTE(.); 38 | } > dram 39 | 40 | .data : ALIGN(4) { 41 | *(.data) 42 | *(.rodata .rodata.*) 43 | } > dram 44 | } 45 | 46 | INCLUDE "rom_32.ld" 47 | -------------------------------------------------------------------------------- /Tool/esptool/flasher_stub/ld/stub_32c3.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Espressif Systems (Shanghai) PTE LTD 3 | * All rights reserved 4 | * 5 | * This program is free software; you can redistribute it and/or modify it under 6 | * the terms of the GNU General Public License as published by the Free Software 7 | * Foundation; either version 2 of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along with 14 | * this program; if not, write to the Free Software Foundation, Inc., 51 Franklin 15 | * Street, Fifth Floor, Boston, MA 02110-1301 USA. 16 | */ 17 | 18 | MEMORY { 19 | iram : org = 0x40380000, len = 0x4000 20 | dram : org = 0x3FC84000, len = 0x18000 21 | } 22 | 23 | ENTRY(stub_main) 24 | 25 | SECTIONS { 26 | .text : ALIGN(4) { 27 | *(.literal) 28 | *(.text .text.*) 29 | } > iram 30 | 31 | .bss : ALIGN(4) { 32 | _bss_start = ABSOLUTE(.); 33 | *(.bss) 34 | _bss_end = ABSOLUTE(.); 35 | } > dram 36 | 37 | .data : ALIGN(4) { 38 | *(.data) 39 | *(.rodata .rodata.*) 40 | } > dram 41 | } 42 | 43 | INCLUDE "rom_32c3.ld" 44 | -------------------------------------------------------------------------------- /Tool/esptool/flasher_stub/ld/stub_32s2.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Espressif Systems (Shanghai) PTE LTD 3 | * All rights reserved 4 | * 5 | * This program is free software; you can redistribute it and/or modify it under 6 | * the terms of the GNU General Public License as published by the Free Software 7 | * Foundation; either version 2 of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along with 14 | * this program; if not, write to the Free Software Foundation, Inc., 51 Franklin 15 | * Street, Fifth Floor, Boston, MA 02110-1301 USA. 16 | */ 17 | 18 | MEMORY { 19 | iram : org = 0x40028000, len = 0x18000 20 | dram : org = 0x3FFD0000, len = 0x28000 21 | } 22 | 23 | ENTRY(stub_main) 24 | 25 | SECTIONS { 26 | .text : ALIGN(4) { 27 | *(.literal) 28 | *(.text .text.*) 29 | } > iram 30 | 31 | .bss : ALIGN(4) { 32 | _bss_start = ABSOLUTE(.); 33 | *(.bss) 34 | _bss_end = ABSOLUTE(.); 35 | } > dram 36 | 37 | .data : ALIGN(4) { 38 | *(.data) 39 | *(.rodata .rodata.*) 40 | } > dram 41 | } 42 | 43 | INCLUDE "rom_32s2.ld" 44 | -------------------------------------------------------------------------------- /Tool/esptool/flasher_stub/ld/stub_32s3.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2019 Espressif Systems (Shanghai) PTE LTD 3 | * All rights reserved 4 | * 5 | * This program is free software; you can redistribute it and/or modify it under 6 | * the terms of the GNU General Public License as published by the Free Software 7 | * Foundation; either version 2 of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along with 14 | * this program; if not, write to the Free Software Foundation, Inc., 51 Franklin 15 | * Street, Fifth Floor, Boston, MA 02110-1301 USA. 16 | */ 17 | 18 | MEMORY { 19 | iram : org = 0x40378000, len = 0x18000 20 | dram : org = 0x3FCA0000, len = 0x28000 21 | } 22 | 23 | ENTRY(stub_main) 24 | 25 | SECTIONS { 26 | .text : ALIGN(4) { 27 | *(.literal) 28 | *(.text .text.*) 29 | } > iram 30 | 31 | .bss : ALIGN(4) { 32 | _bss_start = ABSOLUTE(.); 33 | *(.bss) 34 | _bss_end = ABSOLUTE(.); 35 | } > dram 36 | 37 | .data : ALIGN(4) { 38 | *(.data) 39 | *(.rodata .rodata.*) 40 | } > dram 41 | } 42 | 43 | INCLUDE "rom_32s3.ld" 44 | -------------------------------------------------------------------------------- /Tool/esptool/flasher_stub/ld/stub_8266.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Cesanta Software Limited 3 | * All rights reserved 4 | * 5 | * This program is free software; you can redistribute it and/or modify it under 6 | * the terms of the GNU General Public License as published by the Free Software 7 | * Foundation; either version 2 of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along with 14 | * this program; if not, write to the Free Software Foundation, Inc., 51 Franklin 15 | * Street, Fifth Floor, Boston, MA 02110-1301 USA. 16 | */ 17 | 18 | /* Note: stub is deliberately loaded close to the very top 19 | of available RAM, to reduce change of colliding with anything 20 | else... */ 21 | MEMORY { 22 | iram : org = 0x4010E000, len = 0x2000 23 | dram : org = 0x3FFE8100, len = 0x13f00 24 | } 25 | 26 | ENTRY(stub_main_8266) 27 | 28 | SECTIONS { 29 | .text : ALIGN(4) { 30 | *(.literal) 31 | *(.text .text.*) 32 | } > iram 33 | 34 | .bss : ALIGN(4) { 35 | _bss_start = ABSOLUTE(.); 36 | *(.bss) 37 | _bss_end = ABSOLUTE(.); 38 | } > dram 39 | 40 | .data : ALIGN(4) { 41 | *(.data) 42 | *(.rodata .rodata.*) 43 | } > dram 44 | } 45 | 46 | INCLUDE "rom_8266.ld" 47 | 48 | PROVIDE(SPIFlashModeConfig = 0x40004568); 49 | PROVIDE(SPIParamCfg = 0x40004c2c); 50 | -------------------------------------------------------------------------------- /Tool/esptool/flasher_stub/run_tests_with_stub.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Run test/test_esptool.py using the newly compiled stub, for quick tests 4 | # 5 | # Usage same as test/test_esptool.py 6 | [ -z $PYTHON ] && PYTHON=python 7 | 8 | THISDIR=`realpath -m $(dirname $0)` 9 | 10 | export ESPTOOL_PY="${THISDIR}/esptool_test_stub.py" 11 | ${PYTHON} ${THISDIR}/../test/test_esptool.py $@ 12 | -------------------------------------------------------------------------------- /Tool/esptool/flasher_stub/slip.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 Cesanta Software Limited & Espressif Systems (Shanghai) PTE LTD 3 | * All rights reserved 4 | * 5 | * This program is free software; you can redistribute it and/or modify it under 6 | * the terms of the GNU General Public License as published by the Free Software 7 | * Foundation; either version 2 of the License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, but WITHOUT 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 | * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License along with 14 | * this program; if not, write to the Free Software Foundation, Inc., 51 Franklin 15 | * Street, Fifth Floor, Boston, MA 02110-1301 USA. 16 | */ 17 | 18 | #include 19 | #include "slip.h" 20 | #include "stub_io.h" 21 | 22 | void SLIP_send_frame_delimiter(void) { 23 | stub_tx_one_char('\xc0'); 24 | } 25 | 26 | void SLIP_send_frame_data(char ch) { 27 | if(ch == '\xc0') { 28 | stub_tx_one_char('\xdb'); 29 | stub_tx_one_char('\xdc'); 30 | } else if (ch == '\xdb') { 31 | stub_tx_one_char('\xdb'); 32 | stub_tx_one_char('\xdd'); 33 | } else { 34 | stub_tx_one_char(ch); 35 | } 36 | } 37 | 38 | void SLIP_send_frame_data_buf(const void *buf, uint32_t size) { 39 | const uint8_t *buf_c = (const uint8_t *)buf; 40 | for(int i = 0; i < size; i++) { 41 | SLIP_send_frame_data(buf_c[i]); 42 | } 43 | } 44 | 45 | void SLIP_send(const void *pkt, uint32_t size) { 46 | SLIP_send_frame_delimiter(); 47 | SLIP_send_frame_data_buf(pkt, size); 48 | SLIP_send_frame_delimiter(); 49 | } 50 | 51 | int16_t SLIP_recv_byte(char byte, slip_state_t *state) 52 | { 53 | if (byte == '\xc0') { 54 | if (*state == SLIP_NO_FRAME) { 55 | *state = SLIP_FRAME; 56 | return SLIP_NO_BYTE; 57 | } else { 58 | *state = SLIP_NO_FRAME; 59 | return SLIP_FINISHED_FRAME; 60 | } 61 | } 62 | 63 | switch(*state) { 64 | case SLIP_NO_FRAME: 65 | return SLIP_NO_BYTE; 66 | case SLIP_FRAME: 67 | if (byte == '\xdb') { 68 | *state = SLIP_FRAME_ESCAPING; 69 | return SLIP_NO_BYTE; 70 | } 71 | return byte; 72 | case SLIP_FRAME_ESCAPING: 73 | if (byte == '\xdc') { 74 | *state = SLIP_FRAME; 75 | return '\xc0'; 76 | } 77 | if (byte == '\xdd') { 78 | *state = SLIP_FRAME; 79 | return '\xdb'; 80 | } 81 | return SLIP_NO_BYTE; /* actually a framing error */ 82 | } 83 | return SLIP_NO_BYTE; /* actually a framing error */ 84 | } 85 | 86 | /* This function is needed for the synchornous I/O case, 87 | * which is only flash_read command at the moment. 88 | */ 89 | uint32_t SLIP_recv(void *pkt, uint32_t max_len) { 90 | uint32_t len = 0; 91 | slip_state_t state = SLIP_NO_FRAME; 92 | uint8_t *p = (uint8_t *) pkt; 93 | 94 | int16_t r; 95 | do { 96 | r = SLIP_recv_byte(stub_rx_one_char(), &state); 97 | if(r >= 0 && len < max_len) { 98 | p[len++] = (uint8_t)r; 99 | } 100 | } while(r != SLIP_FINISHED_FRAME); 101 | 102 | return len; 103 | } 104 | -------------------------------------------------------------------------------- /Tool/esptool/setup.cfg: -------------------------------------------------------------------------------- 1 | [flake8] 2 | exclude = ecdsa,.git,__pycache__,.eggs,build 3 | max-line-length = 160 4 | ignore = 5 | # multiple spaces before operator - used for visual indent of constants in some files 6 | E221, 7 | 8 | # various future imports we don't need: absolute_import, with_statement, unicode_literals, generator_stop 9 | # nested_scopes, generators, annotations 10 | # 11 | # See https://pypi.org/project/flake8-future-import/ for list 12 | FI11, FI12, FI14, FI15, FI16, FI17, FI18, 13 | 14 | # future imports we do need: division, print_function 15 | FI50, FI53, 16 | per-file-ignores = 17 | # tests often manipulate sys.path before importing the main tools, so ignore import order violations 18 | test/*.py: E402, 19 | 20 | # multiple spaces after ',' - used for visual layout of eFuse data 21 | espressif/efuse/*/mem_definition.py: E241, 22 | espressif/efuse/*/fields.py: E241, 23 | 24 | # don't require future imports or check for unused imports in __init__.py files 25 | __init__.py: FI10, FI13, F401 26 | 27 | -------------------------------------------------------------------------------- /Tool/esptool/test/README.md: -------------------------------------------------------------------------------- 1 | # esptool.py test cases README 2 | 3 | # test_elf2image.py 4 | 5 | Exists to catch unexpected changes in elf2image or image_info output. Does not require an ESP8266 to verify. 6 | 7 | ## About Tests 8 | 9 | Test method is fairly lo-fi: 10 | 11 | Directory test/elf2image/ contains subdirectories esp8266-v1, esp8266-v2 and esp32. These contain test cases. 12 | 13 | Each test case is a .elf file, which is stored alongside one or more .bin files representing the output of elf2image, and one .txt file representing the output of image_info when reading back the binary. 14 | 15 | Default run of test_elf2image.py will re-run elf2image & image_info on all these images. Suitable --chip and --version args are supplied, determined by the directory name. 16 | 17 | The test runner verifies that nothing in the output of either command has changed. 18 | 19 | ## Dealing With Output Changes 20 | 21 | If changes are detected, we can check if valid images are still being produced. If the changes turn out to be OK, running "test_elf2image.py --regen" will regenerate all of the .bin and .txt files for the test cases. 22 | 23 | (--regen can also be used to evaluate test failures, by looking at git diff output.) 24 | 25 | -------------------------------------------------------------------------------- /Tool/esptool/test/ci/multirun_with_pyenv.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | # 3 | # Tool for running scripts with several versions of Python by the use of pyenv (versions must be installed before in 4 | # the docker image) 5 | # 6 | # Examples: 7 | # ./multirun_with_pyenv.sh ./exec.sh # Run ./exec.h with ALL installed versions of Python 8 | # ./multirun_with_pyenv.sh ./exec.sh arg1 arg2 # Run ./exec.h with arguments (and ALL installed versions of Python) 9 | # ./multirun_with_pyenv.sh -p 2.7.15 ./exec.sh # Run ./exec.h with Python 2.7.15 (-p must be the first argument) 10 | # ./multirun_with_pyenv.sh -p 3.4.8,2.7.15 ./exec.sh # Run ./exec.h with Python 3.4.8 and 2.7.15 (versions must be 11 | # # separated by coma and be without a space) 12 | 13 | PY_VERSIONS="" 14 | 15 | { source /opt/pyenv/activate; } || { echo 'Pyenv activation has failed!' ; exit 1; } 16 | 17 | if [ "$1" = "-p" ]; then 18 | if [ "$#" -ge 2 ]; then 19 | IFS=',' read -a PY_VERSIONS <<< "$2" 20 | shift #remove -p 21 | shift #remove argument after -p 22 | else 23 | echo 'No value (Python version) is given for argument -p!' 24 | exit 1 25 | fi 26 | else 27 | PY_VERSIONS=$(pyenv versions --bare) 28 | fi 29 | 30 | if [ "$#" -lt 1 ]; then 31 | echo 'No executable was passed to the runner!' 32 | exit 1 33 | fi 34 | 35 | for ver in ${PY_VERSIONS[@]} 36 | do 37 | echo 'Switching to Python' $ver 38 | $(pyenv global $ver) || exit 1 39 | echo 'Running' $@ 40 | $@ || { 41 | echo 'Run failed! Switching back to the system version of the Python interpreter.'; 42 | pyenv global system; 43 | exit 1; 44 | } 45 | done 46 | 47 | echo 'Switching back to the system version of Python' 48 | # if the global python is not installed the script will log a warning and finish with zero return code 49 | { pyenv global system; } || { echo 'Restoring the system version of the Python interpreter has failed!' ;} 50 | -------------------------------------------------------------------------------- /Tool/esptool/test/ci/run_test_on_chips_parallel.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -euo pipefail 4 | pids="" 5 | 6 | for dut in esp32 esp32s2 esp8266 esp32s2_usbcdc; do 7 | "${CI_PROJECT_DIR}"/test/ci/multirun_with_pyenv.sh python "${CI_PROJECT_DIR}"/test/test_esptool.py /dev/serial_ports/${dut^^} "${dut%_*}" 115200 &>>"${CI_PROJECT_DIR}"/test/${dut}.out & 8 | current_pid=$! 9 | echo "PID of test for dut $dut is $current_pid" 10 | echo "Output of the process $current_pid is redirected to test/${dut}.out" 11 | pids+=" $current_pid" 12 | done 13 | 14 | for p in $pids; do 15 | if ! wait $p; then 16 | echo "Test with pid $p failed!" 17 | exit 1 18 | fi 19 | done 20 | -------------------------------------------------------------------------------- /Tool/esptool/test/ci/setup_ci_build_env.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -exuo pipefail 4 | 5 | BASE_URL="https://dl.espressif.com/dl/" 6 | 7 | ESP8266_TOOLCHAIN_DIST="xtensa-lx106-elf-linux64-1.22.0-92-g8facf4c-5.2.0.tar.gz" 8 | ESP32_TOOLCHAIN_DIST="xtensa-esp32-elf-gcc8_4_0-esp-2020r3-linux-amd64.tar.gz" 9 | ESP32S2_TOOLCHAIN_DIST="xtensa-esp32s2-elf-gcc8_4_0-esp-2020r3-linux-amd64.tar.gz" 10 | ESP32S3_TOOLCHAIN_DIST="xtensa-esp32s3-elf-gcc8_4_0-esp-2020r3-linux-amd64.tar.gz" 11 | ESP32C3_TOOLCHAIN_DIST="riscv32-esp-elf-gcc8_2_0-crosstool-ng-1.24.0-126-g9fe0ac2-linux-amd64.tar.gz" 12 | 13 | # Setup shell script to download & configure ESP8266 & ESP32 toolchains 14 | # for building the flasher stub program 15 | 16 | mkdir -p ${TOOLCHAIN_DIR} 17 | cd ${TOOLCHAIN_DIR} 18 | 19 | if ! [ -d ${ESP8266_BINDIR} ]; then 20 | wget --continue --no-verbose "${BASE_URL}${ESP8266_TOOLCHAIN_DIST}" 21 | tar zxf ${ESP8266_TOOLCHAIN_DIST} 22 | fi 23 | 24 | if ! [ -d ${ESP32_BINDIR} ]; then 25 | # gitlab CI image may already have this file 26 | wget --continue --no-verbose "${BASE_URL}${ESP32_TOOLCHAIN_DIST}" 27 | tar zxf ${ESP32_TOOLCHAIN_DIST} 28 | fi 29 | 30 | if ! [ -d ${ESP32S2_BINDIR} ]; then 31 | # gitlab CI image may already have this file 32 | wget --continue --no-verbose "${BASE_URL}${ESP32S2_TOOLCHAIN_DIST}" 33 | tar zxf ${ESP32S2_TOOLCHAIN_DIST} 34 | fi 35 | 36 | if ! [ -d ${ESP32S3_BINDIR} ]; then 37 | # gitlab CI image may already have this file 38 | wget --continue --no-verbose "${BASE_URL}${ESP32S3_TOOLCHAIN_DIST}" 39 | tar zxf ${ESP32S3_TOOLCHAIN_DIST} 40 | fi 41 | 42 | if ! [ -d ${ESP32C3_BINDIR} ]; then 43 | # gitlab CI image may already have this file 44 | wget --continue --no-verbose "${BASE_URL}toolchains/preview/c3/${ESP32C3_TOOLCHAIN_DIST}" 45 | tar zxf ${ESP32C3_TOOLCHAIN_DIST} 46 | fi 47 | -------------------------------------------------------------------------------- /Tool/esptool/test/ecdsa_secure_boot_signing_key2.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN EC PRIVATE KEY----- 2 | MHcCAQEEIINRYjKaXM0dQJn4FLwoHYj3ovmpRee7UWv8ksQ9IS2toAoGCCqGSM49 3 | AwEHoUQDQgAEYWCmqAxxAmbr8cZk4AjTYkQJ0pCZOsESk2bPAe6lrzHrFKKR2t2W 4 | ge+cNvXU2dYswEdgWr/fdnyAbHHEVEBSrA== 5 | -----END EC PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Tool/esptool/test/elf2image/esp32-app-cust-ver-info.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/elf2image/esp32-app-cust-ver-info.elf -------------------------------------------------------------------------------- /Tool/esptool/test/elf2image/esp32-app-template.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/elf2image/esp32-app-template.elf -------------------------------------------------------------------------------- /Tool/esptool/test/elf2image/esp32-bootloader.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/elf2image/esp32-bootloader.elf -------------------------------------------------------------------------------- /Tool/esptool/test/elf2image/esp32-too-many-sections.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/elf2image/esp32-too-many-sections.elf -------------------------------------------------------------------------------- /Tool/esptool/test/elf2image/esp8266-nonossdkv12-example.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/elf2image/esp8266-nonossdkv12-example.elf -------------------------------------------------------------------------------- /Tool/esptool/test/elf2image/esp8266-nonossdkv20-at-v2.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/elf2image/esp8266-nonossdkv20-at-v2.elf -------------------------------------------------------------------------------- /Tool/esptool/test/elf2image/esp8266-nonosssdk20-iotdemo.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/elf2image/esp8266-nonosssdk20-iotdemo.elf -------------------------------------------------------------------------------- /Tool/esptool/test/elf2image/esp8266-openrtos-blink-v2.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/elf2image/esp8266-openrtos-blink-v2.elf -------------------------------------------------------------------------------- /Tool/esptool/test/images/aes_key.bin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Tool/esptool/test/images/bootloader_esp32.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/images/bootloader_esp32.bin -------------------------------------------------------------------------------- /Tool/esptool/test/images/bootloader_esp32c3.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/images/bootloader_esp32c3.bin -------------------------------------------------------------------------------- /Tool/esptool/test/images/bootloader_esp32s2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/images/bootloader_esp32s2.bin -------------------------------------------------------------------------------- /Tool/esptool/test/images/bootloader_esp32s3.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/images/bootloader_esp32s3.bin -------------------------------------------------------------------------------- /Tool/esptool/test/images/efuse/128bit: -------------------------------------------------------------------------------- 1 |  2 |  -------------------------------------------------------------------------------- /Tool/esptool/test/images/efuse/192bit: -------------------------------------------------------------------------------- 1 |   -------------------------------------------------------------------------------- /Tool/esptool/test/images/efuse/192bit_1: -------------------------------------------------------------------------------- 1 |  2 | ! -------------------------------------------------------------------------------- /Tool/esptool/test/images/efuse/192bit_2: -------------------------------------------------------------------------------- 1 | " 2 | " -------------------------------------------------------------------------------- /Tool/esptool/test/images/efuse/224bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/images/efuse/224bit -------------------------------------------------------------------------------- /Tool/esptool/test/images/efuse/256bit: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/images/efuse/256bit -------------------------------------------------------------------------------- /Tool/esptool/test/images/efuse/256bit_1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/images/efuse/256bit_1 -------------------------------------------------------------------------------- /Tool/esptool/test/images/efuse/256bit_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/images/efuse/256bit_2 -------------------------------------------------------------------------------- /Tool/esptool/test/images/esp8266_deepsleep.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/images/esp8266_deepsleep.bin -------------------------------------------------------------------------------- /Tool/esptool/test/images/esp8266_sdk/4096_user1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/images/esp8266_sdk/4096_user1.bin -------------------------------------------------------------------------------- /Tool/esptool/test/images/esp8266_sdk/blank.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/images/esp8266_sdk/blank.bin -------------------------------------------------------------------------------- /Tool/esptool/test/images/esp8266_sdk/boot_v1.4(b1).bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/images/esp8266_sdk/boot_v1.4(b1).bin -------------------------------------------------------------------------------- /Tool/esptool/test/images/esp8266_sdk/esp_init_data_default.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/images/esp8266_sdk/esp_init_data_default.bin -------------------------------------------------------------------------------- /Tool/esptool/test/images/fifty_kb.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/images/fifty_kb.bin -------------------------------------------------------------------------------- /Tool/esptool/test/images/helloworld-esp32.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/images/helloworld-esp32.bin -------------------------------------------------------------------------------- /Tool/esptool/test/images/helloworld-esp32_edit.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/images/helloworld-esp32_edit.bin -------------------------------------------------------------------------------- /Tool/esptool/test/images/helloworld-esp8266.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/images/helloworld-esp8266.bin -------------------------------------------------------------------------------- /Tool/esptool/test/images/nodemcu-master-7-modules-2017-01-19-11-10-03-integer.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/images/nodemcu-master-7-modules-2017-01-19-11-10-03-integer.bin -------------------------------------------------------------------------------- /Tool/esptool/test/images/one_kb.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/images/one_kb.bin -------------------------------------------------------------------------------- /Tool/esptool/test/images/one_kb_all_ef.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/images/one_kb_all_ef.bin -------------------------------------------------------------------------------- /Tool/esptool/test/images/one_mb.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/images/one_mb.bin -------------------------------------------------------------------------------- /Tool/esptool/test/images/onebyte.bin: -------------------------------------------------------------------------------- 1 | a -------------------------------------------------------------------------------- /Tool/esptool/test/images/partitions_singleapp.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/images/partitions_singleapp.bin -------------------------------------------------------------------------------- /Tool/esptool/test/images/sector.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/images/sector.bin -------------------------------------------------------------------------------- /Tool/esptool/test/images/unaligned.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/images/unaligned.bin -------------------------------------------------------------------------------- /Tool/esptool/test/images/zerolength.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/images/zerolength.bin -------------------------------------------------------------------------------- /Tool/esptool/test/secure_images/256bit_iv.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/secure_images/256bit_iv.bin -------------------------------------------------------------------------------- /Tool/esptool/test/secure_images/256bit_key.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/secure_images/256bit_key.bin -------------------------------------------------------------------------------- /Tool/esptool/test/secure_images/bootloader-encrypted-conf0.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/secure_images/bootloader-encrypted-conf0.bin -------------------------------------------------------------------------------- /Tool/esptool/test/secure_images/bootloader-encrypted-conf3.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/secure_images/bootloader-encrypted-conf3.bin -------------------------------------------------------------------------------- /Tool/esptool/test/secure_images/bootloader-encrypted-conf9.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/secure_images/bootloader-encrypted-conf9.bin -------------------------------------------------------------------------------- /Tool/esptool/test/secure_images/bootloader-encrypted-confc.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/secure_images/bootloader-encrypted-confc.bin -------------------------------------------------------------------------------- /Tool/esptool/test/secure_images/bootloader-encrypted.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/secure_images/bootloader-encrypted.bin -------------------------------------------------------------------------------- /Tool/esptool/test/secure_images/bootloader.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/secure_images/bootloader.bin -------------------------------------------------------------------------------- /Tool/esptool/test/secure_images/bootloader_digested.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/secure_images/bootloader_digested.bin -------------------------------------------------------------------------------- /Tool/esptool/test/secure_images/bootloader_multi_signed_v2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/secure_images/bootloader_multi_signed_v2.bin -------------------------------------------------------------------------------- /Tool/esptool/test/secure_images/bootloader_signed.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/secure_images/bootloader_signed.bin -------------------------------------------------------------------------------- /Tool/esptool/test/secure_images/bootloader_signed_v2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/secure_images/bootloader_signed_v2.bin -------------------------------------------------------------------------------- /Tool/esptool/test/secure_images/bootloader_unsigned_v2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/secure_images/bootloader_unsigned_v2.bin -------------------------------------------------------------------------------- /Tool/esptool/test/secure_images/digest_iv.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/secure_images/digest_iv.bin -------------------------------------------------------------------------------- /Tool/esptool/test/secure_images/ecdsa_secure_boot_signing_key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN EC PRIVATE KEY----- 2 | MHcCAQEEIOI40eSC7ch6PxDSIclIGFCjfhCoXfHVqbbDn8XdY0GVoAoGCCqGSM49 3 | AwEHoUQDQgAENM762z/ushk+c0XOIYpi8wLSWuF5COnU0VAQnt3spTSX6l3bpwfu 4 | ppsemDdwy+aKbdgeyMYDxFbROLOPTRbYJw== 5 | -----END EC PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Tool/esptool/test/secure_images/ecdsa_secure_boot_signing_key2.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN EC PRIVATE KEY----- 2 | MHcCAQEEIP9iY7XY8g3qSaUkKwTbq6HEq/AwenIxrssLqXGTS0z3oAoGCCqGSM49 3 | AwEHoUQDQgAEG+Ah4OAejTBYKQNvJkEOP9AifgulBMr4E9f+OqRU1Uno9Efi1kMc 4 | fzwZyx0A4mib0HfLUg9JNh8dNrUxLeVb4Q== 5 | -----END EC PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Tool/esptool/test/secure_images/ecdsa_secure_boot_signing_key_pkcs8.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQg4jjR5ILtyHo/ENIh 3 | yUgYUKN+EKhd8dWptsOfxd1jQZWhRANCAAQ0zvrbP+6yGT5zRc4himLzAtJa4XkI 4 | 6dTRUBCe3eylNJfqXdunB+6mmx6YN3DL5opt2B7IxgPEVtE4s49NFtgn 5 | -----END PRIVATE KEY----- 6 | -------------------------------------------------------------------------------- /Tool/esptool/test/secure_images/ecdsa_secure_boot_signing_pubkey.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAENM762z/ushk+c0XOIYpi8wLSWuF5 3 | COnU0VAQnt3spTSX6l3bpwfuppsemDdwy+aKbdgeyMYDxFbROLOPTRbYJw== 4 | -----END PUBLIC KEY----- 5 | -------------------------------------------------------------------------------- /Tool/esptool/test/secure_images/ecdsa_secure_boot_signing_pubkey2.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEG+Ah4OAejTBYKQNvJkEOP9Aifgul 3 | BMr4E9f+OqRU1Uno9Efi1kMcfzwZyx0A4mib0HfLUg9JNh8dNrUxLeVb4Q== 4 | -----END PUBLIC KEY----- 5 | -------------------------------------------------------------------------------- /Tool/esptool/test/secure_images/ef-flashencryption-key.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/secure_images/ef-flashencryption-key.bin -------------------------------------------------------------------------------- /Tool/esptool/test/secure_images/hello-world-signed-encrypted.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/secure_images/hello-world-signed-encrypted.bin -------------------------------------------------------------------------------- /Tool/esptool/test/secure_images/hello-world-signed.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/secure_images/hello-world-signed.bin -------------------------------------------------------------------------------- /Tool/esptool/test/secure_images/rsa_public_key_digest.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/Tool/esptool/test/secure_images/rsa_public_key_digest.bin -------------------------------------------------------------------------------- /Tool/esptool/test/secure_images/rsa_secure_boot_signing_key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | 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 39 | -----END RSA PRIVATE KEY----- 40 | -------------------------------------------------------------------------------- /Tool/esptool/test/secure_images/rsa_secure_boot_signing_key2.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | 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 39 | -----END RSA PRIVATE KEY----- 40 | -------------------------------------------------------------------------------- /Tool/esptool/test/secure_images/rsa_secure_boot_signing_key3.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | 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 39 | -----END RSA PRIVATE KEY----- 40 | -------------------------------------------------------------------------------- /Tool/esptool/test/secure_images/rsa_secure_boot_signing_key4.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | 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 39 | -----END RSA PRIVATE KEY----- 40 | -------------------------------------------------------------------------------- /Tool/esptool/test/secure_images/rsa_secure_boot_signing_pubkey.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAtvnS7JPl5hGfA0Iks2lQ 3 | m/L+eiw7pcAArH2IKGqryKdGCtiwuOLjZkUpNR/dZhSr/7JGvjUw+2elLY7D1XXX 4 | w3pufjVH7AePmo4EXUS4U1g6xDuctj3hj3cOarpKo2+dEYrAwY13Bx28tOW0z2uK 5 | xQhNX3zHP9ssiTsLQ+6E+MjEvKjYcvAFtadXYtYTUZWhxuh8W2vnhOiR3zyJQL98 6 | 4iAl08G/T+HI/3JX3vGSFEnOP/ypqz7wQEMJwOEjVpsgaStf5N1JbSOSKp7r/aOM 7 | LQHnYHkfjWSNkX1v0QJfXl7iwtB8XVxRPftY4fdANrGTpQnUOogVo4q6mI80qJ5O 8 | uWfI+gdkxvMVnbmnNp1HtTslPGfBbF+XfQG23xEFvnYTUVvmmNX5QuHY2Vy6KpSS 9 | tQmf4FGZXjQdGzxavFfQjdiBOhxi5DEixcFpwlS1VcHRWb1G2yp15q3ukWrEkh9X 10 | 4vV6h05fmdvxOk9QhHTr0XCIzC4GmaUBM/UYvzGjlfwrAgMBAAE= 11 | -----END PUBLIC KEY----- 12 | -------------------------------------------------------------------------------- /Tool/esptool/test/secure_images/rsa_secure_boot_signing_pubkey2.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEAsM8ZHltWA8BfpCH1+xrm 3 | unmRCnzxZMjYsl069V7zkZlzKNHm7n76Q0+Jqb4g0uDzY3YD3hQAZTyCYxYjcgVm 4 | 4PQDSedkpWjkovKDJrvUIb3YzCGfoOOdj1vaJhGAH9COpJJJgvJG5fgvor7ERxFt 5 | q6/kTR2Dmipkc0CwrZi1CsBomcHKfUAEfuWY2hd2F4tmyN3Q/jObRUpk3XjPzFJP 6 | QDgnjgkxYHtUq9psalCqR8hjAx+pQHyGOMLNYSK0RwqslbvXy0dheLjlUPg84Z/g 7 | a4eYqboRy8wsiG+vRRgl4oYxIxg36WqurwaRu+8nUCO3zqQDff3yaN/lGlYfJojQ 8 | ihNto8opB5rTdRW/Obs0qE6nSf1WQMfG6ercRoMHx2alRgr1GRFe8QCm+nQsWnY7 9 | DOIy5U3usmQH9kjOBSYvHHvDbXvgyYRA3EHicWjh4akhtlbFosZeBZbK6NrsuKC8 10 | gc0UIpd8OcXmEudUEg34ezoLOs0gd4LI7hMt1c9UKofpAgMBAAE= 11 | -----END PUBLIC KEY----- 12 | -------------------------------------------------------------------------------- /Tool/esptool/test/secure_images/rsa_secure_boot_signing_pubkey4.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEApY+yGcE5s0hecfgMuIiv 3 | 5s4wr4Xkx+DPWs3r2fdZeUulpKtoh5QZ5QG2OFivx1ASBA4bN4NjuCzO+M83OLrC 4 | U8nCr4J1WLejOgJHabrvlAqYrRt6WF9ZQaw0feVasC13b96PgC80GgU6KhiLhJla 5 | hQLFC7F/Cyh14j5P31SCb3isSlIP6VN/PK73RETWwV+Ie3zxIrMeF2mpumLrW4U5 6 | YBt8PNQ1eAWmlUYD1iMGXZeZ9u/DRuhHGxTR4KCSov5/F14+Rb3L0eajYAQcyypU 7 | tDHLc7m62EAICqK2uHl3QX9+xnXnj2cfYUhDiQ1S6WJyVo9RTCx8qCYMVPt4c1DU 8 | rG+1dWKXFS5rQuQ9FaDNlE7sH1+QoBmyWRO9esIVOPFVXHa0E7VCVQQFpH833yCV 9 | JrqCiCCtlVaUDpvXbZWftJHgAXPWE9uecAMUjB+7qW5SXYfbiQsZPi9cnEZTyRs8 10 | jcQwA+1DDhY8SpzRe3+36ooJQ5WJDeCps/3y4STSgs1dAgMBAAE= 11 | -----END PUBLIC KEY----- 12 | -------------------------------------------------------------------------------- /update_log.md: -------------------------------------------------------------------------------- 1 | ### 更新日志 2 | 3 | ##### 软件 4 | 版本 | 更新日期 | 更新说明 5 | :-:|:-:|:-: 6 | v1.0 | 20200213 | 第一版 7 | v1.0.1 | 20210403 | 增加升温完成蜂鸣器的提示,修改编码器的驱动增强操作 8 | v1.0.5 | 20210517 | 增加`surface.py`界面、修改`ssd1306_esp.py` `main.py`的bug 9 | 10 | 11 | 12 | ##### 硬件 13 | 版本 | 更新日期 | 更新说明 14 | :-:|:-:|:-: 15 | v1.0 | 20200228 | 正式版本 16 | v1.1 | 20200410 | PCB中增加可控硅电路的开窗以及覆铜 -------------------------------------------------------------------------------- /webrepl-ctrl.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClimbSnail/HeatPlatform_SMT/0afc43f740b40acb39caababd7b7a4fe034af303/webrepl-ctrl.zip --------------------------------------------------------------------------------