#ifndef VNA_LITEVNA_H
#define VNA_LITEVNA_H



typedef struct VNA_COMPLEX
{
   float re;
   float im;
} VNA_COMPLEX;

/* Parametri impostabili dalla pagina */
extern short int vna_port_index;
extern char      vna_port_name[64];
extern U32       vna_f_start;
extern U32       vna_f_stop;
extern U16       vna_points;
extern char      vna_cal_file[128];

/* Stato */
extern volatile int vna_command;
extern volatile int vna_state;
extern volatile int vna_abort;
extern volatile int vna_acquired;
extern volatile int vna_data_valid;
extern volatile int vna_cal_valid;
extern char         vna_status[128];

/* Dati grezzi non calibrati */
extern U32   vna_frequency[VNA_MAX_POINTS];
extern float vna_s11_raw_re[VNA_MAX_POINTS];
extern float vna_s11_raw_im[VNA_MAX_POINTS];
extern float vna_s21_raw_re[VNA_MAX_POINTS];
extern float vna_s21_raw_im[VNA_MAX_POINTS];

/* Dati corretti da usare per Smith e S21 */
extern float vna_s11_re[VNA_MAX_POINTS];
extern float vna_s11_im[VNA_MAX_POINTS];
extern float vna_s21_re[VNA_MAX_POINTS];
extern float vna_s21_im[VNA_MAX_POINTS];

/* Interfaccia pagina/task */
void vna_update_port_name(void);
void vna_post_command(int command);
void vna_task(void);

#endif
