53 lines
1.6 KiB
C
53 lines
1.6 KiB
C
#ifndef _PARAM_H_
|
|
#define _PARAM_H_
|
|
|
|
#include "utility.h"
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
typedef enum { COUNT_UP = 0, COUNT_DOWN } DIRECTION;
|
|
|
|
/**
|
|
* Counter Control Parameters
|
|
*/
|
|
typedef struct parameter_t
|
|
{
|
|
/** direction of counting for the logical counter */
|
|
DIRECTION direction;
|
|
/** counter read period in milliseconds */
|
|
int poll_period;
|
|
/** sample period in number of reads per sample */
|
|
int sample_period;
|
|
/** report period in number of samples per report */
|
|
int report_period;
|
|
/** value of the logical counter on START, normally zero */
|
|
uint64 initial_count;
|
|
/** value for terminal count exception if enabled */
|
|
uint64 terminal_count;
|
|
/** low limit for acceptable range or zero */
|
|
double range_low;
|
|
/** high limit for acceptable range or zero */
|
|
double range_high;
|
|
/** type = 0:none, 1:count, 2:time */
|
|
int terminal_check_type;
|
|
/** true if range exception enabled */
|
|
bool range_check_enable;
|
|
/** true if range gating enabled */
|
|
bool range_gate_enable;
|
|
/** mode = 0:report, 1:sample, 2:poll */
|
|
int range_mode;
|
|
/** output = 0:disabled, 1:enabled, 2:inverted */
|
|
int output_line;
|
|
/** hardware_sync false:internal, true:external */
|
|
bool sync;
|
|
/** source 0:default, 1:timebase_1, 2:timebase_2, 3:timebase_3 */
|
|
int source;
|
|
|
|
} PARAMETERS, *pPARAMETERS;
|
|
|
|
bool param_set(pPARAMETERS pp, char* name, char* value);
|
|
bool param_set_cmd(pPARAMETERS pp, char* cmd);
|
|
bool param_get_cmd(pPARAMETERS pp, char* cmd, int n);
|
|
#endif
|