Differences

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

Link to this comparison view

Both sides previous revision Previous revision
ctboard:peripherals:gpio_cpld [2022/12/23 11:05] – [Output] ruanctboard:peripherals:gpio_cpld [2026/06/25 14:52] (current) – [Programming Example] scbj
Line 41: Line 41:
 \\ \\
  
-<code asm+<code text
-ADDR_GPIO_IN    EQU      0x60000410 +.equ ADDR_GPIO_IN,   0x60000410 
-ADDR_GPIO_OUT   EQU      0x60000400+.equ ADDR_GPIO_OUT,  0x60000400
                                  
-                LDR      r0, =ADDR_GPIO_IN +        ldr     r0,  =ADDR_GPIO_IN 
-                LDRB     r1, [r0, #0]                 Read byte from P1. +        ldrb    r1,  [r0, #0]                 // Read byte from P1. 
-                LDRH     r1, [r0, #0]                 Read half word from P1 and P2. +        ldrw    r1,  [r0, #0]                 // Read half word from P1 and P2. 
-                LDR      r1, [r0, #0]                 Read word from all ports (P1..4).+        ldr     r1,  [r0, #0]                 // Read word from all ports (P1..4).
                                  
-                LDR      r0, =ADDR_GPIO_OUT +        ldr     r0,  =ADDR_GPIO_OUT 
-                STRB     r1, [r0, #2]                 Write byte of data to P3. +        strb    r1,  [r0, #2]                 // Write byte of data to P3. 
-                STRH     r1, [r0, #2]                 Write halfword of data to P3..4. +        strh    r1,  [r0, #2]                 // Write halfword of data to P3..4. 
-                STR      r1, [r0, #0]                 Write word of data to all ports (P1..4).+        str     r1,  [r0, #0]                 // Write word of data to all ports (P1..4).
 </code> </code>
 \\ \\
  
  • ctboard/peripherals/gpio_cpld.txt
  • Last modified: 2026/06/25 14:52
  • by scbj