#ifndef _TJ_IPCSYS_H_

#define _TJ_IPCSYS_H_



//TJ_IPCSYS Error Code
#define TJ_IPCSYS_SUCCESS                 0
#define TJ_IPCSYS_INVALID_PARAMETER       1
#define TJ_IPCSYS_TIMEOUT                 2
#define TJ_IPCSYS_UNSUPPORTED             3
#define TJ_IPCSYS_FAILED                  4


//GPIO Pin index macro define
#define TJ_IPCSYS_GPIO_PCH_NUM8       0x10
#define TJ_IPCSYS_GPIO_PCH_B75_NUM8   0x10
#define TJ_IPCSYS_GPIO_PCH_B85_NUM8   0x40
#define TJ_IPCSYS_GPIO_IT8786_NUM8    0x20
#define TJ_IPCSYS_GPIO_IT8786_NUM16   0x30 

#define TJ_IPCSYS_GPI         0
#define TJ_IPCSYS_GPO         1
#define TJ_IPCSYS_GPO_LOW     0
#define TJ_IPCSYS_GPO_HIGH    1


#define TJ_IPCSYS_GPIO_HW_PIN1   1
#define TJ_IPCSYS_GPIO_HW_PIN2   2
#define TJ_IPCSYS_GPIO_HW_PIN3   3
#define TJ_IPCSYS_GPIO_HW_PIN4   4
#define TJ_IPCSYS_GPIO_HW_PIN5   5
#define TJ_IPCSYS_GPIO_HW_PIN6   6
#define TJ_IPCSYS_GPIO_HW_PIN7   7
#define TJ_IPCSYS_GPIO_HW_PIN8   8
#define TJ_IPCSYS_GPIO_HW_PIN9   9
#define TJ_IPCSYS_GPIO_HW_PIN10  10
#define TJ_IPCSYS_GPIO_HW_PIN11  11
#define TJ_IPCSYS_GPIO_HW_PIN12  12
#define TJ_IPCSYS_GPIO_HW_PIN13  13
#define TJ_IPCSYS_GPIO_HW_PIN14  14
#define TJ_IPCSYS_GPIO_HW_PIN15  15
#define TJ_IPCSYS_GPIO_HW_PIN16  16
#define TJ_IPCSYS_GPIO_HW_PIN17  17
#define TJ_IPCSYS_GPIO_HW_PIN18  18
#define TJ_IPCSYS_GPIO_HW_PIN19  19
#define TJ_IPCSYS_GPIO_HW_PIN20  20
#define TJ_IPCSYS_GPIO_HW_PIN21  21
#define TJ_IPCSYS_GPIO_HW_PIN22  22
#define TJ_IPCSYS_GPIO_HW_PIN23  23
#define TJ_IPCSYS_GPIO_HW_PIN24  24



#ifndef bool
#define bool int
#define true  1
#define false 0
#endif //#ifndef bool


extern "C"
{
	int _stdcall tj_ipcsys_drv_init();
	int _stdcall tj_ipcsys_drv_exit();
	unsigned char _stdcall tj_ipcsys_get_drv_version();


	//wdt apis
	int _stdcall tj_ipcsys_wdt_start(unsigned char timeout_value); //start watchdog mode
	void _stdcall tj_ipcsys_wdt_feed(); //feeding watchdog
	void _stdcall tj_ipcsys_wdt_stop(); //stop watchdog

	//gpio apis
	int _stdcall tj_ipcsys_gpio_init(unsigned int gpio_type);
	int _stdcall tj_ipcsys_gpio_get_num();
	int _stdcall tj_ipcsys_gpio_set_pin_mode(unsigned char pin, unsigned char pin_mode);
	int _stdcall tj_ipcsys_gpio_set_pin_level(unsigned char pin, unsigned char pin_level); //input mode, set pin level access will be ignored
	int _stdcall tj_ipcsys_gpio_get_pin_level(unsigned char pin, unsigned char *pin_level);

	//common apis
	void _stdcall oem_fix_delay_nms(unsigned short n);   

}

#endif

