Labor04
AppBoard2Buttons.h
Go to the documentation of this file.
1 
12 #ifndef _APPBOARD2BUTTONS_H
13 #define _APPBOARD2BUTTONS_H
14 
15 //Import necessary board packages
16 #include "GPIO_LPC17xx.h"
17 #include "PIN_LPC17xx.h"
18 #include "LPC17xx.h"
19 
20 //Number of push buttons of application board 2
21 #define APPBOARD2_NUMBER_BUTTONS (8U)
22 
23 #define BUTTON_T0 (1U<<0)
24 #define BUTTON_T1 (1U<<1)
25 #define BUTTON_T2 (1U<<2)
26 #define BUTTON_T3 (1U<<3)
27 #define BUTTON_T4 (1U<<4)
28 #define BUTTON_T5 (1U<<5)
29 #define BUTTON_T6 (1U<<6)
30 #define BUTTON_T7 (1U<<7)
31 
32 
33 #define APPBOARD2_MASK_BUTTONS (0x000000FFU)
34 
35 //macro port number -> GPIO start address
36 #define LPC_GPIO_PORT(n) ((LPC_GPIO_TypeDef*)(LPC_GPIO0_BASE + (0x00000020*(n))))
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 //function declarations
45 uint32_t u32AppBoard2ButtonsGetState(void);
46 
47 #ifdef __cplusplus
48 }
49 #endif
50 
51 #endif
52 
53 
vAppboard2ButtonsUninitialize
void vAppboard2ButtonsUninitialize(void)
Uninitialization of all buttons of Application Board 2.
Definition: AppBoard2Buttons.c:59
AppBoard2Buttons.h
Read state of buttons.
vAppboard2ButtonsUninitialize
void vAppboard2ButtonsUninitialize(void)
Uninitialization of all buttons of Application Board 2.
Definition: AppBoard2Buttons.c:59
vAppboard2ButtonsInitialize
void vAppboard2ButtonsInitialize(void)
Initialization of all buttons of Application Board 2.
Definition: AppBoard2Buttons.c:35
axAppBoard2Buttons
GPIO_ID axAppBoard2Buttons[APPBOARD2_NUMBER_BUTTONS]
Definition: AppBoard2Buttons.c:17
vAppboard2ButtonsInitialize
void vAppboard2ButtonsInitialize(void)
Initialization of all buttons of Application Board 2.
Definition: AppBoard2Buttons.c:35
u32AppBoard2ButtonsDebounce
static bool u32AppBoard2ButtonsDebounce(uint32_t u32Value)
Returns true if buttons are debounced.
Definition: AppBoard2Buttons.c:130
LPC_GPIO_PORT
#define LPC_GPIO_PORT(n)
Definition: AppBoard2Buttons.h:36
u32AppBoard2ButtonsGetState
uint32_t u32AppBoard2ButtonsGetState(void)
Returns the pressed Buttons (bit coded see AppBoard2Buttons.h)
Definition: AppBoard2Buttons.c:85
APPBOARD2_NUMBER_BUTTONS
#define APPBOARD2_NUMBER_BUTTONS
Definition: AppBoard2Buttons.h:21
u32AppBoard2ButtonsGetState
uint32_t u32AppBoard2ButtonsGetState(void)
Returns the pressed Buttons (bit coded see AppBoard2Buttons.h)
Definition: AppBoard2Buttons.c:85
APPBOARD2_MASK_BUTTONS
#define APPBOARD2_MASK_BUTTONS
Definition: AppBoard2Buttons.h:33