#ifndef VIDEO_PROC_H_
#define VIDEO_PROC_H_

#define TASK_VIDEO_PROC_STACK_SIZE			(1024/sizeof(portSTACK_TYPE))
#define TASK_VIDEO_PROC_PRIORITY			(tskIDLE_PRIORITY)
#define VIDEO_TASK_DELAY					(20u)
#define VXR_RC_INTERFACE_DELAY				(275u) // at least 250ms after reset before accessing remote control interface

#define VIDEOPROC_NOTIFY_1V0_READY					(1u << 0u)
#define VIDEOPROC_NOTIFY_1V8_AND_OLED_PWR_READY		(1u << 1u)
#define VIDEOPROC_NOTIFY_VXR_RESET					(1u << 2u)
#define VIDEOPROC_NOTIFY_DEBUG_PROX_DISABLED		(1u << 3u)
#define VIDEOPROC_COLORBAR							(1u << 4u)
#define VIDEOPROC_STACK_OVERFLOW					(1u << 20u)

#define VIDEOPROC_NOTIFY_TASKBITS		(VIDEOPROC_NOTIFY_VXR_RESET | VIDEOPROC_NOTIFY_DEBUG_PROX_DISABLED \
										| VIDEOPROC_COLORBAR)

#define DEFAULT_OLED_BRIGHTNESS			(0x010Au) // 266d, or about 26% (max is 0x03FF = 1023d) 

#define NUM_BRIGHTNESS_RETRIES			(3u) // Number of times to retry setting brightness if it failed

typedef enum _Edid_Select{
	EDID_DEFAULT = 0,
	EDID_90HZ_ONLY = 1,
	EDID_75HZ_ONLY = 2,
	EDID_72HZ_ONLY = 3
} Edid_Select_T;

typedef enum FATP_Mode{
	FATP_Mode_0 = 0x00,
	FATP_Mode_1 = 0x01,
	FATP_Mode_2 = 0x02,
	FATP_Mode_None = 0xFF
} FATP_Mode_T;

TaskHandle_t video_proc_task_handle(void);
bool video_is_enabled(void);
bool displays_are_on(void);
void start_video_task(void);
void task_video_proc(void *pvParameters);
void video_proc_set_fatp_edid(FATP_Mode_T fatp_mode_sel);
uint8_t video_proc_select_edid(Edid_Select_T edid_select);
uint8_t video_set_brightness(uint16_t new_brightness);
uint8_t video_set_colorbar(void);
uint16_t video_get_brightness(void);
bool proximity_disable(void);
bool proximity_enable(void);
#endif /* VIDEO_PROC_H_ */
