Subversion Repositories FlightCtrl

Rev

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

Rev 1775 Rev 1821
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
 
5
 
6
#define J3HIGH    PORTD |= (1<<PORTD5)
6
#define J3HIGH    PORTD |= (1<<PORTD5)
7
#define J3LOW     PORTD &= ~(1<<PORTD5)
7
#define J3LOW     PORTD &= ~(1<<PORTD5)
8
#define J3TOGGLE  PORTD ^= (1<<PORTD5)
8
#define J3TOGGLE  PORTD ^= (1<<PORTD5)
9
 
9
 
10
#define J4HIGH    PORTD |= (1<<PORTD4)
10
#define J4HIGH    PORTD |= (1<<PORTD4)
11
#define J4LOW     PORTD &= ~(1<<PORTD4)
11
#define J4LOW     PORTD &= ~(1<<PORTD4)
12
#define J4TOGGLE  PORTD ^= (1<<PORTD4)
12
#define J4TOGGLE  PORTD ^= (1<<PORTD4)
13
 
13
 
14
#define J5HIGH    PORTD |= (1<<PORTD3)
14
#define J5HIGH    PORTD |= (1<<PORTD3)
15
#define J5LOW     PORTD &= ~(1<<PORTD3)
15
#define J5LOW     PORTD &= ~(1<<PORTD3)
16
#define J5TOGGLE  PORTD ^= (1<<PORTD3)
16
#define J5TOGGLE  PORTD ^= (1<<PORTD3)
17
 
17
 
18
#define MAX_CHANNELS 10
18
#define MAX_CHANNELS 10
19
 
19
 
20
// Number of cycles a command must be repeated before commit.
20
// Number of cycles a command must be repeated before commit.
21
#define COMMAND_TIMER 200
21
#define COMMAND_TIMER 200
22
 
22
 
23
extern void RC_Init (void);
23
extern void RC_Init(void);
24
// the RC-Signal. todo: Not export any more.
24
// the RC-Signal. todo: Not export any more.
25
extern volatile int16_t PPM_in[MAX_CHANNELS];
25
extern volatile int16_t PPM_in[MAX_CHANNELS];
26
// extern volatile int16_t PPM_diff[MAX_CHANNELS];      // the differentiated RC-Signal. Should that be exported??
26
// extern volatile int16_t PPM_diff[MAX_CHANNELS];      // the differentiated RC-Signal. Should that be exported??
27
extern volatile uint8_t NewPpmData;     // 0 indicates a new recieved PPM Frame
27
extern volatile uint8_t NewPpmData; // 0 indicates a new recieved PPM Frame
28
extern volatile int16_t RC_Quality;     // rc signal quality indicator (0 to 200)
28
extern volatile int16_t RC_Quality; // rc signal quality indicator (0 to 200)
29
 
29
 
30
// defines for lookup staticParams.ChannelAssignment
30
// defines for lookup staticParams.ChannelAssignment
31
#define CH_PITCH        0
31
#define CH_PITCH        0
32
#define CH_ROLL         1
32
#define CH_ROLL         1
33
#define CH_THROTTLE     2
33
#define CH_THROTTLE     2
34
#define CH_YAW          3
34
#define CH_YAW          3
35
#define CH_POTS         4
35
#define CH_POTS         4
36
#define POT_OFFSET      115
36
#define POT_OFFSET      115
37
 
37
 
38
/*
38
/*
39
int16_t  RC_getPitch        (void);
39
 int16_t  RC_getPitch        (void);
40
int16_t  RC_getYaw          (void);
40
 int16_t  RC_getYaw          (void);
41
int16_t  RC_getRoll         (void);
41
 int16_t  RC_getRoll         (void);
42
uint16_t RC_getThrottle     (void);
42
 uint16_t RC_getThrottle     (void);
43
uint8_t  RC_hasNewRCData    (void);
43
 uint8_t  RC_hasNewRCData    (void);
44
*/
44
 */
45
 
45
 
46
void       RC_update(void);
46
void RC_update(void);
47
int16_t*   RC_getPRTY(void);
47
int16_t* RC_getPRTY(void);
48
uint8_t    RC_getArgument(void);
48
uint8_t RC_getArgument(void);
49
uint8_t    RC_getCommand(void);
49
uint8_t RC_getCommand(void);
50
int16_t    RC_getVariable(uint8_t varNum);
50
int16_t RC_getVariable(uint8_t varNum);
51
void       RC_calibrate(void);
51
void RC_calibrate(void);
52
uint8_t    RC_getSignalQuality(void);
52
uint8_t RC_getSignalQuality(void);
53
uint8_t    RC_getLooping(uint8_t looping);
53
uint8_t RC_getLooping(uint8_t looping);
54
uint8_t    RC_testCompassCalState(void);
54
uint8_t RC_testCompassCalState(void);
55
#endif //_RC_H
55
#endif //_RC_H
56
 
56