HAPI Compatibility: Works with new Check/Apply/ApplyPack API (2026-Q2)
HAPI pin/port API terminals. Hardware implementations are in OneChip. Bit selection is in OneBit.
These are the outermost (user-facing) layer in the HAPI chain. All methods are silent stubs; hardware components below provide the real implementations.
static U get() // read port value (port-width U)
static void act() // ISR propagation (silent)staticvoidon() // set pin high (maskless; Mask<> below provides the mask)
static void off() // set pin low
static void put(U v) // write full port value
static void act()static U get()
static void on()
static void off()
static void put(U v)
static void act()AvrInPin = InPin<unsignedchar> // AVR 8-bit ports
AvrOutPin = OutPin<unsignedchar>
AvrIOPin = IOPin<unsignedchar>
Stm32InPin = InPin<unsignedint> // STM32 32-bit ports
Stm32OutPin = OutPin<unsignedint>
Stm32IOPin = IOPin<unsignedint>Terminal (InPin/OutPin/IOPin) ← outermost, user API
oneBit::Mask<Pins<N>> ← bit selection; provides maskBits()
HwPort (from OneChip) ← register access: get/set/rawSet/rawClear
on()/off() never take a mask argument — the mask is baked in by oneBit::Mask<> below.
Idiomatic use is a single pin (Pins<5>); multi-bit masks (Pins<4,5,6,7>) work too — on() sets all selected bits.
put()/get() operate at full port width (U).
#include<onePin/onePin.h>
#include<chips/avr/avrPort.h>
#include<OneBit.h>usingnamespaceonePin;usingnamespacehw::avr;usingnamespaceoneBit;using Led = APIOf<AvrOutPin, Mask<Pins<5>>, chip::PortB>;
Led led;
led.on(); // PB5 high
led.off(); // PB5 low
led.put(0xFF); // full port high