ngscopeclient 0.1-dev+51fbda87c
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members

Trigger when a UART sees a certain data pattern. More...

#include <UartTrigger.h>

Inheritance diagram for UartTrigger:
Inheritance graph
[legend]
Collaboration diagram for UartTrigger:
Collaboration graph
[legend]

Public Types

enum  ParityType {
  PARITY_NONE , PARITY_ODD , PARITY_EVEN , PARITY_MARK ,
  PARITY_SPACE
}
 Type of parity to use. More...
 
enum  MatchType { TYPE_DATA , TYPE_PARITY_ERR , TYPE_START , TYPE_STOP }
 What kind of pattern to match. More...
 
enum  Polarity { IDLE_HIGH , IDLE_LOW }
 Polarity of the port. More...
 
- Public Types inherited from SerialTrigger
enum  Radix { RADIX_ASCII , RADIX_HEX , RADIX_BINARY }
 
- Public Types inherited from Trigger
enum  Condition {
  CONDITION_EQUAL , CONDITION_NOT_EQUAL , CONDITION_LESS , CONDITION_LESS_OR_EQUAL ,
  CONDITION_GREATER , CONDITION_GREATER_OR_EQUAL , CONDITION_BETWEEN , CONDITION_NOT_BETWEEN ,
  CONDITION_ANY
}
 Conditions for triggers that perform logical comparisons of values. More...
 
typedef Trigger *(* CreateProcType) (Oscilloscope *)
 
- Public Types inherited from FlowGraphNode
enum  DataLocation { LOC_CPU , LOC_GPU , LOC_DONTCARE }
 
typedef std::map< std::string, FilterParameterParameterMapType
 Short name for a map of strings to parameters.
 

Public Member Functions

 UartTrigger (Oscilloscope *scope)
 Creates a new UART trigger. More...
 
void SetParityType (ParityType type)
 Set the parity for the trigger. More...
 
ParityType GetParityType ()
 Get the currently selected parity mode.
 
void SetMatchType (MatchType type)
 Sets the match mode for the trigger. More...
 
MatchType GetMatchType ()
 Returns the currently selected match mode.
 
void SetPolarity (Polarity type)
 Sets the UART polarity. More...
 
Polarity GetPolarity ()
 Get the current trigger polarity.
 
int64_t GetBitRate ()
 Get the current baud rate.
 
void SetBitRate (int64_t t)
 Sets the baud rate. More...
 
float GetStopBits ()
 Get the length of the stop bit, in UI.
 
void SetStopBits (float n)
 Set the length of the stop bit. More...
 
virtual bool ValidateChannel (size_t i, StreamDescriptor stream) override
 
 TRIGGER_INITPROC (UartTrigger)
 
- Public Member Functions inherited from SerialTrigger
 SerialTrigger (Oscilloscope *scope)
 
void SetCondition (Condition cond)
 
Condition GetCondition ()
 
void SetRadix (Radix rad)
 
Radix GetRadix ()
 
void SetPatterns (std::string p1, std::string p2, bool ignore_p2)
 Converts a pattern from ASCII ternary (0-1-x) to a more display-friendly format.
 
std::string GetPattern1 ()
 
std::string GetPattern2 ()
 
- Public Member Functions inherited from Trigger
 Trigger (Oscilloscope *scope)
 Initialize a new trigger. More...
 
float GetLevel ()
 Get the trigger level.
 
void SetLevel (float level)
 Sets the trigger level. More...
 
OscilloscopeGetScope ()
 Gets the scope this trigger is attached to.
 
virtual std::string GetTriggerDisplayName ()=0
 
virtual YAML::Node SerializeConfiguration (IDTable &table) override
 Serializes this trigger's configuration to a YAML string. More...
 
- Public Member Functions inherited from FlowGraphNode
void DetachInputs ()
 Disconnects all inputs from the node without releasing them. More...
 
size_t GetInputCount ()
 
std::string GetInputName (size_t i)
 
void SetInput (size_t i, StreamDescriptor stream, bool force=false)
 Connects a stream to the input of this node. More...
 
void SetInput (const std::string &name, StreamDescriptor stream, bool force=false)
 
virtual bool ValidateChannel (size_t i, StreamDescriptor stream)
 
StreamDescriptor GetInput (size_t i)
 Gets the descriptor for one of our inputs.
 
FilterParameterGetParameter (std::string s)
 
bool HasParameter (std::string s)
 Checks if we have a parameter with a given name. More...
 
ParameterMapType::iterator GetParamBegin ()
 Returns an iterator to the beginning of our parameter map.
 
ParameterMapType::iterator GetParamEnd ()
 Returns an iterator to the end of our parameter map.
 
size_t GetParamCount ()
 Returns the number of parameter we have.
 
virtual YAML::Node SerializeConfiguration (IDTable &table)
 Serializes this trigger's configuration to a YAML string. More...
 
virtual void LoadParameters (const YAML::Node &node, IDTable &table)
 Load configuration from a save file. More...
 
virtual void LoadInputs (const YAML::Node &node, IDTable &table)
 
bool IsDownstreamOf (std::set< FlowGraphNode * > nodes)
 Determines if this node is downstream of any of the specified other nodes. More...
 
virtual DataLocation GetInputLocation ()
 Gets the desired location of the nodes's input data. More...
 
virtual void Refresh ()
 Evaluates a filter graph node. More...
 
virtual void Refresh (vk::raii::CommandBuffer &cmdBuf, std::shared_ptr< QueueHandle > queue)
 
sigc::signal< void()> signal_parametersChanged ()
 
sigc::signal< void()> signal_inputsChanged ()
 

Static Public Member Functions

static std::string GetTriggerName ()
 Returns the trigger name "UART".
 
- Static Public Member Functions inherited from Trigger
static void DoAddTriggerClass (std::string name, CreateProcType proc)
 Register a new trigger class for dynamic creation. More...
 
static void EnumTriggers (std::vector< std::string > &names)
 Gets a list of all registered trigger types. More...
 
static TriggerCreateTrigger (std::string name, Oscilloscope *scope)
 Creates a new trigger for an oscilloscope. More...
 

Protected Attributes

FilterParameterm_baudrate
 Baud rate.
 
FilterParameterm_parity
 Parity type.
 
FilterParameterm_matchtype
 Match type.
 
FilterParameterm_stoptype
 Stop type.
 
FilterParameterm_polarity
 Polarity.
 
- Protected Attributes inherited from SerialTrigger
std::string m_radixname
 
std::string m_conditionname
 
std::string m_patternname
 
std::string m_pattern2name
 
- Protected Attributes inherited from Trigger
Oscilloscopem_scope
 The scope this trigger is part of.
 
FilterParameterm_level
 "Trigger level" parameter
 
- Protected Attributes inherited from FlowGraphNode
std::vector< std::string > m_signalNames
 Names of signals we take as input.
 
std::vector< StreamDescriptorm_inputs
 The channel (if any) connected to each of our inputs.
 
ParameterMapType m_parameters
 
sigc::signal< void()> m_parametersChangedSignal
 Signal emitted when the set of parameters changes.
 
sigc::signal< void()> m_inputsChangedSignal
 Signal emitted when the set of inputs changes.
 

Additional Inherited Members

- Protected Types inherited from Trigger
typedef std::map< std::string, CreateProcType > CreateMapType
 Helper typedef for m_createprocs.
 
- Protected Member Functions inherited from SerialTrigger
std::string FormatPattern (std::string str)
 Converts a pattern in the current radix back to ASCII ternary.
 
- Protected Member Functions inherited from FlowGraphNode
virtual void OnInputChanged (size_t i)
 Called when a new input is connected to the node. More...
 
WaveformBaseGetInputWaveform (size_t i)
 Gets the waveform attached to the specified input. More...
 
SparseAnalogWaveformGetSparseAnalogInputWaveform (size_t i)
 Gets the analog waveform attached to the specified input.
 
UniformAnalogWaveformGetUniformAnalogInputWaveform (size_t i)
 Gets the analog waveform attached to the specified input.
 
SparseDigitalWaveformGetSparseDigitalInputWaveform (size_t i)
 Gets the digital waveform attached to the specified input.
 
UniformDigitalWaveformGetUniformDigitalInputWaveform (size_t i)
 Gets the digital waveform attached to the specified input.
 
SparseDigitalBusWaveformGetSparseDigitalBusInputWaveform (size_t i)
 Gets the digital bus waveform attached to the specified input.
 
void CreateInput (const std::string &name)
 Creates and names an input signal.
 
std::string GetInputDisplayName (size_t i)
 Gets the display name for one of our inputs. More...
 
- Static Protected Attributes inherited from Trigger
static CreateMapType m_createprocs
 Map of trigger type names to factory methods.
 

Detailed Description

Trigger when a UART sees a certain data pattern.

Member Enumeration Documentation

◆ MatchType

What kind of pattern to match.

Enumerator
TYPE_DATA 

Match on a data byte.

TYPE_PARITY_ERR 

Match on a parity error.

TYPE_START 

Match on a start bit.

TYPE_STOP 

Match on a stop bit.

◆ ParityType

Type of parity to use.

Enumerator
PARITY_NONE 

No parity.

PARITY_ODD 

Odd parity.

PARITY_EVEN 

Even parity.

PARITY_MARK 

Mark parity.

PARITY_SPACE 

Space parity.

◆ Polarity

Polarity of the port.

Enumerator
IDLE_HIGH 

Idle high, pull low to send a bit.

IDLE_LOW 

Idle low, pull high to send a bit.

Constructor & Destructor Documentation

◆ UartTrigger()

UartTrigger::UartTrigger ( Oscilloscope scope)

Creates a new UART trigger.

Parameters
scopeScope to create the trigger for

Member Function Documentation

◆ SetBitRate()

void UartTrigger::SetBitRate ( int64_t  t)
inline

Sets the baud rate.

Parameters
tDesired baud rate

◆ SetMatchType()

void UartTrigger::SetMatchType ( MatchType  type)
inline

Sets the match mode for the trigger.

Parameters
typeType of pattern to look for

◆ SetParityType()

void UartTrigger::SetParityType ( ParityType  type)
inline

Set the parity for the trigger.

Parameters
typeSelected parity mode

◆ SetPolarity()

void UartTrigger::SetPolarity ( Polarity  type)
inline

Sets the UART polarity.

Parameters
typeDesired polarity

◆ SetStopBits()

void UartTrigger::SetStopBits ( float  n)
inline

Set the length of the stop bit.

Parameters
nLength of the stop bit, in UI

◆ ValidateChannel()

bool UartTrigger::ValidateChannel ( size_t  i,
StreamDescriptor  stream 
)
overridevirtual

Reimplemented from FlowGraphNode.


The documentation for this class was generated from the following files: