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:button [2016/02/25 09:02] feurctboard:peripherals:button [2022/12/23 11:00] (current) ruan
Line 1: Line 1:
-====== Button ======+====== Buttons ======
  
 The 4 buttons on the CT Board are **"active-high"**, e.g. a pressed button is read as logical **"1"**, and debounced. \\ The 4 buttons on the CT Board are **"active-high"**, e.g. a pressed button is read as logical **"1"**, and debounced. \\
 The buttons are accessible over the memory mapped interface or on [[stm32:peripherals:gpio|GPIO port C]]. \\ \\ The buttons are accessible over the memory mapped interface or on [[stm32:peripherals:gpio|GPIO port C]]. \\ \\
  
-> {{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 only. 
 + 
 +\\ {{ctboard_button_reg.svg}} \\ \\ 
 + 
 +===== Diagram ===== 
 + 
 +\\ {{:ctboard:peripherals:ctboard_button.svg?700em}} \\ \\
  
 ===== Programming Example ===== ===== Programming Example =====
  
-The code snippet bellow shows how to use the Buttons.+The code snippets below show how to use the buttons.
  
 <code c> <code c>
 #include "reg_ctboard.h" #include "reg_ctboard.h"
  
-uint8_t data = CT_BUTTON;       /* Read all buttons into the lower nibble of a byte. */+uint8_t data = CT_BUTTON;                   /* Read all buttons into the lower nibble of a byte. */
 </code> </code>
 +\\
  
-===== Registers =====+<code asm> 
 +ADDR_BUTTON     EQU      0x60000210 
 +                 
 +                LDR      r0, =ADDR_BUTTON 
 +                LDRB     r1, [r0, #0]       ; Read all buttons into the lower nibble of a byte. 
 +</code> 
 +\\
  
-The Registers are read only. 
- 
-{{ctboard_button_reg.svg}} 
- 
-===== Diagram ===== 
- 
-\\ {{:ctboard:peripherals:ctboard_button.svg?700em}} \\ \\ 
  • ctboard/peripherals/button.1456390965.txt.gz
  • Last modified: 2016/02/25 09:02
  • by feur