main.c
来自「GPIO 所有文件 包含头和主程序」· C语言 代码 · 共 62 行
C
62 行
//====================================================================
// File Name : 2410test.c
// Function : S3C2410 Test Main Menu
// Program : Shin, On Pil (SOP)
// Date : May 30, 2002
// Version : 0.0
// History
// 0.0 : Programming start (February 20,2002) -> SOP
// 1.0 (20020530) : First release for customer
// 1.1 (20020801) : Strata NOR Flash Added and etc. -> SOP
//====================================================================
#include <stdlib.h>
#include <string.h>
#include "def.h"
#include "option.h"
#include "2410addr.h"
#include "2410lib.h"
#include "2410slib.h"
void Led_Display(int data);
//===================================================================
void Main(void)
{
int i;
ChangeClockDivider(1,1); // 1:2:4
ChangeMPllValue(0xa1,0x3,0x1); // FCLK=202.8MHz
Port_Init(); //Init The I/O Port
while (1)
{
Led_Display(0x0f); //LED On
for (i=0; i<0xfffff; i++); //Delay
Led_Display(0x00); //LED Off
for (i=0; i<0xfffff; i++); //Delay
}
}
//===================================================================
//Active is low.(LED On)
// GPF7 GPF6 GPF5 GPF4
//nLED_1 nLED2 nLED_4 nLED_3
void Led_Display(int data)
{
// rGPFDAT = (rGPFDAT & 0xf) | !((data & 0xf)<<4);
rGPFDAT = (rGPFDAT & ~(0xf<<4)) | ((~data & 0xf)<<4);
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?