-
Notifications
You must be signed in to change notification settings - Fork 1
/
KnobDevice.h
47 lines (35 loc) · 911 Bytes
/
KnobDevice.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
* Copyright 2004-2011 Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Alexander von Gluck, kallisti5@unixzen.com
*/
#ifndef _USB_KNOB_DRIVER_H_
#define _USB_KNOB_DRIVER_H_
#include "Driver.h"
#include <support/ByteOrder.h>
// device command codes
#define SET_STATIC_BRIGHTNESS 0x01
#define SET_PULSE_ASLEEP 0x02
#define SET_PULSE_AWAKE 0x03
#define SET_PULSE_MODE 0x04
class KnobDevice
{
public:
KnobDevice(usb_device device,
const char *description);
virtual ~KnobDevice();
status_t ProbeDevice();
const char* Name()
{ return fName; }
protected:
status_t WriteState(uint16 parameter, uint16 value);
status_t LedPulse(uint16 brightness, uint16 speed,
uint16 asleep, uint16 awake);
private:
usb_device fDevice;
const char* fName;
volatile bool fBusy;
};
#endif