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:hexsw [2016/02/25 12:36] – [Programming Example] feurctboard:peripherals:hexsw [2022/12/23 11:01] (current) ruan
Line 3: Line 3:
 The HEX switch on the CT Board can switch through 16 different states (4 bit). \\ \\ The HEX switch on the CT Board can switch through 16 different states (4 bit). \\ \\
  
-> {{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 =====
 +
 +**Caveat:** Register bits [7:4] are read as '1' and therefore need to be masked.
 +
 +The register is read only.
 +
 +\\ {{ctboard_hexsw_reg.svg}} \\ \\
 +
 +===== Diagram =====
 +
 +\\ {{:ctboard:peripherals:ctboard_hexsw.svg?700em}} \\ \\
  
 ===== Programming Example ===== ===== Programming Example =====
  
-The code snippet bellow shows how to use the HEXSW.+The code snippets below show how to use the HEXSW.
  
 <code c> <code c>
 #include "reg_ctboard.h" #include "reg_ctboard.h"
  
-uint8_t data = CT_HEXSW;       /* Read HEXSW into the lower nibble of a byte. */+uint8_t data = CT_HEXSW;                    /* Read HEXSW into the lower nibble of a byte. */
 </code> </code>
 \\ \\
  
 <code asm> <code asm>
-ADDR_BUTTON     EQU      0x60000211+ADDR_HEXSW      EQU      0x60000211
                                  
-                LDR      r0, =ADDR_BUTTON+                LDR      r0, =ADDR_HEXSW
                 LDRB     r1, [r0, #0]       ; Read HEXSW into the lower nibble of a byte.                 LDRB     r1, [r0, #0]       ; Read HEXSW into the lower nibble of a byte.
 </code> </code>
 \\ \\
  
-===== Registers ===== 
- 
-The Registers are read only. 
- 
-\\ {{ctboard_hexsw_reg.svg}} \\ \\ 
- 
-===== Diagram ===== 
- 
-\\ {{:ctboard:peripherals:ctboard_hexsw.svg?700em}} \\ \\ 
  • ctboard/peripherals/hexsw.1456403762.txt.gz
  • Last modified: 2016/02/25 12:36
  • by feur