Adding only those device kit headers that are required by libdevice.so

Taken from headers-src.tgz from ftp.be.com


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@692 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
beveloper 2002-08-10 22:45:28 +00:00
parent 4c2bc7e83c
commit 3041056043
5 changed files with 369 additions and 0 deletions

43
headers/os/device/A2D.h Normal file
View File

@ -0,0 +1,43 @@
/********************************************************************************
/
/ File: A2D.h
/
/ Description: Analog-to-Digital converter class header.
/
/ Copyright 1996-98, Be Incorporated, All Rights Reserved.
/
********************************************************************************/
#ifndef _A2D_H
#define _A2D_H
#include <BeBuild.h>
#include <stddef.h>
#include <SupportDefs.h>
/* -----------------------------------------------------------------------*/
class BA2D {
public:
BA2D();
virtual ~BA2D();
status_t Open(const char *portName);
void Close(void);
bool IsOpen(void);
ssize_t Read(ushort *buf);
/* -----------------------------------------------------------------------*/
private:
virtual void _ReservedA2D1();
virtual void _ReservedA2D2();
virtual void _ReservedA2D3();
int ffd;
uint32 _fReserved[3];
};
#endif

45
headers/os/device/D2A.h Normal file
View File

@ -0,0 +1,45 @@
/********************************************************************************
/
/ File: D2A.h
/
/ Description: Digital-To-Analog converter class header.
/
/ Copyright 1996-98, Be Incorporated, All Rights Reserved.
/
********************************************************************************/
#ifndef _D2A_H
#define _D2A_H
#include <BeBuild.h>
#include <stddef.h>
#include <SupportDefs.h>
/* -----------------------------------------------------------------------*/
class BD2A {
public:
BD2A();
virtual ~BD2A();
status_t Open(const char *portName);
void Close(void);
bool IsOpen(void);
ssize_t Read(uint8 *buf);
ssize_t Write(uint8 value);
/* -----------------------------------------------------------------------*/
private:
virtual void _ReservedD2A1();
virtual void _ReservedD2A2();
virtual void _ReservedD2A3();
int ffd;
uint32 _fReserved[3];
};
#endif

View File

@ -0,0 +1,54 @@
/********************************************************************************
/
/ File: DigitalPort.h
/
/ Description: Digital Port class header.
/
/ Copyright 1996-98, Be Incorporated, All Rights Reserved.
/
********************************************************************************/
#ifndef _DIGITAL_PORT_H
#define _DIGITAL_PORT_H
#include <BeBuild.h>
#include <stddef.h>
#include <SupportDefs.h>
/* -----------------------------------------------------------------------*/
class BDigitalPort {
public:
BDigitalPort();
virtual ~BDigitalPort();
status_t Open(const char *portName);
void Close(void);
bool IsOpen(void);
ssize_t Read(uint8 *buf);
ssize_t Write(uint8 value);
status_t SetAsOutput (void);
bool IsOutput (void);
status_t SetAsInput (void);
bool IsInput (void);
/* -----------------------------------------------------------------------*/
private:
virtual void _ReservedDigitalPort1();
virtual void _ReservedDigitalPort2();
virtual void _ReservedDigitalPort3();
int ffd;
bool fIsInput;
uint32 _fReserved[3];
};
#endif

View File

@ -0,0 +1,118 @@
/********************************************************************************
/
/ File: Joystick.h
/
/ Description: Joystick port class header.
/
/ Copyright 1996-98, Be Incorporated, All Rights Reserved.
/
********************************************************************************/
#ifndef _JOYSTICK_H
#define _JOYSTICK_H
#include <BeBuild.h>
#include <SupportDefs.h>
#include <OS.h>
class BList;
struct _extended_joystick;
class _IMPEXP_DEVICE _BJoystickTweaker;
/* -----------------------------------------------------------------------*/
class BJoystick {
public:
BJoystick();
virtual ~BJoystick();
status_t Open(const char *portName); /* always goes for enhanced mode */
status_t Open(const char *portName, bool enter_enhanced);
void Close(void);
status_t Update(void);
status_t SetMaxLatency(
bigtime_t max_latency);
bigtime_t timestamp;
int16 horizontal;
int16 vertical;
bool button1; /* NOTE: true == off */
bool button2;
int32 CountDevices();
status_t GetDeviceName(int32 n, char * name,
size_t bufSize = B_OS_NAME_LENGTH);
/* if you care about more than just the first two axes/buttons, here's where you go */
bool EnterEnhancedMode(
const entry_ref * ref = NULL);
int32 CountSticks();
int32 CountAxes();
int32 CountHats();
int32 CountButtons();
status_t GetAxisValues(
int16 * out_values,
int32 for_stick = 0); /* CountAxes() elements */
status_t GetHatValues(
uint8 * out_hats,
int32 for_stick = 0);
uint32 ButtonValues(
int32 for_stick = 0); /* NOTE: Buttons() are 1 == on */
status_t GetAxisNameAt(
int32 index,
BString * out_name);
status_t GetHatNameAt(
int32 index,
BString * out_name);
status_t GetButtonNameAt(
int32 index,
BString * out_name);
status_t GetControllerModule(
BString * out_name);
status_t GetControllerName(
BString * out_name);
bool IsCalibrationEnabled();
status_t EnableCalibration(
bool calibrates = true);
/* -----------------------------------------------------------------------*/
protected:
virtual void Calibrate(
struct _extended_joystick * reading);
private:
friend class _BJoystickTweaker;
struct _joystick_info;
void ScanDevices(
bool use_disabled = false);
status_t gather_enhanced_info(
const entry_ref * ref = NULL);
status_t save_config(
const entry_ref * ref = NULL);
void _ReservedJoystick1();
virtual void _ReservedJoystick2();
virtual void _ReservedJoystick3();
bool _mBeBoxMode;
bool _mReservedBool;
int ffd;
BList * _fDevices;
_joystick_info * m_info;
char * m_dev_name;
#if !_PR3_COMPATIBLE_
virtual status_t _Reserved_Joystick_4(void *, ...);
virtual status_t _Reserved_Joystick_5(void *, ...);
virtual status_t _Reserved_Joystick_6(void *, ...);
uint32 _reserved_Joystick_[10];
#endif
};
#endif

View File

@ -0,0 +1,109 @@
/********************************************************************************
/
/ File: SerialPort.h
/
/ Description: Serial Port class header.
/
/ Copyright 1995-98, Be Incorporated, All Rights Reserved.
/
********************************************************************************/
#ifndef _SERIAL_PORT_H
#define _SERIAL_PORT_H
#include <BeBuild.h>
#include <stddef.h>
#include <OS.h>
#include <SupportDefs.h>
class BList;
enum data_rate { B_0_BPS = 0, B_50_BPS, B_75_BPS, B_110_BPS, B_134_BPS,
B_150_BPS, B_200_BPS, B_300_BPS, B_600_BPS, B_1200_BPS,
B_1800_BPS, B_2400_BPS, B_4800_BPS, B_9600_BPS, B_19200_BPS,
B_38400_BPS, B_57600_BPS, B_115200_BPS,
B_230400_BPS, B_31250_BPS };
enum data_bits { B_DATA_BITS_7, B_DATA_BITS_8 };
enum stop_bits { B_STOP_BITS_1, B_STOP_BITS_2 };
#define B_STOP_BIT_1 B_STOP_BITS_1
enum parity_mode { B_NO_PARITY, B_ODD_PARITY, B_EVEN_PARITY };
enum { B_NOFLOW_CONTROL = 0, B_HARDWARE_CONTROL = 0x00000001,
B_SOFTWARE_CONTROL = 0x00000002 };
/* -----------------------------------------------------------------------*/
class BSerialPort {
public:
BSerialPort();
virtual ~BSerialPort();
status_t Open(const char *portName);
void Close(void);
ssize_t Read(void *buf, size_t count);
ssize_t Write(const void *buf, size_t count);
void SetBlocking(bool Blocking);
status_t SetTimeout(bigtime_t microSeconds);
status_t SetDataRate(data_rate bitsPerSecond);
data_rate DataRate(void);
void SetDataBits(data_bits numBits);
data_bits DataBits(void);
void SetStopBits(stop_bits numBits);
stop_bits StopBits(void);
void SetParityMode(parity_mode which);
parity_mode ParityMode(void);
void ClearInput(void);
void ClearOutput(void);
void SetFlowControl(uint32 method);
uint32 FlowControl(void);
status_t SetDTR(bool asserted);
status_t SetRTS(bool asserted);
status_t NumCharsAvailable(int32 *wait_until_this_many);
bool IsCTS(void);
bool IsDSR(void);
bool IsRI(void);
bool IsDCD(void);
ssize_t WaitForInput(void);
/* -----------------------------------------------------------------------*/
int32 CountDevices();
status_t GetDeviceName(int32 n, char * name,
size_t bufSize = B_OS_NAME_LENGTH);
private:
void ScanDevices();
virtual void _ReservedSerialPort1();
virtual void _ReservedSerialPort2();
virtual void _ReservedSerialPort3();
virtual void _ReservedSerialPort4();
int ffd;
data_rate fBaudRate;
data_bits fDataBits;
stop_bits fStopBits;
parity_mode fParityMode;
uint32 fFlow;
bigtime_t fTimeout;
bool fBlocking;
int DriverControl();
BList * _fDevices;
uint32 _fReserved[3];
};
#endif