nidas  v1.2-1520
lamsx.h
Go to the documentation of this file.
1 /* -*- mode: C; indent-tabs-mode: nil; c-basic-offset: 8; tab-width: 8; -*- */
2 /* vim: set shiftwidth=8 softtabstop=8 expandtab: */
3 /*
4  ********************************************************************
5  ** NIDAS: NCAR In-situ Data Acquistion Software
6  **
7  ** 2010, Copyright University Corporation for Atmospheric Research
8  **
9  ** This program is free software; you can redistribute it and/or modify
10  ** it under the terms of the GNU General Public License as published by
11  ** the Free Software Foundation; either version 2 of the License, or
12  ** (at your option) any later version.
13  **
14  ** This program is distributed in the hope that it will be useful,
15  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
16  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  ** GNU General Public License for more details.
18  **
19  ** The LICENSE.txt file accompanying this software contains
20  ** a copy of the GNU General Public License. If it is not found,
21  ** write to the Free Software Foundation, Inc.,
22  ** 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23  **
24  ********************************************************************
25 */
26 /* lams.h
27 
28  Header for the NCAR/EOL Laser Air Motion Sensor (LAMS) interface.
29  Original Author: Mike Spowart
30  Copyright by the National Center for Atmospheric Research 2004
31 
32  Revisions:
33  $LastChangedRevision$
34  $LastChangedDate$
35  $LastChangedBy$
36  $HeadURL$
37 */
38 
39 #ifndef NIDAS_LAMS_LAMSX_H
40 #define NIDAS_LAMS_LAMSX_H
41 
42 #include <nidas/linux/types.h>
43 
44 /* This header is also included from user-side code that
45  * wants to get the values of the ioctl commands, and
46  * the definition of the structures.
47  */
48 #define LAMS_SPECTRA_SIZE 512
49 
53 #define LAMS_SPECAVG_SAMPLE_TYPE 0
54 #define LAMS_SPECPEAK_SAMPLE_TYPE 1
55 
56 //#define LAMS_PATTERN 0x5555
57 //#define NUM_ARRAYS 128
58 //#define N_LAMS 3
59 
60 #ifdef __KERNEL__
61 struct lams_avg_sample {
62  dsm_sample_time_t timetag; // timetag of sample
63  dsm_sample_length_t length; // number of bytes in data
64  unsigned int type; // sample type
65  unsigned int data[LAMS_SPECTRA_SIZE]; // the averages
66 };
67 struct lams_peak_sample {
68  dsm_sample_time_t timetag; // timetag of sample
69  dsm_sample_length_t length; // number of bytes in data
70  unsigned int type; // sample type
71  unsigned short data[LAMS_SPECTRA_SIZE]; // the peaks
72 };
73 #else
74 // For user-space programs, the data portion of a spectral average sample
76  unsigned int type;
77  unsigned int data[LAMS_SPECTRA_SIZE]; // the averages
78 };
79 
80 // For user-space programs, the data portion of a spectral peak sample
82  unsigned int type;
83  unsigned short data[LAMS_SPECTRA_SIZE]; // the peaks
84 };
85 #endif
86 
87 
88 struct lams_status {
89  unsigned int missedISRSamples;
90  unsigned int missedOutSamples;
91 };
92 
94 struct lams_set {
95  int channel;
96 };
97 
98 /* Pick a character as the magic number of your driver.
99  * It isn't strictly necessary that it be distinct between
100  * all modules on the system, but is a good idea. With
101  * distinct magic numbers one can catch a user sending
102  * a ioctl to the wrong device.
103  */
104 #define LAMS_MAGIC 'L'
105 
106 // The enumeration of IOCTLs that this driver supports.
107 #define LAMS_SET_CHN _IOW(LAMS_MAGIC,0, struct lams_set) // not needed in new driver
108 #define LAMS_N_AVG _IOW(LAMS_MAGIC,1, unsigned int) // put navg and npeak in a struct
109 #define LAMS_N_PEAKS _IOW(LAMS_MAGIC,2, unsigned int)
110 #define LAMS_N_SKIP _IOW(LAMS_MAGIC,3, unsigned int)
111 #define LAMS_GET_STATUS _IOR(LAMS_MAGIC,4, struct lams_status)
112 #define LAMS_TAS_BELOW _IO(LAMS_MAGIC,5)
113 #define LAMS_TAS_ABOVE _IO(LAMS_MAGIC,6)
114 #define LAMS_IOC_MAXNR 6
115 
116 #endif // NIDAS_LAMS_LAMSX_H
unsigned short data[LAMS_SPECTRA_SIZE]
Definition: lamsx.h:83
not needed in new driver.
Definition: lamsx.h:94
Definition: lamsx.h:81
int dsm_sample_time_t
Depending on the module, either tenths of milliseconds, or milliseconds since 00:00 UTC today...
Definition: types.h:48
#define LAMS_SPECTRA_SIZE
Definition: lamsx.h:48
int channel
Definition: lamsx.h:95
unsigned int type
Definition: lamsx.h:82
unsigned int missedISRSamples
Definition: lamsx.h:89
unsigned int data[LAMS_SPECTRA_SIZE]
Definition: lamsx.h:77
unsigned int dsm_sample_length_t
length of data portion of sample.
Definition: types.h:51
unsigned int missedOutSamples
Definition: lamsx.h:90
unsigned int type
Definition: lamsx.h:76
Definition: lamsx.h:75
Definition: lamsx.h:88