ngscopeclient v0.2.1
Loading...
Searching...
No Matches
CDRTrigger.h
Go to the documentation of this file.
1/***********************************************************************************************************************
2* *
3* libscopehal *
4* *
5* Copyright (c) 2012-2026 Andrew D. Zonenberg and contributors *
6* All rights reserved. *
7* *
8* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
9* following conditions are met: *
10* *
11* * Redistributions of source code must retain the above copyright notice, this list of conditions, and the *
12* following disclaimer. *
13* *
14* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the *
15* following disclaimer in the documentation and/or other materials provided with the distribution. *
16* *
17* * Neither the name of the author nor the names of any contributors may be used to endorse or promote products *
18* derived from this software without specific prior written permission. *
19* *
20* THIS SOFTWARE IS PROVIDED BY THE AUTHORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
21* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL *
22* THE AUTHORS BE HELD LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
23* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR *
24* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
25* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
26* POSSIBILITY OF SUCH DAMAGE. *
27* *
28***********************************************************************************************************************/
29
36#ifndef CDRTrigger_h
37#define CDRTrigger_h
38
43class CDRTrigger : public Trigger
44{
45public:
47 virtual ~CDRTrigger();
48
49 virtual bool ValidateChannel(size_t i, StreamDescriptor stream);
50
57 { m_bitRate.SetIntVal(rate); }
58
61 { return m_bitRate.GetIntVal(); }
62
66
68 sigc::signal<void()> signal_calculateBitRate()
69 { return m_calculateBitRateSignal; }
70
73
75 bool IsCDRLocked();
76
96
106
116
119 { return static_cast<TriggerPosition>(m_position.GetIntVal()); }
120
127 { m_position.SetIntVal(p); }
128
135 { return static_cast<LeCroyEqualizerMode>(m_lecroyEq.GetIntVal()); }
136
144
147 { return static_cast<Polarity>(m_polarity.GetIntVal()); }
148
155 { m_polarity.SetIntVal(mode); }
156
157protected:
158 FilterParameter& m_bitRate;
159 FilterParameter& m_position;
160 FilterParameter& m_lecroyEq;
161 FilterParameter& m_polarity;
162
165};
166
167#endif
168
Definition AcceleratorBuffer.h:204
Base class for triggers involving hardware clock/data recovery pattern matching.
Definition CDRTrigger.h:44
TriggerPosition GetTriggerPosition()
Gets the position of the trigger, relative to the serial bit pattern.
Definition CDRTrigger.h:118
LeCroyEqualizerMode GetEqualizerMode()
Gets the RX equalizer mode.
Definition CDRTrigger.h:134
void SetEqualizerMode(LeCroyEqualizerMode mode)
Sets the RX equalizer mode.
Definition CDRTrigger.h:142
bool IsCDRLocked()
Queries hardware PLL lock status.
Definition CDRTrigger.cpp:127
LeCroyEqualizerMode
RX equalizer settings for LeCroy SDA 8Zi GTX trigger board.
Definition CDRTrigger.h:83
@ LECROY_EQ_LOW
2 dB boost
Definition CDRTrigger.h:88
@ LECROY_EQ_MEDIUM
5 dB boost
Definition CDRTrigger.h:91
@ LECROY_EQ_HIGH
9 dB boost
Definition CDRTrigger.h:94
@ LECROY_EQ_NONE
No equalization.
Definition CDRTrigger.h:85
void CalculateBitRate()
Automatically calculates the bit rate of the incoming signal, if possible.
Definition CDRTrigger.h:64
virtual bool ValidateChannel(size_t i, StreamDescriptor stream)
Check if a stream is allowed to be connected to the given input.
Definition CDRTrigger.cpp:106
bool IsAutomaticBitRateCalculationAvailable()
Checks if automatic bit rate calculation is available.
Definition CDRTrigger.cpp:98
int64_t GetBitRate()
Returns the nominal CDR PLL data rate.
Definition CDRTrigger.h:60
sigc::signal< void()> signal_calculateBitRate()
Signal emitted every time autobaud is requested.
Definition CDRTrigger.h:68
void SetPolarity(Polarity mode)
Gets the polarity inversion.
Definition CDRTrigger.h:154
void SetTriggerPosition(TriggerPosition p)
Sets the position of the trigger, relative to the serial bit pattern.
Definition CDRTrigger.h:126
void SetBitRate(int64_t rate)
Sets the nominal baud rate the PLL should attempt to lock to.
Definition CDRTrigger.h:56
TriggerPosition
Where to position the reported trigger point, relative to the serial bit pattern.
Definition CDRTrigger.h:99
@ POSITION_END
Trigger is reported at the end of the pattern.
Definition CDRTrigger.h:101
@ POSITION_START
Trigger is reported at the start of the pattern.
Definition CDRTrigger.h:104
Polarity GetPolarity()
Gets the polarity inversion.
Definition CDRTrigger.h:146
Polarity
Polarity inversion for the input.
Definition CDRTrigger.h:109
@ POLARITY_INVERTED
Definition CDRTrigger.h:114
@ POLARITY_NORMAL
Definition CDRTrigger.h:111
sigc::signal< void()> m_calculateBitRateSignal
Signal requesting an auto-baud calculation.
Definition CDRTrigger.h:164
A parameter to a filter.
Definition FilterParameter.h:86
void SetIntVal(int64_t i)
Sets the parameter to an integer value.
Definition FilterParameter.cpp:307
int64_t GetIntVal() const
Returns the value of the parameter interpreted as an integer.
Definition FilterParameter.h:119
Generic representation of an oscilloscope, logic analyzer, or spectrum analyzer.
Definition Oscilloscope.h:51
Descriptor for a single stream coming off a channel.
Definition StreamDescriptor.h:47
Abstract base class for oscilloscope / logic analyzer trigger inputs.
Definition Trigger.h:46