semf
semf::InputCapture Class Referenceabstract

Class for utilizing the input capture from the uC. More...

#include <inputcapture.h>

Inheritance diagram for semf::InputCapture:
Inheritance graph
Collaboration diagram for semf::InputCapture:
Collaboration graph

Public Types

enum  Trigger : uint8_t { RisingEdge = 0 , FallingEdge , RisingAndFallingEdge }
 

Public Member Functions

virtual ~InputCapture ()=default
 
virtual unsigned int ticksPerSecond () const =0
 Returns the the number of ticks per second (Hardware timer frequency). More...
 
virtual void setMaxTicks (unsigned int maxTicks)=0
 Set the maximum number of ticks at which the tick counter will overflow. More...
 
virtual unsigned int maxTicks () const =0
 Get the maximum number of ticks from the timer. More...
 
virtual void start ()=0
 
virtual void stop ()=0
 
virtual unsigned int ticks ()=0
 Get the latest number of ticks (at the last change of the input). More...
 
virtual void setTrigger (Trigger trigger)=0
 Sets the trigger source. More...
 

Public Attributes

Signal dataAvailable
 
Signal< Errorerror
 

Detailed Description

Class for utilizing the input capture from the uC.

Definition at line 23 of file inputcapture.h.

Member Enumeration Documentation

◆ Trigger

Trigger settings of the input capture.

Enumerator
RisingEdge 
FallingEdge 
RisingAndFallingEdge 

Definition at line 27 of file inputcapture.h.

Constructor & Destructor Documentation

◆ ~InputCapture()

virtual semf::InputCapture::~InputCapture ( )
virtualdefault

Member Function Documentation

◆ maxTicks()

virtual unsigned int semf::InputCapture::maxTicks ( ) const
pure virtual

Get the maximum number of ticks from the timer.

Returns
The maximum number of ticks from the timer.

Implemented in semf::Stm32InputCapture.

Here is the caller graph for this function:

◆ setMaxTicks()

virtual void semf::InputCapture::setMaxTicks ( unsigned int  maxTicks)
pure virtual

Set the maximum number of ticks at which the tick counter will overflow.

Parameters
maxTicksNumber of ticks at which the tick counter will overflow.

Implemented in semf::Stm32InputCapture.

◆ setTrigger()

virtual void semf::InputCapture::setTrigger ( Trigger  trigger)
pure virtual

Sets the trigger source.

Parameters
triggerTrigger source.

Implemented in semf::Stm32InputCapture.

◆ start()

virtual void semf::InputCapture::start ( )
pure virtual

Starts capturing the input signals.

Implemented in semf::Stm32InputCapture.

Here is the caller graph for this function:

◆ stop()

virtual void semf::InputCapture::stop ( )
pure virtual

Stops capturing the input signals.

Implemented in semf::Stm32InputCapture.

Here is the caller graph for this function:

◆ ticks()

virtual unsigned int semf::InputCapture::ticks ( )
pure virtual

Get the latest number of ticks (at the last change of the input).

Returns
The timer ticks at the last change of the input.

Implemented in semf::Stm32InputCapture.

Here is the caller graph for this function:

◆ ticksPerSecond()

virtual unsigned int semf::InputCapture::ticksPerSecond ( ) const
pure virtual

Returns the the number of ticks per second (Hardware timer frequency).

Returns
Ticks per second.

Implemented in semf::Stm32InputCapture.

Here is the caller graph for this function:

Member Data Documentation

◆ dataAvailable

Signal semf::InputCapture::dataAvailable

Gets emitted when a new period has been sampled.

Definition at line 67 of file inputcapture.h.

◆ error

Signal<Error> semf::InputCapture::error

Gets emitted when an error occurred.

Definition at line 69 of file inputcapture.h.