LED驱动简单设计

1.步骤

2.核心代码 

#define GPKCON 0X7F008800
#define GPKDAT 0X7F008808
light_led:
    ldr r0,=GPKCON
    ldr r1,=0x11110000
    str r1,[r0]
        
    ldr r0,=GPKDAT
    ldr r1,=0xa0
    str r1,[r0]

    mov pc,lr

注:使用6410还需要外设基地址初始化c15, Peripheral Port Memory Remap Register

set_peri_port:
     ldr r0,=0x70000000 
    orr r0,r0,#0x13 
    mcr p15,0,r0,c15,c2,4 
    mov pc,lr 

 

posted on 2016-08-12 21:28  LeoSanford  阅读(173)  评论(0编辑  收藏  举报

levels of contents