#ifndef __LIBW83627_H_
#define	__LIBW83627_H_

#include <sys/ioctl.h>

#ifdef __cplusplus
    extern "C" {
#endif

int libw83627_init(void);
void lib_close(void);

/*GPIO*/
int get_gpi_status(int pin);
int get_gpo_status(int pin);
void set_gpo(int pin, int value);

/*Watch Dog*/
//timevalue 1~255, timetype 0:sec 1:mins
void wdt_start(int _timevalue);
void wdt_stop(void);
int get_wdt_count(void);

#if 0
/*LCM*/
void graphicwritelcm(unsigned char *data);
void get_lcm_mode_type(unsigned char *data);
void get_lcm_firmware_ver(unsigned char *data);
int get_lcm_key_code(unsigned char *data);
void set_lcm_displayoff(void);
void set_lcm_displayon(void);
void clear_lcm_display(void);


//psu for pmbus
//void clear_faults(void);
unsigned char pmbus_read_byte(int pwr, unsigned char cmd);
void pmbus_write_byte(int pwr, unsigned char cmd, unsigned char data);
short pmbus_read_word(int pwr, unsigned char cmd);
void pmbus_write_word(int pwr, unsigned char cmd, short data);
void pmbus_read_block(int pwer,unsigned char cmd, char *data);
void pmbus_write_block(int pwer,unsigned char cmd, unsigned char length, char *data);
float pmbus_Read_Pin(int pwr);
float pmbus_Read_Vin(int pwr);
float pmbus_Read_lin(int pwr);
float pmbus_Read_Vout(int pwr);
float pmbus_Read_lout(int pwr);
float pmbus_Read_Pout(int pwr);
float pmbus_Read_Temperature_1(int pwr);
float pmbus_Read_Temperature_2(int pwr);
float pmbus_Read_Temperature_3(int pwr);
float pmbus_Read_Fan_speed(int pwr);
//void pmbus_page_plus_read(int pwer, unsigned char *data);
int pmbus_power_status(int pwr);


//chassis
int get_chassis_open_status(void);
void set_chassis_open(int value);
#endif

/*LAN BYPASS*/
int get_bypass_firmware_ver(char *ver);
int set_bypass_wdt(int pair, int time); //0-255, 0:stop
int set_bypass_wdt_action(int pair, int action);
int get_bypass_wdt_action(int pair);
int set_bypass_poweron_action(int pair, int action);
int get_bypass_poweron_action(int pair);
int set_bypass_poweroff_action(int pair, int action);
int get_bypass_poweroff_action(int pair);
int set_bypass_current_action(int pair, int action);
int get_bypass_current_action(int pair);

#define LCM_CENTER_KEY	0x1E
#define LCM_UP_KEY	0x1D
#define LCM_RIGHT_KEY	0x1B
#define LCM_LEFT_KEY	0x17
#define LCM_DOWM_KEY	0x0F







#ifdef __cplusplus
    }
#endif

#endif //LIBW83627_H_
