#ifndef _U_LIGHT_CTRL_H_
#define _U_LIGHT_CTRL_H_
#include "u_global.h"
#include "u_main.h"

//enum _rc_code
//{
//	RC_CODE_UP				= 0x90,
//	RC_CODE_DOWN			= 0xB8,
//	RC_CODE_OFF				= 0xF8,
//	RC_CODE_ON				= 0xB0,
//	
//	RC_CODE_W				= 0xA8,
//	RC_CODE_FLASH			= 0xB2,
//	RC_CODE_STROBE			= 0x00,
//	RC_CODE_FADE			= 0x58,
//	RC_CODE_SMOOTH			= 0x30,
//	
//	RC_CODE_COLOR_R			= 0x98,	
//	RC_CODE_COLOR_G			= 0xD8,			
//	RC_CODE_COLOR_B			= 0x88,		
//				
//	RC_CODE_COLOR_1			= 0xE8,			
//	RC_CODE_COLOR_2			= 0x48,		
//	RC_CODE_COLOR_3			= 0x68,
//	
//	RC_CODE_COLOR_4			= 0x02,		
//	RC_CODE_COLOR_5			= 0x32,			
//	RC_CODE_COLOR_6			= 0x20,
//	
//	RC_CODE_COLOR_7			= 0x50,			
//	RC_CODE_COLOR_8			= 0x78,			
//	RC_CODE_COLOR_9			= 0x70,
//	
//	RC_CODE_COLOR_10		= 0x38,		
//	RC_CODE_COLOR_11		= 0x28,		
//	RC_CODE_COLOR_12		= 0xF0,
//};


enum _rc_code
{
	RC_CODE_UP				= 0x00,
	RC_CODE_DOWN			= 0x01,
	RC_CODE_OFF				= 0x02,
	RC_CODE_ON				= 0x03,
	
	RC_CODE_W				= 0x07,
	RC_CODE_FLASH			= 0x0b,
	RC_CODE_STROBE			= 0x0f,
	RC_CODE_FADE			= 0x13,
	RC_CODE_SMOOTH			= 0x17,
	
	RC_CODE_COLOR_R			= 0x04,	
	RC_CODE_COLOR_G			= 0x05,			
	RC_CODE_COLOR_B			= 0x06,		
				
	RC_CODE_COLOR_1			= 0x08,			
	RC_CODE_COLOR_2			= 0x09,		
	RC_CODE_COLOR_3			= 0x0a,
	
	RC_CODE_COLOR_4			= 0x0c,		
	RC_CODE_COLOR_5			= 0x0d,			
	RC_CODE_COLOR_6			= 0x0e,
	
	RC_CODE_COLOR_7			= 0x10,			
	RC_CODE_COLOR_8			= 0x11,			
	RC_CODE_COLOR_9			= 0x12,
	
	RC_CODE_COLOR_10		= 0x14,		
	RC_CODE_COLOR_11		= 0x15,		
	RC_CODE_COLOR_12		= 0x16,
};


enum //_rc_mode
{
	RC_MODE_COLOR_MIN	= 0,
	RC_MODE_COLOR_R		= RC_MODE_COLOR_MIN,
	RC_MODE_COLOR_G,			
	RC_MODE_COLOR_B,		
	RC_MODE_COLOR_W,
	
	RC_MODE_COLOR_1,
	RC_MODE_COLOR_2,
	RC_MODE_COLOR_3,
	RC_MODE_COLOR_4,
	RC_MODE_COLOR_5,
	RC_MODE_COLOR_6,
	RC_MODE_COLOR_7,
	RC_MODE_COLOR_8,
	RC_MODE_COLOR_9,
	RC_MODE_COLOR_10,
	RC_MODE_COLOR_11,
	RC_MODE_COLOR_12,
	
	RC_MODE_FLASH,
	RC_MODE_STROBE,
	RC_MODE_FADE,
	RC_MODE_SMOOTH,
	
};

typedef enum //_rc_mode_switch_dir
{
	RC_MODE_SHITCH_KEEP,
	RC_MODE_SHITCH_PLUS,
	RC_MODE_SHITCH_SUBT,
	
}RcModeDir_t;

void light_param_init(void);
void light_power_set(uint8_t set_state);

void light_speed_ctrl(uint8_t light_speed);
void light_bright_ctrl(uint8_t light_bright);
void light_rhythm_enter(uint8_t rhythm_mode);
void rc_mode_enter(uint8_t rc_mode);

void ir_decode(const uint8_t *ir_code);
uint8_t rgb_line_order_check(void);

void light_info_save_set(void);
void light_info_save(void);
void light_flash_save_cb(void);
void light_info_init(void);
#endif	//_U_LIGHT_CTRL_H_