vfs: check userland buffers before reading them.
[haiku.git] / src / add-ons / media / media-add-ons / radeon / Tuner.h
blobcb948255e56ef1fe921dbffea1bf72c78fd864a8
1 /******************************************************************************
3 / File: Tuner.h
5 / Description: Philips Desktop TV Tuners interface.
7 / Copyright 2001, Carlos Hasan
9 *******************************************************************************/
11 #ifndef __TUNER_H__
12 #define __TUNER_H__
14 #include "I2CPort.h"
16 enum tuner_type {
17 C_TUNER_NONE = 0x1400, /* Unknown */
18 C_TUNER_FI1236 = 0x1401, /* NTSC M/N */
19 C_TUNER_FI1236J = 0x1402, /* NTSC Japan */
20 C_TUNER_FI1236MK2 = 0x1403, /* NTSC M/N */
21 C_TUNER_FI1216 = 0x1404, /* PAL B/G */
22 C_TUNER_FI1216MK2 = 0x1405, /* PAL B/G */
23 C_TUNER_FI1216MF = 0x1406, /* PAL B/G, SECAM L/L' */
24 C_TUNER_FI1246 = 0x1407, /* PAL I */
25 C_TUNER_FI1256 = 0x1408, /* SECAM D/K */
26 C_TUNER_TEMIC_FN5AL_PAL = 0x1409, /* PAL I/B/G/DK */
27 C_TUNER_TEMIC_FN5AL_SECAM = 0x140a /* SECAM DK */
30 enum tuner_picture_carrier {
31 C_TUNER_NTSC_PICTURE_CARRIER = 4575,
32 C_TUNER_PAL_PICTURE_CARRIER = 3890,
33 C_TUNER_SECAM_PICTURE_CARRIER = 3890
36 class CTuner {
37 public:
38 CTuner(CI2CPort & port);
40 ~CTuner();
42 status_t InitCheck() const;
44 const char * Name() const;
46 tuner_type Type() const;
48 bool SetFrequency(float frequency, float picture);
50 bool SweepFrequency(float frequency, float picture);
52 bool HasSignal(void);
54 int Status();
56 bool IsLocked();
58 int ADC();
60 private:
61 void SetParameters(int divider, int control, int band);
63 private:
64 CI2CPort & fPort;
65 tuner_type fType;
66 int fAddress;
67 int fDivider;
70 #endif