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

📄 hello.c

📁 ti_dsp_6000系列下,在dsp/bios实时操作系统下,外设timer的使用
💻 C
字号:
/*
 *  Copyright 2001 by Texas Instruments Incorporated.
 *  All rights reserved. Property of Texas Instruments Incorporated.
 *  Restricted rights to use, duplicate or disclose this code are
 *  granted through contract.
 *  
 */
/* "@(#) DSP/BIOS 4.60.22 12-07-01 (barracuda-j15)" */
/***************************************************************************/
/*                                                                         */
/*     H E L L O . C                                                       */
/*                                                                         */
/*     Basic LOG event operation from main.                                */
/*                                                                         */
/***************************************************************************/

#include <std.h>

#include <log.h>
/* Include for timer */
#include <csl.h>
#include <csl_timer.h>


#include "hellocfg.h"

static Uint32 TimerEventId1; /* Timer event ID */

/* Function Prototypes */
Void my_clock (Void);
Void my_prd (Void);
Void timer_isr (Void);

/*
 *  ======== main ========
 */
Void main()
{
    LOG_printf(&trace, "hello world!");

	TimerEventId1 = TIMER_getEventId (hTimer1); /* get Timer event ID 	  */
	IRQ_enable (TimerEventId1); 				/* Enable the Timer event */
  	TIMER_start (hTimer1);      				/* Start the timer 1      */


    /* fall into DSP/BIOS idle loop */
    return;
}


/* Clock function for CLK0 */
Void my_clock (Void)
{
	LOG_printf (&trace, "In clock function my_clock ()");
} 


/* PRD function for PRD0 */
Void my_prd (Void)
{
	LOG_printf (&trace, "In periodic function my_prd ()");
}

/* ISR function for timer 1 interrupt */
Void timer_isr (Void)
{
	LOG_printf (&trace, "In a timer 1 ISR");
}

⌨️ 快捷键说明

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