Instrument Neutral Distributed Interface INDI  1.9.5
Classes | Macros | Typedefs | Functions
stvdriver.h File Reference

Go to the source code of this file.

Classes

struct  IMAGE_INFO
 

Macros

#define OFF   0
 
#define ON   1
 
#define REQUEST_DOWNLOAD   0x00
 
#define REQUEST_DOWNLOAD_ALL   0x01
 
#define DOWNLOAD_COMPLETE   0x02
 
#define REQUEST_BUFFER_STATUS   0x03
 
#define REQUEST_IMAGE_INFO   0x04
 
#define REQUEST_IMAGE_DATA   0x05
 
#define ACK   0x06
 
#define REQUEST_COMPRESSED_IMAGE_DATA   0x07
 
#define SEND_KEY_PATTERN   0x08
 
#define DISPLAY_ECHO   0x09
 
#define FILE_STATUS   0x0b
 
#define REQUEST_ACK   0x10
 
#define NACK   0x15
 
#define LR_ROTARY_DECREASE_PATTERN   0x8000
 
#define LR_ROTARY_INCREASE_PATTERN   0x4000
 
#define UD_ROTARY_DECREASE_PATTERN   0x2000
 
#define UD_ROTARY_INCREASE_PATTERN   0x1000
 
#define SHIFT_PATTERN   0x0008 /* increases rotary speed when 1 */
 
#define CAL_KEY_PATTERN   0x0100
 
#define TRACK_KEY_PATTERN   0x0200
 
#define DISPLAY_KEY_PATTERN   0x0400
 
#define FILEOPS_KEY_PATTERN   0x0800
 
#define A_KEY_PATTERN   0x0010
 
#define SETUP_KEY_PATTERN   0x0020
 
#define B_KEY_PATTERN   0x0040
 
#define INT_KEY_PATTERN   0x0080
 
#define FOCUS_KEY_PATTERN   0x0001
 
#define IMAGE_KEY_PATTERN   0x0002
 
#define MONITOR_KEY_PATTERN   0x0004
 
#define ID_BITS_MASK   0x0001 /* mask for no bits*/
 
#define ID_BITS_10   0x0001 /* image is full 10 bits*/
 
#define ID_BITS_8   0x0000 /* image from focus, only 8 bits*/
 
#define ID_UNITS_MASK   0x0002 /* mask for units for scope*/
 
#define ID_UNITS_INCHES   0x0002 /* units were inches*/
 
#define ID_UNITS_CM   0x0000 /* units were cm*/
 
#define ID_SCOPE_MASK   0x0004 /* mask for telescope type*/
 
#define ID_SCOPE_REFRACTOR   0x0004 /* scope was refractor*/
 
#define ID_SCOPE_REFLECTOR   0x0000 /* scope was reflector*/
 
#define ID_DATETIME_MASK   0x0008 /* mask for date/time valid*/
 
#define ID_DATETIME_VALID   0x0008 /* date/time was set*/
 
#define ID_DATETIME_INVALID   0x0000 /* date/time was not set*/
 
#define ID_BIN_MASK   0x0030 /* mask for binning mode*/
 
#define ID_BIN_1X1   0x0010 /* binning was 1x1*/
 
#define ID_BIN_2X2   0x0020 /* binning was 2x2*/
 
#define ID_BIN_3X3   0x0030 /* binning was 3x3*/
 
#define ID_PM_MASK   0x0400 /* mask for am/pm in time*/
 
#define ID_PM_PM   0x0400 /* time was pm, add 12 hours*/
 
#define ID_PM_AM   0x0000 /* time was am, don;t add 12 hours*/
 
#define ID_FILTER_MASK   0x0800 /* mask for filter status*/
 
#define ID_FILTER_LUNAR   0x0800 /* lunar filter was used for image*/
 
#define ID_FILTER_NP   0x0000 /* no filter was used for image*/
 
#define ID_DARKSUB_MASK   0x1000 /* mask for dark subtraction*/
 
#define ID_DARKSUB_YES   0x1000 /* image was dark subtracted*/
 
#define ID_DARKSUB_NO   0x0000 /* image was not dark subtracted*/
 
#define ID_MOSAIC_MASK   0x6000 /* mask for mosaic status*/
 
#define ID_MOSAIC_NONE   0x0000 /* no mosaic, one image per frame*/
 
#define ID_MOSAIC_SMALL   0x2000 /* small mosaic: 40x40 pixels/image*/
 
#define ID_MOSAIC_LARGE   0x4000 /* large mosaic: 106x100 pixels/image*/
 
#define PARITY_NONE   0
 
#define PARITY_EVEN   1
 
#define PARITY_ODD   2
 

Typedefs

typedef unsigned char byte
 

Functions

void shutdown_serial (int fd)
 
int init_serial (char *device_name, int bit_rate, int word_size, int parity, int stop_bits)
 
unsigned int calc_crc (byte byte_array[], int size)
 

Macro Definition Documentation

◆ A_KEY_PATTERN

#define A_KEY_PATTERN   0x0010

Definition at line 55 of file stvdriver.h.

◆ ACK

#define ACK   0x06

Definition at line 35 of file stvdriver.h.

◆ B_KEY_PATTERN

#define B_KEY_PATTERN   0x0040

Definition at line 57 of file stvdriver.h.

◆ CAL_KEY_PATTERN

#define CAL_KEY_PATTERN   0x0100

Definition at line 51 of file stvdriver.h.

◆ DISPLAY_ECHO

#define DISPLAY_ECHO   0x09

Definition at line 38 of file stvdriver.h.

◆ DISPLAY_KEY_PATTERN

#define DISPLAY_KEY_PATTERN   0x0400

Definition at line 53 of file stvdriver.h.

◆ DOWNLOAD_COMPLETE

#define DOWNLOAD_COMPLETE   0x02

Definition at line 31 of file stvdriver.h.

◆ FILE_STATUS

#define FILE_STATUS   0x0b

Definition at line 39 of file stvdriver.h.

◆ FILEOPS_KEY_PATTERN

#define FILEOPS_KEY_PATTERN   0x0800

Definition at line 54 of file stvdriver.h.

◆ FOCUS_KEY_PATTERN

#define FOCUS_KEY_PATTERN   0x0001

Definition at line 59 of file stvdriver.h.

◆ ID_BIN_1X1

#define ID_BIN_1X1   0x0010 /* binning was 1x1*/

Definition at line 77 of file stvdriver.h.

◆ ID_BIN_2X2

#define ID_BIN_2X2   0x0020 /* binning was 2x2*/

Definition at line 78 of file stvdriver.h.

◆ ID_BIN_3X3

#define ID_BIN_3X3   0x0030 /* binning was 3x3*/

Definition at line 79 of file stvdriver.h.

◆ ID_BIN_MASK

#define ID_BIN_MASK   0x0030 /* mask for binning mode*/

Definition at line 76 of file stvdriver.h.

◆ ID_BITS_10

#define ID_BITS_10   0x0001 /* image is full 10 bits*/

Definition at line 65 of file stvdriver.h.

◆ ID_BITS_8

#define ID_BITS_8   0x0000 /* image from focus, only 8 bits*/

Definition at line 66 of file stvdriver.h.

◆ ID_BITS_MASK

#define ID_BITS_MASK   0x0001 /* mask for no bits*/

Definition at line 64 of file stvdriver.h.

◆ ID_DARKSUB_MASK

#define ID_DARKSUB_MASK   0x1000 /* mask for dark subtraction*/

Definition at line 86 of file stvdriver.h.

◆ ID_DARKSUB_NO

#define ID_DARKSUB_NO   0x0000 /* image was not dark subtracted*/

Definition at line 88 of file stvdriver.h.

◆ ID_DARKSUB_YES

#define ID_DARKSUB_YES   0x1000 /* image was dark subtracted*/

Definition at line 87 of file stvdriver.h.

◆ ID_DATETIME_INVALID

#define ID_DATETIME_INVALID   0x0000 /* date/time was not set*/

Definition at line 75 of file stvdriver.h.

◆ ID_DATETIME_MASK

#define ID_DATETIME_MASK   0x0008 /* mask for date/time valid*/

Definition at line 73 of file stvdriver.h.

◆ ID_DATETIME_VALID

#define ID_DATETIME_VALID   0x0008 /* date/time was set*/

Definition at line 74 of file stvdriver.h.

◆ ID_FILTER_LUNAR

#define ID_FILTER_LUNAR   0x0800 /* lunar filter was used for image*/

Definition at line 84 of file stvdriver.h.

◆ ID_FILTER_MASK

#define ID_FILTER_MASK   0x0800 /* mask for filter status*/

Definition at line 83 of file stvdriver.h.

◆ ID_FILTER_NP

#define ID_FILTER_NP   0x0000 /* no filter was used for image*/

Definition at line 85 of file stvdriver.h.

◆ ID_MOSAIC_LARGE

#define ID_MOSAIC_LARGE   0x4000 /* large mosaic: 106x100 pixels/image*/

Definition at line 92 of file stvdriver.h.

◆ ID_MOSAIC_MASK

#define ID_MOSAIC_MASK   0x6000 /* mask for mosaic status*/

Definition at line 89 of file stvdriver.h.

◆ ID_MOSAIC_NONE

#define ID_MOSAIC_NONE   0x0000 /* no mosaic, one image per frame*/

Definition at line 90 of file stvdriver.h.

◆ ID_MOSAIC_SMALL

#define ID_MOSAIC_SMALL   0x2000 /* small mosaic: 40x40 pixels/image*/

Definition at line 91 of file stvdriver.h.

◆ ID_PM_AM

#define ID_PM_AM   0x0000 /* time was am, don;t add 12 hours*/

Definition at line 82 of file stvdriver.h.

◆ ID_PM_MASK

#define ID_PM_MASK   0x0400 /* mask for am/pm in time*/

Definition at line 80 of file stvdriver.h.

◆ ID_PM_PM

#define ID_PM_PM   0x0400 /* time was pm, add 12 hours*/

Definition at line 81 of file stvdriver.h.

◆ ID_SCOPE_MASK

#define ID_SCOPE_MASK   0x0004 /* mask for telescope type*/

Definition at line 70 of file stvdriver.h.

◆ ID_SCOPE_REFLECTOR

#define ID_SCOPE_REFLECTOR   0x0000 /* scope was reflector*/

Definition at line 72 of file stvdriver.h.

◆ ID_SCOPE_REFRACTOR

#define ID_SCOPE_REFRACTOR   0x0004 /* scope was refractor*/

Definition at line 71 of file stvdriver.h.

◆ ID_UNITS_CM

#define ID_UNITS_CM   0x0000 /* units were cm*/

Definition at line 69 of file stvdriver.h.

◆ ID_UNITS_INCHES

#define ID_UNITS_INCHES   0x0002 /* units were inches*/

Definition at line 68 of file stvdriver.h.

◆ ID_UNITS_MASK

#define ID_UNITS_MASK   0x0002 /* mask for units for scope*/

Definition at line 67 of file stvdriver.h.

◆ IMAGE_KEY_PATTERN

#define IMAGE_KEY_PATTERN   0x0002

Definition at line 60 of file stvdriver.h.

◆ INT_KEY_PATTERN

#define INT_KEY_PATTERN   0x0080

Definition at line 58 of file stvdriver.h.

◆ LR_ROTARY_DECREASE_PATTERN

#define LR_ROTARY_DECREASE_PATTERN   0x8000

Definition at line 44 of file stvdriver.h.

◆ LR_ROTARY_INCREASE_PATTERN

#define LR_ROTARY_INCREASE_PATTERN   0x4000

Definition at line 45 of file stvdriver.h.

◆ MONITOR_KEY_PATTERN

#define MONITOR_KEY_PATTERN   0x0004

Definition at line 61 of file stvdriver.h.

◆ NACK

#define NACK   0x15

Definition at line 41 of file stvdriver.h.

◆ OFF

#define OFF   0

Definition at line 26 of file stvdriver.h.

◆ ON

#define ON   1

Definition at line 27 of file stvdriver.h.

◆ PARITY_EVEN

#define PARITY_EVEN   1

Definition at line 172 of file stvdriver.h.

◆ PARITY_NONE

#define PARITY_NONE   0

Definition at line 171 of file stvdriver.h.

◆ PARITY_ODD

#define PARITY_ODD   2

Definition at line 173 of file stvdriver.h.

◆ REQUEST_ACK

#define REQUEST_ACK   0x10

Definition at line 40 of file stvdriver.h.

◆ REQUEST_BUFFER_STATUS

#define REQUEST_BUFFER_STATUS   0x03

Definition at line 32 of file stvdriver.h.

◆ REQUEST_COMPRESSED_IMAGE_DATA

#define REQUEST_COMPRESSED_IMAGE_DATA   0x07

Definition at line 36 of file stvdriver.h.

◆ REQUEST_DOWNLOAD

#define REQUEST_DOWNLOAD   0x00

Definition at line 29 of file stvdriver.h.

◆ REQUEST_DOWNLOAD_ALL

#define REQUEST_DOWNLOAD_ALL   0x01

Definition at line 30 of file stvdriver.h.

◆ REQUEST_IMAGE_DATA

#define REQUEST_IMAGE_DATA   0x05

Definition at line 34 of file stvdriver.h.

◆ REQUEST_IMAGE_INFO

#define REQUEST_IMAGE_INFO   0x04

Definition at line 33 of file stvdriver.h.

◆ SEND_KEY_PATTERN

#define SEND_KEY_PATTERN   0x08

Definition at line 37 of file stvdriver.h.

◆ SETUP_KEY_PATTERN

#define SETUP_KEY_PATTERN   0x0020

Definition at line 56 of file stvdriver.h.

◆ SHIFT_PATTERN

#define SHIFT_PATTERN   0x0008 /* increases rotary speed when 1 */

Definition at line 48 of file stvdriver.h.

◆ TRACK_KEY_PATTERN

#define TRACK_KEY_PATTERN   0x0200

Definition at line 52 of file stvdriver.h.

◆ UD_ROTARY_DECREASE_PATTERN

#define UD_ROTARY_DECREASE_PATTERN   0x2000

Definition at line 46 of file stvdriver.h.

◆ UD_ROTARY_INCREASE_PATTERN

#define UD_ROTARY_INCREASE_PATTERN   0x1000

Definition at line 47 of file stvdriver.h.

Typedef Documentation

◆ byte

typedef unsigned char byte

Definition at line 175 of file stvdriver.h.

Function Documentation

◆ calc_crc()

unsigned int calc_crc ( byte  byte_array[],
int  size 
)

◆ init_serial()

int init_serial ( char *  device_name,
int  bit_rate,
int  word_size,
int  parity,
int  stop_bits 
)

Definition at line 1526 of file stvdriver.c.

◆ shutdown_serial()

void shutdown_serial ( int  fd)

Definition at line 1501 of file stvdriver.c.