/*
 * sample.h
 *
 *  Created on: Jun 8, 2021
 *      Author: thomm
 */

#ifndef SAMPLE_H_
#define SAMPLE_H_


void print_bias_volt_iso(void);
void read_bias_bat(void);
float batt_volt_iso(void);
float batt_volt(void);

float read_vbat(void);
float read_env_sensors(void);
float controller_temp(void);


void get_sample(int printFlg, int writeFlg);

void test_get_sample_loop(void);
void test_get_sample_timing(void);
void test_pump_and_sample_loop();
void test_pump_and_sample_timing();

void pump_sequencer_init(void);
int pump_sequencer(int pump_seq_state, int printFlg, int writeFlg);
int pump_and_sample(int printFlg, int writeFlg);
void pump_and_sample_start(void);
void pump_var_init(void);

// pump sequencer state machine defs
#define ST_SEQ_NADA             0
#define ST_SEQ_START            1
#define ST_SEQ_PUMP1            2
#define ST_SEQ_PUMP1_ONTIME     3
#define ST_SEQ_PUMP2            4
#define ST_SEQ_PUMP2_ONTIME     5
#define ST_SEQ_WAIT_TO_START    6

#endif /* SAMPLE_H_ */
