Implemented timeout and delays with timers

Cleaned up a bit hal_timer implementation. Now, it allows to create
interruptions with microsecond resolution.