1 /****************************************************************************** 2 / 3 / File: Tuner.h 4 / 5 / Description: Philips Desktop TV Tuners interface. 6 / 7 / Copyright 2001, Carlos Hasan 8 / 9 *******************************************************************************/ 10 11 #ifndef __TUNER_H__ 12 #define __TUNER_H__ 13 14 #include "I2CPort.h" 15 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 */ 28 }; 29 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 34 }; 35 36 class CTuner { 37 public: 38 CTuner(CI2CPort & port); 39 40 ~CTuner(); 41 42 status_t InitCheck() const; 43 44 const char * Name() const; 45 46 tuner_type Type() const; 47 48 bool SetFrequency(float frequency, float picture); 49 50 bool SweepFrequency(float frequency, float picture); 51 52 bool HasSignal(void); 53 54 int Status(); 55 56 bool IsLocked(); 57 58 int ADC(); 59 60 private: 61 void SetParameters(int divider, int control, int band); 62 63 private: 64 CI2CPort & fPort; 65 tuner_type fType; 66 int fAddress; 67 int fDivider; 68 }; 69 70 #endif 71