Arduino PulseWire Transceiver Library
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes
pulsewire::CustomPreamble Class Reference

CustomPreamble: Allows users to define their own preamble by setting expected edges. Useful for custom protocols or testing. More...

#include <Preamble.h>

Inheritance diagram for pulsewire::CustomPreamble:
Inheritance graph
[legend]
Collaboration diagram for pulsewire::CustomPreamble:
Collaboration graph
[legend]

Public Member Functions

 CustomPreamble (const pulsewire::Vector< pulsewire::OutputEdge > &edges)
 
virtual bool begin (uint16_t bitFrequencyHz)
 
void setEdges (const pulsewire::Vector< pulsewire::OutputEdge > &edges)
 
void addEdge (const pulsewire::OutputEdge &edge)
 
void addEdge (bool level, uint32_t pulseUs)
 
void addEdge (bool level, uint16_t pulseCount, uint32_t frequencyHz)
 
void clear ()
 
int getEdges (Vector< OutputEdge > &output) const override
 Returns the expected preamble edges for this protocol.
 
size_t preambleLength () const override
 
void reset ()
 
virtual bool detect (const OutputEdge &edge)
 Detects if the incoming edge matches the expected preamble pattern.
 
bool inRange (uint32_t value, uint32_t target, uint32_t tolerance) const
 

Protected Attributes

pulsewire::Vector< pulsewire::OutputEdge_history
 
pulsewire::Vector< pulsewire::OutputEdge_expected
 

Detailed Description

CustomPreamble: Allows users to define their own preamble by setting expected edges. Useful for custom protocols or testing.

Note
The duration is specified in bit counts and will be converted to microseconds

Definition at line 165 of file Preamble.h.

Constructor & Destructor Documentation

◆ CustomPreamble()

pulsewire::CustomPreamble::CustomPreamble ( const pulsewire::Vector< pulsewire::OutputEdge > &  edges)
inline

Definition at line 168 of file Preamble.h.

Member Function Documentation

◆ addEdge() [1/3]

void pulsewire::CustomPreambleUs::addEdge ( bool  level,
uint16_t  pulseCount,
uint32_t  frequencyHz 
)
inlineinherited

Definition at line 142 of file Preamble.h.

◆ addEdge() [2/3]

void pulsewire::CustomPreambleUs::addEdge ( bool  level,
uint32_t  pulseUs 
)
inlineinherited

Definition at line 138 of file Preamble.h.

◆ addEdge() [3/3]

void pulsewire::CustomPreambleUs::addEdge ( const pulsewire::OutputEdge edge)
inlineinherited

Definition at line 137 of file Preamble.h.

◆ begin()

virtual bool pulsewire::CustomPreamble::begin ( uint16_t  bitFrequencyHz)
inlinevirtual

Reimplemented from pulsewire::Preamble.

Definition at line 171 of file Preamble.h.

◆ clear()

void pulsewire::CustomPreambleUs::clear ( )
inlineinherited

Definition at line 147 of file Preamble.h.

◆ detect()

virtual bool pulsewire::Preamble::detect ( const OutputEdge edge)
inlinevirtualinherited

Detects if the incoming edge matches the expected preamble pattern.

Reimplemented in pulsewire::IRMultiProtocol, and pulsewire::NoPreamble.

Definition at line 52 of file Preamble.h.

◆ getEdges()

int pulsewire::CustomPreambleUs::getEdges ( Vector< OutputEdge > &  output) const
inlineoverridevirtualinherited

Returns the expected preamble edges for this protocol.

Implements pulsewire::Preamble.

Definition at line 148 of file Preamble.h.

◆ inRange()

bool pulsewire::Preamble::inRange ( uint32_t  value,
uint32_t  target,
uint32_t  tolerance 
) const
inlineinherited

Utility function to check if a value is within a specified tolerance range of a target

Definition at line 95 of file Preamble.h.

◆ preambleLength()

size_t pulsewire::CustomPreambleUs::preambleLength ( ) const
inlineoverridevirtualinherited

Implements pulsewire::Preamble.

Definition at line 154 of file Preamble.h.

◆ reset()

void pulsewire::Preamble::reset ( )
inlineinherited

Definition at line 49 of file Preamble.h.

◆ setEdges()

void pulsewire::CustomPreambleUs::setEdges ( const pulsewire::Vector< pulsewire::OutputEdge > &  edges)
inlineinherited

Definition at line 134 of file Preamble.h.

Field Documentation

◆ _expected

pulsewire::Vector<pulsewire::OutputEdge> pulsewire::Preamble::_expected
protectedinherited

Definition at line 102 of file Preamble.h.

◆ _history

pulsewire::Vector<pulsewire::OutputEdge> pulsewire::Preamble::_history
protectedinherited

Definition at line 101 of file Preamble.h.


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