* avrdude.conf.in: Add avr910 and pavr programmers.
* config_gram.y: Add parsing of avr910 programmer. * lexer.l: Add avr910 token. * avr910.c: [this is still work in progress] Add some debug output. Add probe for programmer presense. * main.c: Set port to default_serial if programmer type is avr910. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@292 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
parent
147c27da52
commit
ae3f4e852f
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
2003-03-16 Theodore A. Roth <troth@openavr.org>
|
||||
|
||||
* avrdude.conf.in: Add avr910 and pavr programmers.
|
||||
* config_gram.y: Add parsing of avr910 programmer.
|
||||
* lexer.l: Add avr910 token.
|
||||
* avr910.c: [this is still work in progress]
|
||||
Add some debug output.
|
||||
Add probe for programmer presense.
|
||||
* main.c: Set port to default_serial if programmer type is avr910.
|
||||
|
||||
2003-03-13 Theodore A. Roth <troth@openavr.org>
|
||||
|
||||
* ser_posix.c, ser_win32.c, serial.h:
|
||||
|
|
99
avr910.c
99
avr910.c
|
@ -39,45 +39,73 @@
|
|||
extern char * progname;
|
||||
extern int do_cycles;
|
||||
|
||||
#define show_func_info() \
|
||||
fprintf(stderr, "%s: %d: called %s()\n", __FILE__, __LINE__, __FUNCTION__)
|
||||
|
||||
|
||||
|
||||
static int avr910_send(PROGRAMMER * pgm, char * buf, size_t len)
|
||||
{
|
||||
show_func_info();
|
||||
|
||||
return serial_send(pgm->fd, buf, len);
|
||||
}
|
||||
|
||||
|
||||
static int avr910_recv(PROGRAMMER * pgm, char * buf, size_t len)
|
||||
{
|
||||
show_func_info();
|
||||
|
||||
return serial_recv(pgm->fd, buf, len);
|
||||
}
|
||||
|
||||
|
||||
static int avr910_drain(PROGRAMMER * pgm, int display)
|
||||
{
|
||||
show_func_info();
|
||||
|
||||
/* Do nothing. */
|
||||
|
||||
return serial_drain(pgm->fd, display);
|
||||
}
|
||||
|
||||
|
||||
static int avr910_rdy_led(PROGRAMMER * pgm, int value)
|
||||
{
|
||||
show_func_info();
|
||||
|
||||
/* Do nothing. */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int avr910_err_led(PROGRAMMER * pgm, int value)
|
||||
{
|
||||
show_func_info();
|
||||
|
||||
/* Do nothing. */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int avr910_pgm_led(PROGRAMMER * pgm, int value)
|
||||
{
|
||||
show_func_info();
|
||||
|
||||
/* Do nothing. */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int avr910_vfy_led(PROGRAMMER * pgm, int value)
|
||||
{
|
||||
show_func_info();
|
||||
|
||||
/* Do nothing. */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -87,6 +115,8 @@ static int avr910_vfy_led(PROGRAMMER * pgm, int value)
|
|||
*/
|
||||
static int avr910_chip_erase(PROGRAMMER * pgm, AVRPART * p)
|
||||
{
|
||||
show_func_info();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -95,6 +125,8 @@ static int avr910_chip_erase(PROGRAMMER * pgm, AVRPART * p)
|
|||
*/
|
||||
static int avr910_program_enable(PROGRAMMER * pgm, AVRPART * p)
|
||||
{
|
||||
show_func_info();
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -104,6 +136,10 @@ static int avr910_program_enable(PROGRAMMER * pgm, AVRPART * p)
|
|||
*/
|
||||
static void avr910_powerup(PROGRAMMER * pgm)
|
||||
{
|
||||
show_func_info();
|
||||
|
||||
/* Do nothing. */
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -113,6 +149,10 @@ static void avr910_powerup(PROGRAMMER * pgm)
|
|||
*/
|
||||
static void avr910_powerdown(PROGRAMMER * pgm)
|
||||
{
|
||||
show_func_info();
|
||||
|
||||
/* Do nothing. */
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -122,30 +162,79 @@ static void avr910_powerdown(PROGRAMMER * pgm)
|
|||
*/
|
||||
static int avr910_initialize(PROGRAMMER * pgm, AVRPART * p)
|
||||
{
|
||||
char pn[8];
|
||||
char sw[2];
|
||||
char hw[2];
|
||||
unsigned char c;
|
||||
|
||||
show_func_info();
|
||||
|
||||
/* Programmer returns exactly 7 chars _without_ the null.*/
|
||||
|
||||
avr910_send(pgm, "S", 1);
|
||||
memset (pn, 0, sizeof(pn));
|
||||
avr910_recv(pgm, pn, sizeof(pn)-1);
|
||||
|
||||
/* Get the HW and SW versions to see if the programmer is present. */
|
||||
|
||||
avr910_send(pgm, "V", 1);
|
||||
avr910_recv(pgm, sw, sizeof(sw));
|
||||
|
||||
avr910_send(pgm, "v", 1);
|
||||
avr910_recv(pgm, hw, sizeof(hw));
|
||||
|
||||
fprintf(stderr, "Found programmer: %s\n", pn);
|
||||
fprintf(stderr, " Software Version = %c.%c; "
|
||||
"Hardware Version = %c.%c\n", sw[0], sw[1], hw[0], hw[1]);
|
||||
|
||||
/* Get list of devices that the programmer supports. */
|
||||
|
||||
avr910_send(pgm, "t", 1);
|
||||
while (1) {
|
||||
avr910_recv(pgm, &c, 1);
|
||||
if (c == 0)
|
||||
break;
|
||||
fprintf(stderr, "Device code: 0x%02x\n", c);
|
||||
};
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int avr910_save(PROGRAMMER * pgm)
|
||||
{
|
||||
show_func_info();
|
||||
|
||||
/* Do nothing. */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static void avr910_restore(PROGRAMMER * pgm)
|
||||
{
|
||||
show_func_info();
|
||||
|
||||
/* Do nothing. */
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static void avr910_disable(PROGRAMMER * pgm)
|
||||
{
|
||||
show_func_info();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static void avr910_enable(PROGRAMMER * pgm)
|
||||
{
|
||||
show_func_info();
|
||||
|
||||
/* Do nothing. */
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -157,12 +246,16 @@ static void avr910_enable(PROGRAMMER * pgm)
|
|||
static int avr910_cmd(PROGRAMMER * pgm, unsigned char cmd[4],
|
||||
unsigned char res[4])
|
||||
{
|
||||
show_func_info();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static void avr910_open(PROGRAMMER * pgm, char * port)
|
||||
{
|
||||
show_func_info();
|
||||
|
||||
strcpy(pgm->port, port);
|
||||
pgm->fd = serial_open(port, 19200);
|
||||
|
||||
|
@ -174,6 +267,8 @@ static void avr910_open(PROGRAMMER * pgm, char * port)
|
|||
|
||||
static void avr910_close(PROGRAMMER * pgm)
|
||||
{
|
||||
show_func_info();
|
||||
|
||||
serial_close(pgm->fd);
|
||||
pgm->fd = -1;
|
||||
}
|
||||
|
@ -181,12 +276,16 @@ static void avr910_close(PROGRAMMER * pgm)
|
|||
|
||||
static void avr910_display(PROGRAMMER * pgm, char * p)
|
||||
{
|
||||
show_func_info();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void avr910_initpgm(PROGRAMMER * pgm)
|
||||
{
|
||||
show_func_info();
|
||||
|
||||
strcpy(pgm->type, "avr910");
|
||||
|
||||
/*
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
# programmer
|
||||
# id = <id1> [, <id2> [, <id3>] ...] ; # <idN> are quoted strings
|
||||
# desc = <description> ; # quoted string
|
||||
# type = par | stk500 ; # programmer type
|
||||
# type = par | stk500 | avr910; # programmer type
|
||||
# vcc = <num1> [, <num2> ... ] ; # pin number(s)
|
||||
# reset = <num> ; # pin number
|
||||
# sck = <num> ; # pin number
|
||||
|
@ -203,6 +203,18 @@ programmer
|
|||
type = stk500;
|
||||
;
|
||||
|
||||
programmer
|
||||
id = "avr910";
|
||||
desc = "Atmel Low Cost Serial Programmer";
|
||||
type = avr910;
|
||||
;
|
||||
|
||||
programmer
|
||||
id = "pavr";
|
||||
desc = "Jason Kyle's pAVR Serial Programmer";
|
||||
type = avr910;
|
||||
;
|
||||
|
||||
programmer
|
||||
id = "stk200";
|
||||
desc = "STK200";
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include "ppi.h"
|
||||
#include "pgm.h"
|
||||
#include "stk500.h"
|
||||
#include "avr910.h"
|
||||
#include "avr.h"
|
||||
|
||||
extern char * progname;
|
||||
|
@ -101,6 +102,7 @@ static int parse_cmdbits(OPCODE * op);
|
|||
%token K_SCK
|
||||
%token K_SIZE
|
||||
%token K_STK500
|
||||
%token K_AVR910
|
||||
%token K_TYPE
|
||||
%token K_VCC
|
||||
%token K_VFYLED
|
||||
|
@ -284,6 +286,12 @@ prog_parm :
|
|||
}
|
||||
} |
|
||||
|
||||
K_TYPE TKN_EQUAL K_AVR910 {
|
||||
{
|
||||
avr910_initpgm(current_prog);
|
||||
}
|
||||
} |
|
||||
|
||||
K_DESC TKN_EQUAL TKN_STRING {
|
||||
strncpy(current_prog->desc, $3->value.string, PGM_DESCLEN);
|
||||
current_prog->desc[PGM_DESCLEN-1] = 0;
|
||||
|
|
1
lexer.l
1
lexer.l
|
@ -152,6 +152,7 @@ retry_pulse { yylval=NULL; return K_RETRY_PULSE; }
|
|||
serial { yylval=NULL; return K_SERIAL; }
|
||||
size { yylval=NULL; return K_SIZE; }
|
||||
stk500 { yylval=NULL; return K_STK500; }
|
||||
avr910 { yylval=NULL; return K_AVR910; }
|
||||
type { yylval=NULL; return K_TYPE; }
|
||||
vcc { yylval=NULL; return K_VCC; }
|
||||
vfyled { yylval=NULL; return K_VFYLED; }
|
||||
|
|
Loading…
Reference in New Issue