Rev 1821 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1612 | dongfang | 1 | #ifndef _RC_H |
2 | #define _RC_H |
||
3 | |||
4 | #include <inttypes.h> |
||
5 | |||
6 | #define J3HIGH PORTD |= (1<<PORTD5) |
||
7 | #define J3LOW PORTD &= ~(1<<PORTD5) |
||
8 | #define J3TOGGLE PORTD ^= (1<<PORTD5) |
||
9 | |||
10 | #define J4HIGH PORTD |= (1<<PORTD4) |
||
11 | #define J4LOW PORTD &= ~(1<<PORTD4) |
||
12 | #define J4TOGGLE PORTD ^= (1<<PORTD4) |
||
13 | |||
14 | #define J5HIGH PORTD |= (1<<PORTD3) |
||
15 | #define J5LOW PORTD &= ~(1<<PORTD3) |
||
16 | #define J5TOGGLE PORTD ^= (1<<PORTD3) |
||
17 | |||
18 | #define MAX_CHANNELS 10 |
||
19 | |||
20 | extern void RC_Init (void); |
||
21 | // the RC-Signal. todo: Not export any more. |
||
22 | extern volatile int16_t PPM_in[MAX_CHANNELS]; |
||
23 | extern volatile int16_t PPM_diff[MAX_CHANNELS]; // the differentiated RC-Signal. Should that be exported?? |
||
24 | extern volatile uint8_t NewPpmData; // 0 indicates a new recieved PPM Frame |
||
25 | extern volatile int16_t RC_Quality; // rc signal quality indicator (0 to 200) |
||
26 | |||
27 | // defines for lookup staticParams.ChannelAssignment |
||
28 | #define CH_PITCH 0 |
||
29 | #define CH_ROLL 1 |
||
30 | #define CH_THROTTLE 2 |
||
31 | #define CH_YAW 3 |
||
32 | #define CH_POTS 4 |
||
33 | #define POT_OFFSET 110 |
||
34 | |||
35 | /* |
||
36 | int16_t RC_getPitch (void); |
||
37 | int16_t RC_getYaw (void); |
||
38 | int16_t RC_getRoll (void); |
||
39 | uint16_t RC_getThrottle (void); |
||
40 | uint8_t RC_hasNewRCData (void); |
||
41 | */ |
||
42 | |||
43 | void RC_update(void); |
||
44 | int16_t* RC_getPRTY(void); |
||
45 | uint8_t RC_getArgument(void); |
||
46 | uint8_t RC_getCommand(void); |
||
47 | int16_t RC_getVariable(uint8_t varNum); |
||
48 | void RC_calibrate(void); |
||
49 | uint8_t RC_getSignalQuality(void); |
||
50 | uint8_t RC_getLooping(uint8_t looping); |
||
51 | |||
52 | #endif //_RC_H |