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:led [2016/02/25 09:15] feurctboard:peripherals:led [2022/12/23 11:06] (current) ruan
Line 1: Line 1:
 ====== LED ====== ====== LED ======
  
-On the CT Board are 32 LEDs mounted. They are arranged in 4 groups of 8 LEDs and are **"active-high"**. \\+The CT Board features 32 LEDs. They are arranged in 4 groups of 8 LEDs and are **"active-high"**. \\
 E.g. the LEDs are on if a logical **"1"** is written. \\ \\ E.g. the LEDs are on if a logical **"1"** is written. \\ \\
  
-> {{ctboard:ctboard_mode_1.svg?48px }} {{ctboard:ctboard_mode_2.svg?48px }} {{ctboard:ctboard_mode_3.svg?48px }} Please make sure the CT Board is in the correct mode. +> {{ctboard:ctboard_mode_1.svg?48px }} {{ctboard:ctboard_mode_2.svg?48px }} {{ctboard:ctboard_mode_3.svg?48px }} {{ctboard:ctboard_mode_4.svg?48px }} Please make sure the CT Board is in the correct mode. 
-> Supported [[ctboard:mode_switch|modes]]: **1**, **2**, **3** +> Supported [[ctboard:mode_switch|modes]]: **1**, **2**, **3**, **4**  
 +\\ 
 + 
 +===== Registers ===== 
 + 
 +The registers are read / write. 
 + 
 +\\ {{ctboard_led_reg.svg}} \\ \\ 
 + 
 +===== Diagram ===== 
 + 
 +\\ {{:ctboard:peripherals:ctboard_led.svg?700em}} \\ \\
  
 ===== Programming Example ===== ===== Programming Example =====
  
-The code snippet bellow shows how to use the LEDs.+The code snippets below show how to use the LEDs.
  
 <code c> <code c>
Line 15: Line 26:
  
 CT_LED->BYTE.LED7_0 = (uint8_t) data_byte;            /* Write byte of data to LED7..0. */ CT_LED->BYTE.LED7_0 = (uint8_t) data_byte;            /* Write byte of data to LED7..0. */
-CT_LED->HWORD.LED15_0 = (uint16_t) data_halfword;     /* Write half word of data to LED15..0. */+CT_LED->HWORD.LED31_16 = (uint16_t) data_halfword;    /* Write half word of data to LED31..16. */
 CT_LED->WORD = (uint32_t) data_word;                  /* Write word of data to all LEDs. */ CT_LED->WORD = (uint32_t) data_word;                  /* Write word of data to all LEDs. */
 </code> </code>
 +\\
  
-===== Registers =====+<code asm> 
 +ADDR_LED        EQU      0x60000100
  
-The Registers are read write.+                LDR      r0, =ADDR_LED 
 +                STRB     r1, [r0, #0]                     ; Write byte of data to LED7..0. 
 +                STRH     r1, [r0, #2]                     ; Write half word of data to LED31..16. */ 
 +                STR      r1, [r0, #0]                     ; Write word of data to all LEDs*/ 
 +</code> 
 +\\
  
-\\ {{ctboard_led_reg.svg}} \\ \\ 
- 
-===== Diagram ===== 
- 
-\\ {{:ctboard:peripherals:ctboard_led.svg?700em}} \\ \\ 
  • ctboard/peripherals/led.1456391729.txt.gz
  • Last modified: 2016/02/25 09:15
  • by feur