nidas v1.2.3
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
33#ifndef NIDAS_LAMS_LAMSX_H
34#define NIDAS_LAMS_LAMSX_H
35
36#include <nidas/linux/types.h>
37
38/* This header is also included from user-side code that
39 * wants to get the values of the ioctl commands, and
40 * the definition of the structures.
41 */
42#define LAMS_SPECTRA_SIZE 512
43
47#define LAMS_SPECAVG_SAMPLE_TYPE 0
48#define LAMS_SPECPEAK_SAMPLE_TYPE 1
49
50//#define LAMS_PATTERN 0x5555
51//#define NUM_ARRAYS 128
52//#define N_LAMS 3
53
54#ifdef __KERNEL__
55struct lams_avg_sample {
56 dsm_sample_time_t timetag; // timetag of sample
57 dsm_sample_length_t length; // number of bytes in data
58 unsigned int type; // sample type
59 unsigned int data[LAMS_SPECTRA_SIZE]; // the averages
60};
61struct lams_peak_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 short data[LAMS_SPECTRA_SIZE]; // the peaks
66};
67#else
68// For user-space programs, the data portion of a spectral average sample
70 unsigned int type;
71 unsigned int data[LAMS_SPECTRA_SIZE]; // the averages
72};
73
74// For user-space programs, the data portion of a spectral peak sample
76 unsigned int type;
77 unsigned short data[LAMS_SPECTRA_SIZE]; // the peaks
78};
79#endif
80
81
83 unsigned int missedISRSamples;
84 unsigned int missedOutSamples;
85};
86
88struct lams_set {
90};
91
92/* Pick a character as the magic number of your driver.
93 * It isn't strictly necessary that it be distinct between
94 * all modules on the system, but is a good idea. With
95 * distinct magic numbers one can catch a user sending
96 * a ioctl to the wrong device.
97 */
98#define LAMS_MAGIC 'L'
99
100// The enumeration of IOCTLs that this driver supports.
101#define LAMS_SET_CHN _IOW(LAMS_MAGIC,0, struct lams_set) // not needed in new driver
102#define LAMS_N_AVG _IOW(LAMS_MAGIC,1, unsigned int) // put navg and npeak in a struct
103#define LAMS_N_PEAKS _IOW(LAMS_MAGIC,2, unsigned int)
104#define LAMS_N_SKIP _IOW(LAMS_MAGIC,3, unsigned int)
105#define LAMS_GET_STATUS _IOR(LAMS_MAGIC,4, struct lams_status)
106#define LAMS_TAS_BELOW _IO(LAMS_MAGIC,5)
107#define LAMS_TAS_ABOVE _IO(LAMS_MAGIC,6)
108#define LAMS_IOC_MAXNR 6
109
110#endif // NIDAS_LAMS_LAMSX_H
#define LAMS_SPECTRA_SIZE
Definition lamsx.h:42
Definition lamsx.h:69
unsigned int type
Definition lamsx.h:70
unsigned int data[LAMS_SPECTRA_SIZE]
Definition lamsx.h:71
Definition lamsx.h:75
unsigned int type
Definition lamsx.h:76
unsigned short data[LAMS_SPECTRA_SIZE]
Definition lamsx.h:77
not needed in new driver.
Definition lamsx.h:88
int channel
Definition lamsx.h:89
Definition lamsx.h:82
unsigned int missedOutSamples
Definition lamsx.h:84
unsigned int missedISRSamples
Definition lamsx.h:83
unsigned int dsm_sample_length_t
length of data portion of sample.
Definition types.h:51
int dsm_sample_time_t
Depending on the module, either tenths of milliseconds, or milliseconds since 00:00 UTC today.
Definition types.h:48