#ifndef HYPERX_ELITE2_H_
#define HYPERX_ELITE2_H_

enum
{
	HYPERX_KEYBOARD_VID		= 0x0951,
	HYPERX_ELITE2_PID		= 0x1711,
	NUM_KEYS				= 128,
	BUF_SIZE				= 64,
	NUM_PACKETS				= 10,
	NKRO_BUF_SIZE			= 15,
	KEY_BUF_SIZE			= 16*16,
};

enum
{
	HYPERX_ITF_KEYBOARD = 0,
	HYPERX_ITF_KEYPRESS,
	HYPERX_ITF_NKRO
};

void get_light();
void rgb_task(uint8_t dev_addr, uint8_t instance, uint8_t report_id);
void send_color(uint8_t dev_addr, uint8_t instance, uint8_t report_id,
	uint8_t red, uint8_t green, uint8_t blue);
void send_initial(uint8_t dev_addr, uint8_t instance, uint8_t report_id);
void startADC();
void send_media(uint8_t const* report, uint16_t len);
void keyboard_task();
void reset_keyboard();
void updatekeys(uint8_t instance, uint8_t const* report, uint16_t len);
void process_report(uint8_t instance, uint8_t const* report, uint16_t len);


void merge_bitmap(uint8_t* nkro_report, uint8_t const* nkro_report1, uint8_t const* nkro_report2);
void boot2nkro(uint8_t const* boot_report, uint8_t* nkro_report, uint16_t len);

#define SET_KEYBIT(array, index) do { (array)[(index) / 8] |= 1 << ((index) % 8); } while(0)
#define CLEAR_KEYBIT(array, index) do { (array)[(index) / 8] &= ~(1 << ((index) % 8)); } while(0)


#endif
