summaryrefslogtreecommitdiffstats
path: root/kstars/kstars/indi/celestronprotocol.h
blob: aae4f204950eddb64b897062e787b7a9f05bd8ab (plain)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/*
* Header File for the Telescope Control protocols for the Meade LX200
* Author:  John Kielkopf (kielkopf@louisville.edu)
*
* This file tqcontains header information used in common with xmtel.
*
* 15 May 2003 -- Version 2.00
*
*/


#ifndef CELESTRON_PROTOCOL_H
#define CELESTRON_PROTOCOL_H

/* These are user defined quantities that set the limits over which it */
/* is safe to operate the telescope.  */


/* LOWER is the number of degrees from the zenith that you will allow. */
/* Use 80, for example, to keep the eyepiece end out of the fork arm space */
/* of an LX200 telescope. */

#define LOWER         90.

/* HIGHER is the horizon.  0 is an unobstructed horizon in every direction. */
/* Use 10, for example, to limit sighting below 10 degrees above the horizon. */

#define HIGHER         0.


/* Set this if a slew to the north sends the telescope south. */

#define REVERSE_NS	0 	/* 1 for reverse; 0 for normal. */


/* Set this for maximum slew rate allowed in degree/sec. */

#define MAXSLEWRATE	4 	/* 2 for safety; 4 for 16-inch; 8 otherwise. */




/* The following parameters are used internally to set speed and direction. */
/* Do not change these values. */


#define	SLEW		0
#define	FIND		1
#define	CENTER		2
#define	GUIDE		3

#if REVERSE_NS > 0
#define	NORTH		3
#define	SOUTH		0
#else
#define	NORTH		0
#define	SOUTH		3
#endif

#define	EAST		2
#define	WEST		1

/* Slew speed defines */

# define SLEWRATE8     8    /* should be 8 degrees per second (not 16-inch) */
# define SLEWRATE4     4    /* should be 4 degrees per second */
# define SLEWRATE3     3    /* should be 3 degrees per second */
# define SLEWRATE2     2    /* should be 2 degrees per second */

/* Reticle defines */

#define BRIGHTER        16  /* increase */
#define DIMMER          8   /* decrease */
#define BLINK0          0   /* no blinking */ 
#define BLINK1          1   /* blink rate 1 */
#define BLINK2          2   /* blink rate 2 */
#define BLINK3          4   /* blink rate 3 */
 

/* Focus defines */

#define FOCUSOUT        8   /* positive voltage output */
#define FOCUSIN         4   /* negative voltage output */
#define FOCUSSTOP       0   /* no output */ 
#define FOCUSSLOW       1   /* half voltage */
#define FOCUSFAST       2   /* full voltage */


/* Rotator defines */

#define ROTATORON        1   /* image rotator on */
#define ROTATOROFF       0   /* image rotator off */


/* Fan defines */

#define FANON        1   /* cooling fan on */
#define FANOFF       0   /* cooling fan off */

#ifdef __cplusplus
extern "C" {
#endif

int ConnectTel(char *port);
void DisconnectTel(void);
int  CheckConnectTel(void);

void SetRate(int newRate);
void SetLimits(double limitLower, double limitHigher);
void StartSlew(int direction);
void StopSlew(int direction);
double GetRA(void);
double GetDec(void);
int  SlewToCoords(double newRA, double newDec);
int  SyncToCoords(double newRA, double newDec);
int  CheckCoords(double desRA, double desDec);

void StopNSEW(void);
int  SetSlewRate(void);

int  SyncLST(double newTime);
int  SyncLocalTime();

void Reticle(int reticle);
void Focus(int focus);
void Derotator(int rotate);
void Fan(int fan);

#ifdef __cplusplus
}
#endif

#endif