simulavr  1.1.0
ExternalIRQSingle Class Reference

External interrupt (INT0, INT1...) on a single pin, one and 2 bit configuration. More...

#include <externalirq.h>

Inheritance diagram for ExternalIRQSingle:

Public Member Functions

 ExternalIRQSingle (IOSpecialReg *ctrl, int ctrlOffset, int ctrlBits, Pin *pin, bool _8515mode=false)
 
void ChangeMode (unsigned char m)
 Handle change of control register. More...
 
bool fireAgain (void)
 does the interrupt source fire again? (for interrupt on level) More...
 
bool mustSetFlagOnFire (void)
 does fire interrupt set the interrupt flag? (level interrupt does this not!) More...
 
void PinStateHasChanged (Pin *pin)
 
- Public Member Functions inherited from ExternalIRQ
 ExternalIRQ (IOSpecialReg *ctrl, int ctrlOffset, int ctrlBits)
 
virtual unsigned char set_from_reg (const IOSpecialReg *reg, unsigned char nv)
 
virtual unsigned char get_from_client (const IOSpecialReg *reg, unsigned char v)
 
- Public Member Functions inherited from IOSpecialRegClient
virtual ~IOSpecialRegClient ()
 
- Public Member Functions inherited from HasPinNotifyFunction
virtual ~HasPinNotifyFunction ()
 

Protected Types

enum  { MODE_LEVEL_LOW = 0, MODE_EDGE_ALL = 1, MODE_EDGE_FALL = 2, MODE_EDGE_RISE = 3 }
 

Protected Attributes

bool state
 saved state from pin More...
 
bool twoBitMode
 IRQ is controlled by 2 mode bits. More...
 
bool mode8515
 at90s8515 don't support MODE_EDGE_ALL More...
 
- Protected Attributes inherited from ExternalIRQ
int handlerIndex
 my own index on handler instance More...
 
ExternalIRQHandlerhandler
 reference to IRQ handler More...
 
int bitshift
 how many bits to shift to get mode from control register More...
 
unsigned char mask
 mask for extract mode from control register More...
 
unsigned char mode
 control mode from control register More...
 

Additional Inherited Members

- Protected Member Functions inherited from ExternalIRQ
void setHandlerIndex (ExternalIRQHandler *h, int idx)
 register handler and index for signaling interrupt More...
 
void fireInterrupt (void)
 fire a interrupt More...
 
virtual void ResetMode (void)
 Reset mode. More...
 

Detailed Description

External interrupt (INT0, INT1...) on a single pin, one and 2 bit configuration.

Definition at line 110 of file externalirq.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
MODE_LEVEL_LOW 

Fire interrupt on low level.

MODE_EDGE_ALL 

Fire interrupt on any logical change.

MODE_EDGE_FALL 

Fire interrupt on falling edge.

MODE_EDGE_RISE 

Fire interrupt on rising edge.

Definition at line 117 of file externalirq.h.

Constructor & Destructor Documentation

◆ ExternalIRQSingle()

ExternalIRQSingle::ExternalIRQSingle ( IOSpecialReg ctrl,
int  ctrlOffset,
int  ctrlBits,
Pin pin,
bool  _8515mode = false 
)

Member Function Documentation

◆ ChangeMode()

void ExternalIRQSingle::ChangeMode ( unsigned char  m)
virtual

Handle change of control register.

Reimplemented from ExternalIRQ.

Definition at line 203 of file externalirq.cpp.

References avr_warning, ExternalIRQ::mode, mode8515, MODE_EDGE_ALL, MODE_EDGE_FALL, and twoBitMode.

◆ fireAgain()

bool ExternalIRQSingle::fireAgain ( void  )
virtual

does the interrupt source fire again? (for interrupt on level)

Reimplemented from ExternalIRQ.

Definition at line 212 of file externalirq.cpp.

References ExternalIRQ::mode, MODE_LEVEL_LOW, and state.

◆ mustSetFlagOnFire()

bool ExternalIRQSingle::mustSetFlagOnFire ( void  )
virtual

does fire interrupt set the interrupt flag? (level interrupt does this not!)

Reimplemented from ExternalIRQ.

Definition at line 216 of file externalirq.cpp.

References ExternalIRQ::mode, and MODE_LEVEL_LOW.

◆ PinStateHasChanged()

void ExternalIRQSingle::PinStateHasChanged ( Pin pin)
virtual

Member Data Documentation

◆ mode8515

bool ExternalIRQSingle::mode8515
protected

at90s8515 don't support MODE_EDGE_ALL

Definition at line 115 of file externalirq.h.

Referenced by ChangeMode(), ExternalIRQSingle(), and PinStateHasChanged().

◆ state

bool ExternalIRQSingle::state
protected

saved state from pin

Definition at line 113 of file externalirq.h.

Referenced by ExternalIRQSingle(), fireAgain(), and PinStateHasChanged().

◆ twoBitMode

bool ExternalIRQSingle::twoBitMode
protected

IRQ is controlled by 2 mode bits.

Definition at line 114 of file externalirq.h.

Referenced by ChangeMode(), and ExternalIRQSingle().


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