/**********************/
/*                    */
/*  8090 head file    */
/*                    */
/**********************/
/*
Ver 1.0.1 [20,May,2003]
    This version is not compatiable to 
    version 1.0.0 (in CD:\Napdos\8000\motion\8090\*.*). 
    
    Remove function 
        i8090_REGISTRATION
        
    Modify function
        i8090_INIT_CARD

    Modify constant definations
        X_axis,Y_axis,Z_axis
        
    Remove constant definations
        YES,NO,ON,OFF
*/                             

#define X_axis          0
#define Y_axis          1
#define Z_axis          2

// Axis mode, used to initial 8090
#define ENC_QUADRANT    0x00
#define ENC_CW_CCW      0x10
#define ENC_PULSE_DIR   0x20

//-------------- subroutines --------------------------------------- 
int i8090_INIT_CARD(unsigned char slot,
                    unsigned char x_mode,
                    unsigned char y_mode,
                    unsigned char z_mode);
/*
    slot: 0~3 or 0~7
    x_mode,y_mode,z_mode: ENC_QUADRANT(0x00), 
                          ENC_CW_CCW(0x10) or 
                          ENC_PULSE_DIR(0x20)
    
    Return:  0 ==> ok
            -1 ==> mode of X     axis error
            -2 ==> mode of   Y   axis error
            -3 ==> mode of X,Y   axis error
            -4 ==> mode of     Z axis error
            -5 ==> mode of X,  Z axis error
            -6 ==> mode of   Y,Z axis error
            -7 ==> mode 0f X,Y,Z axis error
*/        
			               
unsigned int i8090_GET_ENCODER(unsigned char slot, unsigned char axis);
/*
    slot: 0~3 or 0~7
    axis: 0~2
    
    Return: encoder value (0 ==> 65535 ==> 0 ==> ...) 
*/        

void i8090_RESET_ENCODER(unsigned char slot, unsigned char axis);
/*
    slot: 0~3 or 0~7
    axis: 0~2
*/    

unsigned char i8090_GET_INDEX(unsigned char slot);
/*
    slot: 0~3 or 0~7
    
    Return  Bit0 ==> X axis
            Bit1 ==> Y axis
            Bit2 ==> Z axis
*/            

//-------------- 32 bits encoder ----------------------------------- 
void i8090_ENCODER32_ISR(unsigned char slot);
void i8090_RESET_ENCODER32(unsigned char slot, unsigned char axis);
long i8090_GET_ENCODER32(unsigned char slot, unsigned char axis);    

