xref: /haiku/headers/os/device/DigitalPort.h (revision 4f00613311d0bd6b70fa82ce19931c41f071ea4e)
1 /********************************************************************************
2 /
3 /	File:		DigitalPort.h
4 /
5 /	Description:	Digital Port class header.
6 /
7 /	Copyright 1996-98, Be Incorporated, All Rights Reserved.
8 /
9 ********************************************************************************/
10 
11 
12 #ifndef	_DIGITAL_PORT_H
13 #define	_DIGITAL_PORT_H
14 
15 #include <BeBuild.h>
16 #include <stddef.h>
17 #include <SupportDefs.h>
18 
19 
20 /* -----------------------------------------------------------------------*/
21 class BDigitalPort {
22 
23 public:
24 					BDigitalPort();
25 virtual				~BDigitalPort();
26 
27 		status_t	Open(const char *portName);
28 		void		Close(void);
29 		bool		IsOpen(void);
30 
31 		ssize_t		Read(uint8 *buf);
32 		ssize_t		Write(uint8 value);
33 
34 		status_t	SetAsOutput (void);
35 		bool		IsOutput (void);
36 
37 		status_t	SetAsInput (void);
38 		bool		IsInput (void);
39 
40 
41 /* -----------------------------------------------------------------------*/
42 
43 private:
44 
45 virtual	void		_ReservedDigitalPort1();
46 virtual	void		_ReservedDigitalPort2();
47 virtual	void		_ReservedDigitalPort3();
48 
49 		int			ffd;
50 		bool		fIsInput;
51 		uint32		_fReserved[3];
52 };
53 
54 #endif
55