nidas  v1.2-1520
short_filters_kernel.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  ** 2007, 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 /*
27 
28  Simple filters for use in 16 bit digital sampling.
29 
30 */
31 
32 #ifndef NIDAS_SHORT_FILTERS_KERNEL_H
33 #define NIDAS_SHORT_FILTERS_KERNEL_H
34 
36 
37 #include <nidas/linux/types.h>
38 
39 #ifdef __KERNEL__
40 
43 typedef struct short_sample
44 {
48  dsm_sample_time_t timetag;
49 
53  dsm_sample_length_t length;
54 
58  short id;
59 
60  short data[0];
61 
62 } short_sample_t;
63 
68 struct short_filter_data {
73  const char* deviceName;
74 
78  int nchans;
79 
83  int* channels;
84 
88  int inputRate;
89 
93  int outputRate;
94 
98  void* filterObj;
99 
103  short sampleIndex;
104 };
105 
111 typedef void* (*shortfilt_init_method)(void);
112 
120 typedef int (*shortfilt_config_method)(struct short_filter_data* fdata,
121  const void* cfg,int nbcfg);
122 
132 typedef int (*shortfilt_filter_method)(void* obj,
133  dsm_sample_time_t tt, const short* in, int skip_factor, short_sample_t* out);
134 
138 typedef void (*shortfilt_cleanup_method)(void* obj);
139 
144 extern struct short_filter_methods get_short_filter_methods(enum nidas_short_filter type);
145 
149 struct pickoff_filter_config
150 {
151 };
152 
156 struct boxcar_filter_config
157 {
161  int npts;
162 };
163 
167 struct timeavg_filter_config
168 {
172  int rate;
173 };
174 
175 struct short_filter_methods {
176  shortfilt_init_method init;
177  shortfilt_config_method config;
178  shortfilt_filter_method filter;
179  shortfilt_cleanup_method cleanup;
180 };
181 
182 
183 struct short_filter_info {
184  shortfilt_init_method finit;
185  shortfilt_config_method fconfig;
186  shortfilt_filter_method filter;
187  shortfilt_cleanup_method fcleanup;
188  struct short_filter_data data;
189 };
190 
191 #endif /* __KERNEL__ */
192 
193 #endif
194 
int dsm_sample_time_t
Depending on the module, either tenths of milliseconds, or milliseconds since 00:00 UTC today...
Definition: types.h:48
nidas_short_filter
Enumeration of supported filter types.
Definition: short_filters.h:39
static float rate
Definition: sing.cc:53
unsigned int dsm_sample_length_t
length of data portion of sample.
Definition: types.h:51
struct short_filter_methods get_short_filter_methods(enum nidas_short_filter which)
Return structure of pointers to the methods for a given filter.
Definition: short_filters.c:415