SWCU192 November 2021 CC1312R7 , CC1352P7 , CC2652P7 , CC2652R7
The available channels may be set up in compare mode or capture mode.
Compare mode can be set up using the CMD_SET_RAT_CMP command (see Section 26.3.3.2.10). In this case, the timer generates an interrupt when the counter reaches the value given by compareTime. The interrupt is mapped to RFHWIFG (see Section 26.2.3.2 and Section 26.11.2). For the available RAT channels, the interrupt flags in use are RATCH5, RATCH6, and RATCH7. Optionally, it is also possible to control an I/O pin when the counter reaches the value given by compareTime (see Section 26.2.4.2). When the CMD_SET_RAT_CMP command is sent, the value of compareTime is stored in the radio channel value register (RATCHnVAL) corresponding to the selected channel (see Section 26.11.1).
Capture mode can be used to capture a transition on an input pin and record the RAT counter value at the time when the transition occurred. Compare mode can be set up using the CMD_SET_RAT_CPT command (see Section 26.3.3.2.11). When the transition occurs, the current value of the RAT is stored in the RATCHnVAL register corresponding to the selected channel (see Section 26.11.1), and the timer generates an interrupt. As for compare mode, the interrupt is mapped to RFHWIFG. For the available RAT channels, the interrupt flags in use are RATCH5, RATCH6, and RATCH7. If single-capture mode is configured in CMD_SET_CPT, only the first transition is captured, unless the channel is armed again, as explained in the following paragraph. If repeated mode is configured, every transition is captured.
In this case, the captured value in RATCHnVAL register may be overwritten at any time if a new transition occurs.
A channel set up in compare mode or single capture mode may be armed or disarmed. When CMD_SET_RAT_CMP or CMD_SET_RAT_CPT is sent, the channel is armed automatically, and when the capture or compare event occurs, the channel is disarmed automatically. A disarmed channel does not produce any interrupt or cause any timer value to be captured. In addition, a channel may be armed or disarmed using CMD_ARM_RAT_CH or CMD_DISARM_RAT_CH (see Section 26.3.3.2.14 through Section 26.3.3.2.15). While disarmed, the channel keeps its configuration. To disable a channel that is not going to be re-armed with the same configuration, the CMD_DISABLE_RAT_CH command may be used (see Section 26.3.3.2.12).