Instrument Neutral Distributed Interface INDI  2.0.2
lx200apdriver.h
Go to the documentation of this file.
1 /*
2  LX200 AP Driver
3  Copyright (C) 2007 Markus Wildi
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with this library; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 
19 */
20 
21 #pragma once
22 
23 // Used by cp2 driver
24 #define setAPPark(fd) write(fd, "#:KA#", 4)
25 #define setAPUnPark(fd) write(fd, "#:PO#", 4)
26 
27 // Used by several drivers
28 #define getAPVersionNumber(fd, x) getCommandString(fd, x, "#:V#")
29 #define setAPClearBuffer(fd) write(fd, "#", 1) /* AP key pad manual startup sequence */
30 #define setAPBackLashCompensation(fd, x, y, z) setCommandXYZ(fd, x, y, z, "#:Br")
31 
32 #define AP_TRACKING_SIDEREAL 0
33 #define AP_TRACKING_SOLAR 1
34 #define AP_TRACKING_LUNAR 2
35 #define AP_TRACKING_CUSTOM 3
36 #define AP_TRACKING_OFF 4
37 
38 #define AP_PEC_OFF 0
39 #define AP_PEC_ON 1
40 #define AP_PEC_RECORD 2
41 #define AP_PEC_ENCODER 3
42 
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
47 void set_lx200ap_name(const char *deviceName, unsigned int debug_level);
49 int getAPUTCOffset(int fd, double *value);
50 int setAPObjectAZ(int fd, double az);
51 int setAPObjectAlt(int fd, double alt);
52 int setAPUTCOffset(int fd, double hours);
53 int setAPSlewMode(int fd, int slewMode);
54 int APSyncCM(int fd, char *matchedObject);
55 int APSyncCMR(int fd, char *matchedObject);
56 
58 {
64 };
65 
66 // Rate selection for legacy drivers
67 int selectAPMoveToRate(int fd, int moveToIndex);
68 int selectAPSlewRate(int fd, int slewIndex);
69 int selectAPCenterRate(int fd, int centerIndex);
70 // Support rate tables in newer drivers
71 int selectAPV2CenterRate(int fd, int centerIndex, APRateTableState rateTable);
72 
73 int selectAPTrackingMode(int fd, int trackMode);
74 int selectAPGuideRate(int fd, int guideRate);
75 int selectAPPECState(int fd, int pecstate);
76 int swapAPButtons(int fd, int currentSwap);
77 int setAPObjectRA(int fd, double ra);
78 int setAPObjectDEC(int fd, double dec);
79 int setAPSiteLongitude(int fd, double Long);
80 int setAPSiteLatitude(int fd, double Lat);
81 int setAPRATrackRate(int fd, double rate);
82 int setAPDETrackRate(int fd, double rate);
83 int APSendPulseCmd(int fd, int direction, int duration_msec);
84 void set_lx200ap_exp_name(const char *deviceName, unsigned int debug_level);
85 int check_lx200ap_status(int fd, char *parkStatus, char *slewStatus);
86 int APParkMount(int fd);
87 int APUnParkMount(int fd);
88 int getAPWormPosition(int fd, int *position);
89 
90 // Make sure the buffer passed in to getApStatusString (statusString) is at least 32 bytes.
91 int getApStatusString(int fd, char *statusString);
92 bool apStatusParked(const char *statusString);
93 bool apStatusSlewing(const char *statusString);
94 const char *apMountStatus(const char *statusString);
95 int isAPInitialized(int fd, bool *isInitialized);
96 
97 APRateTableState apRateTable(const char *statusString);
98 int getApMountFeatures(int fd, bool *hasEncoder, bool *clutchAware);
99 bool apCanHome(int fd);
100 int apHomeAndSync(int fd);
101 
102 #ifdef __cplusplus
103 }
104 #endif
double ra
double dec
int fd
Definition: intelliscope.c:43
int selectAPMoveToRate(int fd, int moveToIndex)
bool apStatusParked(const char *statusString)
APRateTableState
Definition: lx200apdriver.h:58
@ AP_RATE_TABLE_1
Definition: lx200apdriver.h:60
@ AP_RATE_TABLE_2
Definition: lx200apdriver.h:61
@ AP_RATE_TABLE_DEFAULT
Definition: lx200apdriver.h:63
@ AP_RATE_TABLE_3
Definition: lx200apdriver.h:62
@ AP_RATE_TABLE_0
Definition: lx200apdriver.h:59
int check_lx200ap_connection(int fd)
int setAPUTCOffset(int fd, double hours)
int setAPSiteLatitude(int fd, double Lat)
int getAPWormPosition(int fd, int *position)
void set_lx200ap_name(const char *deviceName, unsigned int debug_level)
int setAPRATrackRate(int fd, double rate)
int apHomeAndSync(int fd)
int setAPObjectRA(int fd, double ra)
int APSyncCMR(int fd, char *matchedObject)
int setAPObjectAlt(int fd, double alt)
int swapAPButtons(int fd, int currentSwap)
int setAPObjectDEC(int fd, double dec)
int isAPInitialized(int fd, bool *isInitialized)
int APSendPulseCmd(int fd, int direction, int duration_msec)
const char * apMountStatus(const char *statusString)
void set_lx200ap_exp_name(const char *deviceName, unsigned int debug_level)
int selectAPCenterRate(int fd, int centerIndex)
int APParkMount(int fd)
int selectAPSlewRate(int fd, int slewIndex)
int getApStatusString(int fd, char *statusString)
int check_lx200ap_status(int fd, char *parkStatus, char *slewStatus)
int APUnParkMount(int fd)
bool apCanHome(int fd)
int selectAPPECState(int fd, int pecstate)
int selectAPGuideRate(int fd, int guideRate)
APRateTableState apRateTable(const char *statusString)
int setAPObjectAZ(int fd, double az)
int APSyncCM(int fd, char *matchedObject)
int getApMountFeatures(int fd, bool *hasEncoder, bool *clutchAware)
int getAPUTCOffset(int fd, double *value)
int setAPSlewMode(int fd, int slewMode)
int setAPDETrackRate(int fd, double rate)
bool apStatusSlewing(const char *statusString)
int setAPSiteLongitude(int fd, double Long)
int selectAPV2CenterRate(int fd, int centerIndex, APRateTableState rateTable)
int selectAPTrackingMode(int fd, int trackMode)