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

« back to all changes in this revision

Viewing changes to serial.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: serial.h,v 1.9 2006/01/12 23:13:50 joerg_wunsch Exp $ */
 
20
/* $Id: serial.h,v 1.13 2007/01/24 22:43:46 joerg_wunsch Exp $ */
21
21
 
22
22
/* This is the API for the generic serial interface. The implementations are
23
23
   actually provided by the target dependant files:
27
27
 
28
28
   The target file will be selected at configure time. */
29
29
 
30
 
#ifndef __serial_h__
31
 
#define __serial_h__
 
30
#ifndef serial_h
 
31
#define serial_h
32
32
 
33
33
extern long serial_recv_timeout;
 
34
union filedescriptor
 
35
{
 
36
  int ifd;
 
37
  void *pfd;
 
38
};
34
39
 
35
40
struct serial_device
36
41
{
37
 
  int (*open)(char * port, long baud);
38
 
  int (*setspeed)(int fd, long baud);
39
 
  void (*close)(int fd);
40
 
 
41
 
  int (*send)(int fd, unsigned char * buf, size_t buflen);
42
 
  int (*recv)(int fd, unsigned char * buf, size_t buflen);
43
 
  int (*drain)(int fd, int display);
 
42
  void (*open)(char * port, long baud, union filedescriptor *fd);
 
43
  int (*setspeed)(union filedescriptor *fd, long baud);
 
44
  void (*close)(union filedescriptor *fd);
 
45
 
 
46
  int (*send)(union filedescriptor *fd, unsigned char * buf, size_t buflen);
 
47
  int (*recv)(union filedescriptor *fd, unsigned char * buf, size_t buflen);
 
48
  int (*drain)(union filedescriptor *fd, int display);
 
49
 
 
50
  int flags;
 
51
#define SERDEV_FL_NONE         0x0000 /* no flags */
 
52
#define SERDEV_FL_CANSETSPEED  0x0001 /* device can change speed */
44
53
};
45
54
 
46
55
extern struct serial_device *serdev;
47
 
extern struct serial_device serial_serdev, usb_serdev, usb_serdev_frame;
 
56
extern struct serial_device serial_serdev;
 
57
extern struct serial_device usb_serdev;
 
58
extern struct serial_device usb_serdev_frame;
 
59
extern struct serial_device avrdoper_serdev;
48
60
 
49
61
#define serial_open (serdev->open)
50
62
#define serial_setspeed (serdev->setspeed)
53
65
#define serial_recv (serdev->recv)
54
66
#define serial_drain (serdev->drain)
55
67
 
56
 
#endif /* __serial_h__ */
 
68
#endif /* serial_h */