2014-01-06 00:20:30 +01:00
|
|
|
#ifndef HENGLONG_H_INCLUDED
|
|
|
|
#define HENGLONG_H_INCLUDED
|
|
|
|
|
|
|
|
#include <linux/input.h>
|
2014-01-06 21:38:22 +01:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <inttypes.h>
|
2014-01-06 00:20:30 +01:00
|
|
|
|
|
|
|
|
|
|
|
typedef struct henglong_t
|
|
|
|
{
|
|
|
|
int velocity, direction;
|
2014-02-05 06:43:14 +01:00
|
|
|
int ignation, mg, fire, turretelev, turret_left, turret_right, recoil, tilt_up, tilt_down, pan_left, pan_right;
|
2014-01-06 21:38:22 +01:00
|
|
|
uint8_t clisel;
|
|
|
|
unsigned char servoff;
|
2014-01-06 00:20:30 +01:00
|
|
|
} henglong_t;
|
|
|
|
|
|
|
|
int CRC(int data);
|
|
|
|
int data2frame(int data);
|
|
|
|
int values2data(int velocity, int direction, int ignation, int mg, int fire, int turretelev, int turret_left, int turret_right, int recoil);
|
|
|
|
void inithenglong(henglong_t* henglong);
|
|
|
|
int event2data(henglong_t* henglong, struct input_event event);
|
|
|
|
|
|
|
|
|
|
|
|
#endif // HENGLONG_H_INCLUDED
|