<p>This file contains the implementation of the <aclass="el"href="struct_x_ttc_ps.html">XTtcPs</a> driver. This driver controls the operation of one timer counter in the Triple Timer Counter (TTC) module in the Ps block. Refer to <aclass="el"href="xttcps_8h.html">xttcps.h</a> for more detailed description of the driver.</p>
<pre>
MODIFICATION HISTORY:</pre><pre> Ver Who Date Changes
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_ttc_ps.html">XTtcPs</a> instance. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>Freq</em> </td><td>is the requested output frequency for the device. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>Interval</em> </td><td>is the interval value for the given frequency, it is the output value for this function. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>Prescaler</em> </td><td>is the prescaler value for the given frequency, it is the output value for this function.</td></tr>
<dlclass="note"><dt><b>Note:</b></dt><dd>Upon successful calculation for the given frequency, Interval and Prescaler carry the settings for the timer counter; Upon unsuccessful calculation, Interval and Prescaler are set to 0xFF(FF) for their maximum values to signal the caller of failure. Therefore, caller needs to check the return interval or prescaler values for whether the function has succeeded. </dd></dl>
<p>Initializes a specific <aclass="el"href="struct_x_ttc_ps.html">XTtcPs</a> instance such that the driver is ready to use. This function initializes a single timer counter in the triple timer counter function block.</p>
<p>The state of the device after initialization is:</p>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_ttc_ps.html">XTtcPs</a> instance. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>ConfigPtr</em> </td><td>is a reference to a structure containing information about a specific TTC device. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>EffectiveAddr</em> </td><td>is the device base address in the virtual memory address space. The caller is responsible for keeping the address mapping from EffectiveAddr to the device physical base address unchanged once this function is invoked. Unexpected errors may occur if the address mapping changes after this function is called. If address translation is not used, then use ConfigPtr->BaseAddress for this parameter, passing the physical address instead.</td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_ttc_ps.html">XTtcPs</a> instance. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>MatchIndex</em> </td><td>is the index to the match register to be set. Valid values are 0, 1, or 2.</td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_ttc_ps.html">XTtcPs</a> instance.</td></tr>
<p>This function is used to set the match registers. There are three match registers.</p>
<p>The match 0 register is special. If the waveform output mode is enabled, the waveform will change polarity when the count matches the value in the match 0 register. The polarity of the waveform output can also be set using the <aclass="el"href="xttcps_8h.html#a0acc0e823f6c3053d15dd1bc159417ec">XTtcPs_SetOptions()</a> function.</p>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_ttc_ps.html">XTtcPs</a> instance. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>MatchIndex</em> </td><td>is the index to the match register to be set. Valid values are 0, 1, or 2. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>Value</em> </td><td>is the 16-bit value to be set in the match register.</td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>InstancePtr</em> </td><td>is a pointer to the <aclass="el"href="struct_x_ttc_ps.html">XTtcPs</a> instance. </td></tr>
<tr><tdvalign="top"></td><tdvalign="top"><em>PrescalerValue</em> </td><td>is a number from 0-16 that sets the prescaler to use. If the parameter is 0 - 15, use a prescaler on the clock of 2^(PrescalerValue+1), or 2-65536. If the parameter is XTTCPS_CLK_CNTRL_PS_DISABLE, do not use a prescaler.</td></tr>