Subversion Repositories FlightCtrl

Rev

Rev 1206 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1206 Rev 1207
Line -... Line 1...
-
 
1
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
 
2
// This code has been derived from the implementation of Stefan Engelke.
-
 
3
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
 
4
/*
-
 
5
    Copyright (c) 2008 Stefan Engelke <stefan@tinkerer.eu>
-
 
6
 
-
 
7
    Permission is hereby granted, free of charge, to any person
-
 
8
    obtaining a copy of this software and associated documentation
-
 
9
    files (the "Software"), to deal in the Software without
-
 
10
    restriction, including without limitation the rights to use, copy,
-
 
11
    modify, merge, publish, distribute, sublicense, and/or sell copies
-
 
12
    of the Software, and to permit persons to whom the Software is
-
 
13
    furnished to do so, subject to the following conditions:
-
 
14
 
-
 
15
    The above copyright notice and this permission notice shall be
1
#include "dsl.h"
16
    included in all copies or substantial portions of the Software.
-
 
17
 
-
 
18
    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-
 
19
    EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-
 
20
    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-
 
21
    NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-
 
22
    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-
 
23
    WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-
 
24
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2
#include "rc.h"
25
    DEALINGS IN THE SOFTWARE.
-
 
26
 
-
 
27
    $Id: rcdsl.c 60 2008-08-21 07:50:48Z taser $
-
 
28
 
-
 
29
    RCDSL.H and RCDSL.C is an INOFFICIAL implementation of the
-
 
30
    communication protocol used by DSL receivers of Act Europe.
-
 
31
    The DSL receivers have a serial communication port to connect
-
 
32
    two receivers in diversity mode. Each receiver is sending the
-
 
33
    received servo signals periodically over this port. This fact
-
 
34
    can be used to connect the receiver to the control unit of the
-
 
35
    model via UART instead of evaluating the PPM signal.
-
 
36
 
-
 
37
    If you have any questions, fell free to send me an e-mail.
-
 
38
 
-
 
39
*/
-
 
40
 
Line 3... Line 41...
3
 
41
 
4
/*
42
/*
5
Connection of DSL to SV1 of FC:
43
Connection of DSL to SV1 of FC:
Line 10... Line 48...
10
3. RXD <--> pin 4 (TXD1 Atmega644p) optional
48
3. RXD <--> pin 4 (TXD1 Atmega644p) optional
11
4. 5V  <--> pin 2 (5V)
49
4. 5V  <--> pin 2 (5V)
Line 12... Line 50...
12
 
50
 
Line 13... Line 51...
13
Do not connect the receiver via PPM-Sumsignal output the same time.
51
Do not connect the receiver via PPM-Sumsignal output the same time.
Line 14... Line 52...
14
 
52
 
Line 15... Line 53...
15
Data are send at 38400baud8n1
53
Data are send at every 20 ms @ 38400 Baud 8-N-1
16
 
54
 
17
Data Frame: |0xFF|0xFF|0x1F|FREQALLOC|??|RSSI|VBAT|??|CRC|10|CH0D1|CH0D0|CH1D1|CH1D0|CRC| ...etc
55
Data Frame: |0xFF|0xFF|0x1F|FREQALLOC|??|RSSI|VBAT|??|CRC|10|CH0D1|CH0D0|CH1D1|CH1D0|CRC| ...etc
Line 18... Line 56...
18
 
56
 
19
FREQALLOC = 35, 40, 72
57
FREQALLOC = 35, 40, 72
20
RSSI = 0.. 255 // Received signal strength indicator
58
RSSI = 0.. 255 // Received signal strength indicator
21
VBAT = 0...255 // supply voltage (0.0V.. 8.2V)
59
VBAT = 0...255 // supply voltage (0.0V.. 7.8V)
Line 45... Line 83...
45
FFFF 1F23F000A30426
83
FFFF 1F23F000A30426
46
FFFF 1F23F000A30426
84
FFFF 1F23F000A30426
47
FFFF 1F23F000A30426
85
FFFF 1F23F000A30426
48
*/
86
*/
Line -... Line 87...
-
 
87
 
-
 
88
 
-
 
89
#include "dsl.h"
49
 
90
#include "rc.h"
50
uint8_t dsl_RSSI = 0;
91
uint8_t dsl_RSSI = 0;
51
uint8_t dsl_Battery = 0;
92
uint8_t dsl_Battery = 0;
52
uint8_t dsl_Allocation = 0;
93
uint8_t dsl_Allocation = 0;