using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
namespace PACNET
{
///
public class PWM
{
////DCON_PWM_API short pac_SetPWMFreqDuty(HANDLE port, int slot, short chIndex, unsigned long freq , float duty);
//[DllImport("PACSDK_PWM.dll", EntryPoint = "")]
//public static extern short pac_SetPWMFreqDuty(IntPtr port, int slot, short chIndex, ulong freq, float duty);
////DCON_PWM_API short pac_GetPWMFreqDuty(HANDLE port, int slot, short chIndex, unsigned long *freq , float *duty);
//[DllImport("PACSDK_PWM.dll", EntryPoint = "")]
//public static extern short pac_GetPWMFreqDuty(IntPtr port, int slot, short chIndex, ref ulong freq, ref float duty);
//DCON_PWM_API short pac_SetPWMDuty(HANDLE port,int slot, short chIndex,float duty);
///
[DllImport("PACSDK_PWM.dll", EntryPoint = "pac_SetPWMDuty")]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool SetPWMDuty(IntPtr port, int slot, short chIndex, float duty);
//DCON_PWM_API short pac_GetPWMDuty(HANDLE port,int slot, short chIndex,float *duty);
///
[DllImport("PACSDK_PWM.dll", EntryPoint = "pac_GetPWMDuty")]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool GetPWMDuty(IntPtr port, int slot, Int16 chIndex, ref float duty);
//DCON_PWM_API short pac_SetPWMFrequency(HANDLE port,int slot,short chIndex,unsigned long freq);
///
[DllImport("PACSDK_PWM.dll", EntryPoint = "pac_SetPWMFrequency")]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool SetPWMFrequency(IntPtr port, int slot, short chIndex, UInt32 freq);
//DCON_PWM_API short pac_GetPWMFrequency(HANDLE port,int slot,short chIndex,unsigned long *freq);
///
[DllImport("PACSDK_PWM.dll", EntryPoint = "pac_GetPWMFrequency")]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool GetPWMFrequency(IntPtr port, int slot, short chIndex, ref UInt32 freq);
//DCON_PWM_API short pac_SetPWMMode(HANDLE port, int slot, short chIndex, long mode);
///
[DllImport("PACSDK_PWM.dll", EntryPoint = "pac_SetPWMMode")]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool SetPWMMode(IntPtr port, int slot, short chIndex, Int32 mode);
//DCON_PWM_API short pac_GetPWMMode(HANDLE port, int slot, short chIndex, long *mode);
//// Mode: 1 continue mode, 0 pulse count mode
///
[DllImport("PACSDK_PWM.dll", EntryPoint = "pac_GetPWMMode")]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool GetPWMMode(IntPtr port, int slot, short chIndex, ref Int32 mode);
//DCON_PWM_API short pac_SetPWMDITriggerConfig(HANDLE port, int slot, short chIndex, short config);
///
[DllImport("PACSDK_PWM.dll", EntryPoint = "pac_SetPWMDITriggerConfig")]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool SetPWMDITriggerConfig(IntPtr port, int slot, short chIndex, short config);
//DCON_PWM_API short pac_GetPWMDITriggerConfig(HANDLE port, int slot, short chIndex, short *config);
///
[DllImport("PACSDK_PWM.dll", EntryPoint = "pac_GetPWMDITriggerConfig")]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool GetPWMDITriggerConfig(IntPtr port, int slot, short chIndex, ref short config);
//DCON_PWM_API short pac_SetPWMStart(HANDLE port, int slot, short enStatus);
///
[DllImport("PACSDK_PWM.dll", EntryPoint = "pac_SetPWMStart")]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool SetPWMStart(IntPtr port, int slot, short enStatus);
//DCON_PWM_API short pac_SetPWMSynChannel(HANDLE port, int slot, short chIndex, short enStatus);
///
[DllImport("PACSDK_PWM.dll", EntryPoint = "pac_SetPWMSynChannel")]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool SetPWMSynChannel(IntPtr port, int slot, short chIndex, short enStatus);
//DCON_PWM_API short pac_GetPWMSynChannel(HANDLE port, int slot, short chIndex, short *enStatus);
///
[DllImport("PACSDK_PWM.dll", EntryPoint = "pac_GetPWMSynChannel")]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool GetPWMSynChannel(IntPtr port, int slot, short chIndex, ref short enStatus);
//DCON_PWM_API short pac_SyncPWMStart(HANDLE port, int slot, short enStatus);
///
[DllImport("PACSDK_PWM.dll", EntryPoint = "pac_SyncPWMStart")]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool SyncPWMStart(IntPtr port, int slot, short enStatus);
//DCON_PWM_API short pac_SavePWMConfig(HANDLE port, int slot);
///
[DllImport("PACSDK_PWM.dll", EntryPoint = "pac_SavePWMConfig")]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool SavePWMConfig(IntPtr port, int slot);
//DCON_PWM_API short pac_GetPWMDIOStatus(HANDLE port, int slot, unsigned char pwmBitArr[], unsigned char diBitArr[]);
///
[DllImport("PACSDK_PWM.dll", EntryPoint = "pac_GetPWMDIOStatus")]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool GetPWMDIOStatus(IntPtr port, int slot, byte[] pwmBitArr, byte[] diBitArr);
//DCON_PWM_API short pac_SetPWMPulseCount(HANDLE port,int slot,short chIndex,long cnt);
///
[DllImport("PACSDK_PWM.dll", EntryPoint = "pac_SetPWMPulseCount")]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool SetPWMPulseCount(IntPtr port, int slot, short chIndex, Int32 cnt);
//DCON_PWM_API short pac_GetPWMPulseCount(HANDLE port,int slot,short chIndex,long *cnt);
///
[DllImport("PACSDK_PWM.dll", EntryPoint = "pac_GetPWMPulseCount")]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool GetPWMPulseCount(IntPtr port, int slot, short chIndex, ref Int32 cnt);
}
}