linux基于arma8的裸机led驱动

#include "s5pc100.h"

int main()
{
int i;

//GPG3.GPG3CON=(GPG3.GPG3CON & ~0xF) |1<<0;
asm(
"ldr r0,=0xE03001c0\n\t"
"mov r1,#0x100\n\t"
"strb r1,[r0]\n\t"
);

while(1)
{
//GPG3.GPG3DAT=(GPG3.GPG3DAT &~0x01)|1<<0;

asm(
"ldr r0,=0xE03001c4\n\t"
"mov r1,#0x4\n\t"
"strb r1,[r0]\n\t"
);
for(i=100000;i>0;i--);
//GPG3.GPG3DAT=(GPG3.GPG3DAT &~0x01);
asm(
"ldr r0,=0xE03001c4\n\t"
"mov r1,#0x0\n\t"
"strb r1,[r0]\n\t"
);
for(i=100000;i>0;i--);
}

return 0;
}

你可能感兴趣的:(led裸机驱动实现)