![]() |
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 <sys/time.h>#include <time.h>#include "avrdude.h"#include "libavrdude.h"#include "crc16.h"#include "jtagmkI.h"#include "jtagmkI_private.h"
Include dependency graph for jtagmkI.c:Go to the source code of this file.
Classes | |
| struct | pdata |
Macros | |
| #define | PDATA(pgm) ((struct pdata *)(pgm->cookie)) |
| #define | OCDEN (1 << 7) |
| #define | MAXTRIES 3 |
| #define | MAXTRIES 3 |
Functions | |
| static int | jtagmkI_read_byte (PROGRAMMER *pgm, AVRPART *p, AVRMEM *mem, unsigned long addr, unsigned char *value) |
| static int | jtagmkI_write_byte (PROGRAMMER *pgm, AVRPART *p, AVRMEM *mem, unsigned long addr, unsigned char data) |
| static int | jtagmkI_set_sck_period (PROGRAMMER *pgm, double v) |
| static int | jtagmkI_getparm (PROGRAMMER *pgm, unsigned char parm, unsigned char *value) |
| static int | jtagmkI_setparm (PROGRAMMER *pgm, unsigned char parm, unsigned char value) |
| static void | jtagmkI_print_parms1 (PROGRAMMER *pgm, const char *p) |
| static int | jtagmkI_resync (PROGRAMMER *pgm, int maxtries, int signon) |
| static void | jtagmkI_setup (PROGRAMMER *pgm) |
| static void | jtagmkI_teardown (PROGRAMMER *pgm) |
| static void | u32_to_b3 (unsigned char *b, unsigned long l) |
| static void | u16_to_b2 (unsigned char *b, unsigned short l) |
| static void | jtagmkI_prmsg (PROGRAMMER *pgm, unsigned char *data, size_t len) |
| static int | jtagmkI_send (PROGRAMMER *pgm, unsigned char *data, size_t len) |
| static int | jtagmkI_recv (PROGRAMMER *pgm, unsigned char *buf, size_t len) |
| static int | jtagmkI_drain (PROGRAMMER *pgm, int display) |
| static int | jtagmkI_getsync (PROGRAMMER *pgm) |
| static int | jtagmkI_chip_erase (PROGRAMMER *pgm, AVRPART *p) |
| static void | jtagmkI_set_devdescr (PROGRAMMER *pgm, AVRPART *p) |
| static int | jtagmkI_reset (PROGRAMMER *pgm) |
| static int | jtagmkI_program_enable_dummy (PROGRAMMER *pgm, AVRPART *p) |
| static int | jtagmkI_program_enable (PROGRAMMER *pgm) |
| static int | jtagmkI_program_disable (PROGRAMMER *pgm) |
| static unsigned char | jtagmkI_get_baud (long baud) |
| static int | jtagmkI_initialize (PROGRAMMER *pgm, AVRPART *p) |
| static void | jtagmkI_disable (PROGRAMMER *pgm) |
| static void | jtagmkI_enable (PROGRAMMER *pgm) |
| static int | jtagmkI_open (PROGRAMMER *pgm, char *port) |
| static void | jtagmkI_close (PROGRAMMER *pgm) |
| static int | jtagmkI_paged_write (PROGRAMMER *pgm, AVRPART *p, AVRMEM *m, unsigned int page_size, unsigned int addr, unsigned int n_bytes) |
| static int | jtagmkI_paged_load (PROGRAMMER *pgm, AVRPART *p, AVRMEM *m, unsigned int page_size, unsigned int addr, unsigned int n_bytes) |
| static void | jtagmkI_display (PROGRAMMER *pgm, const char *p) |
| static void | jtagmkI_print_parms (PROGRAMMER *pgm) |
| void | jtagmkI_initpgm (PROGRAMMER *pgm) |
Variables | ||
| struct { | ||
| long | baud | |
| unsigned char | val | |
| } | baudtab [] | |
| const char | jtagmkI_desc [] = "Atmel JTAG ICE mkI" | |
| #define MAXTRIES 3 |
| #define MAXTRIES 3 |
| #define OCDEN (1 << 7) |
|
static |
References avrdude_message(), CMD_CHIP_ERASE, programmer_t::initialize, jtagmkI_recv(), jtagmkI_send(), MSG_INFO, MSG_NOTICE2, pgm, progname, RESP_OK, and verbose.
Referenced by jtagmkI_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), programmer_t::baudrate, programmer_t::fd, serial_device::flags, filedescriptor::ifd, jtagmkI_get_baud(), jtagmkI_setparm(), MSG_INFO, MSG_NOTICE2, PARM_BITRATE, PDATA, pgm, progname, serdev, SERDEV_FL_CANSETSPEED, serial_close, and serial_setspeed.
Referenced by jtagmkI_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References free(), jtagmkI_program_disable(), PDATA, pgm, and void().
Referenced by jtagmkI_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), jtagmkI_getparm(), jtagmkI_print_parms1(), MSG_INFO, PARM_HW_VERSION, PARM_SW_VERSION, and pgm.
Referenced by jtagmkI_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References programmer_t::fd, pgm, and serial_drain.
Referenced by jtagmkI_getsync(), jtagmkI_initialize(), jtagmkI_open(), and jtagmkI_resync().
Here is the caller graph for this function:
|
static |
|
static |
References baudtab.
Referenced by jtagmkI_close(), and jtagmkI_initialize().
Here is the caller graph for this function:
|
static |
References avrdude_message(), CMD_GET_PARAM, jtagmkI_recv(), jtagmkI_send(), MSG_INFO, MSG_NOTICE2, pgm, progname, RESP_OK, and verbose.
Referenced by jtagmkI_display(), and jtagmkI_print_parms1().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), CMD_GET_SIGNON, jtagmkI_drain(), jtagmkI_recv(), jtagmkI_resync(), jtagmkI_send(), MSG_NOTICE2, pgm, progname, and verbose.
Referenced by jtagmkI_open().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), AVRPART_HAS_JTAG, programmer_t::baudrate, programmer_t::bitclock, cmd, CMD_STOP, avrpart::desc, avrmem::desc, programmer_t::fd, avrpart::flags, serial_device::flags, free(), jtagmkI_drain(), jtagmkI_get_baud(), jtagmkI_read_byte(), jtagmkI_recv(), jtagmkI_reset(), jtagmkI_send(), jtagmkI_set_devdescr(), jtagmkI_set_sck_period(), jtagmkI_setparm(), long, malloc(), MSG_INFO, MSG_NOTICE2, OCDEN, PARM_BITRATE, PARM_EEPROM_PAGESIZE, PARM_FLASH_PAGESIZE_HIGH, PARM_FLASH_PAGESIZE_LOW, PDATA, pgm, progname, RESP_OK, serdev, SERDEV_FL_CANSETSPEED, serial_setspeed, and verbose.
Referenced by jtagmkI_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:| void jtagmkI_initpgm | ( | PROGRAMMER * | pgm | ) |
References programmer_t::chip_erase, programmer_t::close, programmer_t::disable, programmer_t::display, programmer_t::enable, programmer_t::initialize, jtagmkI_chip_erase(), jtagmkI_close(), jtagmkI_disable(), jtagmkI_display(), jtagmkI_enable(), jtagmkI_initialize(), jtagmkI_open(), jtagmkI_paged_load(), jtagmkI_paged_write(), jtagmkI_print_parms(), jtagmkI_program_enable_dummy(), jtagmkI_read_byte(), jtagmkI_set_sck_period(), jtagmkI_setup(), jtagmkI_teardown(), jtagmkI_write_byte(), 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_sck_period, programmer_t::setup, programmer_t::teardown, programmer_t::type, and programmer_t::write_byte.
Here is the call graph for this function:
|
static |
References avrdude_message(), pinfo::baud, baudtab, programmer_t::fd, filedescriptor::ifd, jtagmkI_drain(), jtagmkI_getsync(), MSG_INFO, MSG_NOTICE2, PDATA, pgm, programmer_t::port, progname, serial_close, and serial_open.
Referenced by jtagmkI_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), avrmem::buf, cmd, CMD_READ_MEM, avrmem::desc, jtagmkI_program_enable(), jtagmkI_recv(), jtagmkI_resync(), jtagmkI_send(), MAXTRIES, MSG_DEBUG, MSG_INFO, MSG_NOTICE2, MTYPE_EEPROM_PAGE, MTYPE_FLASH_PAGE, pgm, progname, avrmem::readsize, RESP_OK, serial_recv_timeout, u32_to_b3(), and verbose.
Referenced by jtagmkI_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), avrmem::buf, cmd, CMD_DATA, CMD_WRITE_MEM, avrmem::desc, free(), jtagmkI_program_enable(), jtagmkI_recv(), jtagmkI_resync(), jtagmkI_send(), long, malloc(), MAXTRIES, MSG_DEBUG, MSG_INFO, MSG_NOTICE2, MTYPE_EEPROM_PAGE, MTYPE_FLASH_PAGE, PDATA, pgm, progname, RESP_OK, serial_recv_timeout, u32_to_b3(), and verbose.
Referenced by jtagmkI_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References jtagmkI_print_parms1(), and pgm.
Referenced by jtagmkI_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), JTAG_BITRATE_125_kHz, JTAG_BITRATE_1_MHz, JTAG_BITRATE_250_kHz, JTAG_BITRATE_500_kHz, jtagmkI_getparm(), MSG_INFO, PARM_CLOCK, PARM_OCD_VTARGET, and pgm.
Referenced by jtagmkI_display(), and jtagmkI_print_parms().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), MSG_INFO, MSG_TRACE, RESP_BREAK, RESP_FAILED, RESP_INFO, RESP_OK, RESP_POWER, RESP_SLEEP, RESP_SYNC_ERROR, and verbose.
Referenced by jtagmkI_recv().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), CMD_LEAVE_PROGMODE, programmer_t::fd, filedescriptor::ifd, jtagmkI_recv(), jtagmkI_send(), MSG_INFO, MSG_NOTICE2, PDATA, pgm, progname, RESP_OK, and verbose.
Referenced by jtagmkI_disable(), and jtagmkI_write_byte().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), CMD_ENTER_PROGMODE, jtagmkI_recv(), jtagmkI_send(), MSG_INFO, MSG_NOTICE2, PDATA, pgm, progname, RESP_OK, and verbose.
Referenced by jtagmkI_paged_load(), jtagmkI_paged_write(), jtagmkI_read_byte(), and jtagmkI_write_byte().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Referenced by jtagmkI_initpgm().
Here is the caller graph for this function:
|
static |
References avrdude_message(), cmd, CMD_READ_MEM, avrmem::desc, jtagmkI_program_enable(), jtagmkI_recv(), jtagmkI_send(), MSG_INFO, MSG_NOTICE2, MTYPE_EEPROM_PAGE, MTYPE_FLASH_PAGE, MTYPE_FUSE_BITS, MTYPE_LOCK_BITS, MTYPE_OSCCAL_BYTE, MTYPE_SIGN_JTAG, avrmem::page_size, PDATA, pgm, progname, RESP_OK, u32_to_b3(), and verbose.
Referenced by jtagmkI_initialize(), and jtagmkI_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), programmer_t::fd, jtagmkI_prmsg(), MSG_INFO, pgm, progname, serial_recv, and verbose.
Referenced by jtagmkI_chip_erase(), jtagmkI_getparm(), jtagmkI_getsync(), jtagmkI_initialize(), jtagmkI_paged_load(), jtagmkI_paged_write(), jtagmkI_program_disable(), jtagmkI_program_enable(), jtagmkI_read_byte(), jtagmkI_reset(), jtagmkI_set_devdescr(), jtagmkI_setparm(), and jtagmkI_write_byte().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), CMD_RESET, jtagmkI_recv(), jtagmkI_send(), MSG_INFO, MSG_NOTICE2, pgm, progname, RESP_OK, and verbose.
Referenced by jtagmkI_initialize().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), CMD_GET_SIGNON, CMD_GET_SYNC, programmer_t::fd, jtagmkI_drain(), MSG_INFO, MSG_NOTICE2, MSG_TRACE, pgm, progname, RESP_OK, serial_recv, serial_recv_timeout, and serial_send.
Referenced by jtagmkI_getsync(), jtagmkI_paged_load(), and jtagmkI_paged_write().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), programmer_t::fd, free(), malloc(), MSG_DEBUG, MSG_INFO, pgm, progname, and serial_send.
Referenced by jtagmkI_chip_erase(), jtagmkI_getparm(), jtagmkI_getsync(), jtagmkI_initialize(), jtagmkI_paged_load(), jtagmkI_paged_write(), jtagmkI_program_disable(), jtagmkI_program_enable(), jtagmkI_read_byte(), jtagmkI_reset(), jtagmkI_set_devdescr(), jtagmkI_setparm(), and jtagmkI_write_byte().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), cmd, CMD_SET_DEVICE_DESCRIPTOR, avrmem::desc, avrpart::idr, jtagmkI_recv(), jtagmkI_send(), ldata(), lfirst(), lnext(), avrpart::mem, MSG_INFO, MSG_NOTICE2, avrmem::page_size, PDATA, pgm, progname, avrpart::rampz, RESP_OK, avrpart::spmcr, u16_to_b2(), and verbose.
Referenced by jtagmkI_initialize().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References JTAG_BITRATE_125_kHz, JTAG_BITRATE_1_MHz, JTAG_BITRATE_250_kHz, JTAG_BITRATE_500_kHz, jtagmkI_setparm(), PARM_CLOCK, and pgm.
Referenced by jtagmkI_initialize(), and jtagmkI_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), CMD_SET_PARAM, jtagmkI_recv(), jtagmkI_send(), MSG_INFO, MSG_NOTICE2, pgm, progname, RESP_OK, and verbose.
Referenced by jtagmkI_close(), jtagmkI_initialize(), and jtagmkI_set_sck_period().
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, pgm, and progname.
Referenced by jtagmkI_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 jtagmkI_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), cmd, CMD_DATA, CMD_WRITE_MEM, avrmem::desc, jtagmkI_program_disable(), jtagmkI_program_enable(), jtagmkI_recv(), jtagmkI_send(), long, MSG_INFO, MSG_NOTICE2, MTYPE_EEPROM, MTYPE_FUSE_BITS, MTYPE_LOCK_BITS, MTYPE_OSCCAL_BYTE, MTYPE_SIGN_JTAG, MTYPE_SPM, PDATA, pgm, progname, RESP_OK, u32_to_b3(), and verbose.
Referenced by jtagmkI_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Referenced by jtagmkI_paged_load(), jtagmkI_paged_write(), jtagmkI_read_byte(), and jtagmkI_write_byte().
Here is the caller graph for this function:| const struct { ... } baudtab[] |
Referenced by jtagmkI_get_baud(), jtagmkI_open(), and jtagmkII_get_baud().
| const char jtagmkI_desc[] = "Atmel JTAG ICE mkI" |