<h1>tmrctr v3_0</h1><p>The Xilinx timer/counter component. This component supports the Xilinx timer/counter. More detailed description of the driver operation can be found in the <aclass="el"href="xtmrctr_8c.html">xtmrctr.c</a> file.</p>
<p>The Xilinx timer/counter supports the following features:</p>
<ul>
<li>Polled mode.</li>
<li>Interrupt driven mode</li>
<li>enabling and disabling specific timers</li>
<li>PWM operation</li>
<li>Cascade Operation (This is to be used for getting a 64 bit timer and this feature is present in the latest versions of the axi_timer IP)</li>
</ul>
<p>The driver does not currently support the PWM operation of the device.</p>
<p>The timer counter operates in 2 primary modes, compare and capture. In either mode, the timer counter may count up or down, with up being the default.</p>
<p>Compare mode is typically used for creating a single time period or multiple repeating time periods in the auto reload mode, such as a periodic interrupt. When started, the timer counter loads an initial value, referred to as the compare value, into the timer counter and starts counting down or up. The timer counter expires when it rolls over/under depending upon the mode of counting. An external compare output signal may be configured such that a pulse is generated with this signal when it hits the compare value.</p>
<p>Capture mode is typically used for measuring the time period between external events. This mode uses an external capture input signal to cause the value of the timer counter to be captured. When started, the timer counter loads an initial value, referred to as the compare value,</p>
<p>The timer can be configured to either cause an interrupt when the count reaches the compare value in compare mode or latch the current count value in the capture register when an external input is asserted in capture mode. The external capture input can be enabled/disabled using the XTmrCtr_SetOptions function. While in compare mode, it is also possible to drive an external output when the compare value is reached in the count register The external compare output can be enabled/disabled using the XTmrCtr_SetOptions function.</p>
<p><b>Interrupts</b></p>
<p>It is the responsibility of the application to connect the interrupt handler of the timer/counter to the interrupt source. The interrupt handler function, XTmrCtr_InterruptHandler, is visible such that the user can connect it to the interrupt source. Note that this interrupt handler does not provide interrupt context save and restore processing, the user must perform this processing.</p>
<p>The driver services interrupts and passes timeouts to the upper layer software through callback functions. The upper layer software must register its callback functions during initialization. The driver requires callback functions for timers.</p>
<dlclass="note"><dt><b>Note:</b></dt><dd>The default settings for the timers are:<ul>
<li>Interrupt generation disabled</li>
<li>Count up mode</li>
<li>Compare mode</li>
<li>Hold counter (will not reload the timer)</li>
<li>External compare output disabled</li>
<li>External capture input disabled</li>
<li>Pulse width modulation disabled</li>
<li>Timer disabled, waits for Start function to be called <br/>
<br/>
A timer counter device may contain multiple timer counters. The symbol XTC_DEVICE_TIMER_COUNT defines the number of timer counters in the device. The device currently contains 2 timer counters. <br/>
<br/>
This driver is intended to be RTOS and processor independent. It works with physical addresses only. Any needs for dynamic memory management, threads or thread mutual exclusion, virtual memory, or cache control must be satisfied by the layer above this driver.</li>