S3C2440 gpio

WATCHDOG TIMER
1

原理图
1

手册
1

举例
start.S

.globl _start
_start:

/* 关看门狗 */
/* 往WTCON(0x53000000)写0 */
    ldr r0, =0x53000000
    mov r1, #0
    str r1, [r0] @ str, store, 

/* 设置GPFCON让GPF5作为输出引脚 */
    ldr r1, =0x56000050
    mov r0, #(1<<10)
    str r0, [r1]

/* 设置GPFDAT让GPF5输出0 */
    ldr r1, =0x56000054
    mov r0, #0
    str r0, [r1]

/* 无限循环 */
halt:
    b halt  

Makefile

led.bin: start.o
    arm-linux-gnueabihf-ld -Ttext 0 -o led.elf start.o
    arm-linux-gnueabihf-objcopy -O binary led.elf led.bin
    arm-linux-gnueabihf-objdump -D led.elf > led.dis

start.o : start.S
    arm-linux-gnueabihf-gcc -o start.o start.S -c

clean:
    rm *.o led.elf led.bin led.dis
posted @ 2017-09-15 14:02  thomas_blog  阅读(110)  评论(0编辑  收藏  举报