/**
 ********************************************************************
 * @file  
 *         
 *
 *********************************************************************
 */

/* Define to prevent recursive inclusion 避免重定义 -------------------------------------*/
#ifndef IRCUT_H
#define IRCUT_H

/* Includes ------------------------------------------------------------------*/
#include "JZsdk_Base/JZsdk_Code/JZsdk_Code.h"
#include "./ircutParams.h"
#include "./Sysfs_gpio/Sysfs_gpio.h"

#ifdef __cplusplus
extern "C" {
#endif

/* Exported constants --------------------------------------------------------*/
typedef enum E_JZ_IRC_PORT{
    JZ_IRC_PORT_PA = 0,
    JZ_IRC_PORT_PB = 1,
    JZ_IRC_PORT_PC = 2,
    JZ_IRC_PORT_PD = 3,
    JZ_IRC_PORT_PE = 4,
    JZ_IRC_PORT_PF = 5,
    JZ_IRC_PORT_PG = 6,
}E_JZ_IRC_PORT;

typedef enum E_JZ_IRC_PIN_MODE{
    JZ_IRC_PIN_MODE_IN =  0x00,     //输入模式
    JZ_IRC_PIN_MODE_OUT = 0x01,     //输出模式
    JZ_IRC_PIN_MODE_AUX = 0x02,     //辅助模式
    JZ_IRC_PIN_MODE_INT = 0x03,     //中断模式
    JZ_IRC_PIN_MODE_DISABLE = 0x04,     //禁用模式
}E_JZ_IRC_PIN_MODE;

typedef struct T_JZsdkIrcut_GpioInfo{
    int Enable;             //使能开关 jzoff关 jzon开
    int Group;              //引脚所在组
    E_JZ_IRC_PORT Port;     //引脚所在组的端口
    int index;              //引脚所在组中的第几个引脚
    E_JZ_IRC_PIN_MODE mode;    //引脚模式
}T_JZsdkIrcut_GpioInfo;

typedef struct T_JZsdkIrcut_PwmInfo{
    int Enable;             //使能开关 jzoff关 jzon开
}T_JZsdkIrcut_PwmInfo;

//引脚类型
typedef enum E_JZ_IRC_TYPE{
    JZ_IRC_TYPE_LINUX_GENRAL = 0x01, //linux通用类型引脚
    JZ_IRC_TYPE_LINUX_V3S = 0x02, //v3s独特类型引脚
    JZ_IRC_TYPE_LINUX_H3 = 0x03, //H3独特类型引脚
}E_JZ_IRC_TYPE;

/* 常亮定义*/
/*******
 * 
 *  引脚信息结构体
 * 
 * ********/
typedef struct IrcutInfo
{
//喊话器引脚信息
    //静音角
    T_JZsdkIrcut_GpioInfo Amplifiter_Pin;


//侧面激光引脚信息
    T_JZsdkIrcut_GpioInfo SideLight_Right_Pin;
    T_JZsdkIrcut_GpioInfo SideLight_Left_Pin;

//对外输出电源
    T_JZsdkIrcut_GpioInfo OutPutPower_Pin;

//pwm引脚信息
    //pwm引脚1
    T_JZsdkIrcut_PwmInfo PWM_1_Pin;

//引脚类型
    E_JZ_IRC_TYPE type;

}IrcutInfo;

/* Exported types ------------------------------------------------------------*/

/* Exported functions --------------------------------------------------------*/
T_JZsdkReturnCode Ircut_uInit()  ;

int Ircut_PWM_control(int pwm_num);
T_JZsdkReturnCode Ircut_CheckStatus_OutPutPower(int *value);



T_JZsdkReturnCode Ircut_Init(IrcutInfo ircut_info);
T_JZsdkReturnCode Ircut_SideLaser_IrcutControl(int index, int status);
T_JZsdkReturnCode set_amplifier(int amplifier_mode);
T_JZsdkReturnCode Ircut_Set_OutPutPower_Control(int value);

#ifdef __cplusplus
}
#endif

#endif