SPI library on AVR using interrupt masking abstraction