5 #ifndef __RY0_DEVICE_PT1_PT1CORE_H__
\r
6 #define __RY0_DEVICE_PT1_PT1CORE_H__
\r
10 #include <process.h>
\r
11 #include "EARTH_PT.h"
\r
12 #include "ry0/device/Tuner.h"
\r
25 friend class PT1Tuner;
\r
28 static const int EXCEPTION_NEW_DEVICE = 0x00000001;
\r
29 static const int EXCEPTION_DELETE = 0x00000002;
\r
30 static const int EXCEPTION_OPEN = 0x00000004;
\r
31 static const int EXCEPTION_CLOSE = 0x00000008;
\r
32 static const int EXCEPTION_INIT_TUNER = 0x00000010;
\r
33 static const int EXCEPTION_SET_TUNER_POWER_RESET = 0x00000020;
\r
34 static const int EXCEPTION_SET_TUNER_SLEEP = 0x00000040;
\r
35 static const int EXCEPTION_SET_STREAM_ENABLE = 0x00000080;
\r
36 static const int EXCEPTION_SET_STREAM_GRAY = 0x00000100;
\r
37 static const int EXCEPTION_OTHER = 0x80000000;
\r
39 static const int MAX_TUNERS = 4;
\r
40 static const int PAGE_SIZE = 4096;
\r
41 static const int PAGE_COUNT = 47;
\r
42 static const int PACKET_SIZE = 188;
\r
43 static const int VIRTUAL_SIZE = 4;
\r
44 static const int VIRTUAL_COUNT = 16;
\r
45 static const int LOCK_SIZE = 4;
\r
46 static const int BUFFER_PAGE_COUNT = 511;
\r
47 static const int BLOCK_COUNT = 2;
\r
48 static const int BLOCK_SIZE = (PAGE_SIZE * BUFFER_PAGE_COUNT / BLOCK_COUNT);
\r
52 CRITICAL_SECTION _cs;
\r
53 EARTH::PT::Device * _device;
\r
56 PT1Tuner * _tuners[MAX_TUNERS];
\r
57 bool _locked[MAX_TUNERS];
\r
65 uint32_t _virtualIndex;
\r
66 uint32_t _imageIndex;
\r
67 uint32_t _blockIndex;
\r
68 uint8_t _buffer[BLOCK_SIZE];
\r
70 uint32_t offset(uint32_t imageIndex, uint32_t blockIndex, uint32_t additionalOffset);
\r
71 uint32_t offset(uint32_t imageIndex, uint32_t blockIndex);
\r
72 uint32_t read(uint32_t virtualIndex, uint32_t imageIndex, uint32_t blockIndex);
\r
73 void clearBlock(uint32_t virtualIndex, uint32_t imageIndex, uint32_t blockIndex);
\r
76 bool dispatchBlock();
\r
79 PT1Core(EARTH::PT::Bus *bus, const EARTH::PT::Bus::DeviceInfo *deviceInfo, Tuner *tuners[4], HMODULE multi2_dll);
\r
82 void release(Tuner *tuner);
\r
85 bool getCnAgc(EARTH::uint tuner, EARTH::uint *cn100, EARTH::uint *agc, EARTH::uint *maxAgc);
\r
86 bool setChannel(EARTH::uint tuner, int channel);
\r
97 #endif // __RY0_DEVICE_PT1_PT1CORE_H__
\r