distortos  v0.4.0
object-oriented C++ RTOS for microcontrollers
buttons.hpp
Go to the documentation of this file.
1 
12 #ifndef SOURCE_BOARD_STM32_STM32F4_STM32F4DISCOVERY_INCLUDE_DISTORTOS_BOARD_BUTTONS_HPP_
13 #define SOURCE_BOARD_STM32_STM32F4_STM32F4DISCOVERY_INCLUDE_DISTORTOS_BOARD_BUTTONS_HPP_
14 
16 
17 #include <cstddef>
18 
20 #ifdef CONFIG_CHIP_STM32_GPIOV2_GPIOA_ENABLE
21 #define DISTORTOS_BOARD_B1_BUTTON_ENABLE 1
22 #else // !def CONFIG_CHIP_STM32_GPIOV2_GPIOA_ENABLE
23 #define DISTORTOS_BOARD_B1_BUTTON_ENABLE 0
24 #endif // !def CONFIG_CHIP_STM32_GPIOV2_GPIOA_ENABLE
25 
27 #define DISTORTOS_BOARD_TOTAL_BUTTONS DISTORTOS_BOARD_B1_BUTTON_ENABLE
28 
29 namespace distortos
30 {
31 
32 #ifdef CONFIG_BOARD_BUTTONS_ENABLE
33 
34 namespace chip
35 {
36 
37 class ChipInputPin;
38 
39 } // namespace chip
40 
41 #endif // def CONFIG_BOARD_BUTTONS_ENABLE
42 
43 namespace board
44 {
45 
48 
49 /*---------------------------------------------------------------------------------------------------------------------+
50 | button indexes
51 +---------------------------------------------------------------------------------------------------------------------*/
52 
53 enum
54 {
55 #if DISTORTOS_BOARD_B1_BUTTON_ENABLE == 1
58 #endif // DISTORTOS_BOARD_B1_BUTTON_ENABLE == 1
59 };
60 
61 #ifdef CONFIG_BOARD_BUTTONS_ENABLE
62 
63 /*---------------------------------------------------------------------------------------------------------------------+
64 | indexed access to button objects
65 +---------------------------------------------------------------------------------------------------------------------*/
66 
69 
70 #endif // def CONFIG_BOARD_BUTTONS_ENABLE
71 
72 } // namespace board
73 
74 } // namespace distortos
75 
76 #endif // SOURCE_BOARD_STM32_STM32F4_STM32F4DISCOVERY_INCLUDE_DISTORTOS_BOARD_BUTTONS_HPP_
constexpr size_t totalButtons
total number of buttons on the board
Definition: buttons.hpp:47
#define DISTORTOS_BOARD_TOTAL_BUTTONS
total number of buttons on the board
Definition: buttons.hpp:27
const chip::ChipInputPin buttons[totalButtons]
array with all button objects
Definition: STM32F4DISCOVERY-buttons.cpp:29
distortos configuration
Top-level namespace of distortos project.
index of B1 button
Definition: buttons.hpp:57
Definition: ChipInputPin.hpp:31