Speeduino
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
interrupt_t Struct Reference

This structure represents a trigger interrupt. More...

#include <decoder_t.h>

Collaboration diagram for interrupt_t:
Collaboration graph
[legend]

Public Types

using callback_t = void(*)(void)
 

Public Member Functions

 interrupt_t ()=default
 
 interrupt_t (callback_t _callback, uint8_t _edge)
 
uint8_t attach (uint8_t pin)
 Attach the interrupt to a pin.
 
void detach (uint8_t pin)
 Detach the interrupt from a pin.
 
bool isTriggered (void) const
 Does the pin state match the edge setting?
 
bool isValid (void) const
 Is the interrupt configured correctly?
 
bool isPinHigh (void) const
 

Public Attributes

callback_t callback = nullptr
 The callback function to be called on interrupt.
 
uint8_t edge = TRIGGER_EDGE_NONE
 The edge type for the interrupt. E.g. RISING, FALLING, CHANGE.
 
boardInputPin_t _pin
 

Detailed Description

This structure represents a trigger interrupt.

Member Typedef Documentation

◆ callback_t

Constructor & Destructor Documentation

◆ interrupt_t() [1/2]

interrupt_t::interrupt_t ( )
default

◆ interrupt_t() [2/2]

interrupt_t::interrupt_t ( callback_t  _callback,
uint8_t  _edge 
)
inline

Member Function Documentation

◆ attach()

uint8_t interrupt_t::attach ( uint8_t  pin)

Attach the interrupt to a pin.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ detach()

void interrupt_t::detach ( uint8_t  pin)

Detach the interrupt from a pin.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isPinHigh()

bool interrupt_t::isPinHigh ( void  ) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isTriggered()

bool interrupt_t::isTriggered ( void  ) const

Does the pin state match the edge setting?

Note
Will always return true for the CHANGE trigger edge
Here is the call graph for this function:

◆ isValid()

bool interrupt_t::isValid ( void  ) const
inline

Is the interrupt configured correctly?

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ _pin

boardInputPin_t interrupt_t::_pin

◆ callback

callback_t interrupt_t::callback = nullptr

The callback function to be called on interrupt.

◆ edge

uint8_t interrupt_t::edge = TRIGGER_EDGE_NONE

The edge type for the interrupt. E.g. RISING, FALLING, CHANGE.


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