/*
 * config.h
 *
 *  Created on: Apr 23, 2021
 *      Author: Thom Maughan, tm@mbari.org
 */

#ifndef PHFETSOS_CONFIG_H_
#define PHFETSOS_CONFIG_H_

// data_cfg[TIMESTAMP] config types new 9 Apr 2022
#define TYPE_TIMESTAMP_OFF  0
#define TYPE_US_DATETIME    1
#define TYPE_EPOCH_MSEC     2

void configuration_menu(void);
void print_config_data_fields(void);
void config_data_fields(void);
void config_data_fields_none(int prnFlg);
void config_data_fields_all(int prnFlg);
void config_data_fields_glider(int prnFlg);
void config_data_fields_mfet(int prnFlg);
void config_data_fields_mphox(int prnFlg);
void config_data_fields_m2m_mphox(int prnFlg);
void config_data_fields_nanofet(int prnFlg);
void config_data_fields_wirewalker(int prnFlg);

void print_write_config_data_fields(uint32_t printFlg, uint32_t writeFlg, uint32_t padFlg);
void pump_sequencer_setup(void);

int print_write_metadata_header(const time_t currentTime, uint32_t printFlg, uint32_t writeFlg);
int write_metadata_header(const time_t currentTime);
void print_metadata_header(const time_t currentTime);

void print_sys_samp_data_structure(void);  // for debug
void print_sys_data_structure(void);  // for qa and debug

int print_write_data_header(uint32_t printFlg, uint32_t writeFlg);
void print_data_header(void);
int  write_data_header(void);
void print_config(void);    //m2m

void get_header(void);
int enter_deployment_note(uint32_t timeout);
void enter_metadata(void);
void enter_pH_sensor_cal_coeff(void);
void get_pH_sensor_cal_coeff(void);
void import_pH_sensor_cal_coeff(void);
void export_pH_sensor_cal_coeff();
void change_baud_rate(void);

void print_all_metadata(void);  // print out all metadata

void init_sys_data_default(void);   //was config_sys_data_default_init
void init_sys_samp_default(void);

void config_qa_data_init(void);

void edit_appcfg_fields(void);
void exercise_iso(void);

void copy_edit_sys_data_structure(void);

void config_adc24_sampling_parms(void);

void user_select_ctd(void);
void user_select_timestamp(void);

void ads1248_sampling_defaults(void);

uint32_t edit_uint(uint32_t *uint_data, uint32_t negLim, uint32_t posLim);
float edit_float(float *float_data, float negLim, float posLim);
float edit_float_6(float *float_data, float negLim, float posLim);
float edit_expfloat(float *float_data, float negLim, float posLim);
uint32_t edit_string(char *char_data, uint32_t max_chars);

#endif /* CONFIG_H_ */
