2001-01-19 02:46:50 +00:00
|
|
|
/*
|
2003-02-08 04:17:25 +00:00
|
|
|
* avrdude - A Downloader/Uploader for AVR device programmers
|
2003-02-06 19:08:33 +00:00
|
|
|
* Copyright (C) 2000, 2001, 2002, 2003 Brian S. Dean <bsd@bsdhome.com>
|
2001-01-19 02:46:50 +00:00
|
|
|
*
|
2003-02-06 19:08:33 +00:00
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
2001-01-19 02:46:50 +00:00
|
|
|
*
|
2003-02-06 19:08:33 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2001-01-19 02:46:50 +00:00
|
|
|
*
|
2003-02-06 19:08:33 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
2001-01-19 02:46:50 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* $Id$ */
|
|
|
|
|
|
|
|
#ifndef __avr_h__
|
|
|
|
#define __avr_h__
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2002-11-30 14:09:12 +00:00
|
|
|
#include "avrpart.h"
|
2001-11-21 02:46:55 +00:00
|
|
|
#include "lists.h"
|
2002-11-30 14:09:12 +00:00
|
|
|
#include "pgm.h"
|
2001-01-19 02:46:50 +00:00
|
|
|
|
2001-01-22 01:59:47 +00:00
|
|
|
|
2001-10-13 03:12:52 +00:00
|
|
|
|
2001-01-19 02:46:50 +00:00
|
|
|
extern struct avrpart parts[];
|
|
|
|
|
|
|
|
|
|
|
|
|
2001-10-14 23:17:26 +00:00
|
|
|
AVRPART * avr_find_part(char * p);
|
|
|
|
|
|
|
|
AVRPART * avr_new_part(void);
|
2001-01-19 02:46:50 +00:00
|
|
|
|
2001-11-21 02:46:55 +00:00
|
|
|
OPCODE * avr_new_opcode(void);
|
|
|
|
|
|
|
|
AVRMEM * avr_new_memtype(void);
|
|
|
|
|
2001-10-14 23:17:26 +00:00
|
|
|
AVRPART * avr_dup_part(AVRPART * d);
|
2001-01-19 02:46:50 +00:00
|
|
|
|
2001-11-21 02:46:55 +00:00
|
|
|
AVRMEM * avr_locate_mem(AVRPART * p, char * desc);
|
|
|
|
|
2001-10-13 03:13:13 +00:00
|
|
|
int avr_txrx_bit(int fd, int bit);
|
2001-01-19 02:46:50 +00:00
|
|
|
|
2001-10-13 03:13:13 +00:00
|
|
|
unsigned char avr_txrx(int fd, unsigned char byte);
|
2001-01-19 02:46:50 +00:00
|
|
|
|
2002-11-30 14:09:12 +00:00
|
|
|
int avr_set_bits(OPCODE * op, unsigned char * cmd);
|
2001-01-19 02:46:50 +00:00
|
|
|
|
2002-11-30 14:09:12 +00:00
|
|
|
int avr_read_byte(PROGRAMMER * pgm, AVRPART * p, AVRMEM * mem,
|
|
|
|
unsigned long addr, unsigned char * value);
|
2001-01-19 02:46:50 +00:00
|
|
|
|
2002-11-30 14:09:12 +00:00
|
|
|
int avr_read(PROGRAMMER * pgm, AVRPART * p, char * memtype, int size,
|
|
|
|
int verbose);
|
2001-01-19 02:46:50 +00:00
|
|
|
|
2002-11-30 14:09:12 +00:00
|
|
|
int avr_write_page(PROGRAMMER * pgm, AVRPART * p, AVRMEM * mem,
|
2001-11-21 02:46:55 +00:00
|
|
|
unsigned long addr);
|
2001-10-14 02:53:21 +00:00
|
|
|
|
2002-11-30 14:09:12 +00:00
|
|
|
int avr_write_byte(PROGRAMMER * pgm, AVRPART * p, AVRMEM * mem,
|
2001-10-14 23:17:26 +00:00
|
|
|
unsigned long addr, unsigned char data);
|
2001-01-19 02:46:50 +00:00
|
|
|
|
2002-11-30 14:09:12 +00:00
|
|
|
int avr_write(PROGRAMMER * pgm, AVRPART * p, char * memtype, int size,
|
|
|
|
int verbose);
|
2001-01-19 02:46:50 +00:00
|
|
|
|
2002-11-30 14:09:12 +00:00
|
|
|
int avr_signature(PROGRAMMER * pgm, AVRPART * p);
|
2001-01-19 02:46:50 +00:00
|
|
|
|
2001-10-13 03:13:13 +00:00
|
|
|
char * avr_memtstr(int memtype);
|
2001-01-19 02:46:50 +00:00
|
|
|
|
2001-10-14 23:17:26 +00:00
|
|
|
int avr_initmem(AVRPART * p);
|
2001-01-19 02:46:50 +00:00
|
|
|
|
2001-11-21 02:46:55 +00:00
|
|
|
int avr_verify(AVRPART * p, AVRPART * v, char * memtype, int size);
|
2001-01-19 02:46:50 +00:00
|
|
|
|
2002-02-14 02:48:07 +00:00
|
|
|
void avr_mem_display(char * prefix, FILE * f, AVRMEM * m, int type,
|
|
|
|
int verbose);
|
2001-01-19 02:46:50 +00:00
|
|
|
|
2002-02-14 02:48:07 +00:00
|
|
|
void avr_display(FILE * f, AVRPART * p, char * prefix, int verbose);
|
2001-01-19 02:46:50 +00:00
|
|
|
|
2002-11-30 14:09:12 +00:00
|
|
|
int avr_get_cycle_count(PROGRAMMER * pgm, AVRPART * p, int * cycles);
|
2002-08-01 01:00:03 +00:00
|
|
|
|
2002-11-30 14:09:12 +00:00
|
|
|
int avr_put_cycle_count(PROGRAMMER * pgm, AVRPART * p, int cycles);;
|
2002-08-01 01:00:03 +00:00
|
|
|
|
2001-01-19 02:46:50 +00:00
|
|
|
#endif
|