~ubuntu-branches/ubuntu/raring/avrdude/raring

« back to all changes in this revision

Viewing changes to pgm.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl
  • Date: 2008-07-19 03:22:50 UTC
  • mfrom: (2.1.7 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080719032250-rpu0ljaplx3abxk9
Tags: 5.5-4
* Switch patch system to quilt.
* debian/control
  - Add Build-Depends on quilt.
  - Bump Standards-Version to 3.8.0. Add debian/README.source as recommended
    by the new policy.
* debian/rules
  - Include patchsys-quilt.mk instead of simple-patchsys.mk.
* debian/patches/series
  - Add all existing patches.
* Refresh all patches. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
18
 */
19
19
 
20
 
/* $Id: pgm.h,v 1.30 2006/10/09 14:34:24 joerg_wunsch Exp $ */
 
20
/* $Id: pgm.h,v 1.34 2007/01/30 13:41:53 joerg_wunsch Exp $ */
21
21
 
22
 
#ifndef __pgm_h__
23
 
#define __pgm_h__
 
22
#ifndef pgm_h
 
23
#define pgm_h
24
24
 
25
25
#include <limits.h>
26
26
 
27
27
#include "avrpart.h"
28
28
#include "lists.h"
29
29
#include "pindefs.h"
30
 
 
 
30
#include "serial.h"
31
31
 
32
32
#define ON  1
33
33
#define OFF 0
36
36
#define PGM_PORTLEN PATH_MAX
37
37
#define PGM_TYPELEN 32
38
38
 
39
 
extern LISTID       programmers;
40
 
 
41
39
typedef enum {
42
40
  EXIT_VCC_UNSPEC,
43
41
  EXIT_VCC_ENABLED,
63
61
  int baudrate;
64
62
  double bitclock;    /* JTAG ICE clock period in microseconds */
65
63
  int ispdelay;    /* ISP clock delay */
66
 
  int fd;
 
64
  union filedescriptor fd;
67
65
  int  page_size;  /* page size if the programmer supports paged write/load */
68
66
  int  (*rdy_led)        (struct programmer_t * pgm, int value);
69
67
  int  (*err_led)        (struct programmer_t * pgm, int value);
70
68
  int  (*pgm_led)        (struct programmer_t * pgm, int value);
71
69
  int  (*vfy_led)        (struct programmer_t * pgm, int value);
72
70
  int  (*initialize)     (struct programmer_t * pgm, AVRPART * p);
73
 
  void (*display)        (struct programmer_t * pgm, char * p);
 
71
  void (*display)        (struct programmer_t * pgm, const char * p);
74
72
  void (*enable)         (struct programmer_t * pgm);
75
73
  void (*disable)        (struct programmer_t * pgm);
76
74
  void (*powerup)        (struct programmer_t * pgm);
106
104
  char flag;                  /* for private use of the programmer */
107
105
} PROGRAMMER;
108
106
 
 
107
#ifdef __cplusplus
 
108
extern "C" {
 
109
#endif
109
110
 
110
111
PROGRAMMER * pgm_new(void);
111
112
 
112
 
#if defined(WIN32NATIVE)
113
 
 
114
 
#include "ac_cfg.h"
115
 
#include <windows.h>
116
 
 
117
 
/* usleep replacements */
118
 
/* sleep Windows in ms, Unix usleep in us
119
 
 #define usleep(us) Sleep((us)<20000?20:us/1000)
120
 
 #define usleep(us) Sleep(us/1000)
121
 
 #define ANTIWARP 3
122
 
 #define usleep(us) Sleep(us/1000*ANTIWARP)
123
 
*/
124
 
void usleep(unsigned long us);
125
 
 
126
 
#if !defined(HAVE_GETTIMEOFDAY)
127
 
int gettimeofday(struct timeval *tv, struct timezone *tz);
128
 
#endif /* HAVE_GETTIMEOFDAY */
129
 
 
130
 
#endif /* __win32native_h */
131
 
 
 
113
void programmer_display(PROGRAMMER * pgm, const char * p);
 
114
PROGRAMMER * locate_programmer(LISTID programmers, const char * configid);
 
115
 
 
116
typedef void (*walk_programmers_cb)(const char *name, const char *desc,
 
117
                                    const char *cfgname, int cfglineno,
 
118
                                    void *cookie);
 
119
void walk_programmers(LISTID programmers, walk_programmers_cb cb, void *cookie);
 
120
 
 
121
#ifdef __cplusplus
 
122
}
 
123
#endif
132
124
 
133
125
#endif