• 11.10


    1. .text
    2. .global _start
    3. _start:
    4. @1.RCC时钟使能GPIOE RCC_MP_AHB4ENSETR[4]->1
    5. LDR R0,=0x50000a28
    6. LDR R1,[R0]
    7. ORR R1,R1,#(0x3<<4)
    8. ORR R1,R1,#(0x1<<1)
    9. STR R1,[R0]
    10. @2.设置PE10为输出模式 GPIOE_MODER[21:20]->01
    11. @先清0
    12. LDR R0,=0x50006000
    13. LDR R1,[R0]
    14. BIC R1,R1,#(0x3<<20)
    15. @再置位
    16. ORR R1,R1,#(0x1<<20)
    17. BIC R1,R1,#(0x3<<16)
    18. ORR R1,R1,#(0x1<<16)
    19. STR R1,[R0]
    20. LDR R0,=0x50007000
    21. LDR R1,[R0]
    22. BIC R1,R1,#[0X3<<20]
    23. ORR R1,R1,#[0X1<<20]
    24. STR R1,[R0]
    25. LDR R0,=0x50003000
    26. LDR R1,[R0]
    27. BIC R1,R1,#[0X3<<12]
    28. ORR R1,R1,#[0X1<<12]
    29. STR R1,[R0]
    30. @3.设置PE10为推挽输出 GPIOE_OTYPER[10]->0
    31. LDR R0,=0x50006004
    32. LDR R1,[R0]
    33. BIC R1,R1,#(0x1<<10)
    34. BIC R1,R1,#(0X1<<8)
    35. STR R1,[R0]
    36. LDR R0,=0x50007004
    37. LDR R1,[R0]
    38. BIC R1,R1,#[0X1<<10]
    39. STR R1,[R0]
    40. LDR R0,=0x50003004
    41. LDR R1,[R0]
    42. BIC R1,R1,#[0X1<<6]
    43. STR R1,[R0]
    44. @4.设置PE10为低速输出 GPIOE_OSPEEDR[21:20]->00
    45. LDR R0,=0x50006008
    46. LDR R1,[R0]
    47. BIC R1,R1,#(0X3<<20)
    48. BIC R1,R1,#(0x3<<16)
    49. STR R1,[R0]
    50. LDR R0,=0x50007008
    51. LDR R1,[R0]
    52. BIC R1,R1,#[0X3<<20]
    53. STR R1,[R0]
    54. LDR R0,=0x50003008
    55. LDR R1,[R0]
    56. BIC R1,R1,#[0X3<<12]
    57. STR R1,[R0]
    58. @5.设置PE10输出无上拉下拉 GPIOE_PUPDR[21:20]->00
    59. LDR R0,=0x5000600C
    60. LDR R1,[R0]
    61. BIC R1,R1,#(0x3<<20)
    62. STR R1,[R0]
    63. LDR R0,=0x5000700C
    64. LDR R1,[R0]
    65. BIC R1,R1,#[0X3<<20]
    66. STR R1,[R0]
    67. LDR R0,=0x5000300C
    68. LDR R1,[R0]
    69. BIC R1,R1,#[0X3<<12]
    70. STR R1,[R0]
    71. @LED闪烁
    72. loop:
    73. BL led1_on
    74. bl delay
    75. BL led1_off
    76. bl delay
    77. BL led2_on
    78. bl delay
    79. BL led2_off
    80. bl delay
    81. BL led3_on
    82. bl delay
    83. BL led3_off
    84. bl delay
    85. BL bee_on
    86. bl delay
    87. BL bee_off
    88. bl delay
    89. b loop
    90. led1_on:
    91. ldr r0,=0x50006014
    92. ldr r1,[r0]
    93. orr r1,r1,#(0x1<<10)
    94. str r1,[r0]
    95. mov pc,lr
    96. led1_off:
    97. ldr r0,=0x50006014
    98. ldr r1,[r0]
    99. bic r1,r1,#(0x1<<10)
    100. str r1,[r0]
    101. mov pc,lr
    102. led2_on:
    103. ldr r0,=0x50007014
    104. ldr r1,[r0]
    105. orr r1,r1,#(0x1<<10)
    106. str r1,[r0]
    107. mov pc,lr
    108. led2_off:
    109. ldr r0,=0x50007014
    110. ldr r1,[r0]
    111. bic r1,r1,#(0x1<<10)
    112. str r1,[r0]
    113. mov pc,lr
    114. led3_on:
    115. ldr r0,=0x50006014
    116. ldr r1,[r0]
    117. orr r1,r1,#(0x1<<8)
    118. str r1,[r0]
    119. mov pc,lr
    120. led3_off:
    121. ldr r0,=0x50006014
    122. ldr r1,[r0]
    123. bic r1,r1,#(0x1<<8)
    124. str r1,[r0]
    125. mov pc,lr
    126. bee_on:
    127. ldr r0,=0x50003014
    128. ldr r1,[r0]
    129. orr r1,r1,#(0x1<<6)
    130. str r1,[r0]
    131. mov pc,lr
    132. bee_off:
    133. ldr r0,=0x50003014
    134. ldr r1,[r0]
    135. bic r1,r1,#(0x1<<6)
    136. str r1,[r0]
    137. mov pc,lr
    138. delay:
    139. ldr r1,=0x10000000
    140. mm:
    141. cmp r1,#0
    142. subne r1,r1,#1
    143. bne mm
    144. mov pc,lr
    145. .end

  • 相关阅读:
    DNA修饰金属铑Rh纳米颗粒RhNPS-DNA(DNA修饰贵金属纳米颗粒)
    鸿蒙Harmony应用开发—ArkTS声明式开发(基础手势:Button)
    hdoj 3549 Flow Problem(最大网络流)
    【Java八股文总结】之面试题(一)
    美妆穿搭带货直播稿 话术 脚本
    基于逻辑回归和神经网络识别手写数字(从0到9)(Matlab代码实现)
    基于stm32单片机随机数自动摇号抽奖系统
    蓝鹏测控测宽仪系列又添一员大将——双目测宽仪
    2022C语言知识点大全【详细、必备】
    mybatis_plus
  • 原文地址:https://blog.csdn.net/m0_73912044/article/details/134341984