Skip to content

Latest commit

 

History

History
237 lines (183 loc) · 8.42 KB

ni-pwm-ioctl_pwm_pin_set_active_duty_cycle_percentage.md

File metadata and controls

237 lines (183 loc) · 8.42 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NI:pwm.IOCTL_PWM_PIN_SET_ACTIVE_DUTY_CYCLE_PERCENTAGE
IOCTL_PWM_PIN_SET_ACTIVE_DUTY_CYCLE_PERCENTAGE (pwm.h)
Set a desired duty cycle percentage value for the controller pin or channel. The control code specifies the percentage as a PWM_PIN_SET_ACTIVE_DUTY_CYCLE_PERCENTAGE_INPUT structure.
IOCTL_PWM_PIN_SET_ACTIVE_DUTY_CYCLE_PERCENTAGE
IOCTL_PWM_PIN_SET_ACTIVE_DUTY_CYCLE_PERCENTAGE control
IOCTL_PWM_PIN_SET_ACTIVE_DUTY_CYCLE_PERCENTAGE control code
base.ioctl_pwm_pin_set_active_duty_cycle_percentage
pwm/IOCTL_PWM_PIN_SET_ACTIVE_DUTY_CYCLE_PERCENTAGE
base\ioctl_pwm_pin_set_active_duty_cycle_percentage.htm
base
A6B29913-5F91-46BD-8B96-DB00B7B1D3FF
12/05/2018
IOCTL_PWM_PIN_SET_ACTIVE_DUTY_CYCLE_PERCENTAGE, IOCTL_PWM_PIN_SET_ACTIVE_DUTY_CYCLE_PERCENTAGE control, IOCTL_PWM_PIN_SET_ACTIVE_DUTY_CYCLE_PERCENTAGE control code, base.ioctl_pwm_pin_set_active_duty_cycle_percentage, pwm/IOCTL_PWM_PIN_SET_ACTIVE_DUTY_CYCLE_PERCENTAGE
pwm.h
Pwm.h
Windows
Windows 10 [desktop apps only]
Windows Server 2016 [desktop apps only]
Windows
19H1
IOCTL_PWM_PIN_SET_ACTIVE_DUTY_CYCLE_PERCENTAGE
pwm/IOCTL_PWM_PIN_SET_ACTIVE_DUTY_CYCLE_PERCENTAGE
c++
APIRef
kbSyntax
HeaderDef
Pwm.h
IOCTL_PWM_PIN_SET_ACTIVE_DUTY_CYCLE_PERCENTAGE

IOCTL_PWM_PIN_SET_ACTIVE_DUTY_CYCLE_PERCENTAGE IOCTL

-description

Set a desired duty cycle percentage value for the controller pin or channel. The control code specifies the percentage as a PWM_PIN_SET_ACTIVE_DUTY_CYCLE_PERCENTAGE_INPUT structure.

-ioctlparameters

-input-buffer

A pointer to a buffer that contains a PWM_PIN_SET_ACTIVE_DUTY_CYCLE_PERCENTAGE_INPUT struct. This represents the desired duty cycle percentage for the PWM controller.

-input-buffer-length

The size of the input buffer, in bytes.

-output-buffer

Not used with this operation; set to NULL.

-output-buffer-length

Not used with this operation; set to zero.

-in-out-buffer

-inout-buffer-length

-status-block

If the operation completes successfully, DeviceIoControl returns a nonzero value.

If the operation fails or is pending, DeviceIoControl returns zero. To get extended error information, call GetLastError.

-remarks

To perform this operation, call the DeviceIoControl function with the following parameters.

BOOL 
   WINAPI 
   DeviceIoControl( (HANDLE)       hDevice,         // handle to device
                    (DWORD)        IOCTL_PWM_PIN_SET_ACTIVE_DUTY_CYCLE_PERCENTAGE, // dwIoControlCode(LPDWORD)      lpInBuffer,      // input buffer
                    (DWORD)        nInBufferSize,   // size of input buffer
                    (LPDWORD)      NULL,      // output buffer
                    (DWORD)        0,  // size of output buffer
                    (LPDWORD)      lpBytesReturned, // number of bytes returned
                    (LPOVERLAPPED) lpOverlapped );  // OVERLAPPED structure
Parameters Description
hDevice [in] A handle to the device. To obtain a device handle, call the CreateFile function.
dwIoControlCode [in] The control code for the operation. Use IOCTL_PWM_PIN_SET_ACTIVE_DUTY_CYCLE_PERCENTAGE for this operation.
lpInBuffer A pointer to a buffer that contains a PWM_PIN_SET_ACTIVE_DUTY_CYCLE_PERCENTAGE_INPUT struct. This represents the desired duty cycle percentage for the PWM controller.
nInBufferSize [in] The size of the input buffer, in bytes.
lpOutBuffer [out] Not used with this operation; set to NULL.
nOutBufferSize [in] Not used with this operation; set to zero.
lpBytesReturned [out] LPDWORD

A pointer to a variable that receives the size of the data stored in the output buffer, in bytes.

If the output buffer is too small, the call fails, GetLastError returns ERROR_INSUFFICIENT_BUFFER, and lpBytesReturned is zero.

If lpOverlapped is NULL, lpBytesReturned cannot be NULL. Even when an operation returns no output data and lpOutBuffer is NULL, DeviceIoControl makes use of lpBytesReturned. After such an operation, the value of lpBytesReturned is meaningless.

If lpOverlapped is not NULL, lpBytesReturned can be NULL. If this parameter is not NULL and the operation returns data, lpBytesReturned is meaningless until the overlapped operation has completed. To retrieve the number of bytes returned, call GetOverlappedResult. If the hDevice parameter is associated with an I/O completion port, you can retrieve the number of bytes returned by calling GetQueuedCompletionStatus.

lpOverlapped [in] LPOVERLAPPED

A pointer to an OVERLAPPED structure.

If hDevice was opened without specifying FILE_FLAG_OVERLAPPED, lpOverlapped is ignored.

If hDevice was opened with the FILE_FLAG_OVERLAPPED flag, the operation is performed as an overlapped (asynchronous) operation. In this case, lpOverlapped must point to a valid OVERLAPPED structure that contains a handle to an event object. Otherwise, the function fails in unpredictable ways.

For overlapped operations, DeviceIoControl returns immediately, and the event object is signaled when the operation has been completed. Otherwise, the function does not return until the operation has been completed or an error occurs.

-see-also

DeviceIoControl