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

📄 led_test.c

📁 CodeWarrior IDE!COLDFIRE 5275源程序!
💻 C
字号:
/*
 * File:		led_test.c
 * Purpose:		Test the 4 USER LEDs on the M5275EVB
 *
 * Notes:		
 */

#include "m5275evb.h"
#include "fat.h"

#define ETPU_PROGRAM_STORE   (0x40000000 + 0x1D0000 + 0x10000)
#define ETPU_PARAMETER_RAM   (0x40000000 + 0x1D0000 + 0x8000)
#define VIS             0x00000040      // Shared Code Memory Visibility bit mask
#define MDIS            0x40000000      // Module Disable bit mask for both eTPU engines
#ifdef BSTC
#define STF             0x10000000      // Stop Flag
#endif
 
/********************************************************************/
void
led_test(void)
{
	uint32 i,j;

	
	RESULTS |= LED_TEST;
	
	/* Set DTOUT0,1,2,3 to act as GPIO */
	MCF_GPIO_PAR_TIMER = 0x0000;
	
	/* Set Data Direction of DTOUT0,1,2,3 to Output */
	MCF_GPIO_PDDR_TIMERH = 0x0F;
	MCF_GPIO_PDDR_TIMERL = 0x0F;

	for (i = 0; i < 10; i++)
	{
		/* Write 0 to turn LEDs on */
		MCF_GPIO_PODR_TIMERH = 0x00;
		MCF_GPIO_PODR_TIMERL = 0x00;
		for (j = 0; j < 1000000; j++);
		
		/* Write 1 to turn LEDs off */
		MCF_GPIO_PODR_TIMERH = 0xFF;
		MCF_GPIO_PODR_TIMERL = 0xFF;
		for (j = 0; j < 1000000; j++);
	}

}
/********************************************************************/

⌨️ 快捷键说明

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