Unosquare
    Show / Hide Table of Contents

    Class GpioPinPwmService

    Provides hardware-based PWM services on the pin.

    Inheritance
    Object
    GpioPinServiceBase
    GpioPinPwmService
    Inherited Members
    GpioPinServiceBase.IsAvailable
    GpioPinServiceBase.Pin
    GpioPinServiceBase.ValidateAvailable()
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Unosquare.PiGpio.ManagedModel
    Syntax
    public sealed class GpioPinPwmService : GpioPinServiceBase

    Properties

    Channel

    Gets the PWM channel, 0 or 1. A negative number mans there is no associated PWM channel.

    Declaration
    public int Channel { get; }
    Property Value
    Type Description
    Int32

    Frequency

    Gets the frequency.

    Declaration
    public int Frequency { get; }
    Property Value
    Type Description
    Int32

    Range

    Gets the range of the duty cycle.

    Declaration
    public int Range { get; }
    Property Value
    Type Description
    Int32

    Methods

    ResolveAvailable()

    Resolves the availability of this service for the associated pin.

    Declaration
    protected override bool ResolveAvailable()
    Returns
    Type Description
    Boolean

    True when the service is deemed as available.

    Overrides
    GpioPinServiceBase.ResolveAvailable()

    Start(Int32, Int32)

    Starts PWM hardware pulses. Frequencies above 30MHz are unlikely to work.

    Declaration
    public void Start(int frequency, int dutyCycle)
    Parameters
    Type Name Description
    Int32 frequency

    The frequency. 0 (off) or 1-125000000 (125M).

    Int32 dutyCycle

    0 (off) to 1000000 (1M)(fully on).

    Stop()

    Stops PWM hardware pulses.

    Declaration
    public void Stop()

    See Also

    GpioPinServiceBase

    Comments

    Back to top Copyright © 2017-2019 Unosquare