theCore C++ embedded framework

External interrupt manager class. More...

#include </home/travis/build/forGGe/theCore/platform/tm4c/export/platform/exti_manager.hpp>

Inheritance diagram for ecl::exti_manager:

Data Structures

class  handler
 External interrupt handler. More...
 

Public Types

enum  trigger { trigger::rising, trigger::falling, trigger::both }
 EXTI trigger. More...
 
using callback = void(*)(void *)
 Useful alias. More...
 
using callback = void(*)(void *)
 Useful alias. More...
 
using trigger = gpio_hw::int_source
 EXTI trigger. More...
 

Public Member Functions

 exti_manager ()=delete
 Construction isn't allowed. More...
 
 ~exti_manager ()=delete
 Destruction isn't allowed. More...
 
 exti_manager ()=delete
 Construction isn't allowed. More...
 
 ~exti_manager ()=delete
 Destruction isn't allowed. More...
 

Static Public Member Functions

static void init ()
 Initializes EXTI manager. More...
 
template<typename Gpio >
static void subscribe (handler &h, trigger t)
 Subscribes to event on the given GPIO. More...
 
static void unsubscribe (handler &h)
 Unsubscribes handler from any event. More...
 
static void mask (handler &h)
 Masks (disables) pending EXTI request. More...
 
static void unmask (handler &h)
 Unmasks (enables) pending EXTI request. More...
 
static void init ()
 Initializes EXTI manager. More...
 
template<typename Gpio >
static void subscribe (handler &h, trigger t)
 Subscribes to event on the given GPIO. More...
 
static void unsubscribe (handler &h)
 Unsubscribes handler from any event. More...
 
static void mask (handler &h)
 Masks (disables) pending EXTI request. More...
 
static void unmask (handler &h)
 Unmasks (enables) pending EXTI request. More...
 

Static Protected Member Functions

template<gpio_hw::port Port>
static void irq_port_handler ()
 Handles event from given port. More...
 

Detailed Description

External interrupt manager class.

Allows users to handle and manage external interrupts.

Note
For now, only GPIO external interrupts are usable.
Only GPIO interrupts are supported.

Member Typedef Documentation

◆ callback [1/2]

using ecl::exti_manager::callback = void (*)(void *)

Useful alias.

◆ callback [2/2]

using ecl::exti_manager::callback = void (*)(void *)

Useful alias.

◆ trigger

Member Enumeration Documentation

◆ trigger

EXTI trigger.

Enumerator
rising 

Trigger on rising edge.

falling 

Trigger on falling edge.

both 

Trigger on both edges.

Constructor & Destructor Documentation

◆ exti_manager() [1/2]

ecl::exti_manager::exti_manager ( )
delete

Construction isn't allowed.

◆ ~exti_manager() [1/2]

ecl::exti_manager::~exti_manager ( )
delete

Destruction isn't allowed.

◆ exti_manager() [2/2]

ecl::exti_manager::exti_manager ( )
delete

Construction isn't allowed.

◆ ~exti_manager() [2/2]

ecl::exti_manager::~exti_manager ( )
delete

Destruction isn't allowed.

Member Function Documentation

◆ init()

static void ecl::exti_manager::init ( )
static

Initializes EXTI manager.

Note
Requires that IRQ manager will be initialized first.
See also
irq_manager

◆ subscribe()

template<typename Gpio >
static void ecl::exti_manager::subscribe ( handler h,
trigger  t 
)
static

Subscribes to event on the given GPIO.

User should retain handler object in the valid state in order to receive any events associated with given EXTI. Upon deletion of the handler object unsubscription will be executed by itself. To start receving events, they must be additionally unmasked via unmask() call.

Precondition
Initialized EXTI manager.
Unused handler.
Warning
If handler was already subscribed to EXTI events then behaviour is undefined.
Postcondition
Handler subscribed for events, but events are masked.
See also
unsubscribe()
unmask()
Parameters
[out]hUnsubscribed handler of a GPIO event.
[in]tTrigger which will produce event.

◆ unsubscribe()

static void ecl::exti_manager::unsubscribe ( handler h)
static

Unsubscribes handler from any event.

Precondition
Initialized EXTI manager.
Previously subscribed handler.
Postcondition
Unsubscribed handler.

It is possible to use the same handler for subscribe() call if it was successfully unsubscribed().

Parameters
[in]hHandler, must be previously subscribed.

◆ mask()

static void ecl::exti_manager::mask ( handler h)
static

Masks (disables) pending EXTI request.

Precondition
Subscribed handler.
Initialized EXTI manager.
Parameters
[in]hPreviously subscribed handler.

◆ unmask()

static void ecl::exti_manager::unmask ( handler h)
static

Unmasks (enables) pending EXTI request.

Precondition
Subscribed handler.
Initialized EXTI manager.
Parameters
[in]hPreviously subscribed handler.

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