- Linux MultiMedia Studio Computer Accessories User Manual

NextMove PCI and Non-Micorsoft Operating Systems
MN1278 05.2001
47
5.3.1 The CMySimplePCI Example.
The CMySimplePCI example overloads CSimplePCI to create a class which can be used to communicate with
NextMove PCI under Windows 9X and Windows NT using the CSimplePCI interface. It is laid out in such a
way that the Windows specific code can easily be replaced with code specific to another operating system.
5.3.2 Functions Required by the Overloaded Class.
The CMySimplePCI class declaration is as follows. It shows all the functions required.
#include "simplepci.h"
class CMySimplePCI : public CSimplePCI{
public:
/*------------------------------------------------------------------*/
/* START : These functions MUST be defined. */
/*------------------------------------------------------------------*/
CMySimplePCI ( int nNode, int nCard );
__int16 doDeviceClose ( void );
__int16 getDeviceOpen ( BOOL *bOpen );
__int16 doDeviceOpen ( void );
__int16 getLong ( __int16 nAddress, __int32 FAR *lplValue );
protected:
__int16 InternalSetLong ( __int16 nAddress, __int32 lLong );
__int16 PLXRead ( __int16 nRegister, __int32 *plValue );
__int16 PLXWrite ( __int16 nRegister, __int32 lValue );
/*------------------------------------------------------------------*/
/* END : These functions MUST be defined. */
/*------------------------------------------------------------------*/
/*------------------------------------------------------------------*/
/* START : Replace this. */
/*------------------------------------------------------------------*/
protected:
bool m_bWinNT; // true : WinNT, false Win9X
HANDLE m_hndFile; // Handle to the device driver.
/*------------------------------------------------------------------*/
/* END : Replace this. */
/*------------------------------------------------------------------*/
};
The header shows how the code in the CMySimplePCI example is laid out. There are blocks marked with
/*================================================================*/
/* START : Replace this */
/*================================================================*/