⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 boot.c

📁 这是TI的C6713开发板例程
💻 C
字号:
/*******************************************************************************
*
* Borrowed from earlier work done by souls
*   braver than mine....
*
* Originally, this was the Blink program example,
* but I modified it a little to remove the audio
* portions, and to make a slightly different blink
* pattern.
*       Russ Heeschen, TI Pittsburgh
*
* NOTES: Assumptions:
*             6713 DSK
*             CPLD connected to CE1
*             AMD29LV400BT flash connected to CE1
*             SDRAM connected to CE0
*
*
*/

#include "c6713dec.h"
//#include "cpld.h"
#include "timer.h"

/********************************************************************************/
static Uint32 TimerControl = TIMER_CTL_RMK( /* Timer control register (CTL)*/
  	TIMER_CTL_INVINP_NO, /* TINP inverter control(INVINP). Only affects operation
					      if CLKSRC =0.
                           TIMER_CTL_INVINP_NO  - Uninverted TINP drives timer
                           TIMER_CTL_INVINP_YES - inverted TINP drives timer */
  
  	TIMER_CTL_CLKSRC_CPUOVR4,/* Timer input clock source (CLKSRC)
						   TIMER_CTL_CLKSRC_CPUOVR4 - CPU clock /4           */
						   	
  	TIMER_CTL_CP_CLOCK, /* Clock/pulse mode(CP)
					       TIMER_CTL_CP_PULSE - Pulse mode.TSTAT is active one 
						        CPU clock after the timer reaches the timer
								period.PWID determines when it goes inactive.*/
					    
  	TIMER_CTL_HLD_YES, /* Hold(HLD). Counter may be read or written regardless of 
					    HLD value.
						   TIMER_CTL_HLD_YES - Counter is disabled and held in
						        current value.
						   TIMER_CTL_HLD_NO - COunter is allowed to count.   */
						   
  	TIMER_CTL_GO_NO, /* Go bit(GO). Resets and starts the timer counter.
				           TIMER_CTL_GO_NO - No effects on the timer.
						   TIMER_CTL_GO_YES - if HLD =1, the counter register
						        is zeroed and begins counting on next clock. */
  	TIMER_CTL_PWID_TWO, /* Pulse width(PWID). Only used in pulse mode.
					       TIMER_CTL_PWID_ONE - TSTAT goes inactive one timer 
						        input clock cycle after the timer counter value
								equals the timer period value.
                           TIMER_CTL_PWID_TWO -  TSTAT goes inactive one timer 
						        input clock cycle after the timer counter value
								equals the timer period value.               */

  	TIMER_CTL_DATOUT_0, /* Data output (DATOUT).
					       TIMER_CTL_DATOUT_0 - If FUNC  =0,the DATOUT is
						        driven on TOUT. 
                           TIMER_CTL_DATOUT_1 - If FUNC =1,The DATOUT is driven
						        on TOUT after inversion by INVOUT.           */

  	TIMER_CTL_INVOUT_NO, /* TOUT inverter control (INVOUT) 
					       TIMER_CTL_INVOUT_NO - Uninverted TSTAT drives TOUT
						   TIMER_CTL_INVOUT_YES - Inverted TSTAT drives TOUT.*/
  	TIMER_CTL_FUNC_TOUT /* Function of TOUT pin(FUNC).
					       TIMER_CTL_FUNC_GPIO - TOU is a general purpose 
						        output pin
                           TIMER_CTL_FUNC_TOUT - TOUT is a timer output pin  */
					        
);  
/********************************************************************************/ 

static TIMER_Handle hTimer1;
/* Main function, initializes and loops, blinking the LEDs
 * (Not much of a surprise, I suppose.)
 */
void main( void )
{   
    int i;
    
    CSL_init();
	
	/* DSP initialization */
	IRQ_globalDisable();
	for(i=0;i<32;i++)
	{
	    IRQ_disable(i);   /* Disable and clear all IRQ events    */
	    IRQ_clear(i);     /* except reset and NMI interrupts     */
	}

    PLL_Init();
    EMIF_Init();
    
   hTimer1 = TIMER_open(TIMER_DEV1,TIMER_OPEN_RESET);
   TIMER_configArgs(hTimer1,
    TimerControl, /* use predefined control value  */
    0x000005b9,   /* set period                    */
    0x00000000    /* start count value at zero     */
  	);
  	
  	TIMER_start(hTimer1);
	while(1);
}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -