Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/**
******************************************************************************
* @file Remote_Control.h
* @author Ginger
* @version V1.0.0
* @date 2015/11/14
* @brief
******************************************************************************
* @attention
*
******************************************************************************
*/
#ifndef __RC__
#define __RC__
/* Includes ------------------------------------------------------------------*/
#include "stm32f4xx_hal.h"
#define RC_Frame_Lentgh 18
typedef struct {
int16_t ch1; //each ch value from -364 -- +364
int16_t ch2;
int16_t ch3;
int16_t ch4;
uint8_t switch_left; //3 value
uint8_t switch_right;
struct {
int16_t x;
int16_t y;
int16_t z;
uint8_t press_left;
uint8_t press_right;
}mouse;
struct {
uint16_t key_code;
/**********************************************************************************
* ͨ:15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
* V C X Z G F R E Q CTRL SHIFT D A S W
************************************************************************************/
}keyBoard;
}RC_Type;
enum{
Switch_Up = 1,
Switch_Middle = 3,
Switch_Down = 2,
};
enum{
Key_W,
Key_S,
//...
};
extern RC_Type remote_control;
extern uint32_t Latest_Remote_Control_Pack_Time ;
void Callback_RC_Handle(RC_Type* rc, uint8_t* buff);
#endif