/** @file sys_vim.c 
*   @brief System VIM Driver Source File
*   @date 15.March.2013
*   @version 03.05.00
*
*   This file contains:
*   - API Functions
*   .
*   which are relevant for the System VIM driver.
*/

/* (c) Texas Instruments 2009-2013, All rights reserved. */

#include "sys_vim.h"
#include "sys_common.h"


/** @fn void captureEventSource0(void)
*   @brief Capture Event Source 0
*
*   Function to chose a interrupt channel to Capture RTI counter capture 0.
*
*/
void captureEventSource0()  /* Capture Event Source 0 -> RTI CAPCNTR0 */
{
    vimREG->CAPEVT = (vimREG->CAPEVT & 0xFFFFFF80U) | 0U;
/* USER CODE BEGIN (1) */
/* USER CODE END */
}

/** @fn void captureEventSource0(void)
*   @brief Capture Event Source 0
*
*   Function to chose a interrupt channel to Capture RTI counter capture 1 .
*
*/
void captureEventSource1()  /* Capture Event Source 1 -> RTI CAPCNTR1 */
{
    vimREG->CAPEVT = (vimREG->CAPEVT & 0xFF80FFFFU) | (0U << 16U);
/* USER CODE BEGIN (2) */
/* USER CODE END */
}

/** @fn void nestEnable(void)
*   @brief Enable nested interrupts
*
*   Function to enable interrupt nesting upto 8 levels.
*
*/
void nestEnable(void)
{
    vimREG->NESTCTL = 0x0AU;
}

/** @fn void vimCfg(void)
*   @brief VIM Configuration
*
*   Function to configure VIM.
*
*/
void vimCfg(void)
{	
    
        /* To RTI CAPCNTR0*/
        captureEventSource0(); 

        /* To RTI CAPCNTR1*/
        captureEventSource1(); 
    
/* USER CODE BEGIN (3) */
/* USER CODE END */
}





