├── .editorconfig ├── .gitattributes ├── .github └── workflows │ ├── arduino_packing.yml │ ├── arduino_packing_release.yml │ ├── build.yml │ ├── check-sourcecode.yml │ └── deploy.yml ├── .gitignore ├── AUTHORS ├── CMakeLists.txt ├── CMakeSettings.json ├── COPYING ├── INSTALL ├── NEWS ├── README.md ├── avrdude.pdf ├── build.sh ├── src ├── CMakeLists.txt ├── GNUmakefile.in ├── Makefile.am ├── arduino.c ├── arduino.h ├── auto-aux │ └── .gitignore ├── auto-m4 │ └── .gitignore ├── autotools-build.sh ├── avr.c ├── avr910.c ├── avr910.h ├── avr_opcodes.c ├── avrcache.c ├── avrdude.1 ├── avrdude.conf.in ├── avrdude.h ├── avrdude.spec.in ├── avrftdi.c ├── avrftdi.h ├── avrftdi_private.h ├── avrftdi_tpi.c ├── avrftdi_tpi.h ├── avrintel.c ├── avrpart.c ├── bitbang.c ├── bitbang.h ├── bootstrap ├── build-helpers │ ├── versioninfo.m4 │ ├── versioninfo.md │ ├── versioninfo.mk │ └── versioninfo.sh ├── buspirate.c ├── buspirate.h ├── butterfly.c ├── butterfly.h ├── ch341a.c ├── ch341a.h ├── cmake_config.h.in ├── config.c ├── config.h ├── config_gram.y ├── configure.ac ├── configure.cmake ├── confwin.c ├── crc16.c ├── crc16.h ├── developer_opts.c ├── developer_opts.h ├── developer_opts_private.h ├── dfu.c ├── dfu.h ├── disasm.c ├── doc │ ├── .gitignore │ ├── CMakeLists.txt │ ├── Makefile.am │ ├── avrdude.css │ ├── avrdude.texi │ ├── parts.sed │ ├── programmer_types.cmake │ └── programmers.sed ├── dryrun.c ├── dryrun.h ├── dryrun_private.h ├── elf2tag ├── elf2tag.1 ├── elf2tag.1.adoc ├── fileio.c ├── flip1.c ├── flip1.h ├── flip2.c ├── flip2.h ├── freebsd_ppi.h ├── ft245r.c ├── ft245r.h ├── jtag3.c ├── jtag3.h ├── jtag3_private.h ├── jtagmkI.c ├── jtagmkI.h ├── jtagmkII.c ├── jtagmkII.h ├── jtagmkII_private.h ├── jtagmkI_private.h ├── leds.c ├── lexer.l ├── libavrdude-avrintel.h ├── libavrdude.h ├── libavrdude.i ├── linux_ppdev.h ├── linuxgpio.c ├── linuxgpio.h ├── linuxspi.c ├── linuxspi.h ├── lists.c ├── main.c ├── micronucleus.c ├── micronucleus.h ├── msvc │ ├── getopt.c │ ├── getopt.h │ ├── gettimeofday.c │ ├── msvc_compat.h │ ├── readline.cpp │ ├── readline │ │ ├── history.h │ │ └── readline.h │ ├── sys │ │ └── time.h │ ├── unistd.h │ └── usleep.cpp ├── par.c ├── par.h ├── pgm.c ├── pgm_type.c ├── pickit2.c ├── pickit2.h ├── pickit5.c ├── pickit5.h ├── pickit5_lut.h ├── pickit5_lut_dw.c ├── pickit5_lut_isp.c ├── pickit5_lut_jtag.c ├── pickit5_lut_pdi.c ├── pickit5_lut_tpi.c ├── pickit5_lut_updi.c ├── pindefs.c ├── ppi.c ├── ppi.h ├── python │ ├── about.ui │ ├── adgui.bat.in │ ├── adgui.py │ ├── adgui.sh.in │ ├── adgui.ui │ ├── askfuse.ui │ ├── device.ui │ ├── devinfo.ui │ ├── help.ui │ ├── loglevel.ui │ ├── memories.ui │ ├── programmer.ui │ └── swigtest.py ├── ser_avrdoper.c ├── ser_posix.c ├── ser_win32.c ├── serbb.h ├── serbb_posix.c ├── serbb_win32.c ├── serialadapter.c ├── serialupdi.c ├── serialupdi.h ├── serprog.c ├── serprog.h ├── solaris_ecpp.h ├── stk500.c ├── stk500.h ├── stk500_private.h ├── stk500generic.c ├── stk500generic.h ├── stk500v2.c ├── stk500v2.h ├── stk500v2_private.h ├── strutil.c ├── teensy.c ├── teensy.h ├── term.c ├── tpi.h ├── update-elf2tag-manpage ├── update.c ├── updi_constants.h ├── updi_link.c ├── updi_link.h ├── updi_nvm.c ├── updi_nvm.h ├── updi_nvm_v0.c ├── updi_nvm_v0.h ├── updi_nvm_v2.c ├── updi_nvm_v2.h ├── updi_nvm_v3.c ├── updi_nvm_v3.h ├── updi_nvm_v4.c ├── updi_nvm_v4.h ├── updi_nvm_v5.c ├── updi_nvm_v5.h ├── updi_readwrite.c ├── updi_readwrite.h ├── updi_state.c ├── updi_state.h ├── urbootautogen.c ├── urbootlist.c ├── urbootlist.h ├── urclock.c ├── urclock.h ├── urclock_hash.h ├── urclock_private.h ├── usb_hidapi.c ├── usb_libusb.c ├── usbasp.c ├── usbasp.h ├── usbdevs.h ├── usbtiny.c ├── usbtiny.h ├── whereami.c ├── whereami.h ├── windows.rc.in ├── wiring.c ├── wiring.h ├── xbee.c └── xbee.h ├── supporting-docs └── avrprog.pdf └── tools ├── atdf-to-avrdude.xslt ├── bootloader-hash ├── build-mingw32.sh ├── check-sourcecode ├── get-dw-params.xsl ├── get-hv-params.xsl ├── get-stk600-cards.xsl ├── get-stk600-devices.xsl ├── scripts_decoder.py ├── test-avrdude ├── test8 └── test_files ├── 0xff_128B.hex ├── 0xff_256B.hex ├── 0xff_32B.hex ├── 0xff_512B.hex ├── 0xff_64B.hex ├── 0xff_768B.hex ├── blink-mega2560+lext-test.hex ├── cola-vending-machine.raw ├── expected-flash-m2560.raw ├── generate_test_hex.sh ├── holes_eeprom_0xff_1024B.hex ├── holes_eeprom_0xff_128B.hex ├── holes_eeprom_0xff_2048B.hex ├── holes_eeprom_0xff_256B.hex ├── holes_eeprom_0xff_4096B.hex ├── holes_eeprom_0xff_512B.hex ├── holes_eeprom_0xff_64B.hex ├── holes_eeprom_0xff_8192B.hex ├── holes_flash_0xff_10240B.hex ├── holes_flash_0xff_1024B.hex ├── holes_flash_0xff_131072B.hex ├── holes_flash_0xff_139264B.hex ├── holes_flash_0xff_16384B.hex ├── holes_flash_0xff_204800B.hex ├── holes_flash_0xff_20480B.hex ├── holes_flash_0xff_2048B.hex ├── holes_flash_0xff_262144B.hex ├── holes_flash_0xff_270336B.hex ├── holes_flash_0xff_32768B.hex ├── holes_flash_0xff_36864B.hex ├── holes_flash_0xff_401408B.hex ├── holes_flash_0xff_40960B.hex ├── holes_flash_0xff_4096B.hex ├── holes_flash_0xff_49152B.hex ├── holes_flash_0xff_512B.hex ├── holes_flash_0xff_524288B.hex ├── holes_flash_0xff_65536B.hex ├── holes_flash_0xff_69632B.hex ├── holes_flash_0xff_8192B.hex ├── holes_pack_my_box_1024B.hex ├── holes_pack_my_box_128B.hex ├── holes_pack_my_box_2048B.hex ├── holes_pack_my_box_256B.hex ├── holes_pack_my_box_4096B.hex ├── holes_pack_my_box_512B.hex ├── holes_pack_my_box_64B.hex ├── holes_pack_my_box_8192B.hex ├── holes_rjmp_loops_10240B.hex ├── holes_rjmp_loops_1024B.hex ├── holes_rjmp_loops_131072B.hex ├── holes_rjmp_loops_139264B.hex ├── holes_rjmp_loops_16384B.hex ├── holes_rjmp_loops_204800B.hex ├── holes_rjmp_loops_20480B.hex ├── holes_rjmp_loops_2048B.hex ├── holes_rjmp_loops_262144B.hex ├── holes_rjmp_loops_270336B.hex ├── holes_rjmp_loops_32768B.hex ├── holes_rjmp_loops_36864B.hex ├── holes_rjmp_loops_401408B.hex ├── holes_rjmp_loops_40960B.hex ├── holes_rjmp_loops_4096B.hex ├── holes_rjmp_loops_49152B.hex ├── holes_rjmp_loops_512B.hex ├── holes_rjmp_loops_524288B.hex ├── holes_rjmp_loops_65536B.hex ├── holes_rjmp_loops_69632B.hex ├── holes_rjmp_loops_8192B.hex ├── holes_the_five_boxing_wizards_1024B.hex ├── holes_the_five_boxing_wizards_128B.hex ├── holes_the_five_boxing_wizards_2048B.hex ├── holes_the_five_boxing_wizards_256B.hex ├── holes_the_five_boxing_wizards_4096B.hex ├── holes_the_five_boxing_wizards_512B.hex ├── holes_the_five_boxing_wizards_64B.hex ├── holes_the_five_boxing_wizards_8192B.hex ├── lorem_ipsum_1024B.srec ├── lorem_ipsum_128B.srec ├── lorem_ipsum_2048B.srec ├── lorem_ipsum_256B.srec ├── lorem_ipsum_4096B.srec ├── lorem_ipsum_512B.srec ├── lorem_ipsum_64B.srec ├── lorem_ipsum_8192B.srec ├── random_data_128B.bin ├── random_data_256B.bin ├── random_data_32B.bin ├── random_data_512B.bin ├── random_data_64B.bin ├── random_data_768B.bin ├── rjmp_loops_for_bootloaders_10240B.hex ├── rjmp_loops_for_bootloaders_1024B.hex ├── rjmp_loops_for_bootloaders_131072B.hex ├── rjmp_loops_for_bootloaders_139264B.hex ├── rjmp_loops_for_bootloaders_16384B.hex ├── rjmp_loops_for_bootloaders_204800B.hex ├── rjmp_loops_for_bootloaders_20480B.hex ├── rjmp_loops_for_bootloaders_2048B.hex ├── rjmp_loops_for_bootloaders_262144B.hex ├── rjmp_loops_for_bootloaders_270336B.hex ├── rjmp_loops_for_bootloaders_32768B.hex ├── rjmp_loops_for_bootloaders_36864B.hex ├── rjmp_loops_for_bootloaders_401408B.hex ├── rjmp_loops_for_bootloaders_40960B.hex ├── rjmp_loops_for_bootloaders_4096B.hex ├── rjmp_loops_for_bootloaders_49152B.hex ├── rjmp_loops_for_bootloaders_512B.hex ├── rjmp_loops_for_bootloaders_524288B.hex ├── rjmp_loops_for_bootloaders_65536B.hex ├── rjmp_loops_for_bootloaders_69632B.hex ├── rjmp_loops_for_bootloaders_8192B.hex ├── the_quick_brown_fox_1024B.hex ├── the_quick_brown_fox_128B.hex ├── the_quick_brown_fox_2048B.hex ├── the_quick_brown_fox_256B.hex ├── the_quick_brown_fox_4096B.hex ├── the_quick_brown_fox_512B.hex ├── the_quick_brown_fox_64B.hex ├── the_quick_brown_fox_8192B.hex └── urboot_m2560_1s_x16m0_115k2_uart0_rxe0_txe1_led+b7_pr_ee_ce.hex /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig: https://editorconfig.org 2 | 3 | root = true 4 | 5 | [{CMakeLists.txt,*.cmake}] 6 | charset = utf-8 7 | tab_width = 4 8 | indent_size = 4 9 | indent_style = space 10 | trim_trailing_whitespace = true 11 | 12 | [{bootstrap,configure.ac,avrdude.spec.in,Makefile.am}] 13 | charset = utf-8 14 | tab_width = 4 15 | indent_size = 4 16 | indent_style = tab 17 | 18 | [avrdude.conf.in] 19 | indent_size = 4 20 | indent_style = space 21 | 22 | [*.{c,h,cpp,y}] 23 | tab_width = 4 24 | indent_size = 4 25 | indent_style = space 26 | insert_final_newline = true 27 | trim_trailing_whitespace = true 28 | 29 | [*.md] 30 | charset = utf-8 31 | tab_width = 2 32 | indent_size = 2 33 | indent_style = space 34 | 35 | [*.yml] 36 | charset = utf-8 37 | tab_width = 2 38 | indent_size = 2 39 | indent_style = space 40 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto eol=lf 2 | *.sln text eol=crlf 3 | *.vcxproj text eol=crlf 4 | *.vcxproj.filters text eol=crlf 5 | -------------------------------------------------------------------------------- /.github/workflows/check-sourcecode.yml: -------------------------------------------------------------------------------- 1 | name: "Check Sourcecode" 2 | 3 | on: 4 | push: 5 | branches-ignore: 6 | - 'onlinedocs' 7 | pull_request: 8 | branches-ignore: 9 | - 'onlinedocs' 10 | 11 | jobs: 12 | 13 | check-sourcecode: 14 | name: "Check Sourcecode" 15 | runs-on: ubuntu-latest 16 | 17 | steps: 18 | 19 | - uses: actions/checkout@v4 20 | 21 | # - name: Install prerequisites 22 | 23 | - name: "Check the sourcecode" 24 | run: ./tools/check-sourcecode 25 | 26 | check-generated: 27 | name: "Check Generated Files" 28 | runs-on: ubuntu-latest 29 | 30 | steps: 31 | 32 | - uses: actions/checkout@v4 33 | 34 | - name: Install prerequisites 35 | run: >- 36 | sudo apt-get update 37 | 38 | sudo apt-get install -y 39 | asciidoctor 40 | 41 | - name: "Verify elf2tag.1 consistency" 42 | run: ./src/update-elf2tag-manpage --verify 43 | -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | # 2 | # deploy.yml - GitHub deploy action for AVRDUDE 3 | # Copyright (C) 2021 Marius Greuel 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | name: Deploy 20 | 21 | on: 22 | push: 23 | tags: 24 | - 'v*' 25 | 26 | jobs: 27 | build: 28 | uses: avrdudes/avrdude/.github/workflows/build.yml@main 29 | 30 | release: 31 | needs: build 32 | runs-on: ubuntu-latest 33 | outputs: 34 | upload_url: ${{ steps.create_release.outputs.upload_url }} 35 | steps: 36 | - name: Create Release 37 | id: create_release 38 | uses: actions/create-release@v1 39 | env: 40 | GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} 41 | with: 42 | tag_name: ${{github.ref}} 43 | release_name: AVRDUDE ${{github.ref}} 44 | body: "See **[Release Notes](https://github.com/avrdudes/avrdude/blob/main/NEWS)** for changes" 45 | draft: false 46 | prerelease: false 47 | 48 | asset-msvc: 49 | needs: release 50 | runs-on: ubuntu-latest 51 | strategy: 52 | matrix: 53 | include: 54 | - { arch: x86 } 55 | - { arch: x64 } 56 | - { arch: arm64 } 57 | steps: 58 | - name: Download artifact 59 | uses: actions/download-artifact@v2 60 | with: 61 | name: avrdude-msvc-${{matrix.arch}} 62 | 63 | - name: Create release asset 64 | run: >- 65 | zip -j asset.zip 66 | avrdude.exe 67 | avrdude.pdb 68 | avrdude.conf 69 | 70 | - name: Upload release asset 71 | uses: actions/upload-release-asset@v1 72 | env: 73 | GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} 74 | with: 75 | upload_url: ${{needs.release.outputs.upload_url}} 76 | asset_path: ./asset.zip 77 | asset_name: avrdude-${{github.ref_name}}-windows-${{matrix.arch}}.zip 78 | asset_content_type: application/zip 79 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .deps/ 3 | .libs/ 4 | m4/ 5 | *.diff 6 | *.patch 7 | y.output 8 | y.tab.h 9 | lexer.c 10 | config_gram.c 11 | config_gram.h 12 | .depend 13 | INSTALL 14 | Makefile.in 15 | Makefile 16 | ac_cfg.h.in 17 | ac_cfg.h.in~ 18 | aclocal.m4 19 | autom4te.cache 20 | configure 21 | configure~ 22 | depcomp 23 | install-sh 24 | compile 25 | missing 26 | mkinstalldirs 27 | stamp-h.in 28 | stamp-h1 29 | ac_cfg.h 30 | avrdude.conf 31 | avrdude.conf.tmp 32 | avrdude.spec 33 | config.guess 34 | config.log 35 | config.status 36 | config.sub 37 | avrdude 38 | libtool 39 | ltmain.sh 40 | ylwrap 41 | tags 42 | cscope.out 43 | /src/avrdude-[1-9].[0-9].tar.* 44 | /src/avrdude-[1-9].[0-9]/ 45 | /src/avrdude-[1-9].[0-9]-20[0-9][0-9][01][0-9][0-3][0-9].tar.* 46 | /src/avrdude-[1-9].[0-9]-20[0-9][0-9][01][0-9][0-3][0-9]/ 47 | /src/GNUmakefile 48 | 49 | *.o 50 | *.lo 51 | *.a 52 | *.la 53 | 54 | # CMake 55 | out/ 56 | build/ 57 | build_*/ 58 | CMakeFiles/ 59 | /CMakeCache.txt 60 | cmake_install.cmake 61 | 62 | # Visual Studio 63 | .vs/ 64 | [Dd]ebug/ 65 | [Rr]elease/ 66 | x64/ 67 | x86/ 68 | *.suo 69 | *.user 70 | *.userosscache 71 | *.sln.docstates 72 | *.log 73 | 74 | # Visual Studio code 75 | .vscode/ 76 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | AVRDUDE was written by: 2 | 3 | Brian S. Dean 4 | 5 | AVRDUDE is currently maintained by: 6 | 7 | Hans Eirik Bull 8 | Stefan Rueger 9 | Xiaofan Chen 10 | Joerg Wunsch 11 | 12 | Contributors: 13 | 14 | Joerg Wunsch 15 | Eric B. Weddington 16 | Martin J. Thomas 17 | Theodore A. Roth 18 | Erik Walthinsen 19 | Jan-Hinnerk Reichert 20 | Alex Shepherd 21 | Juliane Holzt 22 | Colin O'Flynn 23 | Thomas Fischl 24 | David Hoerl 25 | Christian Starkjohann 26 | David Moore 27 | David Brownell 28 | Dick Streefland 29 | Limor Fried 30 | Klaus Leidinger 31 | Lars Immisch 32 | Michal Ludvig 33 | Roger E. Wolff 34 | Darell Tan 35 | Brett Hagman 36 | Wolfgang Moser 37 | Ville Voipio 38 | Hannes Weisbach 39 | Doug Springer 40 | Rene Liebscher 41 | Jim Paris 42 | Jan Egil Ruud 43 | David Mosberger 44 | Kirill Levchenko 45 | Kevin Cuzner 46 | David Sainty 47 | Alexey Sadkov 48 | Marius Greuel 49 | Ralf Ramsauer 50 | Dawid Buchwald 51 | Hans Eirik Bull 52 | Stefan Rueger 53 | Xiaofan Chen 54 | Jeff Kent 55 | Sebastian Kuzminsky 56 | Sydney Louisa Wilke 57 | MX682X 58 | 59 | Contributors to code no longer present: 60 | 61 | Dale Roberts for the giveio driver 62 | Paula Tomlinson for the loaddrv sources 63 | Chris Liechti for loaddrv modifications 64 | 65 | For minor contributions, please see the ChangeLog files / Git log. 66 | -------------------------------------------------------------------------------- /CMakeSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "x64-Debug", 5 | "generator": "Ninja", 6 | "configurationType": "Debug", 7 | "inheritEnvironments": [ "msvc_x64_x64" ], 8 | "buildRoot": "${projectDir}\\out\\build\\${name}", 9 | "installRoot": "${projectDir}\\out\\install\\${name}", 10 | "cmakeCommandArgs": "", 11 | "buildCommandArgs": "", 12 | "ctestCommandArgs": "", 13 | "variables": [ 14 | { 15 | "name": "USE_EXTERNAL_LIBS", 16 | "value": "true", 17 | "type": "BOOL" 18 | } 19 | ] 20 | }, 21 | { 22 | "name": "x64-Release", 23 | "generator": "Ninja", 24 | "configurationType": "RelWithDebInfo", 25 | "buildRoot": "${projectDir}\\out\\build\\${name}", 26 | "installRoot": "${projectDir}\\out\\install\\${name}", 27 | "cmakeCommandArgs": "", 28 | "buildCommandArgs": "", 29 | "ctestCommandArgs": "", 30 | "inheritEnvironments": [ "msvc_x64_x64" ], 31 | "variables": [ 32 | { 33 | "name": "USE_EXTERNAL_LIBS", 34 | "value": "true", 35 | "type": "BOOL" 36 | } 37 | ] 38 | }, 39 | { 40 | "name": "x86-Debug", 41 | "generator": "Ninja", 42 | "configurationType": "Debug", 43 | "buildRoot": "${projectDir}\\out\\build\\${name}", 44 | "installRoot": "${projectDir}\\out\\install\\${name}", 45 | "cmakeCommandArgs": "", 46 | "buildCommandArgs": "", 47 | "ctestCommandArgs": "", 48 | "inheritEnvironments": [ "msvc_x86" ], 49 | "variables": [ 50 | { 51 | "name": "USE_EXTERNAL_LIBS", 52 | "value": "true", 53 | "type": "BOOL" 54 | } 55 | ] 56 | }, 57 | { 58 | "name": "x86-Release", 59 | "generator": "Ninja", 60 | "configurationType": "RelWithDebInfo", 61 | "buildRoot": "${projectDir}\\out\\build\\${name}", 62 | "installRoot": "${projectDir}\\out\\install\\${name}", 63 | "cmakeCommandArgs": "", 64 | "buildCommandArgs": "", 65 | "ctestCommandArgs": "", 66 | "inheritEnvironments": [ "msvc_x86" ], 67 | "variables": [ 68 | { 69 | "name": "USE_EXTERNAL_LIBS", 70 | "value": "true", 71 | "type": "BOOL" 72 | } 73 | ] 74 | } 75 | ] 76 | } -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | Installation Instructions 2 | ************************* 3 | 4 | See README.md. 5 | -------------------------------------------------------------------------------- /avrdude.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/avrdudes/avrdude/231bb28db58fe8a016b58526514510ed6fb03135/avrdude.pdf -------------------------------------------------------------------------------- /src/GNUmakefile.in: -------------------------------------------------------------------------------- 1 | # @configure_input@ 2 | 3 | include Makefile 4 | 5 | need_to_rerun := $(shell $(top_srcdir)/build-helpers/versioninfo.sh "$(top_srcdir)" "@VERSIONINFO_STAMPFILE@" | { @VERSIONINFO_READ@; \ 6 | if @VERSIONINFO_IS_UNCHANGED@ \ 7 | echo "no"; \ 8 | fi; } ) 9 | ifneq (no,$(need_to_rerun)) 10 | $(info Recorded and current version information do not match.) 11 | $(info Re-running autoreconf via bootstrap.) 12 | dummy1 := $(shell $(top_srcdir)/bootstrap) 13 | endif 14 | 15 | # vim: syntax=make 16 | -------------------------------------------------------------------------------- /src/arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2009 Lars Immisch 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef arduino_h__ 20 | #define arduino_h__ 21 | 22 | extern const char arduino_desc[]; 23 | void arduino_initpgm(PROGRAMMER *pgm); 24 | #endif 25 | -------------------------------------------------------------------------------- /src/auto-aux/.gitignore: -------------------------------------------------------------------------------- 1 | # Ensure git creates empty directory for autotools to place files into 2 | * 3 | -------------------------------------------------------------------------------- /src/auto-m4/.gitignore: -------------------------------------------------------------------------------- 1 | # Ensure creation of empty directory for autotools to place files into 2 | * 3 | -------------------------------------------------------------------------------- /src/autotools-build.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | set -ex 4 | 5 | cd "$(dirname "$0")" 6 | top_srcdir="$(pwd)" 7 | 8 | ostype="$(uname | tr A-Z a-z)" 9 | 10 | if test "x$MAKE" = x; then 11 | if gmake --version > /dev/null 2>&1; then 12 | MAKE=gmake 13 | fi 14 | fi 15 | make="${make-"${MAKE-make} -j$(nproc)"}" 16 | 17 | rm -rf autom4te.cache/ 18 | 19 | prefix="$top_srcdir/build_autotools-prefix" 20 | rm -rf "$prefix" 21 | 22 | top_builddir="$top_srcdir/build_autotools" 23 | 24 | # Remove remainders of failed distcheck attempts 25 | for dir in "$top_builddir" 26 | do 27 | if test -d "$dir"; then 28 | chmod -R +w "$dir" 29 | fi 30 | done 31 | rm -rf "$top_builddir" 32 | 33 | ./bootstrap 34 | 35 | mkdir "$top_builddir" 36 | cd "$top_builddir" 37 | 38 | configure_opts="" 39 | configure_opts="$configure_opts --disable-silent-rules" 40 | configure_opts="$configure_opts --enable-parport" 41 | case "$ostype" in 42 | *linux) 43 | configure_opts="$configure_opts --enable-linuxgpio --enable-linuxspi" 44 | configure_opts="$configure_opts --enable-doc" 45 | ;; 46 | esac 47 | 48 | $top_srcdir/configure --prefix="$prefix" ${configure_opts} 49 | 50 | $make all 51 | $make check 52 | $make install 53 | $make installcheck 54 | 55 | printf "\n\n" | $top_srcdir/../tools/test-avrdude -e $prefix/bin/avrdude -d0 -p"-cdryrun -pm2560" -p"-cdryrun -pavr64du28" 56 | 57 | $make distcheck 58 | -------------------------------------------------------------------------------- /src/avr910.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2003-2004 Theodore A. Roth 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef avr910_h 20 | #define avr910_h 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | extern const char avr910_desc[]; 27 | void avr910_initpgm(PROGRAMMER *pgm); 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/avrdude.spec.in: -------------------------------------------------------------------------------- 1 | ## -*- mode: rpm-spec; -*- 2 | ## 3 | ## @configure_input@ 4 | ## 5 | 6 | %define debug_package %{nil} 7 | 8 | %define _with_docs 1 9 | %{?_without_docs: %define _with_docs 0} 10 | 11 | Summary: AVRDUDE is software for programming Atmel AVR Microcontrollers. 12 | Name: avrdude 13 | Version: @VERSION@ 14 | Release: 1 15 | URL: http://savannah.nongnu.org/projects/avrdude 16 | Source0: %{name}-%{version}.tar.gz 17 | License: GPL 18 | Group: Development/Tools 19 | BuildRoot: %{_tmppath}/%{name}-%{version}-root 20 | 21 | %description 22 | AVRDUDE is software for programming Atmel AVR Microcontrollers. 23 | 24 | %if %{_with_docs} 25 | ## The avrdude-docs subpackage 26 | %package docs 27 | Summary: Documentation for AVRDUDE. 28 | Group: Documentation 29 | %description docs 30 | Documentation for avrdude in info, html, postscript and pdf formats. 31 | %endif 32 | 33 | %prep 34 | %setup -q 35 | 36 | %build 37 | 38 | ./configure --prefix=%{_prefix} --sysconfdir=/etc --mandir=%{_mandir} \ 39 | --infodir=%{_infodir} \ 40 | %if %{_with_docs} 41 | --enable-doc=yes 42 | %else 43 | --enable-doc=no 44 | %endif 45 | 46 | make 47 | 48 | %install 49 | rm -rf $RPM_BUILD_ROOT 50 | make prefix=$RPM_BUILD_ROOT%{_prefix} \ 51 | sysconfdir=$RPM_BUILD_ROOT/etc \ 52 | mandir=$RPM_BUILD_ROOT%{_mandir} \ 53 | infodir=$RPM_BUILD_ROOT%{_infodir} \ 54 | install 55 | 56 | rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/%{name}-%{version} 57 | rm -f $RPM_BUILD_ROOT%{_infodir}/dir 58 | 59 | %clean 60 | rm -rf $RPM_BUILD_ROOT 61 | 62 | %if %{_with_docs} 63 | %post docs 64 | [ -f %{_infodir}/avrdude.info ] && \ 65 | /sbin/install-info %{_infodir}/avrdude.info %{_infodir}/dir || : 66 | [ -f %{_infodir}/avrdude.info.gz ] && \ 67 | /sbin/install-info %{_infodir}/avrdude.info.gz %{_infodir}/dir || : 68 | 69 | %preun docs 70 | if [ $1 = 0 ]; then 71 | [ -f %{_infodir}/avrdude.info ] && \ 72 | /sbin/install-info --delete %{_infodir}/avrdude.info %{_infodir}/dir || : 73 | [ -f %{_infodir}/avrdude.info.gz ] && \ 74 | /sbin/install-info --delete %{_infodir}/avrdude.info.gz %{_infodir}/dir || : 75 | fi 76 | %endif 77 | 78 | %files 79 | %defattr(-,root,root) 80 | %{_prefix}/bin/avrdude 81 | %{_mandir}/man1/avrdude.1.gz 82 | %attr(0644,root,root) %config /etc/avrdude.conf 83 | 84 | %if %{_with_docs} 85 | %files docs 86 | %doc %{_infodir}/*info* 87 | %doc doc/avrdude-html/*.html 88 | %doc doc/TODO 89 | %doc doc/avrdude.pdf 90 | %endif 91 | 92 | %changelog 93 | * Fri Sep 23 2005 Galen Seitz 94 | - Default to enable-doc=yes during configure. 95 | - Move info file to docs package. 96 | - Make building of docs package conditional. Basic idea copied from avr-gcc. 97 | 98 | * Wed Aug 27 2003 Theodore A. Roth 99 | [Thanks to Artur Lipowski ] 100 | - Do not build debug package. 101 | - Remove files not packaged to quell RH9 rpmbuild complaints. 102 | 103 | * Wed Mar 05 2003 Theodore A. Roth 104 | - Add docs sub-package. 105 | - Add %post and %preun scriptlets for handling info files. 106 | 107 | * Wed Feb 26 2003 Theodore A. Roth 108 | - Initial build. 109 | 110 | 111 | -------------------------------------------------------------------------------- /src/avrftdi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrftdi - extension for avrdude 3 | * Copyright (C) 2011 Wolfgang Moser, Ville Voipio, Hannes Weisbach, Doug Springer 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef avrftdi_h 20 | #define avrftdi_h 21 | 22 | #include 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | extern const char avrftdi_desc[]; 29 | extern const char avrftdi_jtag_desc[]; 30 | void avrftdi_initpgm(PROGRAMMER *pgm); 31 | void avrftdi_jtag_initpgm(PROGRAMMER *pgm); 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | #endif 37 | -------------------------------------------------------------------------------- /src/avrftdi_tpi.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // int avrftdi_tpi_write_byte(PROGRAMMER *pgm, unsigned char byte); 4 | // int avrftdi_tpi_read_byte(PROGRAMMER *pgm, unsigned char *byte); 5 | int avrftdi_cmd_tpi(const PROGRAMMER *pgm, const unsigned char *cmd, int cmd_len, unsigned char *res, int res_len); 6 | int avrftdi_tpi_initialize(const PROGRAMMER *pgm, const AVRPART *p); 7 | void avrftdi_tpi_initpgm(PROGRAMMER *pgm); 8 | -------------------------------------------------------------------------------- /src/bitbang.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2000, 2001, 2002, 2003 Brian S. Dean 4 | * Copyright (C) 2005 Juliane Holzt 5 | * Copyright (C) 2011 Darell Tan 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #ifndef bitbang_h 22 | #define bitbang_h 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | int bitbang_setpin(int fd, int pin, int value); 29 | int bitbang_getpin(int fd, int pin); 30 | int bitbang_highpulsepin(int fd, int pin); 31 | void bitbang_delay(unsigned int us); 32 | 33 | int bitbang_check_prerequisites(const PROGRAMMER *pgm); 34 | 35 | int bitbang_rdy_led(const PROGRAMMER *pgm, int value); 36 | int bitbang_err_led(const PROGRAMMER *pgm, int value); 37 | int bitbang_pgm_led(const PROGRAMMER *pgm, int value); 38 | int bitbang_vfy_led(const PROGRAMMER *pgm, int value); 39 | int bitbang_cmd(const PROGRAMMER *pgm, const unsigned char *cmd, unsigned char *res); 40 | int bitbang_cmd_tpi(const PROGRAMMER *pgm, const unsigned char *cmd, int cmd_len, unsigned char *res, int res_len); 41 | int bitbang_spi(const PROGRAMMER *pgm, const unsigned char *cmd, unsigned char *res, int count); 42 | int bitbang_chip_erase(const PROGRAMMER *pgm, const AVRPART *p); 43 | int bitbang_program_enable(const PROGRAMMER *pgm, const AVRPART *p); 44 | void bitbang_powerup(const PROGRAMMER *pgm); 45 | void bitbang_powerdown(const PROGRAMMER *pgm); 46 | int bitbang_initialize(const PROGRAMMER *pgm, const AVRPART *p); 47 | void bitbang_disable(const PROGRAMMER *pgm); 48 | void bitbang_enable(PROGRAMMER *pgm, const AVRPART *p); 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | #endif 54 | -------------------------------------------------------------------------------- /src/bootstrap: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | cd "$(dirname "$0")" 4 | 5 | : ${AUTORECONF="autoreconf${AC_VER}"} 6 | : ${AUTOHEADER="autoheader${AC_VER}"} 7 | : ${AUTOCONF="autoconf${AC_VER}"} 8 | : ${ACLOCAL="aclocal${AM_VER}"} 9 | : ${AUTOMAKE="automake${AM_VER}"} 10 | 11 | export ACLOCAL AUTOHEADER AUTOCONF AUTOMAKE 12 | 13 | # Bootstrap the build system. 14 | 15 | set -x 16 | 17 | rm -rf autom4te.cache 18 | 19 | # MacOS calls it "glibtoolize", everyone else "libtoolize" 20 | # probe for that 21 | LIBTOOLIZE=libtoolize 22 | glibtoolize --version > /dev/null 2>&1 && LIBTOOLIZE=glibtoolize 23 | export LIBTOOLIZE 24 | 25 | ${AUTORECONF} -i "$@" 26 | -------------------------------------------------------------------------------- /src/build-helpers/versioninfo.m4: -------------------------------------------------------------------------------- 1 | # versioninfo.m4 - find avrdude version information for msg -*- Autoconf -*- 2 | # serial 1 3 | dnl | Increment the above serial number every time you edit this file. 4 | dnl | When it finds multiple m4 files with the same name, 5 | dnl | aclocal will use the one with the highest serial. 6 | dnl 7 | dnl The sequence of version info items to store in the version-stamp file. 8 | dnl This must be the same sequence as the versioninfo script writes. 9 | m4_pattern_forbid([versioninfo_items]) 10 | m4_define([versioninfo_items], [ 11 | [CMAKE_PROJECT_VERSION], 12 | [CMAKE_LIBAVRDUDE_VERSION], 13 | [CMAKE_LIBAVRDUDE_SOVERSION], 14 | [GIT_COMMIT_DATE], 15 | [GIT_COMMIT_HASH], 16 | [GIT_TAG_HASH] 17 | ]) 18 | dnl 19 | dnl Initialize version info from the script command given as macro argument. 20 | m4_pattern_forbid([versioninfo_init]) 21 | m4_define([versioninfo_init], [ 22 | m4_pushdef([versioninfo_split], m4_split(m4_esyscmd($1),m4_newline)) 23 | m4_case(m4_sysval, [0], [ 24 | m4_for([N], [1], m4_count(versioninfo_split), [1], [ 25 | m4_define([versioninfo_]m4_normalize(m4_argn(N, versioninfo_items)), 26 | m4_normalize(m4_argn(N, versioninfo_split))) 27 | ]) 28 | ], [ 29 | m4_fatal([versioninfo script returned non-0]) 30 | ]) 31 | ]) 32 | dnl 33 | m4_define([versioninfo_stampfile], [versioninfo-stamp]) 34 | dnl 35 | versioninfo_init([./build-helpers/versioninfo.sh . ]m4_defn([versioninfo_stampfile])) 36 | dnl 37 | dnl 38 | dnl 39 | dnl ======================================================================== 40 | dnl VERSIONINFO_SETUP() 41 | dnl ======================================================================== 42 | dnl 43 | AC_DEFUN([VERSIONINFO_SETUP], [dnl 44 | m4_foreach([ITEM], [versioninfo_items], [dnl 45 | AC_SUBST(m4_normalize(ITEM), [m4_defn([versioninfo_]m4_normalize(ITEM))]) 46 | AC_MSG_CHECKING([versioninfo item ]m4_normalize(ITEM)) 47 | AC_MSG_RESULT([$]m4_normalize(ITEM)) 48 | ]) 49 | dnl 50 | dnl Define helper substitutions containing shell code for use inside 51 | dnl make recipes in build-helpers/versioninfo.mk and $(shell ...) 52 | dnl calls in GNUmakefile.in dealing with version info. 53 | dnl 54 | AC_SUBST([VERSIONINFO_STAMPFILE], [m4_defn([versioninfo_stampfile])]) 55 | AM_SUBST_NOTMAKE([VERSIONINFO_WRITE]) 56 | dnl 57 | AC_SUBST([VERSIONINFO_READ], 58 | ['m4_foreach([ITEM], [versioninfo_items], [read m4_normalize(ITEM); ]):']) 59 | AM_SUBST_NOTMAKE([VERSIONINFO_READ]) 60 | dnl 61 | AC_SUBST([VERSIONINFO_WRITE], 62 | ['printf "%s\n"m4_foreach([ITEM], [versioninfo_items], [ "$(m4_normalize(ITEM))"])']) 63 | AM_SUBST_NOTMAKE([VERSIONINFO_WRITE]) 64 | dnl 65 | AC_SUBST([VERSIONINFO_IS_UNCHANGED], 66 | ['false; then :; m4_foreach([ITEM], [versioninfo_items], [elif test "x$(m4_normalize(ITEM))" != "x$$m4_normalize(ITEM)"; then printf "%s has changed from %s to %s\n" "m4_normalize(ITEM)" "$(m4_normalize(ITEM))" "$$m4_normalize(ITEM)" >&2; ]) else ']) 67 | AM_SUBST_NOTMAKE([VERSIONINFO_IS_UNCHANGED]) 68 | dnl 69 | ])dnl 70 | dnl 71 | dnl #################################################################### 72 | dnl 73 | dnl Local Variables: 74 | dnl mode: autoconf 75 | dnl End: 76 | -------------------------------------------------------------------------------- /src/build-helpers/versioninfo.mk: -------------------------------------------------------------------------------- 1 | # -*- makefile-automake -*- 2 | 3 | EXTRA_DIST += build-helpers/versioninfo.m4 4 | EXTRA_DIST += build-helpers/versioninfo.md 5 | EXTRA_DIST += build-helpers/versioninfo.sh 6 | 7 | # Before creating dist tarballs, check that autom4te version matches 8 | # versioninfo script version. 9 | dist-hook: versioninfo-check versioninfo-stamp 10 | distcheck-hook: versioninfo-check 11 | 12 | # Note: We cannot run autoreconf from this make recipe, because we would 13 | # need some way to restart the whole dist process from the start 14 | # and there is none. 15 | versioninfo-check: 16 | @:; \ 17 | $(top_srcdir)/build-helpers/versioninfo.sh "$(top_srcdir)" "@VERSIONINFO_STAMPFILE@" \ 18 | | ( @VERSIONINFO_READ@; \ 19 | if @VERSIONINFO_IS_UNCHANGED@ \ 20 | exit 0; \ 21 | fi; \ 22 | rm -rf "$(top_srcdir)/autom4te.cache"; \ 23 | echo "Update the recorded version information by re-running bootstrap/autoreconf(1)."; \ 24 | exit 1; ) 25 | 26 | # Version stamp files can only exist in tarball source trees. 27 | # 28 | # So there is no need to generate them anywhere else or to clean them 29 | # up anywhere. 30 | versioninfo-stamp: 31 | @VERSIONINFO_WRITE@ > "$(distdir)/versioninfo-stamp" 32 | -------------------------------------------------------------------------------- /src/buspirate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * 4 | * avrdude support for The Bus Pirate - universal serial interface 5 | * 6 | * Copyright (C) 2009 Michal Ludvig 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | */ 21 | 22 | #ifndef buspirate_h 23 | #define buspirate_h 24 | 25 | extern const char buspirate_desc[]; 26 | extern const char buspirate_bb_desc[]; 27 | void buspirate_initpgm(PROGRAMMER *pgm); 28 | void buspirate_bb_initpgm(PROGRAMMER *pgm); 29 | #endif 30 | -------------------------------------------------------------------------------- /src/butterfly.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2003-2004 Theodore A. Roth 4 | * 5 | * This program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef butterfly_h 20 | #define butterfly_h 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | extern const char butterfly_desc[]; 27 | extern const char butterfly_mk_desc[]; 28 | void butterfly_initpgm(PROGRAMMER *pgm); 29 | void butterfly_mk_initpgm(PROGRAMMER *pgm); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/ch341a.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * 4 | * avrdude support for CH341A/B 5 | * Copyright (C) 2016 Alexey Sadkov 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #ifndef ch341a_h 22 | #define ch341a_h 23 | 24 | #define CH341A_VID 0x1A86 25 | #define CH341A_PID 0x5512 26 | 27 | #define CH341A_PACKET_LENGTH 0x20 28 | 29 | #define CH341A_USB_BULK_ENDPOINT 0x02 30 | #define CH341A_PACKET_LENGTH 0x20 31 | 32 | #define CH341A_USB_TIMEOUT 15000 33 | 34 | #define CH341A_CMD_SPI_STREAM 0xA8 // SPI command 35 | #define CH341A_CMD_UIO_STREAM 0xAB // UIO command 36 | 37 | #define CH341A_CMD_UIO_STM_IN 0x00 // UIO Interface In (D0~D7) 38 | #define CH341A_CMD_UIO_STM_DIR 0x40 // UIO interface Dir (set dir of D0~D5) 39 | #define CH341A_CMD_UIO_STM_OUT 0x80 // UIO Interface Output (D0~D5) 40 | #define CH341A_CMD_UIO_STM_END 0x20 // UIO Interface End Command 41 | 42 | #define CH341A_CMD_I2C_STREAM 0xAA 43 | #define CH341A_CMD_I2C_STM_SET 0x60 // Bit 2: SPI with two data pairs (D5, D4)=out, (D7, D6)=in 44 | #define CH341A_CMD_I2C_STM_END 0x00 45 | 46 | // USB error identifiers 47 | #define USB_ERROR_NOTFOUND 1 48 | #define USB_ERROR_ACCESS 2 49 | #define USB_ERROR_IO 3 50 | 51 | #ifdef __cplusplus 52 | extern "C" { 53 | #endif 54 | 55 | extern const char ch341a_desc[]; 56 | void ch341a_initpgm(PROGRAMMER *pgm); 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | #endif // ch341a_h 62 | -------------------------------------------------------------------------------- /src/configure.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # configure.cmake - autoconf like multi-line configure 3 | # Copyright (C) 2022 Marius Greuel 4 | # 5 | # This program is free software; you can redistribute it and/or modify 6 | # it under the terms of the GNU General Public License as published by 7 | # the Free Software Foundation; either version 2 of the License, or 8 | # (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program. If not, see . 17 | # 18 | 19 | # Do a multi-line replace based on @