#ifndef PROX_CONTROL_H_
#define PROX_CONTROL_H_

typedef struct prox_ {
    uint16_t current_prox_data;
    uint16_t offset;
    uint16_t proximity_threshold;
    uint16_t proximity_hysteresis;
	uint16_t programmed_cal;
    bool connected;
    bool calibrated;
    bool person_detected; // true when proximity value above detection threshold (plus hysteresis)
} Proximity_T;

bool prox_init(void);
bool prox_is_connected(void);
void prox_update(void);
bool prox_hmd_on_person(void);
uint16_t prox_get_distance(void);
void prox_set_threshold(uint16_t newthresh);
void prox_set_hysteresis(uint16_t newhyst);
bool prox_set_offset(uint16_t newoffset);
Prox_Settings* prox_get_settings(void);
bool prox_apply_settings(void);

#endif // PROX_CONTROL_H_
