diff options
author | Michael J. Chudobiak <mjc@avtechpulse.com> | 2012-08-24 10:15:36 -0400 |
---|---|---|
committer | Michael J. Chudobiak <mjc@avtechpulse.com> | 2012-08-24 10:15:36 -0400 |
commit | c116bc537041827e438cec9d49c5249c33f0377e (patch) | |
tree | b60d09aa46abcdfe3fa63a293d1fb4398c9f54a9 /globals.h | |
parent | 3764cf19983e58a471ac0359509ca81b60526ce3 (diff) |
fix attempt at full set of device functions
Diffstat (limited to 'globals.h')
-rw-r--r-- | globals.h | 96 |
1 files changed, 86 insertions, 10 deletions
@@ -92,7 +92,6 @@ #define NO 0 -#define error_queue_length 512 #define max_commands_in_input 12 #define max_output_length 512 #define max_channels 2 @@ -206,6 +205,31 @@ #define smallest_allowed_number 1.0e-18 +#define zero_equiv_timing 1e-10 +#define max_v_dymanic_range 1e6 + + +// self-cal configs +#define NOT_ENABLE_COUNT 0x01 +#define ENABLE_COUNT 0x00 + +#define NOT_LOAD_BUFFERS_CLK 0x00 +#define LOAD_BUFFERS_CLK 0x02 + +#define NOT_CLR_COUNTERS 0x04 +#define CLR_COUNTERS 0x00 + +#define MEAS_PW 0x08 +#define MEAS_PRF 0x00 + +#define MEAS_CH1 0x00 +#define MEAS_CH2 0x10 + +#define COUNTER_BYTE_0 0x00 +#define COUNTER_BYTE_1 0x20 +#define COUNTER_BYTE_2 0x40 +#define COUNTER_BYTE_3 0x60 + long sec_timer (void); @@ -224,6 +248,40 @@ typedef struct { typedef struct { + int parallel_DAC_reg[8]; + long shift_reg_out[num_out_SRs]; + long last_relay_driver_settings[3]; + int oper_enable_register; /* for stat:enable command */ + int ques_enable_register; /* for stat:enable command */ + int avrq_reg; + int last_rise_time_relay_setting; +} HWregStruct; + + +typedef struct { + int update_freq; + int update_func; + int update_delay; + int update_pw; + int update_amp; + int update_os; + int update_zout; + int update_load; + int update_output; + int update_inv; + int update_gate; + int update_logic_level; + int update_routes; + int update_burst_count; + int update_burst_time; + int update_rise_time; + int update_soft_current_limit; + int update_slew; + int update_whole_main_menu; +} ChangeStruct; + + +typedef struct { int baud; int parity; int stopbits; @@ -663,25 +721,43 @@ typedef struct { } ConstraintsStruct; +#define error_queue_length 512 typedef struct { - ConstraintsStruct Constraints; - ChannelStruct ChannelState[max_channels]; - FlashStruct Flash; - GpibStruct GPIB; - Rs232Struct RS232; - int error_queue[error_queue_length+1]; - int number_of_errors; /* how many errors are in the error queue */ + int number_of_errors; +} ErrorStruct; + + +typedef struct { int extended_ampl_min_max; int do_check_settings; - int oper_enable_register; /* for stat:enable command */ - int ques_enable_register; /* for stat:enable command */ int flash_writes_suspended; + int force_output_fully_off; +} FlagStruct; + + +typedef struct { long startup_timer_value; long last_activity_at[max_channels]; + long normal_relay_bounce_time_in_milliseconds; + long Relay_Switching_Delay_in_Milliseconds; +} TimeStruct; + +typedef struct { + ConstraintsStruct Constraints; + ChannelStruct ChannelState[max_channels]; + FlashStruct Flash; + GpibStruct GPIB; + Rs232Struct RS232; + HWregStruct Registers; + ChangeStruct Changes; + ErrorStruct Errors; + FlagStruct Flags; + TimeStruct Timers; } GlobalStruct; + extern GlobalStruct globals; |