I am trying to use a General Purpose Timer peripheral to respond to a timeout condition. That is, in the absence of a certain event in a given length of time, the timer should trigger an interrupt.
The way I've always done this on other MCUs is to set up a Timer to generate a periodic interrupt. So for example if the event is expected to occur every 950 uS, I might configure a periodic timer to trigger an interrupt every 1 ms. But I never allow that interrupt to trigger: Every time the event in question occurs, the event handler restarts the timer (sets its counter back to 0 or maximum depending on count direction). If the event does not occur, the timer "times out" and triggers the interrupt, which handles the lack of event.
I'm trying to do this with TivaWare. My line of thought is to restart the timer (and therefore prevent triggering the interrupt) by loading the start value into GPTMTAV every time the event occurs.
My questions:
1. Is this the correct way to "restart" the timer back to the beginning?
2. If so, TivaWare provides a function TimerValueGet() but does not provide a function TimerValueSet(). Is there a TivaWare function that accomplishes what I want?