📄 blink.c
字号:
/*H******************************************************************************* $Archive:: $* $Revision:: $* $Date:: $* $Author:: $** DESCRIPTION: TMS320C64xx TEB led code ** GLOBALS ** PUBLIC FUNCTIONS:* * PRIVATE FUNCTIONS:** USAGE/LIMITATIONS:** NOTES: Assumptions:* TMS320C64x TEB* CPLD connected to EMIF B, TBCE0* AMD29LV400BT flash connected to EMIF B, TBCE1* SDRAM connected to EMIF A, TACE0** COMPILE SWITCHES:***H***************************************************************************/#define blink_c/*---- compilation control switches ----------------------------------------*//****************************************************************************** INCLUDE FILES*****************************************************************************//*---- system and platform files -------------------------------------------*/#include <stdlib.h>#include <stdio.h>#include <c6x.h>/*---- program files -------------------------------------------------------*/#include "c6416teb.h"#include "cpld.h"#include "timer.h"#include "emif.h"#include "codec.h"/****************************************************************************** EXTERNAL REFERENCE *****************************************************************************//*---- data declarations ---------------------------------------------------*//*---- function prototypes -------------------------------------------------*//****************************************************************************** PUBLIC DECLARATIONS *****************************************************************************//*---- data declarations ---------------------------------------------------*//****************************************************************************** PRIVATE DECLARATIONS *****************************************************************************//*---- context -------------------------------------------------------------*//*---- data declarations ---------------------------------------------------*/ /*---- function prototypes -------------------------------------------------*//*---- macros --------------------------------------------------------------*//****************************************************************************** PUBLIC FUNCTION DEFINITIONS*****************************************************************************//*F**************************************************************************** NAME: main** DESCRIPTION: * * NOTES:* *F***************************************************************************/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 */ } EMIF_Init(); TIMER_Init(); for( i=0; i<3; i++ ) { CPLD_LedOff( LED_ALL ); TIMER_DelayMsec( 100 ); CPLD_LedOn( LED_ALL ); TIMER_DelayMsec( 100 ); } // Very simple Led test. Turn them all off then on // one at a time, then off one at a time. CPLD_LedOff( LED_ALL ); for(;;) { for( i=0; i<LED_AVAILABLE; i++ ) { CPLD_LedOn( LED_0 << i ); TIMER_DelayMsec( 100 ); } for( i=0; i<LED_AVAILABLE; i++ ) { CPLD_LedOff( LED_3 >> i ); TIMER_DelayMsec( 100 ); } // Play tone on both channels CODEC_PlayTone( 10000, 1, BOTH_CHANNEL ); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -