@classmethod
def fire_event(cls, channel, mode):
    """Fire an event in the specified mode for the given gpio channel."""
    for cback, cb_mode in cls.CALLBACKS[channel]:
        if cb_mode in (cls.BOTH, mode):
            cback(channel)
