Class AnalogTrigger

    • Field Detail

      • m_port

        protected int m_port
        Where the analog trigger is attached.
      • m_index

        protected int m_index
      • m_ownsAnalog

        protected boolean m_ownsAnalog
    • Constructor Detail

      • AnalogTrigger

        public AnalogTrigger​(int channel)
        Constructor for an analog trigger given a channel number.
        Parameters:
        channel - the port to use for the analog trigger
      • AnalogTrigger

        public AnalogTrigger​(AnalogInput channel)
        Construct an analog trigger given an analog channel. This should be used in the case of sharing an analog channel between the trigger and an analog input object.
        Parameters:
        channel - the AnalogInput to use for the analog trigger
    • Method Detail

      • setLimitsRaw

        public void setLimitsRaw​(int lower,
                                 int upper)
        Set the upper and lower limits of the analog trigger. The limits are given in ADC codes. If oversampling is used, the units must be scaled appropriately.
        Parameters:
        lower - the lower raw limit
        upper - the upper raw limit
      • setLimitsVoltage

        public void setLimitsVoltage​(double lower,
                                     double upper)
        Set the upper and lower limits of the analog trigger. The limits are given as floating point voltage values.
        Parameters:
        lower - the lower voltage limit
        upper - the upper voltage limit
      • setAveraged

        public void setAveraged​(boolean useAveragedValue)
        Configure the analog trigger to use the averaged vs. raw values. If the value is true, then the averaged value is selected for the analog trigger, otherwise the immediate value is used.
        Parameters:
        useAveragedValue - true to use an averaged value, false otherwise
      • setFiltered

        public void setFiltered​(boolean useFilteredValue)
        Configure the analog trigger to use a filtered value. The analog trigger will operate with a 3 point average rejection filter. This is designed to help with 360 degree pot applications for the period where the pot crosses through zero.
        Parameters:
        useFilteredValue - true to use a filtered value, false otherwise
      • getIndex

        public int getIndex()
        Return the index of the analog trigger. This is the FPGA index of this analog trigger instance.
        Returns:
        The index of the analog trigger.
      • getInWindow

        public boolean getInWindow()
        Return the InWindow output of the analog trigger. True if the analog input is between the upper and lower limits.
        Returns:
        The InWindow output of the analog trigger.
      • getTriggerState

        public boolean getTriggerState()
        Return the TriggerState output of the analog trigger. True if above upper limit. False if below lower limit. If in Hysteresis, maintain previous state.
        Returns:
        The TriggerState output of the analog trigger.
      • createOutput

        public AnalogTriggerOutput createOutput​(AnalogTriggerOutput.AnalogTriggerType type)
        Creates an AnalogTriggerOutput object. Gets an output object that can be used for routing. Caller is responsible for deleting the AnalogTriggerOutput object.
        Parameters:
        type - An enum of the type of output object to create.
        Returns:
        A pointer to a new AnalogTriggerOutput object.
      • initSendable

        public void initSendable​(SendableBuilder builder)
        Description copied from interface: Sendable
        Initializes this Sendable object.
        Parameters:
        builder - sendable builder