#ifndef INC_CURRENT_MEAS_H
#define INC_CURRENT_MEAS_H

    /* Header file includes */
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"

#define CURRENT_VALVE_REF			260		// valve current consumption in mA
#define	CURRENT_VALVE_UPPER_LIMIT	(CURRENT_VALVE_REF * 12 / 10)
#define CURRENT_VALVE_LOWER_LIMIT	(CURRENT_VALVE_REF * 8 / 10)

#define CURRENT_ACTUATOR_REF			3000	// actuator current consumption in mA
#define	CURRENT_ACTUATOR_UPPER_LIMIT	(CURRENT_ACTUATOR_REF * 12 / 10)
#define CURRENT_ACTUATOR_LOWER_LIMIT	(CURRENT_ACTUATOR_REF * 8 / 10)

#define CURRENT_AT_REST_THRESHOLD_MA	90		// Noisy signal from current sensor IC

typedef struct {
	uint16_t currentRef;
	uint16_t currentUpperLimit;
	uint16_t currentLowerLimit;
} CURRENT_THRESHOLD_STRUCT;

typedef enum {
	VALVE_DEVICE, ACTUATOR_DEVICE
} CURRENT_DEVICE_TYPE;

void vCurrentMeasTask( void *pvParameters );

#endif /* INC_CURRENT_MEAS_H */
