Вы здесь

DlnPwmEnable() Function

The DlnPwmEnable() function activates the corresponding PWM port of your DLN-series adapter.

Syntax
C/C++
DLN_RESULT DlnPwmEnable(
    HDLN handle, 
    uint8_t port,
    uint16_t* conflict
);
Parameters
handle

A handle to the DLN-series adapter.

port

A number of the PWM port.

conflict

A pointer to an unsigned 16-bit integer that receives the number of the conflicted pin, if any.A conflict arises if a pin is already assigned to another module of the DLN-series adapter and cannot be used for the PWM module. To fix this, check which module uses the pin (call the DlnGetPinCfg()function), disconnect the pin from that module and call the DlnPwmEnable() function once again. In case there still are conflicted pins, only the number of the next one will be returned.

Return Value
DLN_RES_SUCCESS (0x00)

The function successfully activated the PWM port.

DLN_RES_INVALID_PORT_NUMBER (0xA8)

The port number is not valid. Use the DlnPwmGetPortCount() function to find the maximum possible port number.

DLN_RES_PIN_IN_USE (0xA5)

The port cannot be activated as the PWM port because one or more pins of the port are assigned to another module. The conflict parameter contains the number of a conflicting pin.

Remarks

The DlnPwmEnable() function is defined in the dln_pwm.h file.

Языки

Вход на сайт