semf
semf::Stm32ExternalInterrupt Class Reference

ExternalInterrupt implementation for STM32. More...

#include <stm32externalinterrupt.h>

Inheritance diagram for semf::Stm32ExternalInterrupt:
Inheritance graph
Collaboration diagram for semf::Stm32ExternalInterrupt:
Collaboration graph

Public Types

enum class  ErrorCode : uint8_t { SetConfigLine_HalError = 0 , SetConfigLine_HalBusy , SetConfigLine_HalTimeout }
 
- Public Types inherited from semf::ExternalInterrupt
enum  Trigger { None = 0 , RisingEdge , FallingEdge , RisingAndFallingEdge }
 

Public Member Functions

 Stm32ExternalInterrupt (uint32_t externalInterruptPort, uint32_t externalInterruptPinLine)
 Constructor. More...
 
 Stm32ExternalInterrupt (const Stm32ExternalInterrupt &other)=delete
 
virtual ~Stm32ExternalInterrupt ()=default
 
void isr (uint16_t pin)
 
void setTrigger (Trigger trigger) override
 Sets the trigger condition of an EXTI. More...
 
- Public Member Functions inherited from semf::ExternalInterrupt
virtual ~ExternalInterrupt ()=default
 
virtual void setTrigger (Trigger trigger)=0
 Sets the trigger condition of an EXTI. More...
 
- Public Member Functions inherited from semf::LinkedQueue< T >::Node
virtual ~Node ()=default
 
T * next () const
 Returns a pointer to the next element in a queue. More...
 
void setNext (T *next)
 Sets a pointer to the next element in a list. More...
 
bool isInQueue (LinkedQueue &queue)
 Returns if a node is part of this LinkedQueue. More...
 

Static Public Member Functions

static LinkedQueue< Stm32ExternalInterrupt > * queue ()
 Get the list with all external interrupts. More...
 
static void systemIsr (uint16_t pin)
 

Additional Inherited Members

- Public Attributes inherited from semf::ExternalInterrupt
Signal changed
 
Signal< Errorerror
 

Detailed Description

ExternalInterrupt implementation for STM32.

Definition at line 25 of file stm32externalinterrupt.h.

Member Enumeration Documentation

◆ ErrorCode

enum class semf::Stm32ExternalInterrupt::ErrorCode : uint8_t
strong

Error codes for this class. Error ID identify a unique error() / onError call (excluding transferring).

Enumerator
SetConfigLine_HalError 
SetConfigLine_HalBusy 
SetConfigLine_HalTimeout 

Definition at line 29 of file stm32externalinterrupt.h.

Constructor & Destructor Documentation

◆ Stm32ExternalInterrupt() [1/2]

semf::Stm32ExternalInterrupt::Stm32ExternalInterrupt ( uint32_t  externalInterruptPort,
uint32_t  externalInterruptPinLine 
)
explicit

Constructor.

Parameters
externalInterruptPortPort number.
externalInterruptPinLineInterrupt pin.
See also
EXTI_GPIOSel in stm32f{x}xx_hal_exti.c
EXTI_Line in stm32f{x}xx_hal_exti.c

Definition at line 20 of file stm32externalinterrupt.cpp.

Here is the call graph for this function:

◆ Stm32ExternalInterrupt() [2/2]

semf::Stm32ExternalInterrupt::Stm32ExternalInterrupt ( const Stm32ExternalInterrupt other)
explicitdelete

◆ ~Stm32ExternalInterrupt()

virtual semf::Stm32ExternalInterrupt::~Stm32ExternalInterrupt ( )
virtualdefault

Member Function Documentation

◆ isr()

void semf::Stm32ExternalInterrupt::isr ( uint16_t  pin)

Must call in the interrupt callback from the stm32 hal lib.

Parameters
pinThe parameter from the stm32 HAL callback function.

Definition at line 39 of file stm32externalinterrupt.cpp.

◆ queue()

LinkedQueue< Stm32ExternalInterrupt > * semf::Stm32ExternalInterrupt::queue ( )
static

Get the list with all external interrupts.

Returns
The list with all external interrupts.

Definition at line 27 of file stm32externalinterrupt.cpp.

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

◆ setTrigger()

void semf::Stm32ExternalInterrupt::setTrigger ( Trigger  trigger)
overridevirtual

Sets the trigger condition of an EXTI.

Parameters
triggerTrigger condition to set.
Exceptions
Init_HalErrorIf the ST-HAL returns a hal error.
Init_HalBusyIf the ST-HAL returns a hal busy.
Init_HalTimeoutIf the ST-HAL returns a hal timeout.

Implements semf::ExternalInterrupt.

Definition at line 48 of file stm32externalinterrupt.cpp.

◆ systemIsr()

void semf::Stm32ExternalInterrupt::systemIsr ( uint16_t  pin)
static

Must call in the interrupt callback from the stm32 hal lib.

Parameters
pinThe parameter from the stm32 HAL callback function.

Definition at line 33 of file stm32externalinterrupt.cpp.

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