This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C123GH6PM: Missing in TivaWare: a TimerIsEnabled() function?

Part Number: TM4C123GH6PM

For timers (driverlib\timers) TivaWare provides functions TimerEnable() and TimerDisable(). I did not see a corresponding TimerIsEnabled() function to query the enabled state of the timer. Such a function would probably look something like this (although this is **NOT** tested) --

//*****************************************************************************
//
//! Checks if timer(s) are enabled
//!
//! \param ui32Base is the base address of the timer module.
//! \param ui32Timer specifies the timer(s) to check; must be one of
//! \b TIMER_A, \b TIMER_B, or \b TIMER_BOTH.
//!
//! \return true if the specified timer(s) are enabled, false if disabled
//
//*****************************************************************************
bool TimerIsEnabled(uint32_t ui32Base, uint32_t ui32Timer)
{
    uint32_t TmrOCtl = HWREG(ui32Base + TIMER_O_CTL);
    uint32_t Expected = ui32Timer & (TIMER_CTL_TAEN | TIMER_CTL_TBEN);

    ASSERT(_TimerBaseValid(ui32Base));
    ASSERT((ui32Timer == TIMER_A) || (ui32Timer == TIMER_B) ||
           (ui32Timer == TIMER_BOTH));

    return ((TmrOCtl & Expected) == Expected) ? true : false;
}

Is there any possibility of that happening in a future version of TivaWare?

  • As past member of similar (giant) semi-firm - it simply is NOT possible to fully anticipate ALL such client needs. Surely your function has merit - yet vendor's workload is large - time is short - and "Not all requests may be accommodated."

    It is noted that if this function proves of high value - you may implement it for your own use - yet be careful as every API upgrade will demand such "added function's" novel insertion...
  • I do appreciate the suggestion, and by posting on E2E others may see and use your function, but I cannot promise its inclusion in a future version of TivaWare.