/************************/ /* head file for 8048 */ /************************/ /* Ver 1.0.0 [7,July,2009] by Sean */ #ifdef _8048_EXPORTS #define I8048W_API __declspec(dllexport) #else #define I8048W_API __declspec(dllimport) #endif #define NoError 0 #define ID_ERROR -1 #ifdef __cplusplus extern "C" { #endif I8048W_API short pac_i8048W_GetLibVersion(void); I8048W_API void pac_i8048W_GetLibDate(char libDate[]); I8048W_API int pac_i8048W_Init(int Slot); //slot:(0~3) /* I8048W_API void pac_i8048W_UnFreezeCPU(int Slot); //Send EOI to 8259==>EOI: End of interrupt */ I8048W_API void pac_i8048W_UnFreezeINT(int Slot,int Channel); //Clear Gi and all channels are latched by 8259 I8048W_API void pac_i8048W_InstallISR(int Slot,PAC_CALLBACK_FUNC f,int Priority); I8048W_API int pac_i8048W_Read_RisingEvent(int Slot,int Channel); //Read rising interrupt status I8048W_API int pac_i8048W_Read_FallingEvent(int Slot,int Channel); //Read falling interrupt status I8048W_API DWORD pac_i8048W_Read_RisingEventCount(int Slot,int Channel); I8048W_API DWORD pac_i8048W_Read_FallingEventCount(int Slot,int Channel); I8048W_API DWORD pac_i8048W_Read_FallingEventCount(int Slot,int Channel); I8048W_API void pac_i8048W_Set_RisingReg(int Slot,int Channel,int Enable); //Set Rising enable register I8048W_API void pac_i8048W_Set_FallingReg(int Slot,int Channel,int Enable); //Set falling enable register I8048W_API int pac_i8048W_Read_RisingReg(int Slot,int Channel); //Read rising enable register I8048W_API int pac_i8048W_Read_FallingReg(int Slot,int Channel); //Read falling enable register I8048W_API int pac_i8048W_DI_ALL(int Slot); /* isolated: +---------------------------+--------------+--------------+- |JPn selected isolated input|Digital Input | LED | +---------------------------+--------------+--------------+- |Input is OPEN | High | OFF | +---------------------------+--------------+--------------+ |Input is 3.5 ~ 30V | Low | ON | +---------------------------+--------------+--------------+ |Input is 0 ~ 1V | High | OFF | +---------------------------+--------------+--------------+ TTL: +---------------------------+--------------+--------------+- |JPn selected TTL input |Digital Input | LED | +---------------------------+--------------+--------------+- |Input is OPEN | High | OFF | +---------------------------+--------------+--------------+ |Input is 0 ~ 0.8V | Low | ON | +---------------------------+--------------+--------------+ |Input is 2 ~ 5V | High | OFF | +---------------------------+--------------+--------------+ */ I8048W_API int pac_i8048W_DI_Ch(int Slot,int Channel); //Read single DI channel status #ifdef __cplusplus } #endif