Public Sub GetPwmParameters(ByVal channel As Long, ByRef state As Eth32PwmChannel, _ ByRef freq As Single, ByRef duty As Single)
This method is provided for your convenience in working with all of the various PWM settings. It internally calls several of the other API functions to determine the current state of the specified PWM channel and calculate its configuration in more familiar terms (hertz and percentage). This method calculates the frequency and duty cycle of the channel from the PWM base period and the channel's duty period.
channel - Specifies the PWM channel number (0 or 1).
state - Output parameter which will receive the current state of the PWM channel. This will be one of the following values of the Eth32PwmChannel enumerator:
PWM_CHANNEL_DISABLED - The PWM pin is configured as a normal digital I/O pin.
PWM_CHANNEL_NORMAL - The PWM pin is configured as a PWM output. It will be high for the time specified by the duty period and low for the rest of the PWM base period.
PWM_CHANNEL_INVERTED - The PWM pin is configured as a PWM output. It will be low for the time specified by the duty period and high for the rest of the PWM base period.
freq - Output parameter which will receive the current frequency of the PWM channels in Hertz.
duty - Output parameter which will receive the duty cycle of the PWM channel. This may range from 0.00 to 1.00, representing the duty cycle as a percentage.