Subversion Repositories FlightCtrl

Rev

Rev 2108 | Rev 2110 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2108 Rev 2109
1
#ifndef _RC_H
1
#ifndef _RC_H
2
#define _RC_H
2
#define _RC_H
3
 
3
 
4
#include <inttypes.h>
4
#include <inttypes.h>
5
#include "configuration.h"
5
#include "configuration.h"
6
 
6
 
7
// Number of cycles a command must be repeated before commit.
7
// Number of cycles a command must be repeated before commit.
8
#define COMMAND_TIMER 200
8
#define COMMAND_TIMER 200
9
 
9
 
10
extern void RC_Init(void);
10
extern void RC_Init(void);
11
// the RC-Signal. todo: Not export any more.
11
// the RC-Signal. todo: Not export any more.
12
extern volatile int16_t PPM_in[MAX_CHANNELS];
12
extern volatile int16_t PPM_in[MAX_CHANNELS];
13
// extern volatile int16_t PPM_diff[MAX_CHANNELS];      // the differentiated RC-Signal. Should that be exported??
13
// extern volatile int16_t PPM_diff[MAX_CHANNELS];      // the differentiated RC-Signal. Should that be exported??
14
extern volatile uint8_t NewPpmData; // 0 indicates a new recieved PPM Frame
14
extern volatile uint8_t NewPpmData; // 0 indicates a new recieved PPM Frame
15
extern volatile uint8_t RCQuality;  // rc signal quality indicator (0 to 200)
15
extern volatile uint8_t RCQuality;  // rc signal quality indicator (0 to 200)
16
 
16
 
17
// defines for lookup staticParams.ChannelAssignment
17
// defines for lookup staticParams.ChannelAssignment
18
#define CH_ELEVATOR     0
18
#define CH_ELEVATOR     0
19
#define CH_AILERONS         1
19
#define CH_AILERONS         1
20
#define CH_THROTTLE         2
20
#define CH_THROTTLE         2
21
#define CH_RUDDER       3
21
#define CH_RUDDER       3
22
#define CH_MODESWITCH   4
22
#define CH_MODESWITCH   4
23
#define CH_POTS         4
23
#define CH_POTS         4
-
 
24
 
-
 
25
// These are a little individual for differnt R/C systems... trim for zero channel readings at zero
-
 
26
// stick, and trim VARIABLE_OFFSET for full variable range 0..255.
24
#define POT_OFFSET      120
27
#define VARIABLE_OFFSET      106
-
 
28
#define RC_TRIM              19
-
 
29
// Set this for a full stick range of about -1024..1024.
-
 
30
#define RC_SCALING           1
25
 
31
 
26
/*
32
/*
27
 int16_t  RC_getPitch        (void);
33
 int16_t  RC_getPitch        (void);
28
 int16_t  RC_getYaw          (void);
34
 int16_t  RC_getYaw          (void);
29
 int16_t  RC_getRoll         (void);
35
 int16_t  RC_getRoll         (void);
30
 uint16_t RC_getThrottle     (void);
36
 uint16_t RC_getThrottle     (void);
31
 uint8_t  RC_hasNewRCData    (void);
37
 uint8_t  RC_hasNewRCData    (void);
32
 */
38
 */
33
 
39
 
34
// void RC_periodicTask(void);
40
// void RC_periodicTask(void);
35
void RC_periodicTaskAndPRYT(int16_t* PRYT);
41
void RC_periodicTaskAndPRYT(int16_t* PRYT);
36
uint8_t RC_getArgument(void);
42
uint8_t RC_getArgument(void);
37
uint8_t RC_getCommand(void);
43
uint8_t RC_getCommand(void);
38
int16_t RC_getVariable(uint8_t varNum);
44
int16_t RC_getVariable(uint8_t varNum);
39
void RC_calibrate(void);
45
void RC_calibrate(void);
40
uint8_t RC_getSignalQuality(void);
46
uint8_t RC_getSignalQuality(void);
41
uint8_t RC_getLooping(uint8_t looping);
47
uint8_t RC_getLooping(uint8_t looping);
42
#ifdef USE_MK3MAG
48
#ifdef USE_MK3MAG
43
uint8_t RC_testCompassCalState(void);
49
uint8_t RC_testCompassCalState(void);
44
#endif
50
#endif
45
#endif //_RC_H
51
#endif //_RC_H
46
 
52