source: trunk/firmware/SES/Inc/tast.h@ 3

Last change on this file since 3 was 1, checked in by f.jahn, 3 years ago
File size: 1.0 KB
Line 
1#ifndef TAST_H
2#define TAST_H
3
4#include "main.h"
5
6//typedef signed short s16;
7
8#define key1_PORT SW_ON_GPIO_Port
9#define key1_PIN SW_ON_Pin
10
11#define key2_PORT SW_OFF_GPIO_Port
12#define key2_PIN SW_OFF_Pin
13
14//#define key3_PORT SWITCH_LEFT_GPIO_Port
15//#define key3_PIN SWITCH_LEFT_Pin
16
17//#define key4_PORT SWITCH_RIGHT_GPIO_Port
18//#define key4_PIN SWITCH_RIGHT_Pin
19
20//#define key5_PORT SWITCH_OK_GPIO_Port
21//#define key5_PIN SWITCH_OK_Pin
22
23#define REPEAT_MASK (key2_PIN^key1_PIN) // repeat: key1, key2 --> (1<<KEY1^1<<KEY2)
24#define REPEAT_START 2400 // after 200ms ( with 1ms checkkeys() call. 20 for 10ms call)
25#define REPEAT_NEXT 100 // every 100ms ( with 1ms checkkeys() call. 20 for 10ms call)
26
27#define KEY_PIN key1_PORT->IDR
28
29
30void checkKeys(void);
31uint32_t get_key_press(uint32_t key_mask );
32uint32_t get_key_rpt(uint32_t key_mask );
33uint32_t get_key_short(uint32_t key_mask );
34uint32_t get_key_long(uint32_t key_mask );
35void clear_input(void);
36
37
38#endif
Note: See TracBrowser for help on using the repository browser.