Exemple #1
0
        public AnalogTrigger(DutyCycle dutyCycle)
        {
            m_dutyCycle = dutyCycle ?? throw new ArgumentNullException(nameof(dutyCycle));

            m_port = Hal.AnalogTriggerLowLevel.InitializeDutyCycle(dutyCycle.m_handle);

            var index = Index;

            UsageReporting.Report(ResourceType.AnalogTrigger, index + 1);
            SendableRegistry.Instance.AddLW(this, "AnalogTrigger", index);
        }
        public DutyCycleEncoder(DutyCycle dutyCycle)
        {
            m_dutyCycle     = dutyCycle;
            m_analogTrigger = new AnalogTrigger(m_dutyCycle);
            m_counter       = new UpDownCounter();

            m_simDevice = SimDevice.Create("DutyCycleEncoder", m_dutyCycle.FPGAIndex);

            if (m_simDevice)
            {
            }

            m_analogTrigger.SetLimitsDutyCycle(0.25, 0.75);
            m_counter.UpSource   = m_analogTrigger.CreateOutput(AnalogTriggerType.kRisingPulse);
            m_counter.DownSource = m_analogTrigger.CreateOutput(AnalogTriggerType.kFallingPulse);

            SendableRegistry.Instance.AddLW(this, "DutyCycle Encoder", m_dutyCycle.SourceChannel);
        }