#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mmu.h"
#include "typedef.h"
#define Bit(n) (1<<(n))
#define GPBCON (*(volatile int *)0x56000010)
#define GPBDAT (*(volatile int *)0x56000014)
#define GPFCON (*(volatile int *)0x56000050)
#define GPFDAT (*(volatile int *)0x56000054)
void delay(unsigned
int count)
{
int j =
1000;
int i =
0;
while(--j)
for(i =count; i >
0; i --);
}
void Main()
{
U32 i;
MMU_Init();
GPFCON &= ~Bit(
0);
GPFCON &= ~Bit(
1);
GPBCON |= Bit(
10);
GPBCON &= ~Bit(
11);
GPBDAT &= ~Bit(
5);
while(
1){
if((GPFDAT &
0x01) ==
0)
{
GPBDAT ^= Bit(
5);
for(i =
0;i <
500000;i++)
{
GPBDAT |= Bit(
0);
}
GPBDAT &= ~Bit(
0);
}
}
}
转载请注明原文地址: https://ju.6miu.com/read-37207.html