Rename files and make more consistent with Beam Monitor code
dio.* => device.* hdio.* => hware.* Digital.* => Monitor.* r1265 | dcl | 2006-11-09 12:25:16 +1100 (Thu, 09 Nov 2006) | 5 lines
This commit is contained in:
62
site_ansto/hardsup/Digital/device.h
Normal file
62
site_ansto/hardsup/Digital/device.h
Normal file
@@ -0,0 +1,62 @@
|
||||
#ifndef _DEVICE_H_
|
||||
#define _DEVICE_H_
|
||||
|
||||
#define MAX_DEVICES 3
|
||||
|
||||
#define SAMPLE_ARRAY_SZ 1000
|
||||
|
||||
#include "utility.h"
|
||||
#include "params.h"
|
||||
|
||||
typedef enum device_state_t
|
||||
{
|
||||
/** The counter has not yet been created or has been destroyed */
|
||||
device_idle = 0,
|
||||
/** The counter has not yet been started or has been stopped */
|
||||
device_stopped,
|
||||
/** The counter is counting */
|
||||
device_running,
|
||||
/** the counter has been paused */
|
||||
device_paused
|
||||
} DEVICE_STATE;
|
||||
|
||||
typedef struct device_t
|
||||
{
|
||||
char name[64];
|
||||
DEVICE_STATE state;
|
||||
/** time of this read */
|
||||
struct timeval current_time;
|
||||
/** time of last read */
|
||||
struct timeval previous_time;
|
||||
/** time of next report generation */
|
||||
struct timeval report_timer;
|
||||
/** number of polls */
|
||||
int poll_counter;
|
||||
/** physical device value */
|
||||
unsigned int value;
|
||||
/** Control parameters */
|
||||
PARAMETERS params;
|
||||
struct device_private_t* private_data;
|
||||
} DEVICE, *pDEVICE;
|
||||
|
||||
void make_report(DEVICE* device);
|
||||
void device_sample(DEVICE* device);
|
||||
void device_send(DEVICE* device, int n);
|
||||
void device_read(DEVICE* device, int n);
|
||||
void device_write(DEVICE* device, int n, const char *tp);
|
||||
void device_print(DEVICE* device, FILE* fd);
|
||||
void device_report(DEVICE* device);
|
||||
int device_init(DEVICE** cpp, char* name);
|
||||
int device_start(DEVICE* device);
|
||||
int device_stop(DEVICE* device);
|
||||
int device_pause(DEVICE* device);
|
||||
int device_resume(DEVICE* device);
|
||||
int device_command(void* device, const char* cmd);
|
||||
int device_poll(DEVICE* device);
|
||||
void device_term(DEVICE* device);
|
||||
bool device_fatal(int error);
|
||||
void device_errmsg(char* buff, int len);
|
||||
double device_time_to_next_sample(DEVICE* device);
|
||||
double device_time_to_next_report(DEVICE* device);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user