├── README.md ├── avrdude ├── .cvsignore ├── AUTHORS ├── BUILD-FROM-SVN ├── COPYING ├── ChangeLog ├── ChangeLog-2001 ├── ChangeLog-2002 ├── ChangeLog-2003 ├── ChangeLog-2004-2006 ├── ChangeLog-2007 ├── ChangeLog-2008 ├── ChangeLog-2009 ├── ChangeLog-2010 ├── ChangeLog-2011 ├── ChangeLog-2012 ├── ChangeLog-2013 ├── ChangeLog-2014 ├── ChangeLog-2015 ├── Makefile.am ├── NEWS ├── README ├── arduino.c ├── arduino.h ├── atmel-docs │ ├── AVR109.pdf │ ├── AVR910.pdf │ ├── AVRISPmkII-AVR069.pdf │ ├── EDBG │ │ ├── common │ │ │ ├── browserDetect.js │ │ │ ├── css │ │ │ │ ├── 960.css │ │ │ │ ├── docbook.css │ │ │ │ ├── fluid_grid.css │ │ │ │ ├── index.css │ │ │ │ ├── positioning.css │ │ │ │ ├── print.css │ │ │ │ ├── reset.css │ │ │ │ └── text.css │ │ │ ├── fonts │ │ │ │ ├── DroidSansMono.eot │ │ │ │ └── DroidSansMono.ttf │ │ │ ├── images │ │ │ │ ├── Book_Closed.png │ │ │ │ ├── Book_Open.png │ │ │ │ ├── Document_Text.png │ │ │ │ ├── Library.png │ │ │ │ ├── external_link.gif │ │ │ │ ├── loading.gif │ │ │ │ ├── logo.png │ │ │ │ ├── minus.png │ │ │ │ ├── next-arrow.png │ │ │ │ ├── plus.png │ │ │ │ ├── previous-arrow.png │ │ │ │ ├── search-icon.png │ │ │ │ ├── sidebar.png │ │ │ │ ├── starsSmall.png │ │ │ │ ├── toc-icon.png │ │ │ │ └── ui-icons_217bc0_256x240.png │ │ │ ├── jquery │ │ │ │ ├── jquery-1.7.2.min.js │ │ │ │ ├── jquery.cookie.js │ │ │ │ ├── jquery.ui.all.js │ │ │ │ ├── layout │ │ │ │ │ └── jquery.layout.js │ │ │ │ ├── theme-redmond │ │ │ │ │ ├── images │ │ │ │ │ │ ├── ui-anim_basic_16x16.gif │ │ │ │ │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ │ │ │ │ ├── ui-bg_flat_55_fbec88_40x100.png │ │ │ │ │ │ ├── ui-bg_glass_75_d0e5f5_1x400.png │ │ │ │ │ │ ├── ui-bg_glass_85_dfeffc_1x400.png │ │ │ │ │ │ ├── ui-bg_glass_95_fef1ec_1x400.png │ │ │ │ │ │ ├── ui-bg_gloss-wave_55_5c9ccc_500x100.png │ │ │ │ │ │ ├── ui-bg_inset-hard_100_f5f8f9_1x100.png │ │ │ │ │ │ ├── ui-bg_inset-hard_100_fcfdfd_1x100.png │ │ │ │ │ │ ├── ui-icons_217bc0_256x240.png │ │ │ │ │ │ ├── ui-icons_2e83ff_256x240.png │ │ │ │ │ │ ├── ui-icons_469bdd_256x240.png │ │ │ │ │ │ ├── ui-icons_6da8d5_256x240.png │ │ │ │ │ │ ├── ui-icons_cd0a0a_256x240.png │ │ │ │ │ │ ├── ui-icons_d8e7f3_256x240.png │ │ │ │ │ │ └── ui-icons_f9bd01_256x240.png │ │ │ │ │ └── jquery-ui-1.8.2.custom.css │ │ │ │ └── treeview │ │ │ │ │ ├── images │ │ │ │ │ ├── file.gif │ │ │ │ │ ├── folder-closed.gif │ │ │ │ │ ├── folder.gif │ │ │ │ │ ├── treeview-black-line.gif │ │ │ │ │ ├── treeview-black.gif │ │ │ │ │ ├── treeview-default-line.gif │ │ │ │ │ ├── treeview-default.gif │ │ │ │ │ ├── treeview-famfamfam-line.gif │ │ │ │ │ ├── treeview-famfamfam.gif │ │ │ │ │ ├── treeview-gray-line.gif │ │ │ │ │ ├── treeview-gray.gif │ │ │ │ │ ├── treeview-red-line.gif │ │ │ │ │ └── treeview-red.gif │ │ │ │ │ ├── jquery.treeview.css │ │ │ │ │ └── jquery.treeview.min.js │ │ │ ├── main.js │ │ │ └── splitterInit.js │ │ └── protocoldocs │ │ │ ├── ch01s01.html │ │ │ ├── ch01s02.html │ │ │ ├── ch02s01.html │ │ │ ├── ch02s02.html │ │ │ ├── ch02s02s01.html │ │ │ ├── ch02s02s02.html │ │ │ ├── ch02s02s02s01.html │ │ │ ├── ch02s02s02s02.html │ │ │ ├── ch02s02s03.html │ │ │ ├── ch02s02s03s01.html │ │ │ ├── ch02s02s03s02.html │ │ │ ├── ch02s02s03s03.html │ │ │ ├── ch02s02s03s04.html │ │ │ ├── ch02s03s01.html │ │ │ ├── ch02s03s02.html │ │ │ ├── ch02s03s03.html │ │ │ ├── ch02s03s04.html │ │ │ ├── ch02s03s05.html │ │ │ ├── ch02s03s06.html │ │ │ ├── ch02s03s07.html │ │ │ ├── ch02s03s08.html │ │ │ ├── ch02s03s09.html │ │ │ ├── ch02s04.html │ │ │ ├── ch02s04s01.html │ │ │ ├── ch02s04s02.html │ │ │ ├── ch02s04s03.html │ │ │ ├── ch03s01.html │ │ │ ├── ch03s01s01.html │ │ │ ├── ch03s01s01.html~ │ │ │ ├── ch03s01s02.html │ │ │ ├── ch03s01s03.html │ │ │ ├── ch03s01s03s01.html │ │ │ ├── ch03s02.html │ │ │ ├── ch03s02s01.html │ │ │ ├── ch03s02s02.html │ │ │ ├── ch03s02s03.html │ │ │ ├── ch03s02s04.html │ │ │ ├── ch04s01.html │ │ │ ├── ch04s02.html │ │ │ ├── ch04s03.html │ │ │ ├── ch04s04.html │ │ │ ├── ch04s04s01.html │ │ │ ├── ch04s04s03.html │ │ │ ├── ch04s04s04.html │ │ │ ├── ch04s04s05.html │ │ │ ├── ch04s05.html │ │ │ ├── ch04s05s01.html │ │ │ ├── ch04s05s03.html │ │ │ ├── ch04s05s04.html │ │ │ ├── ch04s05s06.html │ │ │ ├── ch04s05s06s02.html │ │ │ ├── ch04s05s06s03.html │ │ │ ├── ch04s05s06s04.html │ │ │ ├── ch04s05s06s05.html │ │ │ ├── ch04s05s07.html │ │ │ ├── ch04s05s07s01.html │ │ │ ├── ch04s05s07s02.html │ │ │ ├── ch04s05s07s03.html │ │ │ ├── ch04s05s07s04.html │ │ │ ├── ch04s05s08.html │ │ │ ├── ch04s05s08s01.html │ │ │ ├── ch04s05s08s02.html │ │ │ ├── ch04s05s08s03.html │ │ │ ├── ch04s05s09.html │ │ │ ├── ch04s05s10.html │ │ │ ├── ch05s01.html │ │ │ ├── ch05s01s01.html │ │ │ ├── ch05s01s02.html │ │ │ ├── ch05s01s03.html │ │ │ ├── ch05s01s04.html │ │ │ ├── ch05s01s05.html │ │ │ ├── ch05s01s06.html │ │ │ ├── ch05s01s07.html │ │ │ ├── ch05s01s08.html │ │ │ ├── ch05s01s09.html │ │ │ ├── ch05s01s10.html │ │ │ ├── ch05s01s11.html │ │ │ ├── ch05s01s12.html │ │ │ ├── ch05s01s13.html │ │ │ ├── ch05s01s14.html │ │ │ ├── ch05s01s15.html │ │ │ ├── ch05s02.html │ │ │ ├── ch05s02s01.html │ │ │ ├── ch05s02s02.html │ │ │ ├── ch05s02s03.html │ │ │ ├── ch05s02s04.html │ │ │ ├── ch05s02s05.html │ │ │ ├── ch05s02s06.html │ │ │ ├── ch05s03.html │ │ │ ├── ch05s03s01.html │ │ │ ├── ch05s03s02.html │ │ │ ├── ch05s03s03.html │ │ │ ├── ch05s04.html │ │ │ ├── ch06s01.html │ │ │ ├── ch06s01s01.html │ │ │ ├── ch06s01s02.html │ │ │ ├── ch06s01s03.html │ │ │ ├── ch06s01s04.html │ │ │ ├── ch06s01s05.html │ │ │ ├── ch06s01s06.html │ │ │ ├── ch06s01s07.html │ │ │ ├── ch06s01s08.html │ │ │ ├── ch06s01s09.html │ │ │ ├── ch06s01s10.html │ │ │ ├── ch06s01s11.html │ │ │ ├── ch06s01s12.html │ │ │ ├── ch06s01s13.html │ │ │ ├── ch06s01s14.html │ │ │ ├── ch06s01s15.html │ │ │ ├── ch06s01s16.html │ │ │ ├── ch06s01s17.html │ │ │ ├── ch06s01s18.html │ │ │ ├── ch06s01s19.html │ │ │ ├── ch06s01s20.html │ │ │ ├── ch06s01s21.html │ │ │ ├── ch06s01s22.html │ │ │ ├── ch06s01s23.html │ │ │ ├── ch06s01s24.html │ │ │ ├── ch06s01s25.html │ │ │ ├── ch06s01s26.html │ │ │ ├── ch06s01s27.html │ │ │ ├── ch06s01s28.html │ │ │ ├── ch06s01s29.html │ │ │ ├── ch06s02.html │ │ │ ├── ch06s02s01.html │ │ │ ├── ch06s02s02.html │ │ │ ├── ch06s02s03.html │ │ │ ├── ch06s02s04.html │ │ │ ├── ch06s02s05.html │ │ │ ├── ch06s03.html │ │ │ ├── ch06s03s01.html │ │ │ ├── ch06s03s02.html │ │ │ ├── ch06s04s01.html │ │ │ ├── ch06s04s02.html │ │ │ ├── ch06s04s03.html │ │ │ ├── ch06s05.html │ │ │ ├── ch06s05s01.html │ │ │ ├── ch06s05s02.html │ │ │ ├── ch06s05s03.html │ │ │ ├── ch06s05s04.html │ │ │ ├── ch06s05s05.html │ │ │ ├── ch06s06.html │ │ │ ├── ch07s01.html │ │ │ ├── ch07s01s01.html │ │ │ ├── ch07s01s02.html │ │ │ ├── ch07s01s03.html │ │ │ ├── ch07s01s04.html │ │ │ ├── ch07s01s05.html │ │ │ ├── ch07s01s06.html │ │ │ ├── ch07s01s07.html │ │ │ ├── ch07s01s08.html │ │ │ ├── ch07s01s09.html │ │ │ ├── ch07s01s10.html │ │ │ ├── ch07s01s11.html │ │ │ ├── ch07s01s12.html │ │ │ ├── ch07s01s13.html │ │ │ ├── ch07s01s14.html │ │ │ ├── ch07s01s15.html │ │ │ ├── ch07s01s16.html │ │ │ ├── ch07s01s17.html │ │ │ ├── ch07s02.html │ │ │ ├── ch07s03.html │ │ │ ├── ch08s01.html │ │ │ ├── ch08s01s01.html │ │ │ ├── ch08s01s02.html │ │ │ ├── ch08s01s03.html │ │ │ ├── ch08s01s04.html │ │ │ ├── ch08s01s05.html │ │ │ ├── ch08s01s06.html │ │ │ ├── ch08s02.html │ │ │ ├── ch08s03.html │ │ │ ├── document.revisions.html │ │ │ ├── index.html │ │ │ ├── pr01.html │ │ │ ├── protocoldocs.Introduction.html │ │ │ ├── protocoldocs.avr32protocol.html │ │ │ ├── protocoldocs.avr8protocol.html │ │ │ ├── protocoldocs.avrispprotocol.html │ │ │ ├── protocoldocs.avrprotocol.Overview.html │ │ │ ├── protocoldocs.cmsis_dap.html │ │ │ ├── protocoldocs.edbg_ctrl_protocol.html │ │ │ ├── protocoldocs.tpiprotocol.html │ │ │ ├── search │ │ │ ├── htmlFileInfoList.js │ │ │ ├── index-1.js │ │ │ ├── index-2.js │ │ │ ├── index-3.js │ │ │ ├── l10n.js │ │ │ ├── nwSearchFnt.js │ │ │ └── stemmers │ │ │ │ └── en_stemmer.js │ │ │ ├── section_avr32_memtypes.html │ │ │ ├── section_avr32_setget_params.html │ │ │ ├── section_avr8_memtypes.html │ │ │ ├── section_avr8_query_contexts.html │ │ │ ├── section_avr8_setget_params.html │ │ │ ├── section_edbg_ctrl_setget_params.html │ │ │ ├── section_edbg_query_contexts.html │ │ │ ├── section_housekeeping_start_session.html │ │ │ ├── section_i5v_3yz_rl.html │ │ │ ├── section_jdx_m11_sl.html │ │ │ ├── section_qhb_x1c_sl.html │ │ │ ├── section_serial_trace.html │ │ │ └── section_t1f_hb1_sl.html │ ├── JTAGICE-AVR060.pdf │ ├── JTAGICEmkII-AVR067.pdf │ ├── STK500-AVR061.pdf │ └── STK500v2-AVR068.pdf ├── avr.c ├── avr910.c ├── avr910.h ├── avrdude.1 ├── avrdude.conf.in ├── avrdude.h ├── avrdude.spec.in ├── avrftdi.c ├── avrftdi.h ├── avrftdi_private.h ├── avrftdi_tpi.c ├── avrftdi_tpi.h ├── avrpart.c ├── bitbang.c ├── bitbang.h ├── bootstrap ├── buspirate.c ├── buspirate.h ├── butterfly.c ├── butterfly.h ├── ch341a.c ├── ch341a.h ├── config.c ├── config.h ├── config_gram.y ├── configure.ac ├── confwin.c ├── crc16.c ├── crc16.h ├── dfu.c ├── dfu.h ├── doc │ ├── .cvsignore │ ├── Makefile.am │ ├── TODO │ ├── avrdude.texi │ └── parts_comments.txt ├── 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 ├── lexer.l ├── libavrdude.h ├── linux_ppdev.h ├── linuxgpio.c ├── linuxgpio.h ├── lists.c ├── main.c ├── my_ddk_hidsdi.h ├── par.c ├── par.h ├── pgm.c ├── pgm_type.c ├── pickit2.c ├── pickit2.h ├── pindefs.c ├── ppi.c ├── ppi.h ├── ppiwin.c ├── safemode.c ├── ser_avrdoper.c ├── ser_posix.c ├── ser_win32.c ├── serbb.h ├── serbb_posix.c ├── serbb_win32.c ├── solaris_ecpp.h ├── stk500.c ├── stk500.h ├── stk500_private.h ├── stk500generic.c ├── stk500generic.h ├── stk500v2.c ├── stk500v2.h ├── stk500v2_private.h ├── term.c ├── term.h ├── tools │ ├── build-mingw32.sh │ ├── get-dw-params.xsl │ ├── get-hv-params.xsl │ ├── get-stk600-cards.xsl │ └── get-stk600-devices.xsl ├── tpi.h ├── update.c ├── usb_hidapi.c ├── usb_libusb.c ├── usbasp.c ├── usbasp.h ├── usbdevs.h ├── usbtiny.c ├── usbtiny.h ├── windows │ ├── .cvsignore │ ├── Makefile.am │ ├── giveio.c │ ├── giveio.sys │ ├── install_giveio.bat │ ├── loaddrv.c │ ├── loaddrv.h │ ├── remove_giveio.bat │ └── status_giveio.bat ├── wiring.c └── wiring.h └── avrdude_win32_bin.7z /README.md: -------------------------------------------------------------------------------- 1 | # avrdude_ch341a 2 | CH341a avrdude support http://www.nongnu.org/avrdude/ 3 | 4 | Only FastSPI 5 | -------------------------------------------------------------------------------- /avrdude/.cvsignore: -------------------------------------------------------------------------------- 1 | *.diff 2 | *.patch 3 | y.output 4 | y.tab.h 5 | lexer.c 6 | config_gram.c 7 | config_gram.h 8 | .cvsignore 9 | .depend 10 | .deps 11 | INSTALL 12 | Makefile.in 13 | Makefile 14 | ac_cfg.h.in 15 | aclocal.m4 16 | autom4te.cache 17 | configure 18 | depcomp 19 | install-sh 20 | compile 21 | missing 22 | mkinstalldirs 23 | stamp-h.in 24 | stamp-h1 25 | ac_cfg.h 26 | avrdude.conf 27 | avrdude.conf.tmp 28 | avrdude.spec 29 | config.guess 30 | config.log 31 | config.status 32 | config.sub 33 | avrdude 34 | -------------------------------------------------------------------------------- /avrdude/AUTHORS: -------------------------------------------------------------------------------- 1 | AVRDUDE was written by: 2 | 3 | Brian S. Dean 4 | 5 | Contributors: 6 | 7 | Joerg Wunsch 8 | Eric Weddington 9 | Jan-Hinnerk Reichert 10 | Alex Shepherd 11 | Martin Thomas 12 | Theodore A. Roth 13 | Michael Holzt 14 | Colin O'Flynn 15 | Thomas Fischl 16 | David Hoerl 17 | Michal Ludvig 18 | Darell Tan 19 | Wolfgang Moser 20 | Ville Voipio 21 | Hannes Weisbach 22 | Doug Springer 23 | Brett Hagman 24 | Rene Liebscher 25 | Jim Paris 26 | 27 | For minor contributions, please see the ChangeLog files. 28 | 29 | -------------------------------------------------------------------------------- /avrdude/BUILD-FROM-SVN: -------------------------------------------------------------------------------- 1 | $Id$ 2 | 3 | How to build avrdude from SVN: 4 | 5 | 1. svn co svn://svn.savannah.nongnu.org/avrdude/trunk 6 | 7 | 2. cd trunk/avrdude 8 | 9 | 3. ./bootstrap 10 | 11 | 4. ./configure 12 | 13 | 5. make 14 | -------------------------------------------------------------------------------- /avrdude/ChangeLog: -------------------------------------------------------------------------------- 1 | 2016-09-14 Joerg Wunsch 2 | 3 | * stk500v2.c (DEBUG, DEBUGRECV): define these unconditionally, 4 | as MSG_TRACE2 messages. 5 | 6 | 2016-05-10 Joerg Wunsch 7 | 8 | Submitted by Hannes Jochriem: 9 | * avrdude.conf.in (ehajo-isp): New programmer. 10 | 11 | 2016-04-20 Joerg Wunsch 12 | 13 | * configure.ac (libftdi1): Rather than hardcoding the library 14 | providing the libusb-1.0 API, use the result from the previous 15 | probe. This helps detecting libftdi1 on FreeBSD where the 16 | libusb-1.0 API is provided by the system's libusb. 17 | 18 | 2016-04-18 Joerg Wunsch 19 | 20 | * usb_hidapi.c (usbhid_open): Correctly calculate the 21 | offset for serial number matching 22 | 23 | 2016-03-28 Joerg Wunsch 24 | 25 | bug #47550: Linux GPIO broken 26 | * linuxgpio.c: Replace %ud by %u in snprintf calls. 27 | 28 | 2016-03-02 Joerg Wunsch 29 | 30 | * usb_hidapi.c (usbhid_recv): Bump read timeout to 300 ms. 31 | 32 | 2016-02-20 Joerg Wunsch 33 | 34 | * jtag3.c: add support for libhidapi as (optional) transport for 35 | CMSIS-DAP compliant debuggers (JTAGICE3 with firmware 3+, 36 | AtmelICE, EDBG, mEDBG) 37 | * usb_hidapi.c: (New file) 38 | * libavrdude.h: Mention usbhid_serdev 39 | * configure.ac: Bump version date 40 | 41 | 2016-02-18 Joerg Wunsch 42 | 43 | (Obtained from patch #8717: pattch for mcprog and libhidapi support) 44 | * configure.ac: Probe for libhidapi 45 | * Makefile.am: Add @LIBHIDAPI@ 46 | 47 | 2016-02-16 Joerg Wunsch 48 | 49 | * doc/avrdude.texi: Bump copyright year. 50 | 51 | 2016-02-16 Joerg Wunsch 52 | 53 | * configure.ac: Bump for post-release 6.3. 54 | 55 | 2016-02-16 Joerg Wunsch 56 | 57 | * configure.ac: Released version 6.3. 58 | 59 | 2016-02-15 Joerg Wunsch 60 | 61 | patch #8894: Spelling in 6.2 doc 62 | * doc/avrdude.texi: Various spelling fixes. 63 | 64 | 2016-02-15 Joerg Wunsch 65 | 66 | patch #8895: Spelling in 6.2 code 67 | * avrftdi.c (avrftdi_open): Spell fix. 68 | 69 | 2016-02-15 Joerg Wunsch 70 | 71 | patch #8896: Silence cppcheck warnings in 6.2 code 72 | * linuxgpio.c: Use %ud to print GPIO values. 73 | 74 | 2016-02-15 Joerg Wunsch 75 | 76 | patch #8735: ATtiny28 support in avrdude.conf 77 | * avrdude.conf.in (ATtiny28): New device. 78 | 79 | 2016-02-15 Joerg Wunsch 80 | 81 | * avrdude.conf.in (ATmega48PB, ATmega88PB, ATmega168PB): New 82 | devices. 83 | 84 | 2016-02-15 Joerg Wunsch 85 | 86 | patch #8435: Implementing mEDBG CMSIS-DAP protocol 87 | * usb_libusb.c: Add endpoint IDs for Xplained Mini, correctly 88 | transfer trailing ZLP when needed 89 | * avrdude.conf.in (xplainedmini, xplainedmini_dw): New entries. 90 | * jtag3.c (jtag3_edbg_send, jtag3_edbg_recv_frame): Implement 91 | fragmentation needed for the 64-byte EP size of the Xplained Mini 92 | * avrdude.1: Document the change 93 | * doc/avrdude.texi: (Dito.) 94 | 95 | 96 | -------------------------------------------------------------------------------- /avrdude/ChangeLog-2003: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/ChangeLog-2003 -------------------------------------------------------------------------------- /avrdude/ChangeLog-2015: -------------------------------------------------------------------------------- 1 | 2015-12-15 Joerg Wunsch 2 | 3 | * avrdude.1 (-C): Do not suggest users might change the 4 | default config file. It will be overwritten by updates. 5 | 6 | 2015-12-09 Joerg Wunsch 7 | 8 | bug #46610: Floating point exception (core dumped) arch linux rpi2 9 | bug #46483: version 6.2. ser_open(): can't set attributes for device 10 | * ser_posix.c: Back out change from patch #8380 11 | 12 | 2015-11-16 Joerg Wunsch 13 | 14 | * configure.ac: Bump for post-release 6.2. 15 | 16 | 2015-11-16 Joerg Wunsch 17 | 18 | * configure.ac: Released version 6.2. 19 | 20 | 2015-10-31 Joerg Wunsch 21 | 22 | Submitted by Martino Facchin: 23 | bug #45727: Wrong atmega8u2 flash parameters 24 | * avrdude.conf.in (ATmega8U2): correct page and block size 25 | 26 | 2015-10-31 Joerg Wunsch 27 | 28 | Submitted by Pasquale Cocchini: 29 | bug #46020: Add TIAO TUMPA to the conf file. 30 | * avrdude.conf.in (tumpa): New entry. 31 | 32 | 2015-10-31 Joerg Wunsch 33 | 34 | Submitted by Pasquale Cocchini: 35 | bug #46021: Please add read in the memory lock section of ATtiny85 36 | * avrdude.conf.in (ATtiny25/45/85): add read pattern for lock bits 37 | 38 | 2015-10-31 Joerg Wunsch 39 | 40 | * Makefile.am (libavrdude_a_SOURCES): reflect recent changes 41 | (pgm.h is gone, config.h is new). 42 | 43 | 2015-04-09 Joerg Wunsch 44 | 45 | bug #44717: avrdude creates empty flash dump 46 | * update.c (do_op): When about to write an empty flash dump file, 47 | warn about this to avoid surprises. 48 | * avrdude.1: Document the truncation of trailing 0xFF bytes for 49 | flash memory areas. 50 | * doc/avrdude.texi: (Dito.) 51 | 52 | 2015-04-09 Joerg Wunsch 53 | 54 | Annual ChangeLog rotation. 55 | -------------------------------------------------------------------------------- /avrdude/Makefile.am: -------------------------------------------------------------------------------- 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 | # 20 | # $Id$ 21 | # 22 | 23 | EXTRA_DIST = \ 24 | ChangeLog \ 25 | ChangeLog-2001 \ 26 | ChangeLog-2002 \ 27 | ChangeLog-2003 \ 28 | ChangeLog-2004-2006 \ 29 | ChangeLog-2007 \ 30 | ChangeLog-2008 \ 31 | ChangeLog-2009 \ 32 | ChangeLog-2010 \ 33 | ChangeLog-2011 \ 34 | ChangeLog-2012 \ 35 | ChangeLog-2013 \ 36 | avrdude.1 \ 37 | avrdude.spec \ 38 | bootstrap 39 | 40 | CLEANFILES = \ 41 | config_gram.c \ 42 | config_gram.h \ 43 | lexer.c 44 | 45 | BUILT_SOURCES = $(CLEANFILES) 46 | 47 | #SUBDIRS = doc @WINDOWS_DIRS@ 48 | #DIST_SUBDIRS = doc windows 49 | 50 | # . lets build this directory before the following in SUBDIRS 51 | SUBDIRS = . 52 | # doc comes here, and we want to use the built avrdude to generate the parts list 53 | SUBDIRS += @SUBDIRS_AC@ 54 | SUBDIRS += @WINDOWS_DIRS@ 55 | DIST_SUBDIRS = @DIST_SUBDIRS_AC@ 56 | 57 | AM_YFLAGS = -d 58 | 59 | avrdude_CPPFLAGS = -DCONFIG_DIR=\"$(sysconfdir)\" 60 | 61 | libavrdude_a_CPPFLAGS = -DCONFIG_DIR=\"$(sysconfdir)\" 62 | libavrdude_la_CPPFLAGS = $(libavrdude_a_CPPFLAGS) 63 | 64 | avrdude_CFLAGS = @ENABLE_WARNINGS@ 65 | 66 | libavrdude_a_CFLAGS = @ENABLE_WARNINGS@ 67 | libavrdude_la_CFLAGS = $(libavrdude_a_CFLAGS) 68 | 69 | avrdude_LDADD = $(top_builddir)/$(noinst_LIBRARIES) @LIBUSB_1_0@ @LIBHIDAPI@ @LIBUSB@ @LIBFTDI1@ @LIBFTDI@ @LIBHID@ @LIBELF@ @LIBPTHREAD@ -lm 70 | 71 | bin_PROGRAMS = avrdude 72 | 73 | noinst_LIBRARIES = libavrdude.a 74 | lib_LTLIBRARIES = libavrdude.la 75 | 76 | # automake thinks these generated files should be in the distribution, 77 | # but this might cause trouble for some users, so we rather don't want 78 | # to have them there. 79 | # 80 | # See 81 | # 82 | # https://savannah.nongnu.org/bugs/index.php?func=detailitem&item_id=15536 83 | # 84 | # for why we don't want to have them. 85 | dist-hook: 86 | rm -f \ 87 | $(distdir)/lexer.c \ 88 | $(distdir)/config_gram.c \ 89 | $(distdir)/config_gram.h 90 | 91 | libavrdude_a_SOURCES = \ 92 | config_gram.y \ 93 | lexer.l \ 94 | arduino.h \ 95 | arduino.c \ 96 | avr.c \ 97 | avr910.c \ 98 | avr910.h \ 99 | avrdude.h \ 100 | avrftdi.c \ 101 | avrftdi.h \ 102 | avrftdi_private.h \ 103 | avrftdi_tpi.c \ 104 | avrftdi_tpi.h \ 105 | avrpart.c \ 106 | bitbang.c \ 107 | bitbang.h \ 108 | buspirate.c \ 109 | buspirate.h \ 110 | butterfly.c \ 111 | butterfly.h \ 112 | config.c \ 113 | config.h \ 114 | confwin.c \ 115 | crc16.c \ 116 | crc16.h \ 117 | dfu.c \ 118 | dfu.h \ 119 | fileio.c \ 120 | flip1.c \ 121 | flip1.h \ 122 | flip2.c \ 123 | flip2.h \ 124 | freebsd_ppi.h \ 125 | ft245r.c \ 126 | ft245r.h \ 127 | jtagmkI.c \ 128 | jtagmkI.h \ 129 | jtagmkI_private.h \ 130 | jtagmkII.c \ 131 | jtagmkII.h \ 132 | jtagmkII_private.h \ 133 | jtag3.c \ 134 | jtag3.h \ 135 | jtag3_private.h \ 136 | libavrdude.h \ 137 | linuxgpio.c \ 138 | linuxgpio.h \ 139 | linux_ppdev.h \ 140 | lists.c \ 141 | my_ddk_hidsdi.h \ 142 | par.c \ 143 | par.h \ 144 | pgm.c \ 145 | pgm_type.c \ 146 | pickit2.c \ 147 | pickit2.h \ 148 | pindefs.c \ 149 | ppi.c \ 150 | ppi.h \ 151 | ppiwin.c \ 152 | safemode.c \ 153 | serbb.h \ 154 | serbb_posix.c \ 155 | serbb_win32.c \ 156 | ser_avrdoper.c \ 157 | ser_posix.c \ 158 | ser_win32.c \ 159 | solaris_ecpp.h \ 160 | stk500.c \ 161 | stk500.h \ 162 | stk500_private.h \ 163 | stk500v2.c \ 164 | stk500v2.h \ 165 | stk500v2_private.h \ 166 | stk500generic.c \ 167 | stk500generic.h \ 168 | tpi.h \ 169 | usbasp.c \ 170 | usbasp.h \ 171 | ch341a.c \ 172 | ch341a.h \ 173 | usbdevs.h \ 174 | usb_hidapi.c \ 175 | usb_libusb.c \ 176 | usbtiny.h \ 177 | usbtiny.c \ 178 | update.c \ 179 | wiring.h \ 180 | wiring.c 181 | libavrdude_la_SOURCES = $(libavrdude_a_SOURCES) 182 | libavrdude_la_LDFLAGS = -version-info 1:0 183 | 184 | include_HEADERS = libavrdude.h 185 | 186 | avrdude_SOURCES = \ 187 | main.c \ 188 | term.c \ 189 | term.h 190 | 191 | man_MANS = avrdude.1 192 | 193 | sysconf_DATA = avrdude.conf 194 | 195 | install-exec-local: backup-avrdude-conf 196 | 197 | distclean-local: 198 | rm -f avrdude.conf 199 | 200 | # This will get run before the config file is installed. 201 | backup-avrdude-conf: 202 | @echo "Backing up avrdude.conf in ${DESTDIR}${sysconfdir}" 203 | @if test -e ${DESTDIR}${sysconfdir}/avrdude.conf; then \ 204 | cp -pR ${DESTDIR}${sysconfdir}/avrdude.conf \ 205 | ${DESTDIR}${sysconfdir}/avrdude.conf.bak; \ 206 | fi 207 | 208 | ACLOCAL_AMFLAGS = -I m4 209 | -------------------------------------------------------------------------------- /avrdude/NEWS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/NEWS -------------------------------------------------------------------------------- /avrdude/README: -------------------------------------------------------------------------------- 1 | See the documentation file for the details. 2 | 3 | The latest version of AVRDUDE is always available here: 4 | 5 | http://savannah.nongnu.org/projects/avrdude 6 | 7 | 8 | Important environment variables for ./configure: 9 | ================================================ 10 | 11 | CPPFLAGS: C preprocessor flags (*not* "C++") 12 | 13 | This is the place to put additional (non-standard) -I options into. 14 | For example, if your Windows system has LibUSB-Win32 installed into 15 | \\WINDOWS\ProgramFiles\LibUSB-Win32, use 16 | 17 | CPPFLAGS=-I/WINDOWS/ProgramFiles/LibUSB-Win32/include 18 | 19 | to tell configure where to search for the header files. (The use of 20 | forward slashes rather than backslashes can often simplify things. 21 | Note that the Windows system services internally treat both the same. 22 | It's only cmd.exe which requires backslashes as the directory 23 | separator.) 24 | 25 | LDFLAGS: Linker options 26 | 27 | This is the place to make additional library locations known to the 28 | linker. To continue the above example, use 29 | 30 | LDFLAGS=-L/WINDOWS/ProgramFiles/LibUSB-Win32/lib/gcc 31 | 32 | to make the linker search for "libusb.a" in that directory. 33 | 34 | 35 | Linux users: make sure the header files are installed 36 | ===================================================== 37 | 38 | While many Linux distributions install the libraries needed by AVRDUDE 39 | (libusb, libelf) by default, they leave out the corresponding header 40 | files. Consequently, the configure script won't find them, so these 41 | libraries could not be used. 42 | 43 | Usually, the packages with the header files (and static libraries) are 44 | derived from the regular package name by appending "-devel". Thus, 45 | make sure you have "libusb-devel" and "libelf-devel" installed before 46 | running the configure script. (Same goes for libftdi.) 47 | -------------------------------------------------------------------------------- /avrdude/arduino.c: -------------------------------------------------------------------------------- 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 | /* $Id$ */ 20 | 21 | /* 22 | * avrdude interface for Arduino programmer 23 | * 24 | * The Arduino programmer is mostly a STK500v1, just the signature bytes 25 | * are read differently. 26 | */ 27 | 28 | #include "ac_cfg.h" 29 | 30 | #include 31 | #include 32 | #include 33 | 34 | #include "avrdude.h" 35 | #include "libavrdude.h" 36 | #include "stk500_private.h" 37 | #include "stk500.h" 38 | #include "arduino.h" 39 | 40 | /* read signature bytes - arduino version */ 41 | static int arduino_read_sig_bytes(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m) 42 | { 43 | unsigned char buf[32]; 44 | 45 | /* Signature byte reads are always 3 bytes. */ 46 | 47 | if (m->size < 3) { 48 | avrdude_message(MSG_INFO, "%s: memsize too small for sig byte read", progname); 49 | return -1; 50 | } 51 | 52 | buf[0] = Cmnd_STK_READ_SIGN; 53 | buf[1] = Sync_CRC_EOP; 54 | 55 | serial_send(&pgm->fd, buf, 2); 56 | 57 | if (serial_recv(&pgm->fd, buf, 5) < 0) 58 | return -1; 59 | if (buf[0] == Resp_STK_NOSYNC) { 60 | avrdude_message(MSG_INFO, "%s: stk500_cmd(): programmer is out of sync\n", 61 | progname); 62 | return -1; 63 | } else if (buf[0] != Resp_STK_INSYNC) { 64 | avrdude_message(MSG_INFO, "\n%s: arduino_read_sig_bytes(): (a) protocol error, " 65 | "expect=0x%02x, resp=0x%02x\n", 66 | progname, Resp_STK_INSYNC, buf[0]); 67 | return -2; 68 | } 69 | if (buf[4] != Resp_STK_OK) { 70 | avrdude_message(MSG_INFO, "\n%s: arduino_read_sig_bytes(): (a) protocol error, " 71 | "expect=0x%02x, resp=0x%02x\n", 72 | progname, Resp_STK_OK, buf[4]); 73 | return -3; 74 | } 75 | 76 | m->buf[0] = buf[1]; 77 | m->buf[1] = buf[2]; 78 | m->buf[2] = buf[3]; 79 | 80 | return 3; 81 | } 82 | 83 | static int arduino_open(PROGRAMMER * pgm, char * port) 84 | { 85 | union pinfo pinfo; 86 | strcpy(pgm->port, port); 87 | pinfo.baud = pgm->baudrate? pgm->baudrate: 115200; 88 | if (serial_open(port, pinfo, &pgm->fd)==-1) { 89 | return -1; 90 | } 91 | 92 | /* Clear DTR and RTS to unload the RESET capacitor 93 | * (for example in Arduino) */ 94 | serial_set_dtr_rts(&pgm->fd, 0); 95 | usleep(250*1000); 96 | /* Set DTR and RTS back to high */ 97 | serial_set_dtr_rts(&pgm->fd, 1); 98 | usleep(50*1000); 99 | 100 | /* 101 | * drain any extraneous input 102 | */ 103 | stk500_drain(pgm, 0); 104 | 105 | if (stk500_getsync(pgm) < 0) 106 | return -1; 107 | 108 | return 0; 109 | } 110 | 111 | static void arduino_close(PROGRAMMER * pgm) 112 | { 113 | serial_set_dtr_rts(&pgm->fd, 0); 114 | serial_close(&pgm->fd); 115 | pgm->fd.ifd = -1; 116 | } 117 | 118 | const char arduino_desc[] = "Arduino programmer"; 119 | 120 | void arduino_initpgm(PROGRAMMER * pgm) 121 | { 122 | /* This is mostly a STK500; just the signature is read 123 | differently than on real STK500v1 124 | and the DTR signal is set when opening the serial port 125 | for the Auto-Reset feature */ 126 | stk500_initpgm(pgm); 127 | 128 | strcpy(pgm->type, "Arduino"); 129 | pgm->read_sig_bytes = arduino_read_sig_bytes; 130 | pgm->open = arduino_open; 131 | pgm->close = arduino_close; 132 | } 133 | -------------------------------------------------------------------------------- /avrdude/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 | /* $Id$ */ 20 | 21 | #ifndef arduino_h__ 22 | #define arduino_h__ 23 | 24 | extern const char arduino_desc[]; 25 | void arduino_initpgm (PROGRAMMER * pgm); 26 | 27 | #endif 28 | 29 | 30 | -------------------------------------------------------------------------------- /avrdude/atmel-docs/AVR109.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/AVR109.pdf -------------------------------------------------------------------------------- /avrdude/atmel-docs/AVR910.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/AVR910.pdf -------------------------------------------------------------------------------- /avrdude/atmel-docs/AVRISPmkII-AVR069.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/AVRISPmkII-AVR069.pdf -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/browserDetect.js: -------------------------------------------------------------------------------- 1 | var BrowserDetect = { 2 | init: function () { 3 | this.browser = this.searchString(this.dataBrowser) || "An unknown browser"; 4 | this.version = this.searchVersion(navigator.userAgent) 5 | || this.searchVersion(navigator.appVersion) 6 | || "an unknown version"; 7 | this.OS = this.searchString(this.dataOS) || "an unknown OS"; 8 | }, 9 | searchString: function (data) { 10 | for (var i=0;i> Global 19 | ----------------------------------------------------------------------------------------------------*/ 20 | 21 | .grid_1, 22 | .grid_2, 23 | .grid_3 { 24 | display:inline; 25 | float: left; 26 | position: relative; 27 | margin-left: 1%; 28 | margin-right: 1%; 29 | } 30 | 31 | /* Grid >> Children (Alpha ~ First, Omega ~ Last) 32 | ----------------------------------------------------------------------------------------------------*/ 33 | 34 | .alpha { 35 | margin-left: 0; 36 | } 37 | 38 | .omega { 39 | margin-right: 0; 40 | } 41 | 42 | /* Grid >> 3 Columns 43 | ----------------------------------------------------------------------------------------------------*/ 44 | 45 | 46 | .container_3 .grid_1 { 47 | width:31.333%; 48 | } 49 | 50 | .container_3 .grid_2 { 51 | width:64.667%; 52 | } 53 | 54 | .container_3 .grid_3 { 55 | width:98.0%; 56 | } 57 | 58 | 59 | 60 | /* Prefix Extra Space >> 3 Columns 61 | ----------------------------------------------------------------------------------------------------*/ 62 | 63 | 64 | .container_3 .prefix_1 { 65 | padding-left:33.333%; 66 | } 67 | 68 | .container_3 .prefix_2 { 69 | padding-left:66.667%; 70 | } 71 | 72 | 73 | 74 | /* Suffix Extra Space >> 3 Columns 75 | ----------------------------------------------------------------------------------------------------*/ 76 | 77 | 78 | .container_3 .suffix_1 { 79 | padding-right:33.333%; 80 | } 81 | 82 | .container_3 .suffix_2 { 83 | padding-right:66.667%; 84 | } 85 | 86 | 87 | 88 | /* Push Space >> 3 Columns 89 | ----------------------------------------------------------------------------------------------------*/ 90 | 91 | 92 | .container_3 .push_1 { 93 | left:33.333%; 94 | } 95 | 96 | .container_3 .push_2 { 97 | left:66.667%; 98 | } 99 | 100 | 101 | 102 | /* Pull Space >> 3 Columns 103 | ----------------------------------------------------------------------------------------------------*/ 104 | 105 | 106 | .container_3 .pull_1 { 107 | left:-33.333%; 108 | } 109 | 110 | .container_3 .pull_2 { 111 | left:-66.667%; 112 | } 113 | 114 | 115 | 116 | 117 | /* Clear Floated Elements 118 | ----------------------------------------------------------------------------------------------------*/ 119 | 120 | /* http://sonspring.com/journal/clearing-floats */ 121 | 122 | .clear { 123 | clear: both; 124 | display: block; 125 | overflow: hidden; 126 | visibility: hidden; 127 | width: 0; 128 | height: 0; 129 | } 130 | 131 | /* http://perishablepress.com/press/2008/02/05/lessons-learned-concerning-the-clearfix-css-hack */ 132 | 133 | .clearfix:after { 134 | clear: both; 135 | content: ' '; 136 | display: block; 137 | font-size: 0; 138 | line-height: 0; 139 | visibility: hidden; 140 | width: 0; 141 | height: 0; 142 | } 143 | 144 | .clearfix { 145 | display: inline-block; 146 | } 147 | 148 | * html .clearfix { 149 | height: 1%; 150 | } 151 | 152 | .clearfix { 153 | display: block; 154 | } -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/css/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-size: 12px; 3 | font-family: Verdana, Geneva, sans-serif; 4 | } 5 | 6 | .a { 7 | text-decoration: none; 8 | } 9 | 10 | .title { 11 | padding: 31px 0 0 0; 12 | } 13 | 14 | .group 15 | { 16 | /*background-color: pink;*/ 17 | width:966px; 18 | } 19 | 20 | .group_header { 21 | color: #0066CB; 22 | font: bold 14pt IntervalLight, sans-serif; 23 | text-decoration: none; 24 | padding: 8px; 25 | background-color: #EEEEEE; 26 | margin-top: 24px; 27 | /*margin-bottom: 8px;*/ 28 | } 29 | 30 | .products 31 | { 32 | float:left; 33 | /*background:#FFF8F8;*/ 34 | } 35 | 36 | .product { 37 | /*background: url("../images/panelbg.png") 0 0 no-repeat;*/ 38 | width: 300px; 39 | height: 130px; 40 | /*margin-left: 20px;*/ 41 | padding: 10px; 42 | border: 1px solid #EEEEEE; 43 | display:block; 44 | float: left; 45 | } 46 | 47 | .product span { 48 | font-size: 16px; 49 | color: #0066CB; 50 | margin-bottom: 8px; 51 | clear:both; 52 | } 53 | 54 | .product img 55 | { 56 | margin-right:12px; 57 | float:left; 58 | } 59 | 60 | -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/css/print.css: -------------------------------------------------------------------------------- 1 | body { 2 | color : #000000 !important; 3 | background : #ffffff !important; 4 | font-family : "Times New Roman", Times, serif !important; 5 | font-size : 12pt !important; 6 | } 7 | 8 | #sidebar, #sidebar-resizer, #header-resizer, #header { display: none !important;} 9 | 10 | #content { 11 | position: absolute !important; 12 | margin: 0px !important; 13 | left: 0px !important; 14 | right: auto !important; 15 | top: 0px !important; 16 | height: auto !important; 17 | overflow: visible !important; 18 | overflow-x: visible !important; 19 | border-left: 0px solid #000000 !important; 20 | } 21 | 22 | .ui-layout-container { 23 | overflow: visible !important; 24 | } 25 | 26 | .mediaobject { 27 | text-align: left !important; 28 | } -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/css/reset.css: -------------------------------------------------------------------------------- 1 | a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,dialog,div,dl,dt,em,embed,fieldset,figcaption,figure,font,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,html,i,iframe,img,ins,kbd,label,legend,li,main,mark,menu,meter,nav,object,ol,output,p,pre,progress,q,rp,rt,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video,xmp{border:0;margin:0;padding:0;font-size:100%}html,body{height:100%}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section{display:block}b,strong{font-weight:bold}img{color:transparent;font-size:0;vertical-align:middle;-ms-interpolation-mode:bicubic}ol,ul{list-style:none}li{display:list-item}table{border-collapse:collapse;border-spacing:0}th,td,caption{font-weight:normal;vertical-align:top;text-align:left}q{quotes:none}q:before,q:after{content:'';content:none}sub,sup,small{font-size:75%}sub,sup{line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}svg{overflow:hidden} -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/css/text.css: -------------------------------------------------------------------------------- 1 | body{font:13px/1.5 'Helvetica Neue',Arial,'Liberation Sans',FreeSans,sans-serif}pre,code{font-family:'DejaVu Sans Mono',Menlo,Consolas,monospace}hr{border:0 solid #ccc;border-top-width:1px;clear:both;height:0}h1{font-size:25px}h2{font-size:23px}h3{font-size:21px}h4{font-size:19px}h5{font-size:17px}h6{font-size:15px}ol{list-style:decimal}ul{list-style:disc}li{margin-left:30px}p,dl,hr,h1,h2,h3,h4,h5,h6,ol,ul,pre,table,address,fieldset,figure{margin-bottom:20px} -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/fonts/DroidSansMono.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/fonts/DroidSansMono.eot -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/fonts/DroidSansMono.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/fonts/DroidSansMono.ttf -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/images/Book_Closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/images/Book_Closed.png -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/images/Book_Open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/images/Book_Open.png -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/images/Document_Text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/images/Document_Text.png -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/images/Library.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/images/Library.png -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/images/external_link.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/images/external_link.gif -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/images/loading.gif -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/images/logo.png -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/images/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/images/minus.png -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/images/next-arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/images/next-arrow.png -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/images/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/images/plus.png -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/images/previous-arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/images/previous-arrow.png -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/images/search-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/images/search-icon.png -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/images/sidebar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/images/sidebar.png -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/images/starsSmall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/images/starsSmall.png -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/images/toc-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/images/toc-icon.png -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/images/ui-icons_217bc0_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/images/ui-icons_217bc0_256x240.png -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/jquery/jquery.cookie.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Cookie plugin 3 | * 4 | * Copyright (c) 2006 Klaus Hartl (stilbuero.de) 5 | * Dual licensed under the MIT and GPL licenses: 6 | * http://www.opensource.org/licenses/mit-license.php 7 | * http://www.gnu.org/licenses/gpl.html 8 | * 9 | */ 10 | 11 | /** 12 | * Create a cookie with the given name and value and other optional parameters. 13 | * 14 | * @example $.cookie('the_cookie', 'the_value'); 15 | * @desc Set the value of a cookie. 16 | * @example $.cookie('the_cookie', 'the_value', {expires: 7, path: '/', domain: 'jquery.com', secure: true}); 17 | * @desc Create a cookie with all available options. 18 | * @example $.cookie('the_cookie', 'the_value'); 19 | * @desc Create a session cookie. 20 | * @example $.cookie('the_cookie', null); 21 | * @desc Delete a cookie by passing null as value. 22 | * 23 | * @param String name The name of the cookie. 24 | * @param String value The value of the cookie. 25 | * @param Object options An object literal containing key/value pairs to provide optional cookie attributes. 26 | * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object. 27 | * If a negative value is specified (e.g. a date in the past), the cookie will be deleted. 28 | * If set to null or omitted, the cookie will be a session cookie and will not be retained 29 | * when the the browser exits. 30 | * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie). 31 | * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie). 32 | * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will 33 | * require a secure protocol (like HTTPS). 34 | * @type undefined 35 | * 36 | * @name $.cookie 37 | * @cat Plugins/Cookie 38 | * @author Klaus Hartl/klaus.hartl@stilbuero.de 39 | */ 40 | 41 | /** 42 | * Get the value of a cookie with the given name. 43 | * 44 | * @example $.cookie('the_cookie'); 45 | * @desc Get the value of a cookie. 46 | * 47 | * @param String name The name of the cookie. 48 | * @return The value of the cookie. 49 | * @type String 50 | * 51 | * @name $.cookie 52 | * @cat Plugins/Cookie 53 | * @author Klaus Hartl/klaus.hartl@stilbuero.de 54 | */ 55 | jQuery.cookie = function(name, value, options) { 56 | if (typeof value != 'undefined') { // name and value given, set cookie 57 | options = options || {}; 58 | if (value === null) { 59 | value = ''; 60 | options.expires = -1; 61 | } 62 | var expires = ''; 63 | if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) { 64 | var date; 65 | if (typeof options.expires == 'number') { 66 | date = new Date(); 67 | date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000)); 68 | } else { 69 | date = options.expires; 70 | } 71 | expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE 72 | } 73 | var path = options.path ? '; path=' + options.path : ''; 74 | var domain = options.domain ? '; domain=' + options.domain : ''; 75 | var secure = options.secure ? '; secure' : ''; 76 | document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join(''); 77 | 78 | } else { // only name given, get cookie 79 | var cookieValue = null; 80 | if (document.cookie && document.cookie != '') { 81 | var cookies = document.cookie.split(';'); 82 | for (var i = 0; i < cookies.length; i++) { 83 | var cookie = jQuery.trim(cookies[i]); 84 | // Does this cookie string begin with the name we want? 85 | if (cookie.substring(0, name.length + 1) == (name + '=')) { 86 | cookieValue = decodeURIComponent(cookie.substring(name.length + 1)); 87 | break; 88 | } 89 | } 90 | } 91 | return cookieValue; 92 | } 93 | }; -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/jquery/theme-redmond/images/ui-anim_basic_16x16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/jquery/theme-redmond/images/ui-anim_basic_16x16.gif -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/jquery/theme-redmond/images/ui-bg_flat_0_aaaaaa_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/jquery/theme-redmond/images/ui-bg_flat_0_aaaaaa_40x100.png -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/jquery/theme-redmond/images/ui-bg_flat_55_fbec88_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/jquery/theme-redmond/images/ui-bg_flat_55_fbec88_40x100.png -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/jquery/theme-redmond/images/ui-bg_glass_75_d0e5f5_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/jquery/theme-redmond/images/ui-bg_glass_75_d0e5f5_1x400.png -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/jquery/theme-redmond/images/ui-bg_glass_85_dfeffc_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/jquery/theme-redmond/images/ui-bg_glass_85_dfeffc_1x400.png -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/jquery/theme-redmond/images/ui-bg_glass_95_fef1ec_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/jquery/theme-redmond/images/ui-bg_glass_95_fef1ec_1x400.png -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/jquery/theme-redmond/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/jquery/theme-redmond/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/jquery/theme-redmond/images/ui-bg_inset-hard_100_f5f8f9_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/jquery/theme-redmond/images/ui-bg_inset-hard_100_f5f8f9_1x100.png -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/jquery/theme-redmond/images/ui-bg_inset-hard_100_fcfdfd_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/jquery/theme-redmond/images/ui-bg_inset-hard_100_fcfdfd_1x100.png -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/jquery/theme-redmond/images/ui-icons_217bc0_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/jquery/theme-redmond/images/ui-icons_217bc0_256x240.png -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/jquery/theme-redmond/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/jquery/theme-redmond/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/jquery/theme-redmond/images/ui-icons_469bdd_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/jquery/theme-redmond/images/ui-icons_469bdd_256x240.png -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/jquery/theme-redmond/images/ui-icons_6da8d5_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/jquery/theme-redmond/images/ui-icons_6da8d5_256x240.png -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/jquery/theme-redmond/images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/jquery/theme-redmond/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/jquery/theme-redmond/images/ui-icons_d8e7f3_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/jquery/theme-redmond/images/ui-icons_d8e7f3_256x240.png -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/jquery/theme-redmond/images/ui-icons_f9bd01_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/jquery/theme-redmond/images/ui-icons_f9bd01_256x240.png -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/jquery/treeview/images/file.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/jquery/treeview/images/file.gif -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/jquery/treeview/images/folder-closed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/jquery/treeview/images/folder-closed.gif -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/jquery/treeview/images/folder.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/jquery/treeview/images/folder.gif -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/jquery/treeview/images/treeview-black-line.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/jquery/treeview/images/treeview-black-line.gif -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/jquery/treeview/images/treeview-black.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/jquery/treeview/images/treeview-black.gif -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/jquery/treeview/images/treeview-default-line.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/jquery/treeview/images/treeview-default-line.gif -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/jquery/treeview/images/treeview-default.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/jquery/treeview/images/treeview-default.gif -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/jquery/treeview/images/treeview-famfamfam-line.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/jquery/treeview/images/treeview-famfamfam-line.gif -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/jquery/treeview/images/treeview-famfamfam.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/jquery/treeview/images/treeview-famfamfam.gif -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/jquery/treeview/images/treeview-gray-line.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/jquery/treeview/images/treeview-gray-line.gif -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/jquery/treeview/images/treeview-gray.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/jquery/treeview/images/treeview-gray.gif -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/jquery/treeview/images/treeview-red-line.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/jquery/treeview/images/treeview-red-line.gif -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/jquery/treeview/images/treeview-red.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/EDBG/common/jquery/treeview/images/treeview-red.gif -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/jquery/treeview/jquery.treeview.css: -------------------------------------------------------------------------------- 1 | .treeview, .treeview ul { 2 | padding: 0; 3 | margin: 0; 4 | list-style: none; 5 | } 6 | 7 | .treeview ul { 8 | background-color: white; 9 | margin-top: 4px; 10 | } 11 | 12 | .treeview .hitarea { 13 | background: url(images/treeview-default.gif) -64px -25px no-repeat; 14 | height: 16px; 15 | width: 16px; 16 | margin-left: -16px; 17 | float: left; 18 | cursor: pointer; 19 | } 20 | /* fix for IE6 */ 21 | * html .hitarea { 22 | display: inline; 23 | float:none; 24 | } 25 | 26 | .treeview li { 27 | margin: 0; 28 | padding: 3px 0 3px 16px; 29 | } 30 | 31 | .treeview a.selected { 32 | background-color: #eee; 33 | } 34 | 35 | #treecontrol { margin: 1em 0; display: none; } 36 | 37 | .treeview .hover { color: red; cursor: pointer; } 38 | 39 | .treeview li { background: url(images/treeview-default-line.gif) 0 0 no-repeat; } 40 | .treeview li.collapsable, .treeview li.expandable { background-position: 0 -176px; } 41 | 42 | .treeview .expandable-hitarea { background-position: -80px -3px; } 43 | 44 | .treeview li.last { background-position: 0 -1766px } 45 | .treeview li.lastCollapsable, .treeview li.lastExpandable { background-image: url(images/treeview-default.gif); } 46 | .treeview li.lastCollapsable { background-position: 0 -111px } 47 | .treeview li.lastExpandable { background-position: -32px -67px } 48 | 49 | .treeview div.lastCollapsable-hitarea, .treeview div.lastExpandable-hitarea { background-position: 0; } 50 | 51 | .treeview-red li { background-image: url(images/treeview-red-line.gif); } 52 | .treeview-red .hitarea, .treeview-red li.lastCollapsable, .treeview-red li.lastExpandable { background-image: url(images/treeview-red.gif); } 53 | 54 | .treeview-black li { background-image: url(images/treeview-black-line.gif); } 55 | .treeview-black .hitarea, .treeview-black li.lastCollapsable, .treeview-black li.lastExpandable { background-image: url(images/treeview-black.gif); } 56 | 57 | .treeview-gray li { background-image: url(images/treeview-gray-line.gif); } 58 | .treeview-gray .hitarea, .treeview-gray li.lastCollapsable, .treeview-gray li.lastExpandable { background-image: url(images/treeview-gray.gif); } 59 | 60 | .treeview-famfamfam li { background-image: url(images/treeview-famfamfam-line.gif); } 61 | .treeview-famfamfam .hitarea, .treeview-famfamfam li.lastCollapsable, .treeview-famfamfam li.lastExpandable { background-image: url(images/treeview-famfamfam.gif); } 62 | 63 | 64 | .filetree li { padding: 3px 0 2px 16px; } 65 | .filetree span.folder, .filetree span.file { padding: 1px 0 1px 16px; display: block; } 66 | .filetree span.folder { background: url(images/folder.gif) 0 0 no-repeat; } 67 | .filetree li.expandable span.folder { background: url(images/folder-closed.gif) 0 0 no-repeat; } 68 | .filetree span.file { background: url(images/file.gif) 0 0 no-repeat; } 69 | 70 | html, body {height:100%; margin: 0; padding: 0; } 71 | 72 | /* 73 | html>body { 74 | font-size: 16px; 75 | font-size: 68.75%; 76 | } Reset Base Font Size */ 77 | /* 78 | body { 79 | font-family: Verdana, helvetica, arial, sans-serif; 80 | font-size: 68.75%; 81 | background: #fff; 82 | color: #333; 83 | } */ 84 | 85 | a img { border: none; } -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/jquery/treeview/jquery.treeview.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Treeview 1.4 - jQuery plugin to hide and show branches of a tree 3 | * 4 | * http://bassistance.de/jquery-plugins/jquery-plugin-treeview/ 5 | * http://docs.jquery.com/Plugins/Treeview 6 | * 7 | * Copyright (c) 2007 Jörn Zaefferer 8 | * 9 | * Dual licensed under the MIT and GPL licenses: 10 | * http://www.opensource.org/licenses/mit-license.php 11 | * http://www.gnu.org/licenses/gpl.html 12 | * 13 | * Revision: $Id$ 14 | * kasunbg: changed the cookieid name 15 | * 16 | */;(function($){$.extend($.fn,{swapClass:function(c1,c2){var c1Elements=this.filter('.'+c1);this.filter('.'+c2).removeClass(c2).addClass(c1);c1Elements.removeClass(c1).addClass(c2);return this;},replaceClass:function(c1,c2){return this.filter('.'+c1).removeClass(c1).addClass(c2).end();},hoverClass:function(className){className=className||"hover";return this.hover(function(){$(this).addClass(className);},function(){$(this).removeClass(className);});},heightToggle:function(animated,callback){animated?this.animate({height:"toggle"},animated,callback):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();if(callback)callback.apply(this,arguments);});},heightHide:function(animated,callback){if(animated){this.animate({height:"hide"},animated,callback);}else{this.hide();if(callback)this.each(callback);}},prepareBranches:function(settings){if(!settings.prerendered){this.filter(":last-child:not(ul)").addClass(CLASSES.last);this.filter((settings.collapsed?"":"."+CLASSES.closed)+":not(."+CLASSES.open+")").find(">ul").hide();}return this.filter(":has(>ul)");},applyClasses:function(settings,toggler){this.filter(":has(>ul):not(:has(>a))").find(">span").click(function(event){toggler.apply($(this).next());}).add($("a",this)).hoverClass();if(!settings.prerendered){this.filter(":has(>ul:hidden)").addClass(CLASSES.expandable).replaceClass(CLASSES.last,CLASSES.lastExpandable);this.not(":has(>ul:hidden)").addClass(CLASSES.collapsable).replaceClass(CLASSES.last,CLASSES.lastCollapsable);this.prepend("
").find("div."+CLASSES.hitarea).each(function(){var classes="";$.each($(this).parent().attr("class").split(" "),function(){classes+=this+"-hitarea ";});$(this).addClass(classes);});}this.find("div."+CLASSES.hitarea).click(toggler);},treeview:function(settings){if(typeof(window.treeCookieId) === 'undefined' || window.treeCookieId === ""){treeCookieId = "treeview";} settings=$.extend({cookieId: treeCookieId},settings);if(settings.add){return this.trigger("add",[settings.add]);}if(settings.toggle){var callback=settings.toggle;settings.toggle=function(){return callback.apply($(this).parent()[0],arguments);};}function treeController(tree,control){function handler(filter){return function(){toggler.apply($("div."+CLASSES.hitarea,tree).filter(function(){return filter?$(this).parent("."+filter).length:true;}));return false;};}$("a:eq(0)",control).click(handler(CLASSES.collapsable));$("a:eq(1)",control).click(handler(CLASSES.expandable));$("a:eq(2)",control).click(handler());}function toggler(){$(this).parent().find(">.hitarea").swapClass(CLASSES.collapsableHitarea,CLASSES.expandableHitarea).swapClass(CLASSES.lastCollapsableHitarea,CLASSES.lastExpandableHitarea).end().swapClass(CLASSES.collapsable,CLASSES.expandable).swapClass(CLASSES.lastCollapsable,CLASSES.lastExpandable).find(">ul").heightToggle(settings.animated,settings.toggle);if(settings.unique){$(this).parent().siblings().find(">.hitarea").replaceClass(CLASSES.collapsableHitarea,CLASSES.expandableHitarea).replaceClass(CLASSES.lastCollapsableHitarea,CLASSES.lastExpandableHitarea).end().replaceClass(CLASSES.collapsable,CLASSES.expandable).replaceClass(CLASSES.lastCollapsable,CLASSES.lastExpandable).find(">ul").heightHide(settings.animated,settings.toggle);}}function serialize(){function binary(arg){return arg?1:0;}var data=[];branches.each(function(i,e){data[i]=$(e).is(":has(>ul:visible)")?1:0;});$.cookie(settings.cookieId,data.join(""));}function deserialize(){var stored=$.cookie(settings.cookieId);if(stored){var data=stored.split("");branches.each(function(i,e){$(e).find(">ul")[parseInt(data[i])?"show":"hide"]();});}}this.addClass("treeview");var branches=this.find("li").prepareBranches(settings);switch(settings.persist){case"cookie":var toggleCallback=settings.toggle;settings.toggle=function(){serialize();if(toggleCallback){toggleCallback.apply(this,arguments);}};deserialize();break;case"location":var current=this.find("a").filter(function(){return this.href.toLowerCase()==location.href.toLowerCase();});if(current.length){current.addClass("selected").parents("ul, li").add(current.next()).show();}break;}branches.applyClasses(settings,toggler);if(settings.control){treeController(this,settings.control);$(settings.control).show();}return this.bind("add",function(event,branches){$(branches).prev().removeClass(CLASSES.last).removeClass(CLASSES.lastCollapsable).removeClass(CLASSES.lastExpandable).find(">.hitarea").removeClass(CLASSES.lastCollapsableHitarea).removeClass(CLASSES.lastExpandableHitarea);$(branches).find("li").andSelf().prepareBranches(settings).applyClasses(settings,toggler);});}});var CLASSES=$.fn.treeview.classes={open:"open",closed:"closed",expandable:"expandable",expandableHitarea:"expandable-hitarea",lastExpandableHitarea:"lastExpandable-hitarea",collapsable:"collapsable",collapsableHitarea:"collapsable-hitarea",lastCollapsableHitarea:"lastCollapsable-hitarea",lastCollapsable:"lastCollapsable",lastExpandable:"lastExpandable",last:"last",hitarea:"hitarea"};$.fn.Treeview=$.fn.treeview;})(jQuery); -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/common/splitterInit.js: -------------------------------------------------------------------------------- 1 | 2 | var myLayout; 3 | 4 | jQuery(document).ready(function ($) { 5 | 6 | myLayout = $('body').layout({ 7 | //Defining panes 8 | west__paneSelector: "#sidebar" 9 | , north__paneSelector: "#header" 10 | , center__paneSelector: "#content" 11 | 12 | // some resizing/toggling settings 13 | , north__resizable: false // OVERRIDE the pane-default of 'resizable=true' 14 | , north__spacing_open: 0 // no resizer-bar when open (zero height) 15 | , west__slideable: false 16 | , west__spacing_closed: 6 17 | , west__spacing_open: 4 18 | 19 | , 20 | // some pane-size settings 21 | west__minSize: 280 22 | , north__minSize: 99 23 | 24 | // some pane animation settings 25 | , west__animatePaneSizing: false 26 | , west__fxSpeed_size: "normal" 27 | , west__fxSpeed_open: 10 28 | , west__fxSettings_open: {easing: ""} 29 | , west__fxName_close: "none" 30 | 31 | 32 | , stateManagement__enabled: true // automatic cookie load & save enabled by default 33 | , stateManagement__cookie__name: "sidebar_state" 34 | }); 35 | 36 | 37 | 38 | 39 | }); 40 | 41 | -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/protocoldocs/search/l10n.js: -------------------------------------------------------------------------------- 1 | //Resource strings for localization 2 | var localeresource = new Object; 3 | localeresource["search_no_results"]="Your search returned no results."; 4 | -------------------------------------------------------------------------------- /avrdude/atmel-docs/EDBG/protocoldocs/search/stemmers/en_stemmer.js: -------------------------------------------------------------------------------- 1 | // Porter stemmer in Javascript. Few comments, but it's easy to follow against the rules in the original 2 | // paper, in 3 | // 4 | // Porter, 1980, An algorithm for suffix stripping, Program, Vol. 14, 5 | // no. 3, pp 130-137, 6 | // 7 | // see also http://www.tartarus.org/~martin/PorterStemmer 8 | 9 | // Release 1 10 | // Derived from (http://tartarus.org/~martin/PorterStemmer/js.txt) - cjm (iizuu) Aug 24, 2009 11 | 12 | var stemmer = (function(){ 13 | var step2list = { 14 | "ational" : "ate", 15 | "tional" : "tion", 16 | "enci" : "ence", 17 | "anci" : "ance", 18 | "izer" : "ize", 19 | "bli" : "ble", 20 | "alli" : "al", 21 | "entli" : "ent", 22 | "eli" : "e", 23 | "ousli" : "ous", 24 | "ization" : "ize", 25 | "ation" : "ate", 26 | "ator" : "ate", 27 | "alism" : "al", 28 | "iveness" : "ive", 29 | "fulness" : "ful", 30 | "ousness" : "ous", 31 | "aliti" : "al", 32 | "iviti" : "ive", 33 | "biliti" : "ble", 34 | "logi" : "log" 35 | }, 36 | 37 | step3list = { 38 | "icate" : "ic", 39 | "ative" : "", 40 | "alize" : "al", 41 | "iciti" : "ic", 42 | "ical" : "ic", 43 | "ful" : "", 44 | "ness" : "" 45 | }, 46 | 47 | c = "[^aeiou]", // consonant 48 | v = "[aeiouy]", // vowel 49 | C = c + "[^aeiouy]*", // consonant sequence 50 | V = v + "[aeiou]*", // vowel sequence 51 | 52 | mgr0 = "^(" + C + ")?" + V + C, // [C]VC... is m>0 53 | meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$", // [C]VC[V] is m=1 54 | mgr1 = "^(" + C + ")?" + V + C + V + C, // [C]VCVC... is m>1 55 | s_v = "^(" + C + ")?" + v; // vowel in stem 56 | 57 | return function (w) { 58 | var stem, 59 | suffix, 60 | firstch, 61 | re, 62 | re2, 63 | re3, 64 | re4, 65 | origword = w; 66 | 67 | if (w.length < 3) { return w; } 68 | 69 | firstch = w.substr(0,1); 70 | if (firstch == "y") { 71 | w = firstch.toUpperCase() + w.substr(1); 72 | } 73 | 74 | // Step 1a 75 | re = /^(.+?)(ss|i)es$/; 76 | re2 = /^(.+?)([^s])s$/; 77 | 78 | if (re.test(w)) { w = w.replace(re,"$1$2"); } 79 | else if (re2.test(w)) { w = w.replace(re2,"$1$2"); } 80 | 81 | // Step 1b 82 | re = /^(.+?)eed$/; 83 | re2 = /^(.+?)(ed|ing)$/; 84 | if (re.test(w)) { 85 | var fp = re.exec(w); 86 | re = new RegExp(mgr0); 87 | if (re.test(fp[1])) { 88 | re = /.$/; 89 | w = w.replace(re,""); 90 | } 91 | } else if (re2.test(w)) { 92 | var fp = re2.exec(w); 93 | stem = fp[1]; 94 | re2 = new RegExp(s_v); 95 | if (re2.test(stem)) { 96 | w = stem; 97 | re2 = /(at|bl|iz)$/; 98 | re3 = new RegExp("([^aeiouylsz])\\1$"); 99 | re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); 100 | if (re2.test(w)) { w = w + "e"; } 101 | else if (re3.test(w)) { re = /.$/; w = w.replace(re,""); } 102 | else if (re4.test(w)) { w = w + "e"; } 103 | } 104 | } 105 | 106 | // Step 1c 107 | re = new RegExp("^(.+" + c + ")y$"); 108 | if (re.test(w)) { 109 | var fp = re.exec(w); 110 | stem = fp[1]; 111 | w = stem + "i"; 112 | } 113 | 114 | // Step 2 115 | re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; 116 | if (re.test(w)) { 117 | var fp = re.exec(w); 118 | stem = fp[1]; 119 | suffix = fp[2]; 120 | re = new RegExp(mgr0); 121 | if (re.test(stem)) { 122 | w = stem + step2list[suffix]; 123 | } 124 | } 125 | 126 | // Step 3 127 | re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; 128 | if (re.test(w)) { 129 | var fp = re.exec(w); 130 | stem = fp[1]; 131 | suffix = fp[2]; 132 | re = new RegExp(mgr0); 133 | if (re.test(stem)) { 134 | w = stem + step3list[suffix]; 135 | } 136 | } 137 | 138 | // Step 4 139 | re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; 140 | re2 = /^(.+?)(s|t)(ion)$/; 141 | if (re.test(w)) { 142 | var fp = re.exec(w); 143 | stem = fp[1]; 144 | re = new RegExp(mgr1); 145 | if (re.test(stem)) { 146 | w = stem; 147 | } 148 | } else if (re2.test(w)) { 149 | var fp = re2.exec(w); 150 | stem = fp[1] + fp[2]; 151 | re2 = new RegExp(mgr1); 152 | if (re2.test(stem)) { 153 | w = stem; 154 | } 155 | } 156 | 157 | // Step 5 158 | re = /^(.+?)e$/; 159 | if (re.test(w)) { 160 | var fp = re.exec(w); 161 | stem = fp[1]; 162 | re = new RegExp(mgr1); 163 | re2 = new RegExp(meq1); 164 | re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); 165 | if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) { 166 | w = stem; 167 | } 168 | } 169 | 170 | re = /ll$/; 171 | re2 = new RegExp(mgr1); 172 | if (re.test(w) && re2.test(w)) { 173 | re = /.$/; 174 | w = w.replace(re,""); 175 | } 176 | 177 | // and turn initial Y back to y 178 | 179 | if (firstch == "y") { 180 | w = firstch.toLowerCase() + w.substr(1); 181 | } 182 | 183 | // See http://snowball.tartarus.org/algorithms/english/stemmer.html 184 | // "Exceptional forms in general" 185 | var specialWords = { 186 | "skis" : "ski", 187 | "skies" : "sky", 188 | "dying" : "die", 189 | "lying" : "lie", 190 | "tying" : "tie", 191 | "idly" : "idl", 192 | "gently" : "gentl", 193 | "ugly" : "ugli", 194 | "early": "earli", 195 | "only": "onli", 196 | "singly": "singl" 197 | }; 198 | 199 | if(specialWords[origword]){ 200 | w = specialWords[origword]; 201 | } 202 | 203 | if( "sky news howe atlas cosmos bias \ 204 | andes inning outing canning herring \ 205 | earring proceed exceed succeed".indexOf(origword) !== -1 ){ 206 | w = origword; 207 | } 208 | 209 | // Address words overstemmed as gener- 210 | re = /.*generate?s?d?(ing)?$/; 211 | if( re.test(origword) ){ 212 | w = w + 'at'; 213 | } 214 | re = /.*general(ly)?$/; 215 | if( re.test(origword) ){ 216 | w = w + 'al'; 217 | } 218 | re = /.*generic(ally)?$/; 219 | if( re.test(origword) ){ 220 | w = w + 'ic'; 221 | } 222 | re = /.*generous(ly)?$/; 223 | if( re.test(origword) ){ 224 | w = w + 'ous'; 225 | } 226 | // Address words overstemmed as commun- 227 | re = /.*communit(ies)?y?/; 228 | if( re.test(origword) ){ 229 | w = w + 'iti'; 230 | } 231 | 232 | return w; 233 | } 234 | })(); 235 | -------------------------------------------------------------------------------- /avrdude/atmel-docs/JTAGICE-AVR060.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/JTAGICE-AVR060.pdf -------------------------------------------------------------------------------- /avrdude/atmel-docs/JTAGICEmkII-AVR067.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/JTAGICEmkII-AVR067.pdf -------------------------------------------------------------------------------- /avrdude/atmel-docs/STK500-AVR061.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/STK500-AVR061.pdf -------------------------------------------------------------------------------- /avrdude/atmel-docs/STK500v2-AVR068.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/atmel-docs/STK500v2-AVR068.pdf -------------------------------------------------------------------------------- /avrdude/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 | /* $Id$ */ 20 | 21 | #ifndef avr910_h 22 | #define avr910_h 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | extern const char avr910_desc[]; 29 | void avr910_initpgm (PROGRAMMER * pgm); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif /* avr910_h */ 36 | -------------------------------------------------------------------------------- /avrdude/avrdude.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2007 Joerg Wunsch 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 | /* $Id$ */ 20 | 21 | #ifndef avrdude_h 22 | #define avrdude_h 23 | 24 | extern char * progname; /* name of program, for messages */ 25 | extern char progbuf[]; /* spaces same length as progname */ 26 | 27 | extern int ovsigck; /* override signature check (-F) */ 28 | extern int verbose; /* verbosity level (-v, -vv, ...) */ 29 | extern int quell_progress; /* quiteness level (-q, -qq) */ 30 | 31 | int avrdude_message(const int msglvl, const char *format, ...); 32 | 33 | #define MSG_INFO (0) /* no -v option, can be supressed with -qq */ 34 | #define MSG_NOTICE (1) /* displayed with -v */ 35 | #define MSG_NOTICE2 (2) /* displayed with -vv, used rarely */ 36 | #define MSG_DEBUG (3) /* displayed with -vvv */ 37 | #define MSG_TRACE (4) /* displayed with -vvvv, show trace commuication */ 38 | #define MSG_TRACE2 (5) /* displayed with -vvvvv */ 39 | 40 | #if defined(WIN32NATIVE) 41 | 42 | #include "ac_cfg.h" 43 | #include 44 | 45 | #ifdef __cplusplus 46 | extern "C" { 47 | #endif 48 | 49 | #if !defined(HAVE_USLEEP) 50 | int usleep(unsigned int us); 51 | #endif 52 | 53 | #if !defined(HAVE_GETTIMEOFDAY) 54 | struct timezone; 55 | int gettimeofday(struct timeval *tv, struct timezone *tz); 56 | #endif /* HAVE_GETTIMEOFDAY */ 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | #endif /* defined(WIN32NATIVE) */ 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /avrdude/avrdude.spec.in: -------------------------------------------------------------------------------- 1 | ## -*- mode: rpm-spec; -*- 2 | ## 3 | ## $Id$ 4 | ## 5 | ## @configure_input@ 6 | ## 7 | 8 | %define debug_package %{nil} 9 | 10 | %define _with_docs 1 11 | %{?_without_docs: %define _with_docs 0} 12 | 13 | Summary: AVRDUDE is software for programming Atmel AVR Microcontrollers. 14 | Name: avrdude 15 | Version: @VERSION@ 16 | Release: 1 17 | URL: http://savannah.nongnu.org/projects/avrdude 18 | Source0: %{name}-%{version}.tar.gz 19 | License: GPL 20 | Group: Development/Tools 21 | BuildRoot: %{_tmppath}/%{name}-%{version}-root 22 | 23 | %description 24 | AVRDUDE is software for programming Atmel AVR Microcontrollers. 25 | 26 | %if %{_with_docs} 27 | ## The avrdude-docs subpackage 28 | %package docs 29 | Summary: Documentation for AVRDUDE. 30 | Group: Documentation 31 | %description docs 32 | Documentation for avrdude in info, html, postscript and pdf formats. 33 | %endif 34 | 35 | %prep 36 | %setup -q 37 | 38 | %build 39 | 40 | ./configure --prefix=%{_prefix} --sysconfdir=/etc --mandir=%{_mandir} \ 41 | --infodir=%{_infodir} \ 42 | %if %{_with_docs} 43 | --enable-doc=yes 44 | %else 45 | --enable-doc=no 46 | %endif 47 | 48 | make 49 | 50 | %install 51 | rm -rf $RPM_BUILD_ROOT 52 | make prefix=$RPM_BUILD_ROOT%{_prefix} \ 53 | sysconfdir=$RPM_BUILD_ROOT/etc \ 54 | mandir=$RPM_BUILD_ROOT%{_mandir} \ 55 | infodir=$RPM_BUILD_ROOT%{_infodir} \ 56 | install 57 | 58 | rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/%{name}-%{version} 59 | rm -f $RPM_BUILD_ROOT%{_infodir}/dir 60 | 61 | %clean 62 | rm -rf $RPM_BUILD_ROOT 63 | 64 | %if %{_with_docs} 65 | %post docs 66 | [ -f %{_infodir}/avrdude.info ] && \ 67 | /sbin/install-info %{_infodir}/avrdude.info %{_infodir}/dir || : 68 | [ -f %{_infodir}/avrdude.info.gz ] && \ 69 | /sbin/install-info %{_infodir}/avrdude.info.gz %{_infodir}/dir || : 70 | 71 | %preun docs 72 | if [ $1 = 0 ]; then 73 | [ -f %{_infodir}/avrdude.info ] && \ 74 | /sbin/install-info --delete %{_infodir}/avrdude.info %{_infodir}/dir || : 75 | [ -f %{_infodir}/avrdude.info.gz ] && \ 76 | /sbin/install-info --delete %{_infodir}/avrdude.info.gz %{_infodir}/dir || : 77 | fi 78 | %endif 79 | 80 | %files 81 | %defattr(-,root,root) 82 | %{_prefix}/bin/avrdude 83 | %{_mandir}/man1/avrdude.1.gz 84 | %attr(0644,root,root) %config /etc/avrdude.conf 85 | 86 | %if %{_with_docs} 87 | %files docs 88 | %doc %{_infodir}/*info* 89 | %doc doc/avrdude-html/*.html 90 | %doc doc/TODO 91 | %doc doc/avrdude.ps 92 | %doc doc/avrdude.pdf 93 | %endif 94 | 95 | %changelog 96 | * Fri Sep 23 2005 Galen Seitz 97 | - Default to enable-doc=yes during configure. 98 | - Move info file to docs package. 99 | - Make building of docs package conditional. Basic idea copied from avr-gcc. 100 | 101 | * Wed Aug 27 2003 Theodore A. Roth 102 | [Thanks to Artur Lipowski ] 103 | - Do not build debug package. 104 | - Remove files not packaged to quell RH9 rpmbuild complaints. 105 | 106 | * Wed Mar 05 2003 Theodore A. Roth 107 | - Add docs sub-package. 108 | - Add %post and %preun scriptlets for handling info files. 109 | 110 | * Wed Feb 26 2003 Theodore A. Roth 111 | - Initial build. 112 | 113 | 114 | -------------------------------------------------------------------------------- /avrdude/avrftdi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrftdi - extension for avrdude, Wolfgang Moser, Ville Voipio 3 | * Copyright (C) 2011 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 | /* $Id$ */ 20 | 21 | #ifndef avrftdi_h 22 | #define avrftdi_h 23 | 24 | #include 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | 31 | extern const char avrftdi_desc[]; 32 | void avrftdi_initpgm (PROGRAMMER * pgm); 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif 39 | 40 | 41 | -------------------------------------------------------------------------------- /avrdude/avrftdi_private.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "ac_cfg.h" 3 | 4 | #include 5 | 6 | #if defined(HAVE_LIBFTDI1) && defined(HAVE_LIBUSB_1_0) 7 | # if defined(HAVE_LIBUSB_1_0_LIBUSB_H) 8 | # include 9 | # else 10 | # include 11 | # endif 12 | # include 13 | # undef HAVE_LIBFTDI_TYPE_232H 14 | # define HAVE_LIBFTDI_TYPE_232H 1 15 | #elif defined(HAVE_LIBFTDI) && defined(HAVE_USB_H) 16 | /* ftdi.h includes usb.h */ 17 | #include 18 | #else 19 | #warning No libftdi or libusb support. Install libftdi1/libusb-1.0 or libftdi/libusb and run configure/make again. 20 | #define DO_NOT_BUILD_AVRFTDI 21 | #endif 22 | 23 | #ifndef DO_NOT_BUILD_AVRFTDI 24 | 25 | enum { ERR, WARN, INFO, DEBUG, TRACE }; 26 | 27 | #define __log(lvl, fmt, ...) \ 28 | do { \ 29 | avrftdi_log(lvl, __func__, __LINE__, fmt, ##__VA_ARGS__); \ 30 | } while(0) 31 | 32 | 33 | #define log_err(fmt, ...) __log(ERR, fmt, ##__VA_ARGS__) 34 | #define log_warn(fmt, ...) __log(WARN, fmt, ##__VA_ARGS__) 35 | #define log_info(fmt, ...) __log(INFO, fmt, ##__VA_ARGS__) 36 | #define log_debug(fmt, ...) __log(DEBUG, fmt, ##__VA_ARGS__) 37 | #define log_trace(fmt, ...) __log(TRACE, fmt, ##__VA_ARGS__) 38 | 39 | #define E(x, ftdi) \ 40 | do { \ 41 | if ((x)) \ 42 | { \ 43 | avrdude_message(MSG_INFO, "%s:%d %s() %s: %s (%d)\n\t%s\n", \ 44 | __FILE__, __LINE__, __FUNCTION__, \ 45 | #x, strerror(errno), errno, ftdi_get_error_string(ftdi)); \ 46 | return -1; \ 47 | } \ 48 | } while(0) 49 | 50 | #define E_VOID(x, ftdi) \ 51 | do { \ 52 | if ((x)) \ 53 | { \ 54 | avrdude_message(MSG_INFO, "%s:%d %s() %s: %s (%d)\n\t%s\n", \ 55 | __FILE__, __LINE__, __FUNCTION__, \ 56 | #x, strerror(errno), errno, ftdi_get_error_string(ftdi)); \ 57 | } \ 58 | } while(0) 59 | 60 | 61 | #define to_pdata(pgm) \ 62 | ((avrftdi_t *)((pgm)->cookie)) 63 | 64 | typedef struct avrftdi_s { 65 | /* pointer to struct maintained by libftdi to identify the device */ 66 | struct ftdi_context* ftdic; 67 | /* bitmask of values for pins. bit 0 represents pin 0 ([A|B]DBUS0) */ 68 | uint16_t pin_value; 69 | /* bitmask of pin direction. a '1' make a pin an output. 70 | * bit 0 corresponds to pin 0. */ 71 | uint16_t pin_direction; 72 | /* don't know. not useful. someone put it in. */ 73 | uint16_t led_mask; 74 | /* total number of pins supported by a programmer. varies with FTDI chips */ 75 | int pin_limit; 76 | /* internal RX buffer of the device. needed for INOUT transfers */ 77 | int rx_buffer_size; 78 | int tx_buffer_size; 79 | /* use bitbanging instead of mpsse spi */ 80 | bool use_bitbanging; 81 | } avrftdi_t; 82 | 83 | void avrftdi_log(int level, const char * func, int line, const char * fmt, ...); 84 | 85 | #endif /* DO_NOT_BUILD_AVRFDTI */ 86 | 87 | -------------------------------------------------------------------------------- /avrdude/avrftdi_tpi.c: -------------------------------------------------------------------------------- 1 | #include "ac_cfg.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "avrdude.h" 9 | #include "libavrdude.h" 10 | 11 | #include "usbasp.h" 12 | 13 | #include "avrftdi_tpi.h" 14 | #include "avrftdi_private.h" 15 | 16 | #ifndef DO_NOT_BUILD_AVRFTDI 17 | 18 | static void avrftdi_tpi_disable(PROGRAMMER *); 19 | static int avrftdi_tpi_program_enable(PROGRAMMER * pgm, AVRPART * p); 20 | 21 | #ifdef notyet 22 | static void 23 | avrftdi_debug_frame(uint16_t frame) 24 | { 25 | static char bit_name[] = "IDLES01234567PSS"; 26 | //static char bit_name[] = "SSP76543210SELDI"; 27 | char line0[34], line1[34], line2[34]; 28 | int bit, pos; 29 | 30 | for(bit = 0; bit < 16; bit++) 31 | { 32 | pos = 16 - bit - 1; 33 | if(frame & (1 << pos)) 34 | { 35 | line0[2*pos] = '_'; 36 | line0[2*pos+1] = ' '; 37 | 38 | line2[2*pos] = ' '; 39 | line2[2*pos+1] = ' '; 40 | } 41 | else 42 | { 43 | line0[2*pos] = ' '; 44 | line0[2*pos+1] = ' '; 45 | 46 | line2[2*pos] = '-'; 47 | line2[2*pos+1] = ' '; 48 | } 49 | 50 | line1[2*pos] = bit_name[pos]; 51 | line1[2*pos+1] = ' '; 52 | 53 | } 54 | 55 | line0[32] = 0; 56 | line1[32] = 0; 57 | line2[32] = 0; 58 | 59 | log_debug("%s\n", line0); 60 | log_debug("%s\n", line1); 61 | //log_debug("%s\n", line2); 62 | } 63 | #endif /* notyet */ 64 | 65 | int 66 | avrftdi_tpi_initialize(PROGRAMMER * pgm, AVRPART * p) 67 | { 68 | int ret; 69 | 70 | avrftdi_t* pdata = to_pdata(pgm); 71 | unsigned char buf[] = { MPSSE_DO_WRITE | MPSSE_WRITE_NEG | MPSSE_LSB, 0x01, 0x00, 0xff, 0xff }; 72 | 73 | log_info("Using TPI interface\n"); 74 | 75 | pgm->program_enable = avrftdi_tpi_program_enable; 76 | pgm->cmd_tpi = avrftdi_cmd_tpi; 77 | pgm->chip_erase = avr_tpi_chip_erase; 78 | pgm->disable = avrftdi_tpi_disable; 79 | 80 | pgm->paged_load = NULL; 81 | pgm->paged_write = NULL; 82 | 83 | log_info("Setting /Reset pin low\n"); 84 | pgm->setpin(pgm, PIN_AVR_RESET, OFF); 85 | pgm->setpin(pgm, PIN_AVR_SCK, OFF); 86 | pgm->setpin(pgm, PIN_AVR_MOSI, ON); 87 | usleep(20 * 1000); 88 | 89 | pgm->setpin(pgm, PIN_AVR_RESET, ON); 90 | /* worst case 128ms */ 91 | usleep(2 * 128 * 1000); 92 | 93 | /*setting rst back to 0 */ 94 | pgm->setpin(pgm, PIN_AVR_RESET, OFF); 95 | /*wait at least 20ms bevor issuing spi commands to avr */ 96 | usleep(20 * 1000); 97 | 98 | log_info("Sending 16 init clock cycles ...\n"); 99 | ret = ftdi_write_data(pdata->ftdic, buf, sizeof(buf)); 100 | 101 | return ret; 102 | } 103 | 104 | #define TPI_PARITY_MASK 0x2000 105 | 106 | static uint16_t 107 | tpi_byte2frame(uint8_t byte) 108 | { 109 | uint16_t frame = 0xc00f; 110 | int parity = __builtin_popcount(byte) & 1; 111 | 112 | frame |= ((byte << 5) & 0x1fe0); 113 | 114 | if(parity) 115 | frame |= TPI_PARITY_MASK; 116 | 117 | return frame; 118 | } 119 | 120 | static int 121 | tpi_frame2byte(uint16_t frame, uint8_t * byte) 122 | { 123 | /* drop idle and start bit(s) */ 124 | *byte = (frame >> 5) & 0xff; 125 | 126 | int parity = __builtin_popcount(*byte) & 1; 127 | int parity_rcvd = (frame & TPI_PARITY_MASK) ? 1 : 0; 128 | 129 | return parity != parity_rcvd; 130 | } 131 | 132 | #ifdef notyet 133 | static int 134 | avrftdi_tpi_break(PROGRAMMER * pgm) 135 | { 136 | unsigned char buffer[] = { MPSSE_DO_WRITE | MPSSE_WRITE_NEG | MPSSE_LSB, 1, 0, 0, 0 }; 137 | E(ftdi_write_data(to_pdata(pgm)->ftdic, buffer, sizeof(buffer)) != sizeof(buffer), to_pdata(pgm)->ftdic); 138 | 139 | return 0; 140 | } 141 | #endif /* notyet */ 142 | 143 | static int 144 | avrftdi_tpi_write_byte(PROGRAMMER * pgm, unsigned char byte) 145 | { 146 | uint16_t frame; 147 | 148 | struct ftdi_context* ftdic = to_pdata(pgm)->ftdic; 149 | 150 | unsigned char buffer[] = { MPSSE_DO_WRITE | MPSSE_WRITE_NEG | MPSSE_LSB, 1, 0, 0, 0 }; 151 | 152 | frame = tpi_byte2frame(byte); 153 | 154 | buffer[3] = frame & 0xff; 155 | buffer[4] = frame >> 8; 156 | 157 | log_trace("Byte %02x, frame: %04x, MPSSE: 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x\n", 158 | byte, frame, buffer[0], buffer[1], buffer[2], buffer[3], buffer[4]); 159 | 160 | //avrftdi_debug_frame(frame); 161 | 162 | E(ftdi_write_data(ftdic, buffer, sizeof(buffer)) != sizeof(buffer), ftdic); 163 | 164 | return 0; 165 | } 166 | 167 | #define TPI_FRAME_SIZE 12 168 | #define TPI_IDLE_BITS 2 169 | 170 | static int 171 | avrftdi_tpi_read_byte(PROGRAMMER * pgm, unsigned char * byte) 172 | { 173 | uint16_t frame; 174 | 175 | /* use 2 guard bits, 2 default idle bits + 12 frame bits = 16 bits total */ 176 | const int bytes = 3; 177 | int err, i = 0; 178 | 179 | unsigned char buffer[4]; 180 | 181 | buffer[0] = MPSSE_DO_READ | MPSSE_LSB; 182 | buffer[1] = (bytes-1) & 0xff; 183 | buffer[2] = ((bytes-1) >> 8) & 0xff; 184 | buffer[3] = SEND_IMMEDIATE; 185 | 186 | log_trace("MPSSE: 0x%02x 0x%02x 0x%02x 0x%02x (Read frame)\n", 187 | buffer[0], buffer[1], buffer[2], buffer[3]); 188 | 189 | ftdi_write_data(to_pdata(pgm)->ftdic, buffer, 4); 190 | 191 | memset(buffer, 0, sizeof(buffer)); 192 | 193 | i = 0; 194 | do { 195 | int err = ftdi_read_data(to_pdata(pgm)->ftdic, &buffer[i], bytes - i); 196 | E(err < 0, to_pdata(pgm)->ftdic); 197 | i += err; 198 | } while(i < bytes); 199 | 200 | 201 | log_trace("MPSSE: 0x%02x 0x%02x 0x%02x 0x%02x (Read frame)\n", 202 | buffer[0], buffer[1], buffer[2], buffer[3]); 203 | 204 | 205 | frame = buffer[0] | (buffer[1] << 8); 206 | 207 | err = tpi_frame2byte(frame, byte); 208 | log_trace("Frame: 0x%04x, byte: 0x%02x\n", frame, *byte); 209 | 210 | //avrftdi_debug_frame(frame); 211 | 212 | return err; 213 | } 214 | 215 | static int 216 | avrftdi_tpi_program_enable(PROGRAMMER * pgm, AVRPART * p) 217 | { 218 | return avr_tpi_program_enable(pgm, p, TPIPCR_GT_2b); 219 | } 220 | 221 | int 222 | avrftdi_cmd_tpi(PROGRAMMER * pgm, const unsigned char *cmd, int cmd_len, 223 | unsigned char *res, int res_len) 224 | { 225 | int i, err = 0; 226 | 227 | for(i = 0; i < cmd_len; i++) 228 | { 229 | err = avrftdi_tpi_write_byte(pgm, cmd[i]); 230 | if(err) 231 | return err; 232 | } 233 | 234 | for(i = 0; i < res_len; i++) 235 | { 236 | err = avrftdi_tpi_read_byte(pgm, &res[i]); 237 | if(err) 238 | return err; 239 | } 240 | 241 | return 0; 242 | } 243 | 244 | static void 245 | avrftdi_tpi_disable(PROGRAMMER * pgm) 246 | { 247 | unsigned char cmd[] = {TPI_OP_SSTCS(TPIPCR), 0}; 248 | pgm->cmd_tpi(pgm, cmd, sizeof(cmd), NULL, 0); 249 | 250 | log_info("Leaving Programming mode.\n"); 251 | } 252 | 253 | #endif /* DO_NOT_BUILD_AVRFTDI */ 254 | 255 | -------------------------------------------------------------------------------- /avrdude/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(PROGRAMMER * pgm, const unsigned char *cmd, int cmd_len, 6 | unsigned char *res, int res_len); 7 | int avrftdi_tpi_initialize(PROGRAMMER * pgm, AVRPART * p); 8 | 9 | 10 | -------------------------------------------------------------------------------- /avrdude/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 Michael 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 | /* $Id$ */ 21 | 22 | #ifndef bitbang_h 23 | #define bitbang_h 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | int bitbang_setpin(int fd, int pin, int value); 30 | int bitbang_getpin(int fd, int pin); 31 | int bitbang_highpulsepin(int fd, int pin); 32 | void bitbang_delay(unsigned int us); 33 | 34 | int bitbang_check_prerequisites(PROGRAMMER *pgm); 35 | 36 | int bitbang_rdy_led (PROGRAMMER * pgm, int value); 37 | int bitbang_err_led (PROGRAMMER * pgm, int value); 38 | int bitbang_pgm_led (PROGRAMMER * pgm, int value); 39 | int bitbang_vfy_led (PROGRAMMER * pgm, int value); 40 | int bitbang_cmd (PROGRAMMER * pgm, const unsigned char *cmd, 41 | unsigned char *res); 42 | int bitbang_cmd_tpi (PROGRAMMER * pgm, const unsigned char *cmd, 43 | int cmd_len, unsigned char *res, int res_len); 44 | int bitbang_spi (PROGRAMMER * pgm, const unsigned char *cmd, 45 | unsigned char *res, int count); 46 | int bitbang_chip_erase (PROGRAMMER * pgm, AVRPART * p); 47 | int bitbang_program_enable (PROGRAMMER * pgm, AVRPART * p); 48 | void bitbang_powerup (PROGRAMMER * pgm); 49 | void bitbang_powerdown (PROGRAMMER * pgm); 50 | int bitbang_initialize (PROGRAMMER * pgm, AVRPART * p); 51 | void bitbang_disable (PROGRAMMER * pgm); 52 | void bitbang_enable (PROGRAMMER * pgm); 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /avrdude/bootstrap: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | : ${AUTOHEADER="autoheader${AC_VER}"} 4 | : ${AUTOCONF="autoconf${AC_VER}"} 5 | : ${ACLOCAL="aclocal${AM_VER}"} 6 | : ${AUTOMAKE="automake${AM_VER}"} 7 | 8 | export ACLOCAL AUTOHEADER AUTOCONF AUTOMAKE 9 | 10 | # Bootstrap the build system. 11 | 12 | set -x 13 | 14 | rm -rf autom4te.cache 15 | 16 | libtoolize 17 | 18 | ${ACLOCAL} 19 | ${AUTOHEADER} 20 | ${AUTOCONF} 21 | ${AUTOMAKE} -a -c 22 | -------------------------------------------------------------------------------- /avrdude/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 | /* $Id$ */ 23 | 24 | #ifndef buspirate_h 25 | #define buspirate_h 26 | 27 | extern const char buspirate_desc[]; 28 | extern const char buspirate_bb_desc[]; 29 | void buspirate_initpgm (struct programmer_t *pgm); 30 | void buspirate_bb_initpgm (struct programmer_t *pgm); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /avrdude/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 | /* $Id$ */ 20 | 21 | #ifndef butterfly_h 22 | #define butterfly_h 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | extern const char butterfly_desc[]; 29 | extern const char butterfly_mk_desc[]; 30 | void butterfly_initpgm (PROGRAMMER * pgm); 31 | void butterfly_mk_initpgm (PROGRAMMER * pgm); 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #endif /* butterfly_h */ 38 | -------------------------------------------------------------------------------- /avrdude/ch341a.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * 4 | * avrdude support for CH341 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 | 22 | #ifndef ch341a_h 23 | #define ch341a_h 24 | 25 | #define CH341A_VID 0x1A86 26 | #define CH341A_PID 0x5512 27 | 28 | #define CH341A_PACKET_LENGTH 0x20 29 | 30 | #define CH341A_USB_BULK_ENDPOINT 0x02 31 | #define CH341A_PACKET_LENGTH 0x20 32 | 33 | #define CH341A_USB_TIMEOUT 15000 34 | 35 | #define CH341A_CMD_SPI_STREAM 0xA8 //SPI command 36 | #define CH341A_CMD_UIO_STREAM 0xAB //UIO command 37 | 38 | #define CH341A_CMD_UIO_STM_IN 0x00 // UIO Interface In ( D0 ~ D7 ) 39 | #define CH341A_CMD_UIO_STM_DIR 0x40 // UIO interface Dir( set dir of D0~D5 ) 40 | #define CH341A_CMD_UIO_STM_OUT 0x80 // UIO Interface Output(D0~D5) 41 | #define CH341A_CMD_UIO_STM_END 0x20 // UIO Interface End Command 42 | 43 | #define CH341A_CMD_I2C_STREAM 0xAA 44 | #define CH341A_CMD_I2C_STM_SET 0x60 // bit 2: SPI with two data pairs D5,D4=out, D7,D6=in 45 | #define CH341A_CMD_I2C_STM_END 0x00 46 | 47 | 48 | /* USB error identifiers */ 49 | #define USB_ERROR_NOTFOUND 1 50 | #define USB_ERROR_ACCESS 2 51 | #define USB_ERROR_IO 3 52 | 53 | 54 | #ifdef __cplusplus 55 | extern "C" { 56 | #endif 57 | 58 | extern const char ch341a_desc[]; 59 | void ch341a_initpgm (PROGRAMMER * pgm); 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | #endif /* ch341a_h */ 66 | -------------------------------------------------------------------------------- /avrdude/config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2000-2004 Brian S. Dean 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 | /* $Id$ */ 20 | 21 | /* These are the internal definitions needed for config parsing */ 22 | 23 | #ifndef config_h 24 | #define config_h 25 | 26 | #include "libavrdude.h" 27 | 28 | 29 | #define MAX_STR_CONST 1024 30 | 31 | enum { V_NONE, V_NUM, V_NUM_REAL, V_STR }; 32 | typedef struct value_t { 33 | int type; 34 | /*union { TODO: use an anonymous union here ? */ 35 | int number; 36 | double number_real; 37 | char * string; 38 | /*};*/ 39 | } VALUE; 40 | 41 | 42 | typedef struct token_t { 43 | int primary; 44 | VALUE value; 45 | } TOKEN; 46 | typedef struct token_t *token_p; 47 | 48 | 49 | extern FILE * yyin; 50 | extern PROGRAMMER * current_prog; 51 | extern AVRPART * current_part; 52 | extern AVRMEM * current_mem; 53 | extern int lineno; 54 | extern const char * infile; 55 | extern LISTID string_list; 56 | extern LISTID number_list; 57 | 58 | 59 | #if !defined(HAS_YYSTYPE) 60 | #define YYSTYPE token_p 61 | #endif 62 | extern YYSTYPE yylval; 63 | 64 | extern char string_buf[MAX_STR_CONST]; 65 | extern char *string_buf_ptr; 66 | 67 | #ifdef __cplusplus 68 | extern "C" { 69 | #endif 70 | 71 | int yyparse(void); 72 | 73 | int yyerror(char * errmsg, ...); 74 | 75 | int yywarning(char * errmsg, ...); 76 | 77 | TOKEN * new_token(int primary); 78 | 79 | void free_token(TOKEN * tkn); 80 | 81 | void free_tokens(int n, ...); 82 | 83 | TOKEN * number(char * text); 84 | 85 | TOKEN * number_real(char * text); 86 | 87 | TOKEN * hexnumber(char * text); 88 | 89 | TOKEN * string(char * text); 90 | 91 | TOKEN * keyword(int primary); 92 | 93 | void print_token(TOKEN * tkn); 94 | 95 | void pyytext(void); 96 | 97 | char * dup_string(const char * str); 98 | 99 | #ifdef __cplusplus 100 | } 101 | #endif 102 | 103 | #endif 104 | -------------------------------------------------------------------------------- /avrdude/confwin.c: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2003-2004 Eric B. Weddington 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 | 20 | #include "avrdude.h" 21 | #include "libavrdude.h" 22 | 23 | #if defined(WIN32NATIVE) 24 | 25 | #include 26 | #include 27 | 28 | 29 | static char *filename; 30 | 31 | 32 | void win_sys_config_set(char sys_config[PATH_MAX]) 33 | { 34 | sys_config[0] = 0; 35 | 36 | /* Use Windows API call to search for the Windows default system config file.*/ 37 | SearchPath(NULL, "avrdude.conf", NULL, PATH_MAX, sys_config, &filename); 38 | return; 39 | } 40 | 41 | 42 | void win_usr_config_set(char usr_config[PATH_MAX]) 43 | { 44 | usr_config[0] = 0; 45 | 46 | /* Use Windows API call to search for the Windows default user config file. */ 47 | SearchPath(NULL, "avrdude.rc", NULL, PATH_MAX, usr_config, &filename); 48 | return; 49 | } 50 | 51 | 52 | #endif 53 | 54 | 55 | -------------------------------------------------------------------------------- /avrdude/crc16.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Derived from CRC algorithm for JTAG ICE mkII, published in Atmel 3 | * Appnote AVR067. Converted from C++ to C. 4 | */ 5 | #include "crc16.h" 6 | 7 | /* CRC16 Definitions */ 8 | static const unsigned short crc_table[256] = { 9 | 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, 10 | 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, 11 | 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, 12 | 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, 13 | 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, 14 | 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, 15 | 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, 16 | 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, 17 | 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, 18 | 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, 19 | 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, 20 | 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, 21 | 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, 22 | 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, 23 | 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, 24 | 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, 25 | 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, 26 | 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, 27 | 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, 28 | 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, 29 | 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, 30 | 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, 31 | 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, 32 | 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, 33 | 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, 34 | 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, 35 | 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, 36 | 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, 37 | 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, 38 | 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, 39 | 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, 40 | 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78 41 | }; 42 | 43 | /* CRC calculation macros */ 44 | #define CRC_INIT 0xFFFF 45 | #define CRC(crcval,newchar) crcval = (crcval >> 8) ^ \ 46 | crc_table[(crcval ^ newchar) & 0x00ff] 47 | 48 | unsigned short 49 | crcsum(const unsigned char* message, unsigned long length, 50 | unsigned short crc) 51 | { 52 | unsigned long i; 53 | 54 | for(i = 0; i < length; i++) 55 | { 56 | CRC(crc, message[i]); 57 | } 58 | return crc; 59 | } 60 | 61 | int 62 | crcverify(const unsigned char* message, unsigned long length) 63 | { 64 | /* 65 | * Returns true if the last two bytes in a message is the crc of the 66 | * preceding bytes. 67 | */ 68 | unsigned short expected; 69 | 70 | expected = crcsum(message, length - 2, CRC_INIT); 71 | return (expected & 0xff) == message[length - 2] && 72 | ((expected >> 8) & 0xff) == message[length - 1]; 73 | } 74 | 75 | void 76 | crcappend(unsigned char* message, unsigned long length) 77 | { 78 | unsigned long crc; 79 | 80 | crc = crcsum(message, length, CRC_INIT); 81 | message[length] = (unsigned char)(crc & 0xff); 82 | message[length+1] = (unsigned char)((crc >> 8) & 0xff); 83 | } 84 | -------------------------------------------------------------------------------- /avrdude/crc16.h: -------------------------------------------------------------------------------- 1 | #ifndef CRC16_H 2 | #define CRC16_H 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* 9 | * Derived from CRC algorithm for JTAG ICE mkII, published in Atmel 10 | * Appnote AVR067. Converted from C++ to C. 11 | */ 12 | 13 | extern unsigned short crcsum(const unsigned char* message, 14 | unsigned long length, 15 | unsigned short crc); 16 | /* 17 | * Verify that the last two bytes is a (LSB first) valid CRC of the 18 | * message. 19 | */ 20 | extern int crcverify(const unsigned char* message, 21 | unsigned long length); 22 | /* 23 | * Append a two byte CRC (LSB first) to message. length is size of 24 | * message excluding crc. Space for the CRC bytes must be allocated 25 | * in advance! 26 | */ 27 | extern void crcappend(unsigned char* message, 28 | unsigned long length); 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /avrdude/dfu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2012 Kirill Levchenko 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 | /* $Id$ */ 20 | 21 | #ifndef dfu_h 22 | #define dfu_h 23 | 24 | #include "ac_cfg.h" 25 | 26 | #ifdef HAVE_LIBUSB 27 | #if defined(HAVE_USB_H) 28 | # include 29 | #elif defined(HAVE_LUSB0_USB_H) 30 | # include 31 | #else 32 | # error "libusb needs either or " 33 | #endif 34 | #endif 35 | 36 | #include 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | /* If we have LIBUSB, define the dfu_dev struct normally. Otherwise, declare 43 | * it as an empty struct so that code compiles, but we generate an error at 44 | * run time. 45 | */ 46 | 47 | #ifdef HAVE_LIBUSB 48 | 49 | struct dfu_dev 50 | { 51 | char *bus_name, *dev_name; 52 | usb_dev_handle *dev_handle; 53 | struct usb_device_descriptor dev_desc; 54 | struct usb_config_descriptor conf_desc; 55 | struct usb_interface_descriptor intf_desc; 56 | struct usb_endpoint_descriptor endp_desc; 57 | char *manf_str, *prod_str, *serno_str; 58 | unsigned int timeout; 59 | }; 60 | 61 | #else 62 | 63 | struct dfu_dev { 64 | // empty 65 | }; 66 | 67 | #endif 68 | 69 | /* We assume unsigned char is 1 byte. */ 70 | 71 | #if UCHAR_MAX != 255 72 | #error UCHAR_MAX != 255 73 | #endif 74 | 75 | struct dfu_status { 76 | unsigned char bStatus; 77 | unsigned char bwPollTimeout[3]; 78 | unsigned char bState; 79 | unsigned char iString; 80 | }; 81 | 82 | // Values of bStatus field. 83 | 84 | #define DFU_STATUS_OK 0x0 85 | #define DFU_STATUS_ERR_TARGET 0x1 86 | #define DFU_STATUS_ERR_FILE 0x2 87 | #define DFU_STATUS_ERR_WRITE 0x3 88 | #define DFU_STATUS_ERR_ERASE 0x4 89 | #define DFU_STATUS_ERR_CHECK_ERASED 0x5 90 | #define DFU_STATUS_ERR_PROG 0x6 91 | #define DFU_STATUS_ERR_VERIFY 0x7 92 | #define DFU_STATUS_ERR_ADDRESS 0x8 93 | #define DFU_STATUS_ERR_NOTDONE 0x9 94 | #define DFU_STATUS_ERR_FIRMWARE 0xA 95 | #define DFU_STATUS_ERR_VENDOR 0xB 96 | #define DFU_STATUS_ERR_USBR 0xC 97 | #define DFU_STATUS_ERR_POR 0xD 98 | #define DFU_STATUS_ERR_UNKNOWN 0xE 99 | #define DFU_STATUS_ERR_STALLEDPKT 0xF 100 | 101 | // Values of bState field. 102 | 103 | #define DFU_STATE_APP_IDLE 0 104 | #define DFU_STATE_APP_DETACH 1 105 | #define DFU_STATE_DFU_IDLE 2 106 | #define DFU_STATE_DFU_DLOAD_SYNC 3 107 | #define DFU_STATE_DFU_DNBUSY 4 108 | #define DFU_STATE_DFU_DNLOAD_IDLE 5 109 | #define DFU_STATE_DFU_MANIFEST_SYNC 6 110 | #define DFU_STATE_DFU_MANIFEST 7 111 | #define DFU_STATE_DFU_MANIFEST_WAIT_RESET 8 112 | #define DFU_STATE_DFU_UPLOAD_IDLE 9 113 | #define DFU_STATE_DFU_ERROR 10 114 | 115 | // FUNCTIONS 116 | 117 | extern struct dfu_dev * dfu_open(char *port_spec); 118 | extern int dfu_init(struct dfu_dev *dfu, 119 | unsigned short vid, unsigned short pid); 120 | extern void dfu_close(struct dfu_dev *dfu); 121 | 122 | extern int dfu_getstatus(struct dfu_dev *dfu, struct dfu_status *status); 123 | extern int dfu_clrstatus(struct dfu_dev *dfu); 124 | extern int dfu_dnload(struct dfu_dev *dfu, void *ptr, int size); 125 | extern int dfu_upload(struct dfu_dev *dfu, void *ptr, int size); 126 | extern int dfu_abort(struct dfu_dev *dfu); 127 | 128 | extern void dfu_show_info(struct dfu_dev *dfu); 129 | 130 | extern const char * dfu_status_str(int bStatus); 131 | extern const char * dfu_state_str(int bState); 132 | 133 | #ifdef __cplusplus 134 | } 135 | #endif 136 | 137 | #endif /* dfu_h */ 138 | -------------------------------------------------------------------------------- /avrdude/doc/.cvsignore: -------------------------------------------------------------------------------- 1 | .cvsignore 2 | Makefile 3 | Makefile.in 4 | avrdude-html 5 | avrdude.aux 6 | avrdude.cp 7 | avrdude.cps 8 | avrdude.dvi 9 | avrdude.fn 10 | avrdude.info 11 | avrdude.ky 12 | avrdude.log 13 | avrdude.pdf 14 | avrdude.pg 15 | avrdude.ps 16 | avrdude.toc 17 | avrdude.tp 18 | avrdude.vr 19 | mdate-sh 20 | stamp-vti 21 | texinfo.tex 22 | version.texi 23 | programmer_types.texi 24 | parts.texi 25 | programmers.texi 26 | -------------------------------------------------------------------------------- /avrdude/doc/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # avrdude - A Downloader/Uploader for AVR device programmers 3 | # Copyright (C) 2003 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 | # 20 | # $Id$ 21 | # 22 | 23 | GENERATED_TEXINFOS = \ 24 | $(builddir)/programmers.texi \ 25 | $(builddir)/parts.texi \ 26 | $(builddir)/programmer_types.texi \ 27 | $(builddir)/version.texi 28 | 29 | CLEANFILES = \ 30 | $(GENERATED_TEXINFOS) \ 31 | $(builddir)/stamp-vti 32 | 33 | info_TEXINFOS = avrdude.texi 34 | 35 | EXTRA_DIST = \ 36 | parts_comments.txt 37 | 38 | all-local: info html ps pdf 39 | 40 | html: avrdude-html/avrdude.html 41 | 42 | avrdude-html/avrdude.html: $(srcdir)/$(info_TEXINFOS) $(GENERATED_TEXINFOS) 43 | texi2html -split_node $(srcdir)/$(info_TEXINFOS) 44 | if [ -e ./avrdude.html -o -e ./avrdude_1.html ]; then \ 45 | mkdir -p avrdude-html ; \ 46 | mv -f *.html avrdude-html ; \ 47 | else \ 48 | mv -f avrdude avrdude-html; \ 49 | fi; 50 | 51 | $(builddir)/avrdude.info: $(GENERATED_TEXINFOS) 52 | $(builddir)/avrdude.dvi: $(GENERATED_TEXINFOS) 53 | $(builddir)/avrdude.pdf: $(GENERATED_TEXINFOS) 54 | 55 | # if it does not exist make this first 56 | ../avrdude$(EXEEXT): 57 | $(MAKE) -C .. avrdude$(EXEEXT) 58 | 59 | $(builddir)/programmers.texi: ../avrdude$(EXEEXT) ../avrdude.conf Makefile 60 | ../avrdude$(EXEEXT) -C ../avrdude.conf -c \? 2>&1 \ 61 | | $(AWK) '$$2 ~ /^=$$/ {printf("@item @code{%s} @tab %s\n",$$1,gensub("[^=]+=[ \t]*","",1))}' \ 62 | | sed "s# *,\? *<\?\(http://[^ \t>]*\)>\?#,@*\n@url{\1}#g" \ 63 | >programmers.texi 64 | 65 | $(builddir)/programmer_types.texi: ../avrdude$(EXEEXT) ../avrdude.conf Makefile 66 | ../avrdude$(EXEEXT) -C ../avrdude.conf -c \?type 2>&1 \ 67 | | $(AWK) '$$2 ~ /^=$$/ {printf("@item @code{%s} @tab %s\n",$$1,gensub("[^=]+=[ \t]*","",1))}' \ 68 | | sed "s#<\?\(http://[^ \t,>]*\)>\?#@url{\1}#g" \ 69 | >programmer_types.texi 70 | 71 | $(builddir)/parts.texi: ../avrdude$(EXEEXT) ../avrdude.conf parts_comments.txt Makefile 72 | ../avrdude$(EXEEXT) -C ../avrdude.conf -p \? 2>&1 \ 73 | | $(AWK) '$$2 ~ /^=$$/ {printf("@item @code{%s} @tab %s\n",$$1,$$3)}' \ 74 | | sed -e "`sed 's:\([^ \t]*\)[ \t]*\(.*\):s/\1$$/\1 \2/g:g' parts.texi 76 | 77 | clean-local: 78 | rm -rf avrdude-html *.info 79 | 80 | install-data-local: install-docs 81 | 82 | install-docs: html ps pdf 83 | $(mkinstalldirs) $(DOC_INST_DIR) 84 | $(INSTALL_DATA) avrdude.ps $(DOC_INST_DIR)/avrdude.ps 85 | $(INSTALL_DATA) avrdude.pdf $(DOC_INST_DIR)/avrdude.pdf 86 | $(mkinstalldirs) $(DOC_INST_DIR)/avrdude-html 87 | @list=`echo avrdude-html/*.html`; \ 88 | for file in $$list; \ 89 | do \ 90 | $(INSTALL_DATA) $$file $(DOC_INST_DIR)/$$file; \ 91 | done 92 | 93 | uninstall-local: 94 | rm -rf $(DOC_INST_DIR) 95 | -------------------------------------------------------------------------------- /avrdude/doc/TODO: -------------------------------------------------------------------------------- 1 | 2 | - Man page needs updated for avr910 info. 3 | 4 | - Website needs to link to docs: 5 | http://savannah.nongnu.org/download/avrdude/doc/avrdude-html/ 6 | 7 | - Add "skip empty pages" optimization on avr910 paged write. The stk500 has 8 | this optimization already. 9 | 10 | - Fix "overfull \hbox" issues in building documentation. 11 | 12 | - FIXME: term.c: terminal_get_input(): strip newlines in non-readline input 13 | code. 14 | 15 | - FIXME: avr910.c: avr910_cmd(): Insert version check here. 16 | 17 | - FIXME: ser_posix.c: serial_close(): Should really restore the terminal to 18 | original state here. 19 | 20 | - FIXME: main.c, par.c: exitspecs don't work if RESET-pin is controlled over 21 | PPICTRL. 22 | 23 | - transfer ppi-speedtuning to the windows version (CAVEAT: This will make 24 | programming too fast for chips with 500kHz clock) 25 | 26 | - make SCK-period configurable for PPI-programmers 27 | -------------------------------------------------------------------------------- /avrdude/doc/parts_comments.txt: -------------------------------------------------------------------------------- 1 | AT90S1200 (****) 2 | AT90S2343 (*) 3 | ATmega2560 (**) 4 | ATmega2561 (**) 5 | ATtiny11 (***) 6 | -------------------------------------------------------------------------------- /avrdude/flip1.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2014 Joerg Wunsch 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 | /* $Id$ */ 20 | 21 | #ifndef flip1_h 22 | #define flip1_h 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | extern const char flip1_desc[]; 29 | extern void flip1_initpgm(PROGRAMMER * pgm); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif /* flip1_h */ 36 | -------------------------------------------------------------------------------- /avrdude/flip2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2012 Kirill Levchenko 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 | /* $Id$ */ 20 | 21 | #ifndef flip2_h 22 | #define flip2_h 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | extern const char flip2_desc[]; 29 | extern void flip2_initpgm(PROGRAMMER * pgm); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif /* flip2_h */ 36 | -------------------------------------------------------------------------------- /avrdude/freebsd_ppi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2005 Joerg Wunsch 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 | /* $Id$ */ 20 | 21 | #ifndef freebsd_ppi_h 22 | #define freebsd_ppi_h 23 | 24 | #include 25 | 26 | #define ppi_claim(fd) {} 27 | 28 | #define ppi_release(fd) {} 29 | 30 | #define DO_PPI_READ(fd, reg, valp) \ 31 | (void)ioctl(fd, \ 32 | (reg) == PPIDATA? PPIGDATA: ((reg) == PPICTRL? PPIGCTRL: PPIGSTATUS), \ 33 | valp) 34 | #define DO_PPI_WRITE(fd, reg, valp) \ 35 | (void)ioctl(fd, \ 36 | (reg) == PPIDATA? PPISDATA: ((reg) == PPICTRL? PPISCTRL: PPISSTATUS), \ 37 | valp) 38 | 39 | #endif /* freebsd_ppi_h */ 40 | -------------------------------------------------------------------------------- /avrdude/ft245r.h: -------------------------------------------------------------------------------- 1 | #ifndef ft245r_h 2 | #define ft245r_h 3 | 4 | extern const char ft245r_desc[]; 5 | void ft245r_initpgm (PROGRAMMER * pgm); 6 | 7 | 8 | #endif /* ft245r_h */ 9 | -------------------------------------------------------------------------------- /avrdude/jtag3.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2012 Joerg Wunsch 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 | /* $Id$ */ 20 | 21 | #ifndef jtag3_h 22 | #define jtag3_h 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | int jtag3_open_common(PROGRAMMER * pgm, char * port); 29 | int jtag3_send(PROGRAMMER * pgm, unsigned char * data, size_t len); 30 | int jtag3_recv(PROGRAMMER * pgm, unsigned char **msg); 31 | void jtag3_close(PROGRAMMER * pgm); 32 | int jtag3_getsync(PROGRAMMER * pgm, int mode); 33 | int jtag3_getparm(PROGRAMMER * pgm, unsigned char scope, 34 | unsigned char section, unsigned char parm, 35 | unsigned char *value, unsigned char length); 36 | int jtag3_setparm(PROGRAMMER * pgm, unsigned char scope, 37 | unsigned char section, unsigned char parm, 38 | unsigned char *value, unsigned char length); 39 | int jtag3_command(PROGRAMMER *pgm, unsigned char *cmd, unsigned int cmdlen, 40 | unsigned char **resp, const char *descr); 41 | extern const char jtag3_desc[]; 42 | extern const char jtag3_dw_desc[]; 43 | extern const char jtag3_pdi_desc[]; 44 | void jtag3_initpgm (PROGRAMMER * pgm); 45 | void jtag3_dw_initpgm (PROGRAMMER * pgm); 46 | void jtag3_pdi_initpgm (PROGRAMMER * pgm); 47 | 48 | /* 49 | * These functions are referenced from stk500v2.c for JTAGICE3 in 50 | * one of the STK500v2 modi. 51 | */ 52 | void jtag3_setup(PROGRAMMER * pgm); 53 | void jtag3_teardown(PROGRAMMER * pgm); 54 | 55 | #ifdef __cplusplus 56 | } 57 | #endif 58 | 59 | #endif 60 | 61 | -------------------------------------------------------------------------------- /avrdude/jtagmkI.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2002-2004 Brian S. Dean 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 | /* $Id$ */ 20 | 21 | #ifndef jtagmkI_h 22 | #define jtagmkI_h 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | extern const char jtagmkI_desc[]; 29 | void jtagmkI_initpgm (PROGRAMMER * pgm); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif 36 | 37 | -------------------------------------------------------------------------------- /avrdude/jtagmkII.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2002-2004, 2006 Brian S. Dean 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 | /* $Id$ */ 20 | 21 | #ifndef jtagmkII_h 22 | #define jtagmkII_h 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | int jtagmkII_send(PROGRAMMER * pgm, unsigned char * data, size_t len); 29 | int jtagmkII_recv(PROGRAMMER * pgm, unsigned char **msg); 30 | void jtagmkII_close(PROGRAMMER * pgm); 31 | int jtagmkII_getsync(PROGRAMMER * pgm, int mode); 32 | int jtagmkII_getparm(PROGRAMMER * pgm, unsigned char parm, 33 | unsigned char * value); 34 | 35 | extern const char jtagmkII_desc[]; 36 | extern const char jtagmkII_avr32_desc[]; 37 | extern const char jtagmkII_dw_desc[]; 38 | extern const char jtagmkII_pdi_desc[]; 39 | extern const char jtagmkII_dragon_desc[]; 40 | extern const char jtagmkII_dragon_dw_desc[]; 41 | extern const char jtagmkII_dragon_pdi_desc[]; 42 | void jtagmkII_initpgm (PROGRAMMER * pgm); 43 | void jtagmkII_avr32_initpgm (PROGRAMMER * pgm); 44 | void jtagmkII_dw_initpgm (PROGRAMMER * pgm); 45 | void jtagmkII_pdi_initpgm (PROGRAMMER * pgm); 46 | void jtagmkII_dragon_initpgm (PROGRAMMER * pgm); 47 | void jtagmkII_dragon_dw_initpgm (PROGRAMMER * pgm); 48 | void jtagmkII_dragon_pdi_initpgm (PROGRAMMER * pgm); 49 | 50 | /* 51 | * These functions are referenced from stk500v2.c for JTAG ICE mkII 52 | * and AVR Dragon programmers running in one of the STK500v2 53 | * modi. 54 | */ 55 | void jtagmkII_setup(PROGRAMMER * pgm); 56 | void jtagmkII_teardown(PROGRAMMER * pgm); 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | 62 | #endif 63 | 64 | -------------------------------------------------------------------------------- /avrdude/jtagmkI_private.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2005 Joerg Wunsch 4 | * 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | /* $Id$ */ 21 | 22 | 23 | /* 24 | * JTAG ICE mkI definitions 25 | */ 26 | 27 | /* ICE command codes */ 28 | /* 0x20 Get Synch [Resp_OK] */ 29 | #define CMD_GET_SYNC ' ' 30 | 31 | /* 0x31 Single Step [Sync_CRC/EOP] [Resp_OK] */ 32 | /* 0x32 Read PC [Sync_CRC/EOP] [Resp_OK] [program counter] 33 | * [Resp_OK] */ 34 | /* 0x33 Write PC [program counter] [Sync_CRC/EOP] [Resp_OK] 35 | * [Resp_OK] */ 36 | /* 0xA2 Firmware Upgrade [upgrade string] [Sync_CRC/EOP] [Resp_OK] 37 | * [Resp_OK] */ 38 | /* 0xA0 Set Device Descriptor [device info] [Sync_CRC/EOP] [Resp_OK] 39 | * [Resp_OK] */ 40 | #define CMD_SET_DEVICE_DESCRIPTOR 0xA0 41 | 42 | /* 0x42 Set Parameter [parameter] [setting] [Sync_CRC/EOP] [Resp_OK] 43 | * [Resp_OK] */ 44 | #define CMD_SET_PARAM 'B' 45 | 46 | /* 0x46 Forced Stop [Sync_CRC/EOP] [Resp_OK] [checksum][program 47 | * counter] [Resp_OK] */ 48 | #define CMD_STOP 'F' 49 | 50 | /* 0x47 Go [Sync_CRC/EOP] [Resp_OK] */ 51 | #define CMD_GO 'G' 52 | 53 | /* 0x52 Read Memory [memory type] [word count] [start address] 54 | * [Sync_CRC/EOP] [Resp_OK] [word 0] ... [word n] [checksum] 55 | * [Resp_OK] */ 56 | #define CMD_READ_MEM 'R' 57 | 58 | /* 0x53 Get Sign On [Sync_CRC/EOP] [Resp_OK] ["AVRNOCD"] [Resp_OK] */ 59 | #define CMD_GET_SIGNON 'S' 60 | 61 | /* 0XA1 Erase Page spm [address] [Sync_CRC/EOP] [Resp_OK] [Resp_OK] */ 62 | 63 | /* 0x57 Write Memory [memory type] [word count] [start address] 64 | * [Sync_CRC/EOP] [Resp_OK] [Cmd_DATA] [word 0] ... [word n] */ 65 | #define CMD_WRITE_MEM 'W' 66 | 67 | /* Second half of write memory: the data command. Undocumented. */ 68 | #define CMD_DATA 'h' 69 | 70 | /* 0x64 Get Debug Info [Sync_CRC/EOP] [Resp_OK] [0x00] [Resp_OK] */ 71 | /* 0x71 Get Parameter [parameter] [Sync_CRC/EOP] [Resp_OK] [setting] 72 | * [Resp_OK] */ 73 | #define CMD_GET_PARAM 'q' 74 | 75 | /* 0x78 Reset [Sync_CRC/EOP] [Resp_OK] [Resp_OK] */ 76 | #define CMD_RESET 'x' 77 | 78 | /* 0xA3 Enter Progmode [Sync_CRC/EOP] [Resp_OK] [Resp_OK] */ 79 | #define CMD_ENTER_PROGMODE 0xa3 80 | 81 | /* 0xA4 Leave Progmode [Sync_CRC/EOP] [Resp_OK] [Resp_OK] */ 82 | #define CMD_LEAVE_PROGMODE 0xa4 83 | 84 | /* 0xA5 Chip Erase [Sync_CRC/EOP] [Resp_OK] [Resp_OK] */ 85 | #define CMD_CHIP_ERASE 0xa5 86 | 87 | 88 | /* ICE responses */ 89 | #define RESP_OK 'A' 90 | #define RESP_BREAK 'B' 91 | #define RESP_INFO 'G' 92 | #define RESP_FAILED 'F' 93 | #define RESP_SYNC_ERROR 'E' 94 | #define RESP_SLEEP 'H' 95 | #define RESP_POWER 'I' 96 | 97 | #define PARM_BITRATE 'b' 98 | #define PARM_SW_VERSION 0x7b 99 | #define PARM_HW_VERSION 0x7a 100 | #define PARM_IREG_HIGH 0x81 101 | #define PARM_IREG_LOW 0x82 102 | #define PARM_OCD_VTARGET 0x84 103 | #define PARM_OCD_BREAK_CAUSE 0x85 104 | #define PARM_CLOCK 0x86 105 | #define PARM_EXTERNAL_RESET 0x8b 106 | #define PARM_FLASH_PAGESIZE_LOW 0x88 107 | #define PARM_FLASH_PAGESIZE_HIGH 0x89 108 | #define PARM_EEPROM_PAGESIZE 0x8a 109 | #define PARM_TIMERS_RUNNING 0xa0 110 | #define PARM_BP_FLOW 0xa1 111 | #define PARM_BP_X_HIGH 0xa2 112 | #define PARM_BP_X_LOW 0xa3 113 | #define PARM_BP_Y_HIGH 0xa4 114 | #define PARM_BP_Y_LOW 0xa5 115 | #define PARM_BP_MODE 0xa6 116 | #define PARM_JTAGID_BYTE0 0xa7 117 | #define PARM_JTAGID_BYTE1 0xa8 118 | #define PARM_JTAGID_BYTE2 0xa9 119 | #define PARM_JTAGID_BYTE3 0xaa 120 | #define PARM_UNITS_BEFORE 0xab 121 | #define PARM_UNITS_AFTER 0xac 122 | #define PARM_BIT_BEFORE 0xad 123 | #define PARM_BIT_AFTER 0xae 124 | #define PARM_PSB0_LOW 0xaf 125 | #define PARM_PSBO_HIGH 0xb0 126 | #define PARM_PSB1_LOW 0xb1 127 | #define PARM_PSB1_HIGH 0xb2 128 | #define PARM_MCU_MODE 0xb3 129 | 130 | #define JTAG_BITRATE_1_MHz 0xff 131 | #define JTAG_BITRATE_500_kHz 0xfe 132 | #define JTAG_BITRATE_250_kHz 0xfd 133 | #define JTAG_BITRATE_125_kHz 0xfb 134 | 135 | /* memory types for CMND_{READ,WRITE}_MEMORY */ 136 | #define MTYPE_IO_SHADOW 0x30 /* cached IO registers? */ 137 | #define MTYPE_SRAM 0x20 /* target's SRAM or [ext.] IO registers */ 138 | #define MTYPE_EEPROM 0x22 /* EEPROM, what way? */ 139 | #define MTYPE_EVENT 0x60 /* ICE event memory */ 140 | #define MTYPE_SPM 0xA0 /* flash through LPM/SPM */ 141 | #define MTYPE_FLASH_PAGE 0xB0 /* flash in programming mode */ 142 | #define MTYPE_EEPROM_PAGE 0xB1 /* EEPROM in programming mode */ 143 | #define MTYPE_FUSE_BITS 0xB2 /* fuse bits in programming mode */ 144 | #define MTYPE_LOCK_BITS 0xB3 /* lock bits in programming mode */ 145 | #define MTYPE_SIGN_JTAG 0xB4 /* signature in programming mode */ 146 | #define MTYPE_OSCCAL_BYTE 0xB5 /* osccal cells in programming mode */ 147 | 148 | struct device_descriptor 149 | { 150 | unsigned char ucReadIO[8]; /*LSB = IOloc 0, MSB = IOloc63 */ 151 | unsigned char ucWriteIO[8]; /*LSB = IOloc 0, MSB = IOloc63 */ 152 | unsigned char ucReadIOShadow[8]; /*LSB = IOloc 0, MSB = IOloc63 */ 153 | unsigned char ucWriteIOShadow[8]; /*LSB = IOloc 0, MSB = IOloc63 */ 154 | unsigned char ucReadExtIO[20]; /*LSB = IOloc 96, MSB = IOloc255 */ 155 | unsigned char ucWriteExtIO[20]; /*LSB = IOloc 96, MSB = IOloc255 */ 156 | unsigned char ucReadIOExtShadow[20]; /*LSB = IOloc 96, MSB = IOloc255 */ 157 | unsigned char ucWriteIOExtShadow[20];/*LSB = IOloc 96, MSB = IOloc255 */ 158 | unsigned char ucIDRAddress; /*IDR address */ 159 | unsigned char ucSPMCRAddress; /*SPMCR Register address and dW BasePC */ 160 | unsigned char ucRAMPZAddress; /*RAMPZ Register address in SRAM I/O */ 161 | /*space */ 162 | unsigned char uiFlashPageSize[2]; /*Device Flash Page Size, Size = */ 163 | /*2 exp ucFlashPageSize */ 164 | unsigned char ucEepromPageSize; /*Device Eeprom Page Size in bytes */ 165 | unsigned char ulBootAddress[4]; /*Device Boot Loader Start Address */ 166 | unsigned char uiUpperExtIOLoc; /*Topmost (last) extended I/O */ 167 | /*location, 0 if no external I/O */ 168 | }; 169 | -------------------------------------------------------------------------------- /avrdude/linux_ppdev.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2003, 2005 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 | /* $Id$ */ 20 | 21 | #ifndef linux_ppdev_h 22 | #define linux_ppdev_h 23 | 24 | #define OBSOLETE__IOW _IOW 25 | 26 | #include 27 | #ifdef HAVE_PARPORT 28 | #include 29 | #include 30 | #endif 31 | 32 | #include 33 | 34 | #define ppi_claim(fd) \ 35 | if (ioctl(fd, PPCLAIM)) { \ 36 | avrdude_message(MSG_INFO, "%s: can't claim device \"%s\": %s\n\n", \ 37 | progname, port, strerror(errno)); \ 38 | close(fd); \ 39 | return; \ 40 | } 41 | 42 | #define ppi_release(fd) \ 43 | if (ioctl(fd, PPRELEASE)) { \ 44 | avrdude_message(MSG_INFO, "%s: can't release device: %s\n\n", \ 45 | progname, strerror(errno)); \ 46 | } 47 | 48 | #define DO_PPI_READ(fd, reg, valp) \ 49 | (void)ioctl(fd, \ 50 | (reg) == PPIDATA? PPRDATA: ((reg) == PPICTRL? PPRCONTROL: PPRSTATUS), \ 51 | valp) 52 | #define DO_PPI_WRITE(fd, reg, valp) \ 53 | (void)ioctl(fd, \ 54 | (reg) == PPIDATA? PPWDATA: ((reg) == PPICTRL? PPWCONTROL: PPWSTATUS), \ 55 | valp) 56 | 57 | #endif /* linux_ppdev_h */ 58 | -------------------------------------------------------------------------------- /avrdude/linuxgpio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2013 Radoslav Kolev 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, write to the Free Software 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 | */ 19 | 20 | /* $Id: par.h 722 2007-01-24 22:43:46Z joerg_wunsch $ */ 21 | 22 | #ifndef linuxgpio_h 23 | #define linuxgpio_h 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | extern const char linuxgpio_desc[]; 30 | void linuxgpio_initpgm (PROGRAMMER * pgm); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /avrdude/my_ddk_hidsdi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2006 Christian Starkjohann 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 | /* $Id$ */ 20 | 21 | /* 22 | The following is a replacement for hidsdi.h from the Windows DDK. It defines some 23 | of the types and function prototypes of this header for our project. If you 24 | have the Windows DDK version of this file or a version shipped with MinGW, use 25 | that instead. 26 | */ 27 | #ifndef MY_DDK_HIDSDI_H 28 | #define MY_DDK_HIDSDI_H 29 | #include 30 | #include 31 | #include 32 | typedef struct{ 33 | ULONG Size; 34 | USHORT VendorID; 35 | USHORT ProductID; 36 | USHORT VersionNumber; 37 | }HIDD_ATTRIBUTES; 38 | void __stdcall HidD_GetHidGuid(OUT LPGUID hidGuid); 39 | BOOLEAN __stdcall HidD_GetAttributes(IN HANDLE device, OUT HIDD_ATTRIBUTES *attributes); 40 | BOOLEAN __stdcall HidD_GetManufacturerString(IN HANDLE device, OUT void *buffer, IN ULONG bufferLen); 41 | BOOLEAN __stdcall HidD_GetProductString(IN HANDLE device, OUT void *buffer, IN ULONG bufferLen); 42 | BOOLEAN __stdcall HidD_GetSerialNumberString(IN HANDLE device, OUT void *buffer, IN ULONG bufferLen); 43 | BOOLEAN __stdcall HidD_GetFeature(IN HANDLE device, OUT void *reportBuffer, IN ULONG bufferLen); 44 | BOOLEAN __stdcall HidD_SetFeature(IN HANDLE device, IN void *reportBuffer, IN ULONG bufferLen); 45 | BOOLEAN __stdcall HidD_GetNumInputBuffers(IN HANDLE device, OUT ULONG *numBuffers); 46 | BOOLEAN __stdcall HidD_SetNumInputBuffers(IN HANDLE device, OUT ULONG numBuffers); 47 | #include 48 | #endif /* MY_DDK_HIDSDI_H */ 49 | -------------------------------------------------------------------------------- /avrdude/par.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2000-2004 Brian S. Dean 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 | /* $Id$ */ 20 | 21 | #ifndef par_h 22 | #define par_h 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | extern const char par_desc[]; 29 | void par_initpgm (PROGRAMMER * pgm); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /avrdude/pgm_type.c: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2002-2004 Brian S. Dean 4 | * Copyright 2007 Joerg Wunsch 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | /* $Id: pgm.c 976 2011-08-23 21:03:36Z joerg_wunsch $ */ 21 | 22 | #include "ac_cfg.h" 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | #include "avrdude.h" 29 | #include "libavrdude.h" 30 | 31 | #include "arduino.h" 32 | #include "avr910.h" 33 | #include "avrftdi.h" 34 | #include "buspirate.h" 35 | #include "butterfly.h" 36 | #include "flip1.h" 37 | #include "flip2.h" 38 | #include "ft245r.h" 39 | #include "jtagmkI.h" 40 | #include "jtagmkII.h" 41 | #include "jtag3.h" 42 | #include "linuxgpio.h" 43 | #include "par.h" 44 | #include "pickit2.h" 45 | #include "ppi.h" 46 | #include "serbb.h" 47 | #include "stk500.h" 48 | #include "stk500generic.h" 49 | #include "stk500v2.h" 50 | #include "usbasp.h" 51 | #include "ch341a.h" 52 | #include "usbtiny.h" 53 | #include "wiring.h" 54 | 55 | 56 | const PROGRAMMER_TYPE programmers_types[] = { 57 | {"arduino", arduino_initpgm, arduino_desc}, 58 | {"avr910", avr910_initpgm, avr910_desc}, 59 | {"avrftdi", avrftdi_initpgm, avrftdi_desc}, 60 | {"buspirate", buspirate_initpgm, buspirate_desc}, 61 | {"buspirate_bb", buspirate_bb_initpgm, buspirate_bb_desc}, 62 | {"butterfly", butterfly_initpgm, butterfly_desc}, 63 | {"butterfly_mk", butterfly_mk_initpgm, butterfly_mk_desc}, 64 | {"dragon_dw", jtagmkII_dragon_dw_initpgm, jtagmkII_dragon_dw_desc}, 65 | {"dragon_hvsp", stk500v2_dragon_hvsp_initpgm, stk500v2_dragon_hvsp_desc}, 66 | {"dragon_isp", stk500v2_dragon_isp_initpgm, stk500v2_dragon_isp_desc}, 67 | {"dragon_jtag", jtagmkII_dragon_initpgm, jtagmkII_dragon_desc}, 68 | {"dragon_pdi", jtagmkII_dragon_pdi_initpgm, jtagmkII_dragon_pdi_desc}, 69 | {"dragon_pp", stk500v2_dragon_pp_initpgm, stk500v2_dragon_pp_desc}, 70 | {"flip1", flip1_initpgm, flip1_desc}, 71 | {"flip2", flip2_initpgm, flip2_desc}, 72 | {"ftdi_syncbb", ft245r_initpgm, ft245r_desc}, 73 | {"jtagmki", jtagmkI_initpgm, jtagmkI_desc}, 74 | {"jtagmkii", jtagmkII_initpgm, jtagmkII_desc}, 75 | {"jtagmkii_avr32", jtagmkII_avr32_initpgm, jtagmkII_avr32_desc}, 76 | {"jtagmkii_dw", jtagmkII_dw_initpgm, jtagmkII_dw_desc}, 77 | {"jtagmkii_isp", stk500v2_jtagmkII_initpgm, stk500v2_jtagmkII_desc}, 78 | {"jtagmkii_pdi", jtagmkII_pdi_initpgm, jtagmkII_pdi_desc}, 79 | {"jtagice3", jtag3_initpgm, jtag3_desc}, 80 | {"jtagice3_pdi", jtag3_pdi_initpgm, jtag3_pdi_desc}, 81 | {"jtagice3_dw", jtag3_dw_initpgm, jtag3_dw_desc}, 82 | {"jtagice3_isp", stk500v2_jtag3_initpgm, stk500v2_jtag3_desc}, 83 | {"linuxgpio", linuxgpio_initpgm, linuxgpio_desc}, 84 | {"par", par_initpgm, par_desc}, 85 | {"pickit2", pickit2_initpgm, pickit2_desc}, 86 | {"serbb", serbb_initpgm, serbb_desc}, 87 | {"stk500", stk500_initpgm, stk500_desc}, 88 | {"stk500generic", stk500generic_initpgm, stk500generic_desc}, 89 | {"stk500v2", stk500v2_initpgm, stk500v2_desc}, 90 | {"stk500hvsp", stk500hvsp_initpgm, stk500hvsp_desc}, 91 | {"stk500pp", stk500pp_initpgm, stk500pp_desc}, 92 | {"stk600", stk600_initpgm, stk600_desc}, 93 | {"stk600hvsp", stk600hvsp_initpgm, stk600hvsp_desc}, 94 | {"stk600pp", stk600pp_initpgm, stk600pp_desc}, 95 | {"usbasp", usbasp_initpgm, usbasp_desc}, 96 | {"ch341a", ch341a_initpgm, ch341a_desc}, 97 | {"usbtiny", usbtiny_initpgm, usbtiny_desc}, 98 | {"wiring", wiring_initpgm, wiring_desc}, 99 | }; 100 | 101 | const PROGRAMMER_TYPE * locate_programmer_type(const char * id) 102 | { 103 | const PROGRAMMER_TYPE * p = NULL; 104 | int i; 105 | int found; 106 | 107 | found = 0; 108 | 109 | for (i = 0; i < sizeof(programmers_types)/sizeof(programmers_types[0]) && !found; i++) { 110 | p = &(programmers_types[i]); 111 | if (strcasecmp(id, p->id) == 0) 112 | found = 1; 113 | } 114 | 115 | if (found) 116 | return p; 117 | 118 | return NULL; 119 | } 120 | 121 | /* 122 | * Iterate over the list of programmers given as "programmers", and 123 | * call the callback function cb for each entry found. cb is being 124 | * passed the following arguments: 125 | * . the name of the programmer (for -c) 126 | * . the descriptive text given in the config file 127 | * . the name of the config file this programmer has been defined in 128 | * . the line number of the config file this programmer has been defined at 129 | * . the "cookie" passed into walk_programmers() (opaque client data) 130 | */ 131 | /* 132 | void walk_programmer_types(LISTID programmer_types, walk_programmer_types_cb cb, void *cookie) 133 | { 134 | LNODEID ln1; 135 | PROGRAMMER * p; 136 | 137 | for (ln1 = lfirst(programmers); ln1; ln1 = lnext(ln1)) { 138 | p = ldata(ln1); 139 | cb(p->id, p->desc, cookie); 140 | } 141 | } 142 | }*/ 143 | 144 | void walk_programmer_types(walk_programmer_types_cb cb, void *cookie) 145 | { 146 | const PROGRAMMER_TYPE * p; 147 | int i; 148 | 149 | for (i = 0; i < sizeof(programmers_types)/sizeof(programmers_types[0]); i++) { 150 | p = &(programmers_types[i]); 151 | cb(p->id, p->desc, cookie); 152 | } 153 | } 154 | 155 | 156 | -------------------------------------------------------------------------------- /avrdude/pickit2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2006 Thomas Fischl 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 | /* $Id: pickit2.h 2010-05-03 dbrown $ */ 20 | 21 | #ifndef pickit2_h 22 | #define pickit2_h 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | extern const char pickit2_desc[]; 29 | void pickit2_initpgm (PROGRAMMER * pgm); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif // pickit2_h 36 | -------------------------------------------------------------------------------- /avrdude/ppi.c: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2000-2004 Brian S. Dean 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 | /* $Id$ */ 20 | 21 | 22 | #if !defined(WIN32NATIVE) 23 | 24 | #include "ac_cfg.h" 25 | 26 | #if HAVE_PARPORT 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) 36 | # include "freebsd_ppi.h" 37 | #elif defined(__linux__) 38 | # include "linux_ppdev.h" 39 | #elif defined(__sun__) || defined(__sun) /* Solaris */ 40 | # include "solaris_ecpp.h" 41 | #endif 42 | 43 | #include "avrdude.h" 44 | #include "libavrdude.h" 45 | 46 | #include "ppi.h" 47 | 48 | enum { 49 | PPI_READ, 50 | PPI_WRITE, 51 | PPI_SHADOWREAD 52 | }; 53 | 54 | static int ppi_shadow_access(union filedescriptor *fdp, int reg, 55 | unsigned char *v, unsigned char action) 56 | { 57 | static unsigned char shadow[3]; 58 | int shadow_num; 59 | 60 | switch (reg) { 61 | case PPIDATA: 62 | shadow_num = 0; 63 | break; 64 | case PPICTRL: 65 | shadow_num = 1; 66 | break; 67 | case PPISTATUS: 68 | shadow_num = 2; 69 | break; 70 | default: 71 | avrdude_message(MSG_INFO, "%s: avr_set(): invalid register=%d\n", 72 | progname, reg); 73 | return -1; 74 | break; 75 | } 76 | 77 | switch (action) { 78 | case PPI_SHADOWREAD: 79 | *v = shadow[shadow_num]; 80 | break; 81 | case PPI_READ: 82 | DO_PPI_READ(fdp->ifd, reg, v); 83 | shadow[shadow_num]=*v; 84 | break; 85 | case PPI_WRITE: 86 | shadow[shadow_num]=*v; 87 | DO_PPI_WRITE(fdp->ifd, reg, v); 88 | break; 89 | } 90 | return 0; 91 | } 92 | 93 | /* 94 | * set the indicated bit of the specified register. 95 | */ 96 | int ppi_set(union filedescriptor *fdp, int reg, int bit) 97 | { 98 | unsigned char v; 99 | int rc; 100 | 101 | rc = ppi_shadow_access(fdp, reg, &v, PPI_SHADOWREAD); 102 | v |= bit; 103 | rc |= ppi_shadow_access(fdp, reg, &v, PPI_WRITE); 104 | 105 | if (rc) 106 | return -1; 107 | 108 | return 0; 109 | } 110 | 111 | 112 | /* 113 | * clear the indicated bit of the specified register. 114 | */ 115 | int ppi_clr(union filedescriptor *fdp, int reg, int bit) 116 | { 117 | unsigned char v; 118 | int rc; 119 | 120 | rc = ppi_shadow_access(fdp, reg, &v, PPI_SHADOWREAD); 121 | v &= ~bit; 122 | rc |= ppi_shadow_access(fdp, reg, &v, PPI_WRITE); 123 | 124 | if (rc) 125 | return -1; 126 | 127 | return 0; 128 | } 129 | 130 | 131 | /* 132 | * get the indicated bit of the specified register. 133 | */ 134 | int ppi_get(union filedescriptor *fdp, int reg, int bit) 135 | { 136 | unsigned char v; 137 | int rc; 138 | 139 | rc = ppi_shadow_access(fdp, reg, &v, PPI_READ); 140 | v &= bit; 141 | 142 | if (rc) 143 | return -1; 144 | 145 | return v; /* v == bit */ 146 | } 147 | 148 | /* 149 | * toggle the indicated bit of the specified register. 150 | */ 151 | int ppi_toggle(union filedescriptor *fdp, int reg, int bit) 152 | { 153 | unsigned char v; 154 | int rc; 155 | 156 | rc = ppi_shadow_access(fdp, reg, &v, PPI_SHADOWREAD); 157 | v ^= bit; 158 | rc |= ppi_shadow_access(fdp, reg, &v, PPI_WRITE); 159 | 160 | if (rc) 161 | return -1; 162 | 163 | return 0; 164 | } 165 | 166 | 167 | /* 168 | * get all bits of the specified register. 169 | */ 170 | int ppi_getall(union filedescriptor *fdp, int reg) 171 | { 172 | unsigned char v; 173 | int rc; 174 | 175 | rc = ppi_shadow_access(fdp, reg, &v, PPI_READ); 176 | 177 | if (rc) 178 | return -1; 179 | 180 | return v; /* v == bit */ 181 | } 182 | 183 | /* 184 | * set all bits of the specified register to val. 185 | */ 186 | int ppi_setall(union filedescriptor *fdp, int reg, int val) 187 | { 188 | unsigned char v; 189 | int rc; 190 | 191 | v = val; 192 | rc = ppi_shadow_access(fdp, reg, &v, PPI_WRITE); 193 | 194 | if (rc) 195 | return -1; 196 | 197 | return 0; 198 | } 199 | 200 | 201 | void ppi_open(char * port, union filedescriptor *fdp) 202 | { 203 | int fd; 204 | unsigned char v; 205 | 206 | fd = open(port, O_RDWR); 207 | if (fd < 0) { 208 | avrdude_message(MSG_INFO, "%s: can't open device \"%s\": %s\n", 209 | progname, port, strerror(errno)); 210 | fdp->ifd = -1; 211 | return; 212 | } 213 | 214 | ppi_claim (fd); 215 | 216 | /* 217 | * Initialize shadow registers 218 | */ 219 | 220 | ppi_shadow_access (fdp, PPIDATA, &v, PPI_READ); 221 | ppi_shadow_access (fdp, PPICTRL, &v, PPI_READ); 222 | ppi_shadow_access (fdp, PPISTATUS, &v, PPI_READ); 223 | 224 | fdp->ifd = fd; 225 | } 226 | 227 | 228 | void ppi_close(union filedescriptor *fdp) 229 | { 230 | ppi_release (fdp->ifd); 231 | close(fdp->ifd); 232 | } 233 | 234 | #endif /* HAVE_PARPORT */ 235 | 236 | #endif /* !WIN32NATIVE */ 237 | -------------------------------------------------------------------------------- /avrdude/ppi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2000-2004 Brian S. Dean 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 | /* $Id$ */ 20 | 21 | #ifndef ppi_h 22 | #define ppi_h 23 | 24 | /* 25 | * PPI registers 26 | */ 27 | enum { 28 | PPIDATA, 29 | PPICTRL, 30 | PPISTATUS 31 | }; 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | int ppi_get (union filedescriptor *fdp, int reg, int bit); 38 | 39 | int ppi_set (union filedescriptor *fdp, int reg, int bit); 40 | 41 | int ppi_clr (union filedescriptor *fdp, int reg, int bit); 42 | 43 | int ppi_getall (union filedescriptor *fdp, int reg); 44 | 45 | int ppi_setall (union filedescriptor *fdp, int reg, int val); 46 | 47 | int ppi_toggle (union filedescriptor *fdp, int reg, int bit); 48 | 49 | void ppi_open (char * port, union filedescriptor *fdp); 50 | 51 | void ppi_close (union filedescriptor *fdp); 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif 58 | 59 | 60 | -------------------------------------------------------------------------------- /avrdude/serbb.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 Michael Holzt 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | /* $Id$ */ 20 | 21 | #ifndef serbb_h 22 | #define serbb_h 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | extern const char serbb_desc[]; 29 | void serbb_initpgm (PROGRAMMER * pgm); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif 36 | 37 | 38 | -------------------------------------------------------------------------------- /avrdude/solaris_ecpp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2005 Joerg Wunsch 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 | /* $Id$ */ 20 | 21 | #ifndef solaris_ecpp_h 22 | #define solaris_ecpp_h 23 | 24 | #include 25 | 26 | #define ppi_claim(fd) \ 27 | do { \ 28 | struct ecpp_transfer_parms p; \ 29 | (void)ioctl(fd, ECPPIOC_GETPARMS, &p); \ 30 | p.mode = ECPP_DIAG_MODE; \ 31 | (void)ioctl(fd, ECPPIOC_SETPARMS, &p); \ 32 | } while(0); 33 | 34 | #define ppi_release(fd) 35 | 36 | #define DO_PPI_READ(fd, reg, valp) \ 37 | do { struct ecpp_regs r; \ 38 | if ((reg) == PPIDATA) { (void)ioctl(fd, ECPPIOC_GETDATA, valp); } \ 39 | else { (void)ioctl(fd, ECPPIOC_GETREGS, &r); \ 40 | *(valp) = ((reg) == PPICTRL)? r.dcr: r.dsr; } \ 41 | } while(0) 42 | #define DO_PPI_WRITE(fd, reg, valp) \ 43 | do { struct ecpp_regs r; \ 44 | if ((reg) == PPIDATA) { (void)ioctl(fd, ECPPIOC_SETDATA, valp); } \ 45 | else { if ((reg) == PPICTRL) r.dcr = *(valp); else r.dsr = *(valp); \ 46 | (void)ioctl(fd, ECPPIOC_SETREGS, &r); } \ 47 | } while(0) 48 | 49 | 50 | #endif /* solaris_ecpp_h */ 51 | -------------------------------------------------------------------------------- /avrdude/stk500.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2002-2004 Brian S. Dean 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 | /* $Id$ */ 20 | 21 | #ifndef stk500_h 22 | #define stk500_h 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | extern const char stk500_desc[]; 29 | void stk500_initpgm (PROGRAMMER * pgm); 30 | 31 | /* used by arduino.c to avoid duplicate code */ 32 | int stk500_getsync(PROGRAMMER * pgm); 33 | int stk500_drain(PROGRAMMER * pgm, int display); 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif 40 | 41 | 42 | -------------------------------------------------------------------------------- /avrdude/stk500_private.h: -------------------------------------------------------------------------------- 1 | //**** ATMEL AVR - A P P L I C A T I O N N O T E ************************ 2 | //* 3 | //* Title: AVR061 - STK500 Communication Protocol 4 | //* Filename: command.h 5 | //* Version: 1.0 6 | //* Last updated: 09.09.2002 7 | //* 8 | //* Support E-mail: avr@atmel.com 9 | //* 10 | //************************************************************************** 11 | 12 | // *****************[ STK Message constants ]*************************** 13 | 14 | #define STK_SIGN_ON_MESSAGE "AVR STK" // Sign on string for Cmnd_STK_GET_SIGN_ON 15 | 16 | // *****************[ STK Response constants ]*************************** 17 | 18 | #define Resp_STK_OK 0x10 // ' ' 19 | #define Resp_STK_FAILED 0x11 // ' ' 20 | #define Resp_STK_UNKNOWN 0x12 // ' ' 21 | #define Resp_STK_NODEVICE 0x13 // ' ' 22 | #define Resp_STK_INSYNC 0x14 // ' ' 23 | #define Resp_STK_NOSYNC 0x15 // ' ' 24 | 25 | #define Resp_ADC_CHANNEL_ERROR 0x16 // ' ' 26 | #define Resp_ADC_MEASURE_OK 0x17 // ' ' 27 | #define Resp_PWM_CHANNEL_ERROR 0x18 // ' ' 28 | #define Resp_PWM_ADJUST_OK 0x19 // ' ' 29 | 30 | // *****************[ STK Special constants ]*************************** 31 | 32 | #define Sync_CRC_EOP 0x20 // 'SPACE' 33 | 34 | // *****************[ STK Command constants ]*************************** 35 | 36 | #define Cmnd_STK_GET_SYNC 0x30 // ' ' 37 | #define Cmnd_STK_GET_SIGN_ON 0x31 // ' ' 38 | 39 | #define Cmnd_STK_SET_PARAMETER 0x40 // ' ' 40 | #define Cmnd_STK_GET_PARAMETER 0x41 // ' ' 41 | #define Cmnd_STK_SET_DEVICE 0x42 // ' ' 42 | #define Cmnd_STK_SET_DEVICE_EXT 0x45 // ' ' 43 | 44 | #define Cmnd_STK_ENTER_PROGMODE 0x50 // ' ' 45 | #define Cmnd_STK_LEAVE_PROGMODE 0x51 // ' ' 46 | #define Cmnd_STK_CHIP_ERASE 0x52 // ' ' 47 | #define Cmnd_STK_CHECK_AUTOINC 0x53 // ' ' 48 | #define Cmnd_STK_LOAD_ADDRESS 0x55 // ' ' 49 | #define Cmnd_STK_UNIVERSAL 0x56 // ' ' 50 | #define Cmnd_STK_UNIVERSAL_MULTI 0x57 // ' ' 51 | 52 | #define Cmnd_STK_PROG_FLASH 0x60 // ' ' 53 | #define Cmnd_STK_PROG_DATA 0x61 // ' ' 54 | #define Cmnd_STK_PROG_FUSE 0x62 // ' ' 55 | #define Cmnd_STK_PROG_LOCK 0x63 // ' ' 56 | #define Cmnd_STK_PROG_PAGE 0x64 // ' ' 57 | #define Cmnd_STK_PROG_FUSE_EXT 0x65 // ' ' 58 | 59 | #define Cmnd_STK_READ_FLASH 0x70 // ' ' 60 | #define Cmnd_STK_READ_DATA 0x71 // ' ' 61 | #define Cmnd_STK_READ_FUSE 0x72 // ' ' 62 | #define Cmnd_STK_READ_LOCK 0x73 // ' ' 63 | #define Cmnd_STK_READ_PAGE 0x74 // ' ' 64 | #define Cmnd_STK_READ_SIGN 0x75 // ' ' 65 | #define Cmnd_STK_READ_OSCCAL 0x76 // ' ' 66 | #define Cmnd_STK_READ_FUSE_EXT 0x77 // ' ' 67 | #define Cmnd_STK_READ_OSCCAL_EXT 0x78 // ' ' 68 | 69 | // *****************[ STK Parameter constants ]*************************** 70 | 71 | #define Parm_STK_HW_VER 0x80 // ' ' - R 72 | #define Parm_STK_SW_MAJOR 0x81 // ' ' - R 73 | #define Parm_STK_SW_MINOR 0x82 // ' ' - R 74 | #define Parm_STK_LEDS 0x83 // ' ' - R/W 75 | #define Parm_STK_VTARGET 0x84 // ' ' - R/W 76 | #define Parm_STK_VADJUST 0x85 // ' ' - R/W 77 | #define Parm_STK_OSC_PSCALE 0x86 // ' ' - R/W 78 | #define Parm_STK_OSC_CMATCH 0x87 // ' ' - R/W 79 | #define Parm_STK_RESET_DURATION 0x88 // ' ' - R/W 80 | #define Parm_STK_SCK_DURATION 0x89 // ' ' - R/W 81 | 82 | #define Parm_STK_BUFSIZEL 0x90 // ' ' - R/W, Range {0..255} 83 | #define Parm_STK_BUFSIZEH 0x91 // ' ' - R/W, Range {0..255} 84 | #define Parm_STK_DEVICE 0x92 // ' ' - R/W, Range {0..255} 85 | #define Parm_STK_PROGMODE 0x93 // ' ' - 'P' or 'S' 86 | #define Parm_STK_PARAMODE 0x94 // ' ' - TRUE or FALSE 87 | #define Parm_STK_POLLING 0x95 // ' ' - TRUE or FALSE 88 | #define Parm_STK_SELFTIMED 0x96 // ' ' - TRUE or FALSE 89 | #define Param_STK500_TOPCARD_DETECT 0x98 // ' ' - Detect top-card attached 90 | 91 | // *****************[ STK status bit definitions ]*************************** 92 | 93 | #define Stat_STK_INSYNC 0x01 // INSYNC status bit, '1' - INSYNC 94 | #define Stat_STK_PROGMODE 0x02 // Programming mode, '1' - PROGMODE 95 | #define Stat_STK_STANDALONE 0x04 // Standalone mode, '1' - SM mode 96 | #define Stat_STK_RESET 0x08 // RESET button, '1' - Pushed 97 | #define Stat_STK_PROGRAM 0x10 // Program button, ' 1' - Pushed 98 | #define Stat_STK_LEDG 0x20 // Green LED status, '1' - Lit 99 | #define Stat_STK_LEDR 0x40 // Red LED status, '1' - Lit 100 | #define Stat_STK_LEDBLINK 0x80 // LED blink ON/OFF, '1' - Blink 101 | 102 | 103 | // *****************************[ End Of COMMAND.H ]************************** 104 | -------------------------------------------------------------------------------- /avrdude/stk500generic.c: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2006 Joerg Wunsch 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 | /* $Id$ */ 20 | 21 | /* 22 | * avrdude interface for Atmel STK500 programmer 23 | * 24 | * This is a wrapper around the STK500[v1] and STK500v2 programmers. 25 | * Try to select the programmer type that actually responds, and 26 | * divert to the actual programmer implementation if successful. 27 | */ 28 | 29 | #include "ac_cfg.h" 30 | 31 | #include 32 | #include 33 | 34 | #include "avrdude.h" 35 | #include "libavrdude.h" 36 | 37 | #include "stk500generic.h" 38 | #include "stk500.h" 39 | #include "stk500v2.h" 40 | 41 | static int stk500generic_open(PROGRAMMER * pgm, char * port) 42 | { 43 | stk500_initpgm(pgm); 44 | if (pgm->open(pgm, port) >= 0) 45 | { 46 | avrdude_message(MSG_INFO, "%s: successfully opened stk500v1 device -- please use -c stk500v1\n", 47 | progname); 48 | return 0; 49 | } 50 | 51 | pgm->close(pgm); 52 | 53 | stk500v2_initpgm(pgm); 54 | if (pgm->open(pgm, port) >= 0) 55 | { 56 | avrdude_message(MSG_INFO, "%s: successfully opened stk500v2 device -- please use -c stk500v2\n", 57 | progname); 58 | return 0; 59 | } 60 | 61 | avrdude_message(MSG_INFO, "%s: cannot open either stk500v1 or stk500v2 programmer\n", 62 | progname); 63 | return -1; 64 | } 65 | 66 | static void stk500generic_setup(PROGRAMMER * pgm) 67 | { 68 | /* 69 | * Only STK500v2 needs setup/teardown. 70 | */ 71 | stk500v2_initpgm(pgm); 72 | pgm->setup(pgm); 73 | } 74 | 75 | static void stk500generic_teardown(PROGRAMMER * pgm) 76 | { 77 | stk500v2_initpgm(pgm); 78 | pgm->teardown(pgm); 79 | } 80 | 81 | const char stk500generic_desc[] = "Atmel STK500, autodetect firmware version"; 82 | 83 | void stk500generic_initpgm(PROGRAMMER * pgm) 84 | { 85 | strcpy(pgm->type, "STK500GENERIC"); 86 | 87 | pgm->open = stk500generic_open; 88 | pgm->setup = stk500generic_setup; 89 | pgm->teardown = stk500generic_teardown; 90 | } 91 | -------------------------------------------------------------------------------- /avrdude/stk500generic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2006 Joerg Wunsch 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 | /* $Id$ */ 20 | 21 | #ifndef stk500generic_h__ 22 | #define stk500generic_h__ 23 | 24 | extern const char stk500generic_desc[]; 25 | void stk500generic_initpgm (PROGRAMMER * pgm); 26 | 27 | #endif 28 | 29 | 30 | -------------------------------------------------------------------------------- /avrdude/stk500v2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2002-2005 Brian S. Dean 4 | * Copyright (C) 2006 Joerg Wunsch 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | /* $Id$ */ 21 | 22 | #ifndef stk500v2_h 23 | #define stk500v2_h 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | extern const char stk500v2_desc[]; 30 | extern const char stk500hvsp_desc[]; 31 | extern const char stk500pp_desc[]; 32 | extern const char stk500v2_jtagmkII_desc[]; 33 | extern const char stk500v2_dragon_hvsp_desc[]; 34 | extern const char stk500v2_dragon_isp_desc[]; 35 | extern const char stk500v2_dragon_pp_desc[]; 36 | extern const char stk500v2_jtag3_desc[]; 37 | extern const char stk600_desc[]; 38 | extern const char stk600hvsp_desc[]; 39 | extern const char stk600pp_desc[]; 40 | void stk500v2_initpgm (PROGRAMMER * pgm); 41 | void stk500hvsp_initpgm (PROGRAMMER * pgm); 42 | void stk500pp_initpgm (PROGRAMMER * pgm); 43 | void stk500v2_jtagmkII_initpgm(PROGRAMMER * pgm); 44 | void stk500v2_jtag3_initpgm(PROGRAMMER * pgm); 45 | void stk500v2_dragon_hvsp_initpgm(PROGRAMMER * pgm); 46 | void stk500v2_dragon_isp_initpgm(PROGRAMMER * pgm); 47 | void stk500v2_dragon_pp_initpgm(PROGRAMMER * pgm); 48 | void stk600_initpgm (PROGRAMMER * pgm); 49 | void stk600hvsp_initpgm (PROGRAMMER * pgm); 50 | void stk600pp_initpgm (PROGRAMMER * pgm); 51 | 52 | void stk500v2_setup(PROGRAMMER * pgm); 53 | void stk500v2_teardown(PROGRAMMER * pgm); 54 | int stk500v2_drain(PROGRAMMER * pgm, int display); 55 | int stk500v2_getsync(PROGRAMMER * pgm); 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | 61 | #endif 62 | 63 | 64 | -------------------------------------------------------------------------------- /avrdude/term.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2000-2004 Brian S. Dean 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 | /* $Id$ */ 20 | 21 | #ifndef term_h 22 | #define term_h 23 | 24 | #include "libavrdude.h" 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | int terminal_mode(PROGRAMMER * pgm, struct avrpart * p); 31 | char * terminal_get_input(const char *prompt); 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /avrdude/tools/build-mingw32.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # ---------------------------------------------------------------------------- 4 | # "THE BEER-WARE LICENSE" (Revision 42): 5 | # Joerg Wunsch wrote this file. As long as you retain this notice you 6 | # can do whatever you want with this stuff. If we meet some day, and you think 7 | # this stuff is worth it, you can buy me a beer in return. 8 | # ---------------------------------------------------------------------------- 9 | 10 | # Script to cross-compile a MinGW32 executable under unixish host. 11 | # Run this script from within the tools/ subdirectory. 12 | # Override MINGW32_PREFIX and LIBUSB_PREFIX from the commandline 13 | # when invoking the script, like 14 | # 15 | # env LIBUSB_PREFIX="$HOME/dos/ProgramFiles/LibUSB-Win32" ./build-mingw32.sh 16 | # 17 | # The LibUSB-Win32 package is shipped as a self-installing 18 | # executable; it can be unpacked using Wine, and typically 19 | # extracts into the Wine environment. 20 | # 21 | # libelf can be cross-compiled, and installed into the MinGW32 22 | # target environment if desired. 23 | 24 | MINGW32_PREFIX=${MINGW32_PREFIX:-/usr/local/mingw32} 25 | LIBUSB_PREFIX=${LIBUSB_PREFIX:-/WINDOWS/ProgramFiles/LibUSB-Win32} 26 | 27 | for CC in mingw32-gcc i686-w64-mingw32-gcc i586-mingw32msvc-gcc 28 | do 29 | touch foo.c 30 | if ${CC} -c foo.c 2> /dev/null 31 | then 32 | rm -f foo.* 33 | break 34 | fi 35 | done 36 | tgt=$(expr "$CC" : "\(.*\)-gcc") 37 | 38 | BUILDDIR=build-mingw32 39 | mkdir -p ${BUILDDIR} || { echo "Cannot create build dir $BUILDDIR"; exit 1; } 40 | 41 | cd ${BUILDDIR} || { echo "Cannot chdir to $BUILDDIR"; exit 1; } 42 | 43 | LDFLAGS="-L${MINGW32_PREFIX}/lib -L${LIBUSB_PREFIX}/lib/gcc" 44 | CPPFLAGS="-I${MINGW32_PREFIX}/include -I${LIBUSB_PREFIX}/include" 45 | 46 | env \ 47 | CC="${CC}" \ 48 | CPPFLAGS="${CPPFLAGS}" \ 49 | LDFLAGS="${LDFLAGS}" \ 50 | ../../configure \ 51 | --host=$(../../config.guess) \ 52 | --target=${tgt} 53 | 54 | make all 55 | -------------------------------------------------------------------------------- /avrdude/tools/get-dw-params.xsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 29 | 30 | 31 | 32 | 34 | 38 | 42 | 44 | 46 | 47 | 48 | 49 | 50 | 51 | #------------------------------------------------------------ 52 | # 53 | 54 | 55 | #------------------------------------------------------------ 56 | part desc = " 57 | 58 | "; has_debugwire = yes; 59 | 60 | flash_instr = 61 | 62 | 63 | 64 | 65 | ; 66 | 67 | eeprom_instr = 68 | 69 | 70 | 71 | 72 | ; 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 0 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 0 97 | 98 | 99 | 0x 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 127 | 128 | 129 | 130 | , 131 | 132 | 133 | , 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | -------------------------------------------------------------------------------- /avrdude/tools/get-stk600-cards.xsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 35 | 36 | 37 | 38 | 39 | 40 | { 41 | 42 | , " 43 | 44 | " }, 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | { 53 | 54 | , " 55 | 56 | " }, 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /avrdude/tools/get-stk600-devices.xsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 21 | 32 | 33 | 34 | @multitable @columnfractions .15 .15 .6 35 | Routing card @tab Socket card @tab Devices 36 | 37 | @item @code{ 38 | 39 | } @tab @code{ 40 | 41 | } @tab 42 | 43 | 44 | 45 | 46 | 47 | 48 | @end multitable 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /avrdude/tpi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2011 Darell Tan 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 | /* $Id$ */ 20 | 21 | #ifndef tpi_h 22 | #define tpi_h 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | static const unsigned char tpi_skey[] = { 0x12, 0x89, 0xAB, 0x45, 0xCD, 0xD8, 0x88, 0xFF }; 29 | 30 | /* registers */ 31 | #define TPI_REG_TPIIR 0x0F 32 | 33 | #define TPI_IDENT_CODE 0x80 34 | 35 | #define TPI_REG_TPIPCR 0x02 36 | #define TPI_REG_TPISR 0x00 37 | 38 | #define TPI_REG_TPISR_NVMEN (1 << 1) 39 | 40 | /* TPI commands */ 41 | #define TPI_CMD_SLD 0x20 42 | #define TPI_CMD_SLD_PI 0x24 43 | #define TPI_CMD_SIN 0x10 44 | #define TPI_CMD_SOUT 0x90 45 | #define TPI_CMD_SSTCS 0xC0 46 | #define TPI_CMD_SST 0x60 47 | #define TPI_CMD_SST_PI 0x64 48 | 49 | #define TPI_CMD_SLDCS 0x80 50 | #define TPI_CMD_SSTPR 0x68 51 | #define TPI_CMD_SKEY 0xE0 52 | 53 | /* for TPI_CMD_SIN & TPI_CMD_SOUT */ 54 | #define TPI_SIO_ADDR(x) ((x & 0x30) << 1 | (x & 0x0F)) 55 | 56 | /* ATtiny4/5/9/10 I/O registers */ 57 | #define TPI_IOREG_NVMCSR 0x32 58 | #define TPI_IOREG_NVMCMD 0x33 59 | 60 | /* bit for NVMCSR */ 61 | #define TPI_IOREG_NVMCSR_NVMBSY (1 << 7) 62 | 63 | /* NVM commands */ 64 | #define TPI_NVMCMD_NO_OPERATION 0x00 65 | #define TPI_NVMCMD_CHIP_ERASE 0x10 66 | #define TPI_NVMCMD_SECTION_ERASE 0x14 67 | #define TPI_NVMCMD_WORD_WRITE 0x1D 68 | 69 | static const unsigned char tpi_skey_cmd[] = { TPI_CMD_SKEY, 0xff, 0x88, 0xd8, 0xcd, 0x45, 0xab, 0x89, 0x12 }; 70 | 71 | #ifdef __cplusplus 72 | } 73 | #endif 74 | 75 | #endif 76 | 77 | -------------------------------------------------------------------------------- /avrdude/usbasp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2006 Thomas Fischl 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 | /* $Id$ */ 20 | 21 | #ifndef usbasp_h 22 | #define usbasp_h 23 | 24 | /* USB function call identifiers */ 25 | #define USBASP_FUNC_CONNECT 1 26 | #define USBASP_FUNC_DISCONNECT 2 27 | #define USBASP_FUNC_TRANSMIT 3 28 | #define USBASP_FUNC_READFLASH 4 29 | #define USBASP_FUNC_ENABLEPROG 5 30 | #define USBASP_FUNC_WRITEFLASH 6 31 | #define USBASP_FUNC_READEEPROM 7 32 | #define USBASP_FUNC_WRITEEEPROM 8 33 | #define USBASP_FUNC_SETLONGADDRESS 9 34 | #define USBASP_FUNC_SETISPSCK 10 35 | #define USBASP_FUNC_TPI_CONNECT 11 36 | #define USBASP_FUNC_TPI_DISCONNECT 12 37 | #define USBASP_FUNC_TPI_RAWREAD 13 38 | #define USBASP_FUNC_TPI_RAWWRITE 14 39 | #define USBASP_FUNC_TPI_READBLOCK 15 40 | #define USBASP_FUNC_TPI_WRITEBLOCK 16 41 | #define USBASP_FUNC_GETCAPABILITIES 127 42 | 43 | /* USBASP capabilities */ 44 | #define USBASP_CAP_TPI 0x01 45 | 46 | /* Block mode flags */ 47 | #define USBASP_BLOCKFLAG_FIRST 1 48 | #define USBASP_BLOCKFLAG_LAST 2 49 | 50 | /* Block mode data size */ 51 | #define USBASP_READBLOCKSIZE 200 52 | #define USBASP_WRITEBLOCKSIZE 200 53 | 54 | /* ISP SCK speed identifiers */ 55 | #define USBASP_ISP_SCK_AUTO 0 56 | #define USBASP_ISP_SCK_0_5 1 /* 500 Hz */ 57 | #define USBASP_ISP_SCK_1 2 /* 1 kHz */ 58 | #define USBASP_ISP_SCK_2 3 /* 2 kHz */ 59 | #define USBASP_ISP_SCK_4 4 /* 4 kHz */ 60 | #define USBASP_ISP_SCK_8 5 /* 8 kHz */ 61 | #define USBASP_ISP_SCK_16 6 /* 16 kHz */ 62 | #define USBASP_ISP_SCK_32 7 /* 32 kHz */ 63 | #define USBASP_ISP_SCK_93_75 8 /* 93.75 kHz */ 64 | #define USBASP_ISP_SCK_187_5 9 /* 187.5 kHz */ 65 | #define USBASP_ISP_SCK_375 10 /* 375 kHz */ 66 | #define USBASP_ISP_SCK_750 11 /* 750 kHz */ 67 | #define USBASP_ISP_SCK_1500 12 /* 1.5 MHz */ 68 | 69 | /* TPI instructions */ 70 | #define TPI_OP_SLD 0x20 71 | #define TPI_OP_SLD_INC 0x24 72 | #define TPI_OP_SST 0x60 73 | #define TPI_OP_SST_INC 0x64 74 | #define TPI_OP_SSTPR(a) (0x68 | (a)) 75 | #define TPI_OP_SIN(a) (0x10 | (((a)<<1)&0x60) | ((a)&0x0F) ) 76 | #define TPI_OP_SOUT(a) (0x90 | (((a)<<1)&0x60) | ((a)&0x0F) ) 77 | #define TPI_OP_SLDCS(a) (0x80 | ((a)&0x0F) ) 78 | #define TPI_OP_SSTCS(a) (0xC0 | ((a)&0x0F) ) 79 | #define TPI_OP_SKEY 0xE0 80 | 81 | /* TPI control/status registers */ 82 | #define TPIIR 0xF 83 | #define TPIPCR 0x2 84 | #define TPISR 0x0 85 | 86 | // TPIPCR bits 87 | #define TPIPCR_GT_2 0x04 88 | #define TPIPCR_GT_1 0x02 89 | #define TPIPCR_GT_0 0x01 90 | #define TPIPCR_GT_128b 0x00 91 | #define TPIPCR_GT_64b 0x01 92 | #define TPIPCR_GT_32b 0x02 93 | #define TPIPCR_GT_16b 0x03 94 | #define TPIPCR_GT_8b 0x04 95 | #define TPIPCR_GT_4b 0x05 96 | #define TPIPCR_GT_2b 0x06 97 | #define TPIPCR_GT_0b 0x07 98 | 99 | // TPISR bits 100 | #define TPISR_NVMEN 0x02 101 | 102 | /* NVM registers */ 103 | #define NVMCSR 0x32 104 | #define NVMCMD 0x33 105 | 106 | // NVMCSR bits 107 | #define NVMCSR_BSY 0x80 108 | 109 | // NVMCMD values 110 | #define NVMCMD_NOP 0x00 111 | #define NVMCMD_CHIP_ERASE 0x10 112 | #define NVMCMD_SECTION_ERASE 0x14 113 | #define NVMCMD_WORD_WRITE 0x1D 114 | 115 | 116 | typedef struct sckoptions_t { 117 | int id; 118 | double frequency; 119 | } CLOCKOPTIONS; 120 | 121 | /* USB error identifiers */ 122 | #define USB_ERROR_NOTFOUND 1 123 | #define USB_ERROR_ACCESS 2 124 | #define USB_ERROR_IO 3 125 | 126 | #ifdef __cplusplus 127 | extern "C" { 128 | #endif 129 | 130 | extern const char usbasp_desc[]; 131 | void usbasp_initpgm (PROGRAMMER * pgm); 132 | 133 | #ifdef __cplusplus 134 | } 135 | #endif 136 | 137 | #endif /* usbasp_h */ 138 | -------------------------------------------------------------------------------- /avrdude/usbdevs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2006 Joerg Wunsch 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 | /* $Id$ */ 20 | 21 | /* 22 | * defines for the USB interface 23 | */ 24 | 25 | #ifndef usbdevs_h 26 | #define usbdevs_h 27 | 28 | #define USB_VENDOR_ATMEL 1003 29 | #define USB_DEVICE_JTAGICEMKII 0x2103 30 | #define USB_DEVICE_AVRISPMKII 0x2104 31 | #define USB_DEVICE_STK600 0x2106 32 | #define USB_DEVICE_AVRDRAGON 0x2107 33 | #define USB_DEVICE_JTAGICE3 0x2110 34 | #define USB_DEVICE_XPLAINEDPRO 0x2111 35 | #define USB_DEVICE_JTAG3_EDBG 0x2140 36 | #define USB_DEVICE_ATMEL_ICE 0x2141 37 | 38 | #define USB_VENDOR_FTDI 0x0403 39 | #define USB_DEVICE_FT2232 0x6010 40 | #define USB_DEVICE_FT245 0x6001 41 | 42 | #define USBASP_SHARED_VID 0x16C0 /* VOTI */ 43 | #define USBASP_SHARED_PID 0x05DC /* Obdev's free shared PID */ 44 | 45 | #define USBASP_OLD_VID 0x03EB /* ATMEL */ 46 | #define USBASP_OLD_PID 0xC7B4 /* (unoffical) USBasp */ 47 | 48 | #define USBASP_NIBOBEE_VID 0x16C0 /* VOTI */ 49 | #define USBASP_NIBOBEE_PID 0x092F /* NIBObee PID */ 50 | 51 | // these are specifically assigned to USBtiny, 52 | // if you need your own VID and PIDs you can get them for cheap from 53 | // www.mecanique.co.uk so please don't reuse these. Thanks! 54 | #define USBTINY_VENDOR_DEFAULT 0x1781 55 | #define USBTINY_PRODUCT_DEFAULT 0x0C9F 56 | 57 | 58 | 59 | /* JTAGICEmkII, AVRISPmkII */ 60 | #define USBDEV_BULK_EP_WRITE_MKII 0x02 61 | #define USBDEV_BULK_EP_READ_MKII 0x82 62 | #define USBDEV_MAX_XFER_MKII 64 63 | 64 | /* STK600 */ 65 | #define USBDEV_BULK_EP_WRITE_STK600 0x02 66 | #define USBDEV_BULK_EP_READ_STK600 0x83 67 | 68 | /* JTAGICE3 */ 69 | #define USBDEV_BULK_EP_WRITE_3 0x01 70 | #define USBDEV_BULK_EP_READ_3 0x82 71 | #define USBDEV_EVT_EP_READ_3 0x83 72 | #define USBDEV_MAX_XFER_3 512 73 | 74 | /* 75 | * When operating on the JTAGICE3, usbdev_recv_frame() returns an 76 | * indication in the upper bits of the return value whether the 77 | * message has been received from the event endpoint rather than the 78 | * normal conversation endpoint. 79 | */ 80 | #define USB_RECV_LENGTH_MASK 0x0fff /* up to 4 KiB */ 81 | #define USB_RECV_FLAG_EVENT 0x1000 82 | 83 | #endif /* usbdevs_h */ 84 | -------------------------------------------------------------------------------- /avrdude/usbtiny.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2007 Limor Fried 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 | 20 | #ifndef usbtiny_h 21 | #define usbtiny_h 22 | 23 | // Generic requests to the USBtiny 24 | #define USBTINY_ECHO 0 // echo test 25 | #define USBTINY_READ 1 // read byte (wIndex:address) 26 | #define USBTINY_WRITE 2 // write byte (wIndex:address, wValue:value) 27 | #define USBTINY_CLR 3 // clear bit (wIndex:address, wValue:bitno) 28 | #define USBTINY_SET 4 // set bit (wIndex:address, wValue:bitno) 29 | 30 | // Programming requests 31 | #define USBTINY_POWERUP 5 // apply power (wValue:SCK-period, wIndex:RESET) 32 | #define USBTINY_POWERDOWN 6 // remove power from chip 33 | #define USBTINY_SPI 7 // issue SPI command (wValue:c1c0, wIndex:c3c2) 34 | #define USBTINY_POLL_BYTES 8 // set poll bytes for write (wValue:p1p2) 35 | #define USBTINY_FLASH_READ 9 // read flash (wIndex:address) 36 | #define USBTINY_FLASH_WRITE 10 // write flash (wIndex:address, wValue:timeout) 37 | #define USBTINY_EEPROM_READ 11 // read eeprom (wIndex:address) 38 | #define USBTINY_EEPROM_WRITE 12 // write eeprom (wIndex:address, wValue:timeout) 39 | 40 | 41 | 42 | // Flags to indicate how to set RESET on power up 43 | #define RESET_LOW 0 44 | #define RESET_HIGH 1 45 | 46 | // The SCK speed can be set by avrdude, to allow programming of slow-clocked parts 47 | #define SCK_MIN 1 // usec delay (target clock >= 4 MHz) 48 | #define SCK_MAX 250 // usec (target clock >= 16 KHz) 49 | #define SCK_DEFAULT 10 // usec (target clock >= 0.4 MHz) 50 | 51 | // How much data, max, do we want to send in one USB packet? 52 | #define CHUNK_SIZE 128 // must be power of 2 less than 256 53 | 54 | // The default USB Timeout 55 | #define USB_TIMEOUT 500 // msec 56 | 57 | #ifdef __cplusplus 58 | extern "C" { 59 | #endif 60 | 61 | extern const char usbtiny_desc[]; 62 | void usbtiny_initpgm (PROGRAMMER * pgm); 63 | 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | 68 | #endif /* usbtiny_h */ 69 | -------------------------------------------------------------------------------- /avrdude/windows/.cvsignore: -------------------------------------------------------------------------------- 1 | .cvsignore 2 | .deps 3 | Makefile 4 | Makefile.in 5 | -------------------------------------------------------------------------------- /avrdude/windows/Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # avrdude - A Downloader/Uploader for AVR device programmers 3 | # Copyright (C) 2003 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 | # 20 | # $Id$ 21 | # 22 | 23 | # 24 | # This Makefile will only be used on windows based systems. 25 | # 26 | 27 | local_install_list = \ 28 | giveio.sys \ 29 | install_giveio.bat \ 30 | remove_giveio.bat \ 31 | status_giveio.bat 32 | 33 | EXTRA_DIST = \ 34 | giveio.c \ 35 | $(local_install_list) 36 | 37 | bin_PROGRAMS = loaddrv 38 | 39 | loaddrv_SOURCES = \ 40 | loaddrv.c \ 41 | loaddrv.h 42 | 43 | install-exec-local: 44 | $(mkinstalldirs) $(DESTDIR)$(bindir) 45 | @list='$(local_install_list)'; for file in $$list; do \ 46 | echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) \ 47 | $(srcdir)/$$file $(DESTDIR)$(bindir)/$$file"; \ 48 | $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $(srcdir)/$$file \ 49 | $(DESTDIR)$(bindir)/$$file; \ 50 | done 51 | 52 | uninstall-local: 53 | @for file in $(local_install_list); do \ 54 | echo " rm -f $(DESTDIR)$(bindir)/$$file"; \ 55 | rm -f $(DESTDIR)$(bindir)/$$file; \ 56 | done 57 | 58 | -------------------------------------------------------------------------------- /avrdude/windows/giveio.c: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | 3 | Author: Dale Roberts 4 | Date: 8/30/95 5 | Program: GIVEIO.SYS 6 | Compile: Use DDK BUILD facility 7 | 8 | Purpose: Give direct port I/O access to a user mode process. 9 | 10 | *********************************************************************/ 11 | #include 12 | 13 | /* 14 | * The name of our device driver. 15 | */ 16 | #define DEVICE_NAME_STRING L"giveio" 17 | 18 | /* 19 | * This is the "structure" of the IOPM. It is just a simple 20 | * character array of length 0x2000. 21 | * 22 | * This holds 8K * 8 bits -> 64K bits of the IOPM, which maps the 23 | * entire 64K I/O space of the x86 processor. Any 0 bits will give 24 | * access to the corresponding port for user mode processes. Any 1 25 | * bits will disallow I/O access to the corresponding port. 26 | */ 27 | #define IOPM_SIZE 0x2000 28 | typedef UCHAR IOPM[IOPM_SIZE]; 29 | 30 | /* 31 | * This will hold simply an array of 0's which will be copied 32 | * into our actual IOPM in the TSS by Ke386SetIoAccessMap(). 33 | * The memory is allocated at driver load time. 34 | */ 35 | IOPM *IOPM_local = 0; 36 | 37 | /* 38 | * These are the two undocumented calls that we will use to give 39 | * the calling process I/O access. 40 | * 41 | * Ke386IoSetAccessMap() copies the passed map to the TSS. 42 | * 43 | * Ke386IoSetAccessProcess() adjusts the IOPM offset pointer so that 44 | * the newly copied map is actually used. Otherwise, the IOPM offset 45 | * points beyond the end of the TSS segment limit, causing any I/O 46 | * access by the user mode process to generate an exception. 47 | */ 48 | void Ke386SetIoAccessMap(int, IOPM *); 49 | void Ke386QueryIoAccessMap(int, IOPM *); 50 | void Ke386IoSetAccessProcess(PEPROCESS, int); 51 | 52 | /********************************************************************* 53 | Release any allocated objects. 54 | *********************************************************************/ 55 | VOID GiveioUnload(IN PDRIVER_OBJECT DriverObject) 56 | { 57 | WCHAR DOSNameBuffer[] = L"\\DosDevices\\" DEVICE_NAME_STRING; 58 | UNICODE_STRING uniDOSString; 59 | 60 | if(IOPM_local) 61 | MmFreeNonCachedMemory(IOPM_local, sizeof(IOPM)); 62 | 63 | RtlInitUnicodeString(&uniDOSString, DOSNameBuffer); 64 | IoDeleteSymbolicLink (&uniDOSString); 65 | IoDeleteDevice(DriverObject->DeviceObject); 66 | } 67 | 68 | /********************************************************************* 69 | Set the IOPM (I/O permission map) of the calling process so that it 70 | is given full I/O access. Our IOPM_local[] array is all zeros, so 71 | the IOPM will be all zeros. If OnFlag is 1, the process is given I/O 72 | access. If it is 0, access is removed. 73 | *********************************************************************/ 74 | VOID SetIOPermissionMap(int OnFlag) 75 | { 76 | Ke386IoSetAccessProcess(PsGetCurrentProcess(), OnFlag); 77 | Ke386SetIoAccessMap(1, IOPM_local); 78 | } 79 | 80 | void GiveIO(void) 81 | { 82 | SetIOPermissionMap(1); 83 | } 84 | 85 | /********************************************************************* 86 | Service handler for a CreateFile() user mode call. 87 | 88 | This routine is entered in the driver object function call table by 89 | the DriverEntry() routine. When the user mode application calls 90 | CreateFile(), this routine gets called while still in the context of 91 | the user mode application, but with the CPL (the processor's Current 92 | Privelege Level) set to 0. This allows us to do kernel mode 93 | operations. GiveIO() is called to give the calling process I/O 94 | access. All the user mode application needs do to obtain I/O access 95 | is open this device with CreateFile(). No other operations are 96 | required. 97 | *********************************************************************/ 98 | NTSTATUS GiveioCreateDispatch( 99 | IN PDEVICE_OBJECT DeviceObject, 100 | IN PIRP Irp 101 | ) 102 | { 103 | GiveIO(); // give the calling process I/O access 104 | 105 | Irp->IoStatus.Information = 0; 106 | Irp->IoStatus.Status = STATUS_SUCCESS; 107 | IoCompleteRequest(Irp, IO_NO_INCREMENT); 108 | return STATUS_SUCCESS; 109 | } 110 | 111 | /********************************************************************* 112 | Driver Entry routine. 113 | 114 | This routine is called only once after the driver is initially 115 | loaded into memory. It allocates everything necessary for the 116 | driver's operation. In our case, it allocates memory for our IOPM 117 | array, and creates a device which user mode applications can open. 118 | It also creates a symbolic link to the device driver. This allows 119 | a user mode application to access our driver using the \\.\giveio 120 | notation. 121 | *********************************************************************/ 122 | NTSTATUS DriverEntry( 123 | IN PDRIVER_OBJECT DriverObject, 124 | IN PUNICODE_STRING RegistryPath 125 | ) 126 | { 127 | PDEVICE_OBJECT deviceObject; 128 | NTSTATUS status; 129 | WCHAR NameBuffer[] = L"\\Device\\" DEVICE_NAME_STRING; 130 | WCHAR DOSNameBuffer[] = L"\\DosDevices\\" DEVICE_NAME_STRING; 131 | UNICODE_STRING uniNameString, uniDOSString; 132 | 133 | // 134 | // Allocate a buffer for the local IOPM and zero it. 135 | // 136 | IOPM_local = MmAllocateNonCachedMemory(sizeof(IOPM)); 137 | if(IOPM_local == 0) 138 | return STATUS_INSUFFICIENT_RESOURCES; 139 | RtlZeroMemory(IOPM_local, sizeof(IOPM)); 140 | 141 | // 142 | // Set up device driver name and device object. 143 | // 144 | RtlInitUnicodeString(&uniNameString, NameBuffer); 145 | RtlInitUnicodeString(&uniDOSString, DOSNameBuffer); 146 | 147 | status = IoCreateDevice(DriverObject, 0, 148 | &uniNameString, 149 | FILE_DEVICE_UNKNOWN, 150 | 0, FALSE, &deviceObject); 151 | 152 | if(!NT_SUCCESS(status)) 153 | return status; 154 | 155 | status = IoCreateSymbolicLink (&uniDOSString, &uniNameString); 156 | 157 | if (!NT_SUCCESS(status)) 158 | return status; 159 | 160 | // 161 | // Initialize the Driver Object with driver's entry points. 162 | // All we require are the Create and Unload operations. 163 | // 164 | DriverObject->MajorFunction[IRP_MJ_CREATE] = GiveioCreateDispatch; 165 | DriverObject->DriverUnload = GiveioUnload; 166 | return STATUS_SUCCESS; 167 | } 168 | 169 | -------------------------------------------------------------------------------- /avrdude/windows/giveio.sys: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude/windows/giveio.sys -------------------------------------------------------------------------------- /avrdude/windows/install_giveio.bat: -------------------------------------------------------------------------------- 1 | @set DIRVERNAME=giveio 2 | @set DIRVERFILE=%DIRVERNAME%.sys 3 | 4 | @echo Copying the driver to the windows directory 5 | @echo target file: %WINDIR%\%DIRVERFILE% 6 | @copy %DIRVERFILE% %WINDIR%\%DIRVERFILE% 7 | 8 | @echo Remove a running service if needed... 9 | @loaddrv stop %DIRVERNAME% >NUL 10 | @if errorlevel 2 goto install 11 | 12 | @loaddrv remove %DIRVERNAME% >NUL 13 | @if errorlevel 1 goto install 14 | 15 | :install 16 | @echo Installing Windows NT/2k/XP driver: %DIRVERNAME% 17 | 18 | @loaddrv install %DIRVERNAME% %WINDIR%\%DIRVERFILE% 19 | @if errorlevel 3 goto error 20 | 21 | @loaddrv start %DIRVERNAME% 22 | @if errorlevel 1 goto error 23 | 24 | @loaddrv starttype %DIRVERNAME% auto 25 | @if errorlevel 1 goto error 26 | 27 | @echo Success 28 | @goto exit 29 | 30 | :error 31 | @echo ERROR: Installation of %DIRVERNAME% failed 32 | 33 | :exit 34 | 35 | -------------------------------------------------------------------------------- /avrdude/windows/loaddrv.h: -------------------------------------------------------------------------------- 1 | #ifndef LOADDRV_H 2 | #define LOADDRV_H 3 | 4 | #include 5 | 6 | #define OKAY 0 7 | #define UNEXPECTED_ERROR 9999 8 | 9 | //prototypes 10 | DWORD LoadDriverInit(void); 11 | void LoadDriverCleanup(void); 12 | DWORD DriverInstall(LPSTR, LPSTR); 13 | DWORD DriverStart(LPSTR); 14 | DWORD DriverStop(LPSTR); 15 | DWORD DriverRemove(LPSTR); 16 | DWORD DriverStatus(LPSTR); 17 | DWORD DriverStartType(LPSTR, DWORD); 18 | #endif //LOADDRV_H 19 | 20 | 21 | -------------------------------------------------------------------------------- /avrdude/windows/remove_giveio.bat: -------------------------------------------------------------------------------- 1 | @set DIRVERNAME=giveio 2 | 3 | @loaddrv stop %DIRVERNAME% 4 | @if errorlevel 2 goto error 5 | 6 | @loaddrv remove %DIRVERNAME% 7 | @if errorlevel 1 goto error 8 | 9 | @goto exit 10 | 11 | :error 12 | @echo ERROR: Deinstallation of %DIRVERNAME% failed 13 | 14 | :exit 15 | -------------------------------------------------------------------------------- /avrdude/windows/status_giveio.bat: -------------------------------------------------------------------------------- 1 | @set DIRVERNAME=giveio 2 | 3 | @loaddrv status %DIRVERNAME% 4 | @if errorlevel 1 goto error 5 | 6 | @goto exit 7 | 8 | :error 9 | @echo ERROR: Status querry for %DIRVERNAME% failed 10 | 11 | :exit 12 | 13 | -------------------------------------------------------------------------------- /avrdude/wiring.c: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2011 Brett Hagman 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 | /* $Id$ */ 20 | 21 | /* 22 | * avrdude interface for Wiring bootloaders 23 | * 24 | * http://wiring.org.co/ 25 | * 26 | * The Wiring bootloader uses a near-complete STK500v2 protocol. 27 | * (Only ISP specific programming commands are not implemented 28 | * e.g. chip erase). 29 | * DTR and RTS signals are diddled to set the board into programming mode. 30 | * 31 | * Also includes an extended parameter to introduce a delay after opening 32 | * to accommodate multi-layered programmers/bootloaders. If the extended 33 | * parameter 'snooze' > 0, then no DTR/RTS toggle takes place, and 34 | * AVRDUDE will wait that amount of time in milliseconds before syncing. 35 | * 36 | * Unfortunately, there is no way to easily chain private programmer data 37 | * when we "inherit" programmer types as we have (stk500v2). Sooooo, a 38 | * *cringe* global variable is used to store the snooze time. 39 | */ 40 | 41 | #include "ac_cfg.h" 42 | 43 | #include 44 | #include 45 | #include 46 | #include 47 | 48 | #include "avrdude.h" 49 | #include "libavrdude.h" 50 | 51 | #include "stk500v2_private.h" 52 | #include "stk500v2.h" 53 | #include "wiring.h" 54 | 55 | /* 56 | * Private data for this programmer. 57 | */ 58 | struct wiringpdata 59 | { 60 | /* 61 | * We just have the single snooze integer to carry around for now. 62 | */ 63 | int snoozetime; 64 | }; 65 | 66 | 67 | /* wiringpdata is our private data */ 68 | /* pdata is stk500v2's private data (inherited) */ 69 | 70 | #define WIRINGPDATA(x) ((struct wiringpdata *)(x)) 71 | 72 | #define STK500V2PDATA(pgm) ((struct pdata *)(pgm->cookie)) 73 | 74 | 75 | static void wiring_setup(PROGRAMMER * pgm) 76 | { 77 | void *mycookie; 78 | 79 | /* 80 | * First, have STK500v2 backend allocate its own private data. 81 | */ 82 | stk500v2_setup(pgm); 83 | 84 | /* 85 | * Now prepare our data 86 | */ 87 | if ((mycookie = malloc(sizeof(struct wiringpdata))) == 0) { 88 | avrdude_message(MSG_INFO, "%s: wiring_setup(): Out of memory allocating private data\n", 89 | progname); 90 | exit(1); 91 | } 92 | memset(mycookie, 0, sizeof(struct wiringpdata)); 93 | WIRINGPDATA(mycookie)->snoozetime = 0; 94 | 95 | /* 96 | * Store our own cookie in a safe place for the time being. 97 | */ 98 | STK500V2PDATA(pgm)->chained_pdata = mycookie; 99 | } 100 | 101 | static void wiring_teardown(PROGRAMMER * pgm) 102 | { 103 | void *mycookie; 104 | 105 | mycookie = STK500V2PDATA(pgm)->chained_pdata; 106 | 107 | free(mycookie); 108 | 109 | stk500v2_teardown(pgm); 110 | } 111 | 112 | static int wiring_parseextparms(PROGRAMMER * pgm, LISTID extparms) 113 | { 114 | LNODEID ln; 115 | const char *extended_param; 116 | int rv = 0; 117 | void *mycookie = STK500V2PDATA(pgm)->chained_pdata; 118 | 119 | for (ln = lfirst(extparms); ln; ln = lnext(ln)) { 120 | extended_param = ldata(ln); 121 | 122 | if (strncmp(extended_param, "snooze=", strlen("snooze=")) == 0) { 123 | int newsnooze; 124 | if (sscanf(extended_param, "snooze=%i", &newsnooze) != 1 || 125 | newsnooze < 0) { 126 | avrdude_message(MSG_INFO, "%s: wiring_parseextparms(): invalid snooze time '%s'\n", 127 | progname, extended_param); 128 | rv = -1; 129 | continue; 130 | } 131 | avrdude_message(MSG_NOTICE2, "%s: wiring_parseextparms(): snooze time set to %d ms\n", 132 | progname, newsnooze); 133 | WIRINGPDATA(mycookie)->snoozetime = newsnooze; 134 | 135 | continue; 136 | } 137 | 138 | avrdude_message(MSG_INFO, "%s: wiring_parseextparms(): invalid extended parameter '%s'\n", 139 | progname, extended_param); 140 | rv = -1; 141 | } 142 | 143 | return rv; 144 | } 145 | 146 | static int wiring_open(PROGRAMMER * pgm, char * port) 147 | { 148 | int timetosnooze; 149 | void *mycookie = STK500V2PDATA(pgm)->chained_pdata; 150 | union pinfo pinfo; 151 | 152 | strcpy(pgm->port, port); 153 | pinfo.baud = pgm->baudrate ? pgm->baudrate: 115200; 154 | serial_open(port, pinfo, &pgm->fd); 155 | 156 | /* If we have a snoozetime, then we wait and do NOT toggle DTR/RTS */ 157 | 158 | if (WIRINGPDATA(mycookie)->snoozetime > 0) { 159 | timetosnooze = WIRINGPDATA(mycookie)->snoozetime; 160 | 161 | avrdude_message(MSG_NOTICE2, "%s: wiring_open(): snoozing for %d ms\n", 162 | progname, timetosnooze); 163 | while (timetosnooze--) 164 | usleep(1000); 165 | avrdude_message(MSG_NOTICE2, "%s: wiring_open(): done snoozing\n", 166 | progname); 167 | } else { 168 | /* Perform Wiring programming mode RESET. */ 169 | /* This effectively *releases* both DTR and RTS. */ 170 | /* i.e. both DTR and RTS rise to a HIGH logic level */ 171 | /* since they are active LOW signals. */ 172 | 173 | avrdude_message(MSG_NOTICE2, "%s: wiring_open(): releasing DTR/RTS\n", 174 | progname); 175 | 176 | serial_set_dtr_rts(&pgm->fd, 0); 177 | usleep(50*1000); 178 | 179 | /* After releasing for 50 milliseconds, DTR and RTS */ 180 | /* are asserted (i.e. logic LOW) again. */ 181 | 182 | avrdude_message(MSG_NOTICE2, "%s: wiring_open(): asserting DTR/RTS\n", 183 | progname); 184 | 185 | serial_set_dtr_rts(&pgm->fd, 1); 186 | usleep(50*1000); 187 | } 188 | 189 | /* drain any extraneous input */ 190 | stk500v2_drain(pgm, 0); 191 | 192 | if (stk500v2_getsync(pgm) < 0) 193 | return -1; 194 | 195 | return 0; 196 | } 197 | 198 | static void wiring_close(PROGRAMMER * pgm) 199 | { 200 | serial_set_dtr_rts(&pgm->fd, 0); 201 | serial_close(&pgm->fd); 202 | pgm->fd.ifd = -1; 203 | } 204 | 205 | const char wiring_desc[] = "http://wiring.org.co/, Basically STK500v2 protocol, with some glue to trigger the bootloader."; 206 | 207 | void wiring_initpgm(PROGRAMMER * pgm) 208 | { 209 | /* The Wiring bootloader uses a near-complete STK500v2 protocol. */ 210 | 211 | stk500v2_initpgm(pgm); 212 | 213 | strcpy(pgm->type, "Wiring"); 214 | pgm->open = wiring_open; 215 | pgm->close = wiring_close; 216 | 217 | pgm->setup = wiring_setup; 218 | pgm->teardown = wiring_teardown; 219 | pgm->parseextparams = wiring_parseextparms; 220 | } 221 | 222 | -------------------------------------------------------------------------------- /avrdude/wiring.h: -------------------------------------------------------------------------------- 1 | /* 2 | * avrdude - A Downloader/Uploader for AVR device programmers 3 | * Copyright (C) 2011 Brett Hagman 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 | /* $Id$ */ 20 | 21 | #ifndef wiring_h__ 22 | #define wiring_h__ 23 | 24 | extern const char wiring_desc[]; 25 | void wiring_initpgm(PROGRAMMER * pgm); 26 | 27 | #endif 28 | 29 | 30 | -------------------------------------------------------------------------------- /avrdude_win32_bin.7z: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alx2000y/avrdude_ch341a/d5cfdb71233e8d81a07378a66f8d30b1aea9748a/avrdude_win32_bin.7z --------------------------------------------------------------------------------