#ifndef HW_TEST_H_
#define HW_TEST_H_

#include "oled_control.h"

typedef enum test_type {
	HWTest_USB_Hub = 'H',
	HWTest_RGB_LED = 'L',
	HWTest_USBC_Switch = 'S',
	HWTest_VXR = 'V',
	HWTest_Prox = 'P',
	HWTest_OLED = 'O',
	HWTest_Fan = 'F'
} HW_Test_T;

typedef enum test_error {
	TE_Fail = pdFAIL,
	TE_Success = pdPASS,
} Test_Error_T;

#define TEST_FAN_PWM_SETTING_1				(25)
#define TEST_FAN_PWM_SETTING_2				(40)
#define TEST_FAN_PWM_SETTING_3				(55)
#define TEST_FAN_PWM_SETTING_4				(70)
#define TEST_FAN_MIN_AVERAGE_SPEED			(10)
#define TEST_FAN_DEVIATION_ALLOWED			(250)
#define TEST_FAN_STARTUP_TIME_MS			(300)	// Time to wait after starting up before averaging
#define TEST_FAN_SAMPLING_TIME_MS			(3)		// Time to wait between taking samples
#define TEST_FAN_AVERAGING_WINDOW_SIZE		(32)
#define TEST_FAN_TIMEOUT					(4000)	// About 400ms (RTT is about 10kHz)

Test_Error_T test_usb_hub(void);
Test_Error_T test_rgb_led(void);
Test_Error_T test_usbc_switch(void);
Test_Error_T test_vxr(void);
Test_Error_T test_prox(void);
Test_Error_T test_oled_panels(void);
Test_Error_T test_oled_panel(OLED_Panel_T panel_sel);
Test_Error_T test_fan(void);

#endif /* HW_TEST_H_ */