public void EnablePWM(bcm2835PWMClockDivider Clock = bcm2835PWMClockDivider.BCM2835_PWM_CLOCK_DIVIDER_2048,
                              uint Range = 65535, uint Data = 32767, bool MarkSpace = false, bool Enabled = false)
        {
            if (pwm != null)
            {
                pwm.Dispose();
            }

            pwm = new RaspPWM(Clock, Range, Data, MarkSpace, Enabled);
        }
Exemple #2
0
        public RaspPWM(bcm2835PWMClockDivider Clock, uint Range, uint Data, bool MarkSpace, bool Enabled)
        {
            this.Clock = Clock;
            this.Range = range;
            this.Data  = data;

            markSpace = MarkSpace;
            enabled   = Enabled;

            RaspExtern.PWM.bcm2835_pwm_set_mode(0, markSpace, enabled);
        }
Exemple #3
0
        public void EnablePWM(bcm2835PWMClockDivider Clock = bcm2835PWMClockDivider.BCM2835_PWM_CLOCK_DIVIDER_16384,
                              uint Range = 65535, uint Data = 32767, bool MarkSpace = false, bool Enabled = false)
        {
            if (pwm != null)
            {
                pwm.Dispose();
            }

            var pin = gpio[RPiGPIOPin.RPI_GPIO_P1_12];

            if (pwm != null)
            {
                prevFunction = pin.Function;
            }

            pin.Function = GPIOFunctionSelect.Function_ALT5;

            pwm = new RaspPWM(Clock, Range, Data, MarkSpace, Enabled);
        }
Exemple #4
0
 public static extern void bcm2835_pwm_set_clock(bcm2835PWMClockDivider divisor);