Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
ctboard:peripherals:dipsw [2016/09/01 11:32] ruanctboard:peripherals:dipsw [2026/06/25 14:53] (current) – [Programming Example] scbj
Line 7: Line 7:
 > Supported [[ctboard:mode_switch|modes]]: **1**, **2**, **3**, **4**  > Supported [[ctboard:mode_switch|modes]]: **1**, **2**, **3**, **4** 
 \\ \\
 +
 +===== Registers =====
 +
 +The registers are read only.
 +
 +\\ {{ctboard_dipsw_reg.svg}} \\ \\
 +
 +===== Diagram =====
 +
 +\\ {{:ctboard:peripherals:ctboard_dipsw.svg?700em}} \\ \\
  
 ===== Programming Example ===== ===== Programming Example =====
  
-The code snippet bellow shows how to use the DIPSW.+The code snippets below show how to use the DIPSW.
  
 <code c> <code c>
Line 21: Line 31:
 \\ \\
  
-<code asm+<code text
-ADDR_DIPSW      EQU      0x60000200+.equ ADDR_DIPSW,     0x60000200
                                  
-                LDR      r0, =ADDR_DIPSW +        ldr     r0,  =ADDR_DIPSW 
-                LDRB     r1, [r0, #0]          Read byte from S7..0. +        ldrb    r1,  [r0, #0]          // Read byte from S7..0. 
-                LDRH     r1, [r0, #2]          Read half word from S31..16. +        ldrh    r1,  [r0, #2]          // Read half word from S31..16. 
-                LDR      r1, [r0, #0]          Read all DIPSW at once into a word.+        ldr     r1,  [r0, #0]          // Read all DIPSW at once into a word.
 </code> </code>
 \\ \\
- 
-===== Registers ===== 
- 
-The Registers are read only. 
- 
-\\ {{ctboard_dipsw_reg.svg}} \\ \\ 
- 
-===== Diagram ===== 
- 
-\\ {{:ctboard:peripherals:ctboard_dipsw.svg?700em}} \\ \\ 
  • ctboard/peripherals/dipsw.1472729534.txt.gz
  • Last modified: 2016/09/01 11:32
  • by ruan