-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathSpektrum.h
34 lines (27 loc) · 842 Bytes
/
Spektrum.h
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
/*
ChibiCopter - https://github.com/grantmd/ChibiCopter
A quadcopter platform running under ChibiOS/RT.
Talks to a Spektrum Satellite receiver over Serial and receives commands
*/
#ifndef _SPEKTRUM_H_
#define _SPEKTRUM_H_
// Warning: Possibly only accurate for the DX6i TX
#define MAX_RC_CHANNELS 7
#define AILE_CHANNEL 0
#define AUX1_CHANNEL 1 // Flaps?
#define ELEV_CHANNEL 2
#define RUDD_CHANNEL 3
#define THROTTLE_CHANNEL 4
#define GEAR_CHANNEL 5
#define AUX2_CHANNEL 6
extern EventSource spektrum_event;
// Public functions
void SpektrumInit(void);
int getSpektrumData(int channel);
// Private functions
unsigned char _SpektrumParse(uint8_t c);
long _SpektrumGetFrameNum(void);
void _SpektrumInvalidateFrame(void);
void _SpektrumValidateFrame(void);
unsigned char _SpektrumFrameIsValid(void);
#endif /* _SPEKTRUM_H_ */