nidas v1.2.3
|
#include <nidas/linux/util.h>
#include <nidas/linux/klog.h>
#include <nidas/linux/Revision.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/uaccess.h>
Macros | |
#define | REPO_REVISION "unknown" |
Functions | |
MODULE_AUTHOR ("Gordon Maclean <maclean@ucar.edu>") | |
MODULE_DESCRIPTION ("NCAR nidas utilities") | |
MODULE_LICENSE ("GPL") | |
MODULE_VERSION (REPO_REVISION) | |
int | alloc_dsm_circ_buf (struct dsm_sample_circ_buf *c, size_t dlen, int blen) |
void | free_dsm_circ_buf (struct dsm_sample_circ_buf *c) |
int | realloc_dsm_circ_buf (struct dsm_sample_circ_buf *c, size_t dlen, int blen) |
void | init_dsm_circ_buf (struct dsm_sample_circ_buf *c) |
ssize_t | nidas_circbuf_read_nowait (struct file *filp, char __user *buf, size_t count, struct dsm_sample_circ_buf *cbuf, struct sample_read_state *state) |
ssize_t | nidas_circbuf_read (struct file *filp, char __user *buf, size_t count, struct dsm_sample_circ_buf *cbuf, struct sample_read_state *state, wait_queue_head_t *readq) |
static void __exit | nidas_util_cleanup (void) |
static int __init | nidas_util_init (void) |
void | screen_timetag_init (struct screen_timetag_data *td, int deltaT_Usec, int adjustUsec) |
dsm_sample_time_t | screen_timetag (struct screen_timetag_data *td, dsm_sample_time_t tt) |
Adjust time tags in a series which should have a fixed delta-T, such as from an A2D. | |
EXPORT_SYMBOL (alloc_dsm_circ_buf) | |
EXPORT_SYMBOL (free_dsm_circ_buf) | |
EXPORT_SYMBOL (realloc_dsm_circ_buf) | |
EXPORT_SYMBOL (init_dsm_circ_buf) | |
EXPORT_SYMBOL (nidas_circbuf_read) | |
EXPORT_SYMBOL (nidas_circbuf_read_nowait) | |
EXPORT_SYMBOL (screen_timetag_init) | |
EXPORT_SYMBOL (screen_timetag) | |
module_init (nidas_util_init) | |
module_exit (nidas_util_cleanup) | |
#define REPO_REVISION "unknown" |
Referenced by nidas_util_init().
int alloc_dsm_circ_buf | ( | struct dsm_sample_circ_buf * | c, |
size_t | dlen, | ||
int | blen ) |
References SIZEOF_DSM_SAMPLE_HEADER.
Referenced by init_cntr(), init_event(), init_fcntrs(), ir104_init(), lams_open(), mesa_ioctl(), realloc_dsm_circ_buf(), and startA2D().
EXPORT_SYMBOL | ( | alloc_dsm_circ_buf | ) |
EXPORT_SYMBOL | ( | free_dsm_circ_buf | ) |
EXPORT_SYMBOL | ( | init_dsm_circ_buf | ) |
EXPORT_SYMBOL | ( | nidas_circbuf_read | ) |
EXPORT_SYMBOL | ( | nidas_circbuf_read_nowait | ) |
EXPORT_SYMBOL | ( | realloc_dsm_circ_buf | ) |
EXPORT_SYMBOL | ( | screen_timetag | ) |
EXPORT_SYMBOL | ( | screen_timetag_init | ) |
void free_dsm_circ_buf | ( | struct dsm_sample_circ_buf * | c | ) |
void init_dsm_circ_buf | ( | struct dsm_sample_circ_buf * | c | ) |
MODULE_AUTHOR | ( | "Gordon Maclean <maclean@ucar.edu>" | ) |
MODULE_DESCRIPTION | ( | "NCAR nidas utilities" | ) |
module_exit | ( | nidas_util_cleanup | ) |
module_init | ( | nidas_util_init | ) |
MODULE_LICENSE | ( | "GPL" | ) |
MODULE_VERSION | ( | REPO_REVISION | ) |
ssize_t nidas_circbuf_read | ( | struct file * | filp, |
char __user * | buf, | ||
size_t | count, | ||
struct dsm_sample_circ_buf * | cbuf, | ||
struct sample_read_state * | state, | ||
wait_queue_head_t * | readq ) |
References nidas_circbuf_read_nowait().
Referenced by dmmat_read_a2d(), dmmat_read_cntr(), dmmat_read_d2d(), gpio_mm_read_event(), gpio_mm_read_fcntr(), ir104_relay_read(), mesa_read(), ncar_a2d_read(), and pc104sg_read().
ssize_t nidas_circbuf_read_nowait | ( | struct file * | filp, |
char __user * | buf, | ||
size_t | count, | ||
struct dsm_sample_circ_buf * | cbuf, | ||
struct sample_read_state * | state ) |
References SIZEOF_DSM_SAMPLE_HEADER.
Referenced by lams_read(), and nidas_circbuf_read().
|
static |
|
static |
References REPO_REVISION.
int realloc_dsm_circ_buf | ( | struct dsm_sample_circ_buf * | c, |
size_t | dlen, | ||
int | blen ) |
References alloc_dsm_circ_buf(), and free_dsm_circ_buf().
Referenced by pc104sg_open(), and startBoard().
dsm_sample_time_t screen_timetag | ( | struct screen_timetag_data * | td, |
dsm_sample_time_t | tt ) |
Adjust time tags in a series which should have a fixed delta-T, such as from an A2D.
The A2D driver modules assign the original time tag based on the time of the read of the A2D FIFO by the interrupt service routine or polling method. These time tags may be late due to ISR or polling latency.
If DO_TIMETAG_ERROR_AVERAGE is defined then this function keeps a running mean of the differences between the original and the expected time tags. This average is used to generate a time series with (approximately) the requested delta-T, but which can slowly drift to account for any clock drift of the A2D, or to correct an error in the initial time tag in the series.
If DO_TIMETAG_ERROR_AVERAGE is not defined then this function keeps track of the minimum difference between the original and expected time tags. After npts have been received, this minimum difference is added to the added to the generated time tags. This will do step changes (hopefully small) correct for clock drift between the CPU and the A2D.
The time tags are assumed to be in the raw form generated by the NIDAS A2D driver modules, as the number of 1/10 milliseconds since 00:00 UTC.
References TMSECS_PER_DAY, TMSECS_PER_SEC, and USECS_PER_TMSEC.
Referenced by dmmat_a2d_bottom_half(), and dmmat_a2d_bottom_half_fast().
void screen_timetag_init | ( | struct screen_timetag_data * | td, |
int | deltaT_Usec, | ||
int | adjustUsec ) |
References TMSECS_PER_DAY, and USECS_PER_TMSEC.
Referenced by startA2D_MM16AT(), and startA2D_MM32XAT().