INT32S DRV_CounterPWMSetting ( PTR_T DeviceHandle, PT_CounterPWMSetting *lpCounterPWMSetting );
On the device indicated by the DeviceHandle, it sets parameters for the pulse width modulation output. After the configuration, call DRV_CounterPWMEnable to start the PWM output.
Some parameters, such as target counter channel (Port), operation period (Period), high period (HiPeriod) of PWM, output pulse count (OutCount) and gate mode (GateMode), are stored in the PT_CounterPWMSetting structure pointed by the lpCounterPWMSetting.
| Name | Direction | Range | Description |
| DeviceHandle | input | default | The pointer retrieved from DRV_DeviceOpen which specifies the target device. |
| lpCounterPWMSetting | input | default | Pointer to the user-prepared structure PT_CounterPWMSetting that stores target counter channel (INT16U Port), operation period (FP32 Period), high pulse (FP32 HiPeriod) of PWM, output pulse count (INT32U OutCount) and gate mode (INT16U GateMode). |
| 1. SUCCESS | Successful. |
| 2. InvalidDriverHandle | The Driverhandle is NULL. |
| 3. InvalidChannel | The target channel is out of range. |
| 4. Other value | Please reference ErrorCodes |