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/01/26 12:39] 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_mode_1.svg?48px }} {{ctboard_mode_2.svg?48px }} {{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 modes: **1**, **2**, **3** +> Supported [[ctboard:mode_switch|modes]]: **1**, **2**, **3**, **4**  
 +\\
  
 ===== Registers ===== ===== Registers =====
  
-The Registers are read / write.+The registers are read / write.
  
-|< 100% 10em >| +\\ {{ctboard_led_reg.svg}} \\ \\
-^  Address  ^  Bit 7  ^  Bit 6  ^  Bit 5  ^  Bit 4  ^  Bit 3  ^  Bit 2  ^  Bit 1  ^  Bit 0  ^ +
-^  0x6000'0100  |  LED7  |  LED6  |  LED5  |  LED4  |  LED3  |  LED2  |  LED1  |  LED0  | +
-^  0x6000'0101  |  LED15  |  LED14  |  LED13  |  LED12  |  LED11  |  LED10  |  LED9  |  LED8  | +
-^  0x6000'0102  |  LED23  |  LED22  |  LED21  |  LED20  |  LED19  |  LED18  |  LED17  |  LED16  | +
-^  0x6000'0103  |  LED31  |  LED30  |  LED29  |  LED28  |  LED27  |  LED26  |  LED25  |  LED24  |+
  
 ===== Diagram ===== ===== Diagram =====
  
-\\ {{:ctboard:peripherals:ctboard_led.svg?800em}} \\ \\+\\ {{:ctboard:peripherals:ctboard_led.svg?700em}} \\ \\ 
 + 
 +===== Programming Example ===== 
 + 
 +The code snippets below show how to use the LEDs. 
 + 
 +<code c> 
 +#include "reg_ctboard.h" 
 + 
 +CT_LED->BYTE.LED7_0 = (uint8_t) data_byte;            /* Write byte of data to LED7..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. */ 
 +</code> 
 +\\ 
 + 
 +<code asm> 
 +ADDR_LED        EQU      0x60000100 
 + 
 +                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/peripherals/led.1453811949.txt.gz
  • Last modified: 2016/01/26 12:39
  • by feur