![]() |
Prusa Slicer 2.6.0
|
#include "ac_cfg.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>#include "avrdude.h"#include "libavrdude.h"#include "bitbang.h"#include "buspirate.h"
Include dependency graph for buspirate.c:Go to the source code of this file.
Classes | |
| struct | pdata |
Macros | |
| #define | BP_RESET_CS 0x01 |
| #define | BP_RESET_AUX 0x02 |
| #define | BP_RESET_AUX2 0x04 |
| #define | BP_FLAG_IN_BINMODE (1<<0) |
| #define | BP_FLAG_XPARM_FORCE_ASCII (1<<1) |
| #define | BP_FLAG_XPARM_RESET (1<<2) |
| #define | BP_FLAG_XPARM_SPIFREQ (1<<3) |
| #define | BP_FLAG_NOPAGEDWRITE (1<<4) |
| #define | BP_FLAG_XPARM_CPUFREQ (1<<5) |
| #define | BP_FLAG_XPARM_RAWFREQ (1<<6) |
| #define | BP_FLAG_NOPAGEDREAD (1<<7) |
| #define | PDATA(pgm) ((struct pdata *)(pgm->cookie)) |
Functions | |
| static int | buspirate_uses_ascii (struct programmer_t *pgm) |
| static void | dump_mem (const int msglvl, const unsigned char *buf, size_t len) |
| static int | buspirate_send_bin (struct programmer_t *pgm, const unsigned char *data, size_t len) |
| static int | buspirate_recv_bin (struct programmer_t *pgm, unsigned char *buf, size_t len) |
| static int | buspirate_expect_bin (struct programmer_t *pgm, unsigned char *send_data, size_t send_len, unsigned char *expect_data, size_t expect_len) |
| static int | buspirate_expect_bin_byte (struct programmer_t *pgm, unsigned char send_byte, unsigned char expect_byte) |
| static int | buspirate_getc (struct programmer_t *pgm) |
| static char * | buspirate_readline_noexit (struct programmer_t *pgm, char *buf, size_t len) |
| static char * | buspirate_readline (struct programmer_t *pgm, char *buf, size_t len) |
| static int | buspirate_send (struct programmer_t *pgm, const char *str) |
| static int | buspirate_is_prompt (const char *str) |
| static int | buspirate_expect (struct programmer_t *pgm, char *send, char *expect, int wait_for_prompt) |
| static void | buspirate_dummy_6 (struct programmer_t *pgm, const char *p) |
| static int | buspirate_parseextparms (struct programmer_t *pgm, LISTID extparms) |
| static int | buspirate_verifyconfig (struct programmer_t *pgm) |
| static int | buspirate_open (struct programmer_t *pgm, char *port) |
| static void | buspirate_close (struct programmer_t *pgm) |
| static void | buspirate_reset_from_binmode (struct programmer_t *pgm) |
| static int | buspirate_start_mode_bin (struct programmer_t *pgm) |
| static int | buspirate_start_spi_mode_ascii (struct programmer_t *pgm) |
| static void | buspirate_enable (struct programmer_t *pgm) |
| static void | buspirate_disable (struct programmer_t *pgm) |
| static int | buspirate_initialize (struct programmer_t *pgm, AVRPART *p) |
| static void | buspirate_powerup (struct programmer_t *pgm) |
| static void | buspirate_powerdown (struct programmer_t *pgm) |
| static int | buspirate_cmd_bin (struct programmer_t *pgm, const unsigned char *cmd, unsigned char *res) |
| static int | buspirate_cmd_ascii (struct programmer_t *pgm, const unsigned char *cmd, unsigned char *res) |
| static int | buspirate_cmd (struct programmer_t *pgm, const unsigned char *cmd, unsigned char *res) |
| static int | buspirate_paged_load (PROGRAMMER *pgm, AVRPART *p, AVRMEM *m, unsigned int page_size, unsigned int address, unsigned int n_bytes) |
| static int | buspirate_paged_write (struct programmer_t *pgm, AVRPART *p, AVRMEM *m, unsigned int page_size, unsigned int base_addr, unsigned int n_data_bytes) |
| static int | buspirate_program_enable (struct programmer_t *pgm, AVRPART *p) |
| static int | buspirate_chip_erase (struct programmer_t *pgm, AVRPART *p) |
| static void | buspirate_setup (struct programmer_t *pgm) |
| static void | buspirate_teardown (struct programmer_t *pgm) |
| void | buspirate_initpgm (struct programmer_t *pgm) |
| static void | buspirate_bb_enable (struct programmer_t *pgm) |
| static int | buspirate_bb_getpin (struct programmer_t *pgm, int pinfunc) |
| static int | buspirate_bb_setpin_internal (struct programmer_t *pgm, int pin, int value) |
| static int | buspirate_bb_setpin (struct programmer_t *pgm, int pinfunc, int value) |
| static int | buspirate_bb_highpulsepin (struct programmer_t *pgm, int pinfunc) |
| static void | buspirate_bb_powerup (struct programmer_t *pgm) |
| static void | buspirate_bb_powerdown (struct programmer_t *pgm) |
| void | buspirate_bb_initpgm (struct programmer_t *pgm) |
Variables | |
| const char | buspirate_desc [] = "Using the Bus Pirate's SPI interface for programming" |
| const char | buspirate_bb_desc [] = "Using the Bus Pirate's bitbang interface for programming" |
| #define BP_FLAG_IN_BINMODE (1<<0) |
| #define BP_FLAG_NOPAGEDREAD (1<<7) |
| #define BP_FLAG_NOPAGEDWRITE (1<<4) |
| #define BP_FLAG_XPARM_CPUFREQ (1<<5) |
| #define BP_FLAG_XPARM_FORCE_ASCII (1<<1) |
| #define BP_FLAG_XPARM_RAWFREQ (1<<6) |
| #define BP_FLAG_XPARM_RESET (1<<2) |
| #define BP_FLAG_XPARM_SPIFREQ (1<<3) |
| #define BP_RESET_AUX 0x02 |
| #define BP_RESET_AUX2 0x04 |
| #define BP_RESET_CS 0x01 |
|
static |
References avrdude_message(), bitbang_check_prerequisites(), BP_FLAG_IN_BINMODE, buspirate_recv_bin(), buspirate_reset_from_binmode(), buspirate_send_bin(), programmer_t::fd, programmer_t::flag, MSG_INFO, PDATA, pgm, and serial_drain.
Referenced by buspirate_bb_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), buspirate_recv_bin(), buspirate_send_bin(), MSG_DEBUG, PDATA, pgm, PIN_INVERSE, PIN_MASK, and programmer_t::pinno.
Referenced by buspirate_bb_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References buspirate_bb_setpin(), and pgm.
Referenced by buspirate_bb_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:| void buspirate_bb_initpgm | ( | struct programmer_t * | pgm | ) |
References avr_read_byte_default(), avr_write_byte_default(), bitbang_chip_erase(), bitbang_cmd(), bitbang_cmd_tpi(), bitbang_err_led(), bitbang_initialize(), bitbang_pgm_led(), bitbang_program_enable(), bitbang_rdy_led(), bitbang_vfy_led(), buspirate_bb_enable(), buspirate_bb_getpin(), buspirate_bb_highpulsepin(), buspirate_bb_powerdown(), buspirate_bb_powerup(), buspirate_bb_setpin(), buspirate_close(), buspirate_disable(), buspirate_dummy_6(), buspirate_open(), buspirate_setup(), buspirate_teardown(), programmer_t::chip_erase, programmer_t::close, programmer_t::cmd, programmer_t::cmd_tpi, programmer_t::disable, programmer_t::display, programmer_t::enable, programmer_t::err_led, programmer_t::getpin, programmer_t::highpulsepin, programmer_t::initialize, programmer_t::open, pgm, pgm_fill_old_pins(), programmer_t::pgm_led, programmer_t::powerdown, programmer_t::powerup, programmer_t::program_enable, programmer_t::rdy_led, programmer_t::read_byte, programmer_t::setpin, programmer_t::setup, programmer_t::teardown, programmer_t::type, programmer_t::vfy_led, and programmer_t::write_byte.
Here is the call graph for this function:
|
static |
References buspirate_bb_setpin_internal(), and pgm.
Referenced by buspirate_bb_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References buspirate_bb_setpin_internal(), and pgm.
Referenced by buspirate_bb_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References buspirate_bb_setpin_internal(), pgm, and programmer_t::pinno.
Referenced by buspirate_bb_highpulsepin(), and buspirate_bb_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), buspirate_send_bin(), MSG_DEBUG, PDATA, pgm, PIN_INVERSE, and PIN_MASK.
Referenced by buspirate_bb_powerdown(), buspirate_bb_powerup(), and buspirate_bb_setpin().
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, and usleep().
Referenced by buspirate_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References programmer_t::fd, filedescriptor::ifd, pgm, and serial_close.
Referenced by buspirate_bb_initpgm(), and buspirate_initpgm().
Here is the caller graph for this function:
|
static |
References BP_FLAG_IN_BINMODE, buspirate_cmd_ascii(), buspirate_cmd_bin(), cmd, programmer_t::flag, and pgm.
Referenced by buspirate_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), buspirate_getc(), buspirate_is_prompt(), buspirate_readline(), buspirate_send(), cmd, MSG_INFO, pgm, progname, and snprintf.
Referenced by buspirate_cmd().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References buspirate_expect_bin_byte(), buspirate_recv_bin(), buspirate_send_bin(), cmd, and pgm.
Referenced by buspirate_cmd().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References BP_FLAG_IN_BINMODE, buspirate_expect(), buspirate_reset_from_binmode(), programmer_t::flag, pgm, and serial_recv_timeout.
Referenced by buspirate_bb_initpgm(), and buspirate_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Referenced by buspirate_bb_initpgm(), and buspirate_initpgm().
Here is the caller graph for this function:
|
static |
References avrdude_message(), BP_FLAG_IN_BINMODE, buspirate_is_prompt(), buspirate_readline_noexit(), buspirate_send_bin(), buspirate_start_mode_bin(), buspirate_start_spi_mode_ascii(), buspirate_uses_ascii(), buspirate_verifyconfig(), programmer_t::fd, programmer_t::flag, MSG_DEBUG, MSG_INFO, pgm, progname, and serial_drain.
Referenced by buspirate_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References buspirate_is_prompt(), buspirate_readline(), buspirate_send(), programmer_t::fd, pgm, and serial_drain.
Referenced by buspirate_disable(), buspirate_powerdown(), buspirate_powerup(), and buspirate_program_enable().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), BP_FLAG_IN_BINMODE, buspirate_recv_bin(), buspirate_send_bin(), programmer_t::flag, MSG_INFO, and pgm.
Referenced by buspirate_expect_bin_byte().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References buspirate_expect_bin(), and pgm.
Referenced by buspirate_cmd_bin(), buspirate_program_enable(), buspirate_reset_from_binmode(), and buspirate_start_mode_bin().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), BP_FLAG_IN_BINMODE, programmer_t::fd, programmer_t::flag, MSG_INFO, pgm, and serial_recv.
Referenced by buspirate_cmd_ascii(), and buspirate_readline_noexit().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References pgm, programmer_t::powerup, and programmer_t::program_enable.
Referenced by buspirate_initpgm().
Here is the caller graph for this function:| void buspirate_initpgm | ( | struct programmer_t * | pgm | ) |
References avr_read_byte_default(), avr_write_byte_default(), buspirate_chip_erase(), buspirate_close(), buspirate_cmd(), buspirate_disable(), buspirate_dummy_6(), buspirate_enable(), buspirate_initialize(), buspirate_open(), buspirate_paged_load(), buspirate_paged_write(), buspirate_parseextparms(), buspirate_powerdown(), buspirate_powerup(), buspirate_program_enable(), buspirate_setup(), buspirate_teardown(), 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::paged_load, programmer_t::paged_write, programmer_t::parseextparams, pgm, programmer_t::powerdown, programmer_t::powerup, programmer_t::program_enable, programmer_t::read_byte, programmer_t::setup, programmer_t::teardown, programmer_t::type, and programmer_t::write_byte.
Here is the call graph for this function:
|
static |
Referenced by buspirate_cmd_ascii(), buspirate_enable(), buspirate_expect(), buspirate_reset_from_binmode(), and buspirate_start_spi_mode_ascii().
Here is the caller graph for this function:
|
static |
References pinfo::baud, programmer_t::baudrate, programmer_t::fd, pgm, programmer_t::port, serial_drain, and serial_open.
Referenced by buspirate_bb_initpgm(), and buspirate_initpgm().
Here is the caller graph for this function:
|
static |
References avrdude_message(), BP_FLAG_NOPAGEDREAD, avrmem::buf, buspirate_recv_bin(), buspirate_send_bin(), avrmem::desc, programmer_t::flag, MSG_INFO, MSG_NOTICE, avrmem::page_size, and pgm.
Referenced by buspirate_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References AVR_OP_LOADPAGE_HI, AVR_OP_LOADPAGE_LO, avr_set_addr(), avr_set_bits(), avr_set_input(), avr_write_page(), avrdude_message(), BP_FLAG_IN_BINMODE, BP_FLAG_NOPAGEDWRITE, avrmem::buf, buspirate_recv_bin(), buspirate_send_bin(), avrpart::desc, avrmem::desc, programmer_t::err_led, programmer_t::flag, MSG_INFO, OFF, ON, avrmem::op, pgm, programmer_t::pgm_led, and progname.
Referenced by buspirate_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), BP_FLAG_NOPAGEDREAD, BP_FLAG_NOPAGEDWRITE, BP_FLAG_XPARM_CPUFREQ, BP_FLAG_XPARM_FORCE_ASCII, BP_FLAG_XPARM_RAWFREQ, BP_FLAG_XPARM_RESET, BP_FLAG_XPARM_SPIFREQ, BP_RESET_AUX, BP_RESET_AUX2, BP_RESET_CS, programmer_t::flag, ldata(), lfirst(), lnext(), MSG_INFO, PDATA, pgm, serial_recv_timeout, and strcasecmp.
Referenced by buspirate_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), BP_FLAG_IN_BINMODE, BP_FLAG_XPARM_CPUFREQ, buspirate_expect(), programmer_t::flag, MSG_INFO, pgm, and progname.
Referenced by buspirate_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), BP_FLAG_IN_BINMODE, BP_FLAG_XPARM_CPUFREQ, buspirate_expect(), programmer_t::flag, MSG_INFO, PDATA, pgm, progname, and snprintf.
Referenced by buspirate_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References AVR_OP_PGM_ENABLE, avr_set_bits(), avrdude_message(), BP_FLAG_IN_BINMODE, buspirate_expect(), buspirate_expect_bin_byte(), programmer_t::cmd, cmd, avrpart::desc, programmer_t::flag, MSG_INFO, avrpart::op, PDATA, and pgm.
Referenced by buspirate_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), buspirate_readline_noexit(), MSG_INFO, pgm, and progname.
Referenced by buspirate_cmd_ascii(), buspirate_expect(), buspirate_send(), and buspirate_start_spi_mode_ascii().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), buspirate_getc(), MSG_DEBUG, PDATA, pgm, progname, and serial_recv_timeout.
Referenced by buspirate_enable(), and buspirate_readline().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), dump_mem(), programmer_t::fd, MSG_DEBUG, pgm, progname, and serial_recv.
Referenced by buspirate_bb_enable(), buspirate_bb_getpin(), buspirate_cmd_bin(), buspirate_expect_bin(), buspirate_paged_load(), buspirate_paged_write(), buspirate_reset_from_binmode(), and buspirate_start_mode_bin().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), BP_FLAG_IN_BINMODE, BP_FLAG_XPARM_CPUFREQ, buspirate_expect_bin_byte(), buspirate_is_prompt(), buspirate_recv_bin(), buspirate_send_bin(), programmer_t::flag, MSG_INFO, MSG_NOTICE, pgm, and progname.
Referenced by buspirate_bb_enable(), buspirate_disable(), and buspirate_start_mode_bin().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), BP_FLAG_IN_BINMODE, buspirate_readline(), programmer_t::fd, programmer_t::flag, MSG_DEBUG, MSG_INFO, pgm, progname, and serial_send.
Referenced by buspirate_cmd_ascii(), buspirate_expect(), and buspirate_start_spi_mode_ascii().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), dump_mem(), programmer_t::fd, MSG_DEBUG, pgm, progname, and serial_send.
Referenced by buspirate_bb_enable(), buspirate_bb_getpin(), buspirate_bb_setpin_internal(), buspirate_cmd_bin(), buspirate_enable(), buspirate_expect_bin(), buspirate_paged_load(), buspirate_paged_write(), buspirate_reset_from_binmode(), and buspirate_start_mode_bin().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_oom(), programmer_t::cookie, PDATA, and pgm.
Referenced by buspirate_bb_initpgm(), and buspirate_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), BP_FLAG_IN_BINMODE, BP_FLAG_NOPAGEDREAD, BP_FLAG_NOPAGEDWRITE, BP_FLAG_XPARM_CPUFREQ, BP_FLAG_XPARM_RAWFREQ, buspirate_expect_bin_byte(), buspirate_recv_bin(), buspirate_reset_from_binmode(), buspirate_send_bin(), programmer_t::fd, programmer_t::flag, MSG_DEBUG, MSG_INFO, MSG_NOTICE, programmer_t::paged_load, programmer_t::paged_write, PDATA, pgm, progname, serial_drain, and usleep().
Referenced by buspirate_enable().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
References avrdude_message(), buspirate_is_prompt(), buspirate_readline(), buspirate_send(), cmd, MSG_INFO, pgm, progname, and snprintf.
Referenced by buspirate_enable().
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 buspirate_bb_initpgm(), and buspirate_initpgm().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
References BP_FLAG_XPARM_FORCE_ASCII, programmer_t::flag, and pgm.
Referenced by buspirate_enable(), and buspirate_verifyconfig().
Here is the caller graph for this function:
|
static |
References avrdude_message(), BP_FLAG_XPARM_RAWFREQ, BP_FLAG_XPARM_SPIFREQ, BP_RESET_CS, buspirate_uses_ascii(), programmer_t::flag, MSG_INFO, PDATA, and pgm.
Referenced by buspirate_enable().
Here is the call graph for this function:
Here is the caller graph for this function:References avrdude_message().
Referenced by buspirate_recv_bin(), and buspirate_send_bin().
Here is the call graph for this function:
Here is the caller graph for this function:| const char buspirate_bb_desc[] = "Using the Bus Pirate's bitbang interface for programming" |
| const char buspirate_desc[] = "Using the Bus Pirate's SPI interface for programming" |