2001-01-19 02:46:50 +00:00
|
|
|
/*
|
2002-01-12 01:51:35 +00:00
|
|
|
* Copyright (c) 2000, 2001, 2002 Brian S. Dean <bsd@bsdhome.com>
|
2001-01-19 02:46:50 +00:00
|
|
|
* All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
*
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY BRIAN S. DEAN ``AS IS'' AND ANY
|
|
|
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BRIAN S. DEAN BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
|
|
|
|
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
|
|
|
|
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
|
|
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
|
|
|
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
|
|
|
* DAMAGE.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* $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
|