HWA
Bare metal programming with style
Class _pxa: pin change interrupt controller

A class _pxa object is a pin change interrupt controller.

It is used in:

Interrupts

Class _pxa objects can trigger the following IRQs as soon as the state of one of its monitored pins changes:

Actions


enable, disable, turn select which pins are monitored (one or several at once):

hw|hwa( enable, pcic0, (porta,0) );
hw|hwa( disable, pcic0, (porta,0) );
hw|hwa( turn, pcic0, (porta,0), on | off );

FIXME: object should be '(pcic0,(porta,0))'

Status

The pin change IRQ flag and the enable bit can be accessed through interrupt-related instructions:

if ( hw( read, (pcic0,irq) ) ) { // Read pin change flag
hw( clear, (pcic0,irq) ); // Clear pin change flag
hw( disable, (pcic0,irq) ); // Disable pin change IRQ
}

Registers

Hardware registers:

Logical registers:

hwa
#define hwa(...)
hwa( action, object [,...] ) stores an action for an object into a HWA context.
Definition: hwa_macros.h:552
hw
#define hw(...)
hw( action, object [,...] ) executes an action immediately on an object.
Definition: hwa_macros.h:523