ircut.h
2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
/**
********************************************************************
* @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