COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
prkx2su_lib.h
Go to the documentation of this file.
1 /********************************************************************
2 * Copyright (C) 2015 by Interstel Technologies, Inc.
3 * and Hawaii Space Flight Laboratory.
4 *
5 * This file is part of the COSMOS/core that is the central
6 * module for COSMOS. For more information on COSMOS go to
7 * <http://cosmos-project.com>
8 *
9 * The COSMOS/core software is licenced under the
10 * GNU Lesser General Public License (LGPL) version 3 licence.
11 *
12 * You should have received a copy of the
13 * GNU Lesser General Public License
14 * If not, go to <http://www.gnu.org/licenses/>
15 *
16 * COSMOS/core is free software: you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public License
18 * as published by the Free Software Foundation, either version 3 of
19 * the License, or (at your option) any later version.
20 *
21 * COSMOS/core is distributed in the hope that it will be useful, but
22 * WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
25 *
26 * Refer to the "licences" folder for further information on the
27 * condititons and terms to use this software.
28 ********************************************************************/
29 
37 #ifndef _prkx2suLIB_H
38 #define _prkx2suLIB_H 1
39 
40 #include "support/configCosmos.h"
41 
42 #include "math/mathlib.h"
43 #include "support/cosmos-errno.h"
45 
46 #include <stdio.h>
47 
48 #define PRKX2SU_ID 1
49 #define PRKX2SU_BAUD 9600
50 #define PRKX2SU_BITS 8
51 #define PRKX2SU_PARITY 0
52 #define PRKX2SU_STOPBITS 1
53 
54 #define PRKX2SU_AXIS_AZ 0
55 #define PRKX2SU_AXIS_EL 1
56 
63  {
64  uint8_t azid;
65  uint8_t azstatus;
66  int32_t az_center;
67  int32_t az_mode;
69  float az_offset;
70  float minaz;
71  float maxaz;
72  float currentaz;
73  float targetaz;
74  uint8_t elid;
75  uint8_t elstatus;
77  float el_offset;
78  float minel;
79  float maxel;
80  float currentel;
81  float targetel;
82  float minimumel;
83  float sensitivity;
84  int32_t in_command;
85  int32_t data_received;
86  } ;
87 
88 int32_t prkx2su_init(string device);
89 int32_t prkx2su_connect();
90 int32_t prkx2su_disconnect();
91 int32_t prkx2su_calibrate_offset(int32_t axis);
92 float prkx2su_get_az();
93 float prkx2su_get_el();
94 int32_t prkx2su_get_az_el(float &az, float &el);
95 float prkx2su_get_az_offset();
96 float prkx2su_get_el_offset();
97 void prkx2su_get_state(prkx2su_state &state);
98 int32_t prkx2su_goto(float az, float el);
99 int32_t prkx2su_stop(uint8_t axis);
100 int32_t prkx2su_ramp(uint8_t axis, uint8_t speed);
101 int32_t prkx2su_minimum_speed(uint8_t axis, uint8_t speed);
102 int32_t prkx2su_maximum_speed(uint8_t axis, uint8_t speed);
103 int32_t prkx2su_getdata(uint8_t axis, string buf, uint16_t buflen);
104 int32_t prkx2su_send(uint8_t axis, string buf, bool force);
105 int32_t prkx2su_test(uint8_t axis);
106 int32_t prkx2su_set_sensitivity(float sensitivity);
107 int32_t prkx2su_get_limits(uint8_t axis);
108 
109 #endif
int32_t prkx2su_maximum_speed(uint8_t axis, uint8_t speed)
Definition: prkx2su_lib.cpp:311
prkx2su state
Definition: prkx2su_lib.h:62
uint8_t elstatus
Definition: prkx2su_lib.h:75
float minaz
Definition: prkx2su_lib.h:70
int32_t prkx2su_set_sensitivity(float sensitivity)
Definition: prkx2su_lib.cpp:491
float prkx2su_get_az()
Definition: prkx2su_lib.cpp:375
int32_t prkx2su_getdata(uint8_t axis, string buf, uint16_t buflen)
Definition: prkx2su_lib.cpp:155
float el_offset
Definition: prkx2su_lib.h:77
int32_t prkx2su_init(string device)
Definition: prkx2su_lib.cpp:44
float currentel
Definition: prkx2su_lib.h:80
float sensitivity
Definition: prkx2su_lib.h:83
float prkx2su_get_el()
Definition: prkx2su_lib.cpp:380
int32_t prkx2su_minimum_speed(uint8_t axis, uint8_t speed)
Definition: prkx2su_lib.cpp:292
int32_t prkx2su_calibrate_offset(int32_t axis)
int32_t prkx2su_connect()
Definition: prkx2su_lib.cpp:65
float targetel
Definition: prkx2su_lib.h:81
void prkx2su_get_state(prkx2su_state &state)
Definition: prkx2su_lib.cpp:442
int32_t prkx2su_test(uint8_t axis)
Definition: prkx2su_lib.cpp:447
uint8_t azstatus
Definition: prkx2su_lib.h:65
int32_t az_mode
Definition: prkx2su_lib.h:67
int32_t az_offset_waiting
Definition: prkx2su_lib.h:68
float prkx2su_get_el_offset()
Definition: prkx2su_lib.cpp:437
int32_t az_center
Definition: prkx2su_lib.h:66
int32_t prkx2su_stop(uint8_t axis)
Definition: prkx2su_lib.cpp:266
Headers and definitions common to all COSMOS.
int32_t data_received
Definition: prkx2su_lib.h:85
uint8_t elid
Definition: prkx2su_lib.h:74
COSMOS Error Codes.
float minel
Definition: prkx2su_lib.h:78
int32_t prkx2su_ramp(uint8_t axis, uint8_t speed)
Definition: prkx2su_lib.cpp:273
int32_t prkx2su_send(uint8_t axis, string buf, bool force)
Definition: prkx2su_lib.cpp:471
int32_t prkx2su_get_limits(uint8_t axis)
Definition: prkx2su_lib.cpp:212
int32_t el_offset_waiting
Definition: prkx2su_lib.h:76
int32_t in_command
Definition: prkx2su_lib.h:84
mathlib include file
float maxaz
Definition: prkx2su_lib.h:71
float speed
Definition: netperf_send.cpp:40
float currentaz
Definition: prkx2su_lib.h:72
float minimumel
Definition: prkx2su_lib.h:82
float az_offset
Definition: prkx2su_lib.h:69
float targetaz
Definition: prkx2su_lib.h:73
char buf[128]
Definition: rw_test.cpp:40
float maxel
Definition: prkx2su_lib.h:79
uint8_t azid
Definition: prkx2su_lib.h:64
int32_t prkx2su_goto(float az, float el)
Definition: prkx2su_lib.cpp:330
int32_t prkx2su_disconnect()
Definition: prkx2su_lib.cpp:131
static string device
Definition: ax25_recv.cpp:39
float prkx2su_get_az_offset()
Definition: prkx2su_lib.cpp:432
int32_t prkx2su_get_az_el(float &az, float &el)
Definition: prkx2su_lib.cpp:385