// MMCControl.h: interface for the CMMCControl class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_MMCCONTROL_H__F675B1BE_14BE_4DE6_B01D_0F5127463D88__INCLUDED_)
#define AFX_MMCCONTROL_H__F675B1BE_14BE_4DE6_B01D_0F5127463D88__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


typedef void (*F1)( int no, WORD iocc, int data ); // OutW_N
typedef WORD (*F2)( int no, WORD iocc ); // InW_N
typedef BOOL (*F3)( void ); // CloseCard_all
typedef HANDLE (*F4)( int no, void (WINAPI *isr)(void), int base_addr, int size, int irq); // OpenCard_N
typedef char* (*F5)( void ); // ValidString

#define MAX_CARD	16

class CMMCControl  
{
public:
	static USHORT m_rr[4][8];
	static int m_no;

	void readRR(int no, int axis);

	static F1 _OutW_N;
	static F2 _InW_N;
	static F3 _CloseCard_all;
	static F4 _OpenCard_N;
	static F5 _ValidString;

public:
	static int  BoardOk[MAX_CARD];
	static int  int_flg[MAX_CARD];
	static int  index[MAX_CARD];

	static void wreg1_N( int no, int axis, int wdata );
	static void wreg2_N( int no, int axis, int wdata );
	static void wreg3_N( int no, int axis, int wdata );
	static void command_N( int no, int axis, int cmd );
	static void range_N( int no, int axis, long wdata );
	static void acac_N( int no, int axis, int wdata );
	static void acc_N( int no, int axis, int wdata );
	static void dec_N( int no, int axis, int wdata );
	static void startv_N( int no, int axis, int wdata );
	static void speed_N( int no, int axis, int wdata );
	static void pulse_N( int no, int axis, long wdata );
	static void decp_N( int no, int axis, long wdata );
	static void center_N( int no, int axis, long wdata );
	static void lp_N( int no, int axis, long wdata );
	static void ep_N( int no, int axis, long wdata );
	static void compp_N( int no, int axis, long wdata );
	static void compm_N( int no, int axis, long wdata );
	static void accofst_N( int no, int axis, long wdata );
	static long readlp_N( int no, int axis );
	static long readep_N( int no, int axis );
	static void wait_N( int no, int axis );
	static void next_wait_N( int no );
	static void bp_wait_N( int no );
	static int  init();
	static void close();

public:
	static void outwN(int no, WORD iocc, WORD data);
	static WORD inwN(int no,WORD iocc);
	CMMCControl();
	virtual ~CMMCControl();
};

#endif // !defined(AFX_MMCCONTROL_H__F675B1BE_14BE_4DE6_B01D_0F5127463D88__INCLUDED_)
