Implements checking for alarm state and alarm interrupt state, turning alarm off, clearing alarm, enabling and disabling alarm interrupt.