![]() |
Prusa Slicer 2.6.0
|
#include "ac_cfg.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include <errno.h>#include <unistd.h>#include "avrdude.h"#include "libavrdude.h"#include "stk500.h"#include "stk500_private.h"
Include dependency graph for stk500.c:Go to the source code of this file.
Classes | |
| struct | pdata |
Macros | |
| #define | STK500_XTAL 7372800U |
| #define | MAX_SYNC_ATTEMPTS 10 |
| #define | PDATA(pgm) ((struct pdata *)(pgm->cookie)) |
Functions | |
| static int | stk500_getparm (PROGRAMMER *pgm, unsigned parm, unsigned *value) |
| static int | stk500_setparm (PROGRAMMER *pgm, unsigned parm, unsigned value) |
| static void | stk500_print_parms1 (PROGRAMMER *pgm, const char *p) |
| static int | stk500_send (PROGRAMMER *pgm, unsigned char *buf, size_t len) |
| static int | stk500_recv (PROGRAMMER *pgm, unsigned char *buf, size_t len) |
| int | stk500_drain (PROGRAMMER *pgm, int display) |
| int | stk500_getsync (PROGRAMMER *pgm) |
| static int | stk500_cmd (PROGRAMMER *pgm, const unsigned char *cmd, unsigned char *res) |
| static int | stk500_chip_erase (PROGRAMMER *pgm, AVRPART *p) |
| static int | stk500_program_enable (PROGRAMMER *pgm, AVRPART *p) |
| static int | stk500_set_extended_parms (PROGRAMMER *pgm, int n, unsigned char *cmd) |
| static int | mib510_isp (PROGRAMMER *pgm, unsigned char cmd) |
| static int | stk500_initialize (PROGRAMMER *pgm, AVRPART *p) |
| static void | stk500_disable (PROGRAMMER *pgm) |
| static void | stk500_enable (PROGRAMMER *pgm) |
| static int | stk500_open (PROGRAMMER *pgm, char *port) |
| static void | stk500_close (PROGRAMMER *pgm) |
| static int | stk500_loadaddr (PROGRAMMER *pgm, AVRMEM *mem, unsigned int addr) |
| static int | stk500_paged_write (PROGRAMMER *pgm, AVRPART *p, AVRMEM *m, unsigned int page_size, unsigned int addr, unsigned int n_bytes) |
| static int | stk500_paged_load (PROGRAMMER *pgm, AVRPART *p, AVRMEM *m, unsigned int page_size, unsigned int addr, unsigned int n_bytes) |
| static int | stk500_set_vtarget (PROGRAMMER *pgm, double v) |
| static int | stk500_set_varef (PROGRAMMER *pgm, unsigned int chan, double v) |
| static int | stk500_set_fosc (PROGRAMMER *pgm, double v) |
| static int | stk500_set_sck_period (PROGRAMMER *pgm, double v) |
| static void | stk500_display (PROGRAMMER *pgm, const char *p) |
| static void | stk500_print_parms (PROGRAMMER *pgm) |
| static void | stk500_setup (PROGRAMMER *pgm) |
| static void | stk500_teardown (PROGRAMMER *pgm) |
| void | stk500_initpgm (PROGRAMMER *pgm) |
Variables | |
| const char | stk500_desc [] = "Atmel STK500 Version 1.x firmware" |
| #define MAX_SYNC_ATTEMPTS 10 |
| #define STK500_XTAL 7372800U |
|
static |
References avrdude_message(), cmd, MSG_INFO, pgm, progname, Resp_STK_FAILED, Resp_STK_INSYNC, Resp_STK_NODEVICE, Resp_STK_NOSYNC, Resp_STK_OK, stk500_getsync(), stk500_recv(), and stk500_send().
Referenced by stk500_close(), and stk500_open().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References AVR_OP_CHIP_ERASE, avr_set_bits(), avrdude_message(), avrpart::chip_erase_delay, programmer_t::cmd, cmd, avrpart::desc, programmer_t::initialize, MSG_INFO, OFF, ON, avrpart::op, pgm, programmer_t::pgm_led, progname, programmer_t::type, and usleep().
Referenced by stk500_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References programmer_t::fd, programmer_t::id, filedescriptor::ifd, ldata(), lfirst(), mib510_isp(), pgm, serial_close, and void().
Referenced by stk500_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), cmd, Cmnd_STK_UNIVERSAL, MSG_INFO, pgm, progname, Resp_STK_INSYNC, Resp_STK_OK, stk500_recv(), stk500_send(), and Sync_CRC_EOP.
Referenced by stk500_initpgm(), and stk500_loadaddr().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), Cmnd_STK_LEAVE_PROGMODE, MSG_INFO, pgm, progname, Resp_STK_INSYNC, Resp_STK_NODEVICE, Resp_STK_NOSYNC, Resp_STK_OK, stk500_getsync(), stk500_recv(), stk500_send(), and Sync_CRC_EOP.
Referenced by stk500_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), MSG_INFO, Param_STK500_TOPCARD_DETECT, Parm_STK_HW_VER, Parm_STK_SW_MAJOR, Parm_STK_SW_MINOR, pgm, stk500_getparm(), and stk500_print_parms1().
Referenced by stk500_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:| int stk500_drain | ( | PROGRAMMER * | pgm, |
| int | display | ||
| ) |
References programmer_t::fd, pgm, and serial_drain.
Referenced by arduino_open(), stk500_getsync(), and stk500_open().
Here is the caller graph for this function:
|
static |
|
static |
References avrdude_message(), Cmnd_STK_GET_PARAMETER, MSG_INFO, pgm, progname, Resp_STK_FAILED, Resp_STK_INSYNC, Resp_STK_NOSYNC, Resp_STK_OK, stk500_getsync(), stk500_recv(), stk500_send(), and Sync_CRC_EOP.
Referenced by stk500_display(), stk500_initialize(), stk500_print_parms1(), stk500_set_varef(), and stk500_set_vtarget().
Here is the call graph for this function:
Here is the caller graph for this function:| int stk500_getsync | ( | PROGRAMMER * | pgm | ) |
References avrdude_message(), Cmnd_STK_GET_SYNC, MAX_SYNC_ATTEMPTS, MSG_INFO, pgm, progname, Resp_STK_INSYNC, Resp_STK_OK, stk500_drain(), stk500_recv(), stk500_send(), and Sync_CRC_EOP.
Referenced by arduino_open(), mib510_isp(), stk500_disable(), stk500_getparm(), stk500_initialize(), stk500_loadaddr(), stk500_open(), stk500_paged_load(), stk500_paged_write(), stk500_program_enable(), stk500_set_extended_parms(), and stk500_setparm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avr_locate_mem(), avrdude_message(), AVRPART_PARALLELOK, AVRPART_PSEUDOPARALLEL, AVRPART_SERIALOK, avrpart::bs2, Cmnd_STK_SET_DEVICE, avrpart::desc, avrpart::flags, programmer_t::id, ldata(), lfirst(), MSG_INFO, MSG_NOTICE2, avrmem::page_size, avrmem::paged, avrpart::pagel, Parm_STK_SW_MAJOR, Parm_STK_SW_MINOR, pgm, progname, programmer_t::program_enable, avrmem::readback, RESET_DEDICATED, avrpart::reset_disposition, Resp_STK_INSYNC, Resp_STK_NOSYNC, Resp_STK_OK, avrmem::size, avrpart::stk500_devcode, stk500_getparm(), stk500_getsync(), stk500_recv(), stk500_send(), stk500_set_extended_parms(), and Sync_CRC_EOP.
Referenced by stk500_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:| void stk500_initpgm | ( | PROGRAMMER * | pgm | ) |
References avr_read_byte_default(), avr_write_byte_default(), programmer_t::chip_erase, programmer_t::close, programmer_t::cmd, programmer_t::disable, programmer_t::display, programmer_t::enable, programmer_t::initialize, programmer_t::open, programmer_t::page_size, programmer_t::paged_load, programmer_t::paged_write, pgm, programmer_t::print_parms, programmer_t::program_enable, programmer_t::read_byte, programmer_t::set_fosc, programmer_t::set_sck_period, programmer_t::set_varef, programmer_t::set_vtarget, programmer_t::setup, stk500_chip_erase(), stk500_close(), stk500_cmd(), stk500_disable(), stk500_display(), stk500_enable(), stk500_initialize(), stk500_open(), stk500_paged_load(), stk500_paged_write(), stk500_print_parms(), stk500_program_enable(), stk500_set_fosc(), stk500_set_sck_period(), stk500_set_varef(), stk500_set_vtarget(), stk500_setup(), stk500_teardown(), programmer_t::teardown, programmer_t::type, and programmer_t::write_byte.
Referenced by arduino_initpgm(), and stk500generic_open().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References AVR_OP_LOAD_EXT_ADDR, avr_set_addr(), avr_set_bits(), avrdude_message(), Cmnd_STK_LOAD_ADDRESS, MSG_INFO, avrmem::op, PDATA, pgm, progname, Resp_STK_INSYNC, Resp_STK_NOSYNC, Resp_STK_OK, stk500_cmd(), stk500_getsync(), stk500_recv(), stk500_send(), and Sync_CRC_EOP.
Referenced by stk500_paged_load(), and stk500_paged_write().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References pinfo::baud, programmer_t::baudrate, programmer_t::fd, programmer_t::id, ldata(), lfirst(), mib510_isp(), pgm, programmer_t::port, serial_close, serial_open, stk500_drain(), and stk500_getsync().
Referenced by stk500_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References AVR_OP_LOADPAGE_LO, AVR_OP_READ_LO, avrdude_message(), avrmem::buf, Cmnd_STK_READ_PAGE, avrmem::desc, programmer_t::id, ldata(), lfirst(), MSG_INFO, avrmem::op, pgm, progname, Resp_STK_INSYNC, Resp_STK_NOSYNC, Resp_STK_OK, stk500_getsync(), stk500_loadaddr(), stk500_recv(), stk500_send(), and Sync_CRC_EOP.
Referenced by stk500_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References AVR_OP_LOADPAGE_LO, AVR_OP_READ_LO, avrdude_message(), avrmem::buf, Cmnd_STK_PROG_PAGE, avrmem::desc, programmer_t::id, ldata(), lfirst(), MSG_INFO, avrmem::op, pgm, progname, Resp_STK_INSYNC, Resp_STK_NOSYNC, Resp_STK_OK, stk500_getsync(), stk500_loadaddr(), stk500_recv(), stk500_send(), and Sync_CRC_EOP.
Referenced by stk500_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References pgm, and stk500_print_parms1().
Referenced by stk500_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), MSG_INFO, Parm_STK_OSC_CMATCH, Parm_STK_OSC_PSCALE, Parm_STK_SCK_DURATION, Parm_STK_VADJUST, Parm_STK_VTARGET, pgm, stk500_getparm(), and STK500_XTAL.
Referenced by stk500_display(), and stk500_print_parms().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), Cmnd_STK_ENTER_PROGMODE, MSG_INFO, pgm, progname, Resp_STK_FAILED, Resp_STK_INSYNC, Resp_STK_NODEVICE, Resp_STK_NOSYNC, Resp_STK_OK, stk500_getsync(), stk500_recv(), stk500_send(), and Sync_CRC_EOP.
Referenced by stk500_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), programmer_t::fd, MSG_INFO, pgm, progname, and serial_recv.
Referenced by mib510_isp(), stk500_cmd(), stk500_disable(), stk500_getparm(), stk500_getsync(), stk500_initialize(), stk500_loadaddr(), stk500_paged_load(), stk500_paged_write(), stk500_program_enable(), stk500_set_extended_parms(), and stk500_setparm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References programmer_t::fd, pgm, and serial_send.
Referenced by mib510_isp(), stk500_cmd(), stk500_disable(), stk500_getparm(), stk500_getsync(), stk500_initialize(), stk500_loadaddr(), stk500_paged_load(), stk500_paged_write(), stk500_program_enable(), stk500_set_extended_parms(), and stk500_setparm().
Here is the caller graph for this function:
|
static |
References avrdude_message(), cmd, Cmnd_STK_SET_DEVICE_EXT, MSG_INFO, pgm, progname, Resp_STK_FAILED, Resp_STK_INSYNC, Resp_STK_NODEVICE, Resp_STK_NOSYNC, Resp_STK_OK, stk500_getsync(), stk500_recv(), stk500_send(), and Sync_CRC_EOP.
Referenced by stk500_initialize().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), MSG_INFO, Parm_STK_OSC_CMATCH, Parm_STK_OSC_PSCALE, pgm, progname, stk500_setparm(), and STK500_XTAL.
Referenced by stk500_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), MSG_INFO, Parm_STK_SCK_DURATION, pgm, progname, stk500_setparm(), and STK500_XTAL.
Referenced by stk500_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), MSG_INFO, Parm_STK_VADJUST, Parm_STK_VTARGET, pgm, progname, stk500_getparm(), and stk500_setparm().
Referenced by stk500_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), MSG_INFO, Parm_STK_VADJUST, Parm_STK_VTARGET, pgm, progname, stk500_getparm(), and stk500_setparm().
Referenced by stk500_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), Cmnd_STK_SET_PARAMETER, MSG_INFO, pgm, progname, Resp_STK_FAILED, Resp_STK_INSYNC, Resp_STK_NOSYNC, Resp_STK_OK, stk500_getsync(), stk500_recv(), stk500_send(), and Sync_CRC_EOP.
Referenced by stk500_set_fosc(), stk500_set_sck_period(), stk500_set_varef(), and stk500_set_vtarget().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), programmer_t::cookie, malloc(), MSG_INFO, PDATA, pgm, and progname.
Referenced by stk500_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References programmer_t::cookie, free(), and pgm.
Referenced by stk500_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:| const char stk500_desc[] = "Atmel STK500 Version 1.x firmware" |