Differences

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

Link to this comparison view

Next revision
Previous revision
ctboard:peripherals:led [2016/01/26 11:54] – created feurctboard:peripherals:led [2022/12/23 11:06] (current) ruan
Line 1: Line 1:
 ====== LED ====== ====== LED ======
  
-On the CT Board are 32 DIP switches mounted. They are arranged in 4 groups of 8 DIP switches. \\ +The CT Board features 32 LEDs. They are arranged in 4 groups of 8 LEDs and are **"active-high"**. \\ 
-If a DIP switch is in the position "high" (see [[#diagram]] below) it provides a logical **"1"**. \\ \\+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 only.+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'0200  |  S7  |  S6  |  S5  |  S4  |  S3  |  S2  |  S1  |  S0  | +
-^  0x6000'0201  |  S15  |  S14  |  S13  |  S12  |  S11  |  S10  |  S9  |  S8  | +
-^  0x6000'0202  |  S23  |  S22  |  S21  |  S20  |  S19  |  S18  |  S17  |  S16  | +
-^  0x6000'0203  |  S31  |  S30  |  S29  |  S28  |  S27  |  S26  |  S25  |  S24  |+
  
 ===== Diagram ===== ===== Diagram =====
  
-\\ {{:ctboard:peripherals:ctboard_dipsw.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.1453809240.txt.gz
  • Last modified: 2016/01/26 11:54
  • by feur