Example #1
0
        public void DisablePWM()
        {
            if (pwm == null)
            {
                return;
            }

            pwm.Dispose();
            pwm = null;
        }
Example #2
0
        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);
        }
Example #3
0
        public void DisablePWM()
        {
            if (pwm == null)
            {
                return;
            }

            pwm.Dispose();
            pwm = null;

            gpio[RPiGPIOPin.RPI_GPIO_P1_12].Function = prevFunction;
        }
Example #4
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);
        }