_input_controller.md 8.0 KB
Newer Older
D
hdi api  
duangavin123 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
# InputController


## **概述**

**所属模块:**

[Input](_input.md)


## **汇总**


### Public 属性

  | Public 属性 | 描述 | 
| -------- | -------- |
| ( [SetPowerStatus](#setpowerstatus) )(uint32_t devIndex, uint32_t status) | 设置电源状态 [更多...](#setpowerstatus) | 
| ( [GetPowerStatus](#getpowerstatus) )(uint32_t devIndex, uint32_t \*status) | 获取电源状态 [更多...](#getpowerstatus) | 
L
liyan 已提交
20
| ( [GetDeviceType](#getdevicetype) )(uint32_t devIndex, uint32_t \*deviceType) | 获取devIndex对应的Input设备的类型 [更多...](#getdevicetype) | 
D
hdi api  
duangavin123 已提交
21 22 23 24 25 26 27 28 29 30
| ( [GetChipInfo](#getchipinfo) )(uint32_t devIndex, char \*chipInfo, uint32_t length) | 获取器件对应的编码信息 [更多...](#getchipinfo) | 
| ( [GetVendorName](#getvendorname) )(uint32_t devIndex, char \*vendorName, uint32_t length) | 获取devIndex对应的模组厂商名 [更多...](#getvendorname) | 
| ( [GetChipName](#getchipname) )(uint32_t devIndex, char \*chipName, uint32_t length) | 获取devIndex对应的驱动芯片名 [更多...](#getchipname) | 
| ( [SetGestureMode](#setgesturemode) )(uint32_t devIndex, uint32_t gestureMode) | 设置手势模式 [更多...](#setgesturemode) | 
| ( [RunCapacitanceTest](#runcapacitancetest) )(uint32_t devIndex, uint32_t testType, char \*result, uint32_t length) | 执行容值自检测试 [更多...](#runcapacitancetest) | 
| ( [RunExtraCommand](#runextracommand) )(uint32_t devIndex, [InputExtraCmd](_input_extra_cmd.md) \*cmd) | 执行拓展指令 [更多...](#runextracommand) | 


## **详细描述**

L
liyan 已提交
31
提供Input设备业务控制相关的接口。
D
hdi api  
duangavin123 已提交
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55

此类接口包含电源状态的设置、特性的使能、器件信息的获取,以及产线相关的测试功能接口。


## **类成员变量说明**


### GetChipInfo

  
```
int32_t(* InputController::GetChipInfo) (uint32_t devIndex, char *chipInfo, uint32_t length)
```

**描述:**

获取器件对应的编码信息

一款产品通常会有多家模组和Driver IC,上层应用如果关注具体器件型号,则通过此接口来获取。

**参数:**

  | 名称 | 描述 | 
| -------- | -------- |
L
liyan 已提交
56
| devIndex | Input设备索引,用于标志多个Input设备,取值从0开始,最多支持32个设备。 | 
D
hdi api  
duangavin123 已提交
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
| chipInfo | 获取的对应设备索引的器件编码信息。 | 
| length | 保存器件芯片信息的内存长度。 | 

**返回:**

Returns INPUT_SUCCESS 表示执行成功。

Returns 其他值表示执行失败,具体错误码查看**RetSatus**


### GetChipName

  
```
int32_t(* InputController::GetChipName) (uint32_t devIndex, char *chipName, uint32_t length)
```

**描述:**

获取devIndex对应的驱动芯片名

**参数:**

  | 名称 | 描述 | 
| -------- | -------- |
L
liyan 已提交
82
| devIndex | Input设备索引,用于标志多个Input设备,取值从0开始,最多支持32个设备。 | 
D
hdi api  
duangavin123 已提交
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
| chipName | 获取的对应设备索引的驱动芯片名。 | 
| length | 保存驱动芯片名的内存长度。 | 

**返回:**

Returns INPUT_SUCCESS 表示执行成功。

Returns 其他值表示执行失败,具体错误码查看**RetSatus**


### GetDeviceType

  
```
int32_t(* InputController::GetDeviceType) (uint32_t devIndex, uint32_t *deviceType)
```

**描述:**

L
liyan 已提交
102
获取devIndex对应的Input设备的类型
D
hdi api  
duangavin123 已提交
103 104 105 106 107

**参数:**

  | 名称 | 描述 | 
| -------- | -------- |
L
liyan 已提交
108
| devIndex | Input设备索引,用于标志多个Input设备,取值从0开始,最多支持32个设备。 | 
D
hdi api  
duangavin123 已提交
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
| deviceType | 获取的对应设备索引的设备类型,具体参考**InputDevType**。 | 

**返回:**

Returns INPUT_SUCCESS 表示执行成功。

Returns 其他值表示执行失败,具体错误码查看**RetSatus**


### GetPowerStatus

  
```
int32_t(* InputController::GetPowerStatus) (uint32_t devIndex, uint32_t *status)
```

**描述:**

获取电源状态

L
liyan 已提交
129
在系统休眠或者唤醒时,Input服务或电源管理模块获取电源状态,以便驱动IC能正常进入对应的休眠模式。
D
hdi api  
duangavin123 已提交
130 131 132 133 134

**参数:**

  | 名称 | 描述 | 
| -------- | -------- |
L
liyan 已提交
135
| devIndex | Input设备索引,用于标志多个Input设备,取值从0开始,最多支持32个设备。 | 
D
hdi api  
duangavin123 已提交
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
| status | 获取的对应设备索引的电源状态,具体参考**PowerStatus**。 | 

**返回:**

Returns INPUT_SUCCESS 表示执行成功。

Returns 其他值表示执行失败,具体错误码查看**RetSatus。**


### GetVendorName

  
```
int32_t(* InputController::GetVendorName) (uint32_t devIndex, char *vendorName, uint32_t length)
```

**描述:**

获取devIndex对应的模组厂商名

**参数:**

  | 名称 | 描述 | 
| -------- | -------- |
L
liyan 已提交
160
| devIndex | Input设备索引,用于标志多个Input设备,取值从0开始,最多支持32个设备。 | 
D
hdi api  
duangavin123 已提交
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
| vendorName | 获取的对应设备索引的模组厂商名。 | 
| length | 保存模组厂商名的内存长度。 | 

**返回:**

Returns INPUT_SUCCESS 表示执行成功。

Returns 其他值表示执行失败,具体错误码查看**RetSatus**


### RunCapacitanceTest

  
```
int32_t(* InputController::RunCapacitanceTest) (uint32_t devIndex, uint32_t testType, char *result, uint32_t length)
```

**描述:**

执行容值自检测试

启动不同检测场景下的容值自检测试,并获取测试结果,容值自检项由器件厂商自定义, 一般包括RawData测试、 \* 短路检测、开路检测、干扰检测、行列差检测等测试项。

**参数:**

  | 名称 | 描述 | 
| -------- | -------- |
L
liyan 已提交
188
| devIndex | Input设备索引,用于标志多个Input设备,取值从0开始,最多支持32个设备。 | 
D
hdi api  
duangavin123 已提交
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214
| testType | 容值测试的测试类型,具体参考**CapacitanceTest**。 | 
| result | 容值测试的结果,成功则输出“SUCCESS”,失败则返回对应的错误提示 。 | 
| length | 保存容值测试结果的内存长度。 | 

**返回:**

Returns INPUT_SUCCESS 表示执行成功。

Returns 其他值表示执行失败,具体错误码查看**RetSatus**


### RunExtraCommand

  
```
int32_t(* InputController::RunExtraCommand) (uint32_t devIndex, InputExtraCmd *cmd)
```

**描述:**

执行拓展指令

**参数:**

  | 名称 | 描述 | 
| -------- | -------- |
L
liyan 已提交
215
| devIndex | Input设备索引,用于标志多个Input设备,取值从0开始,最多支持32个设备。 | 
D
hdi api  
duangavin123 已提交
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241
| cmd | 拓展指令数据包,包括指令编码及参数,具体参考**InputExtraCmd**。 | 

**返回:**

Returns INPUT_SUCCESS 表示执行成功。

Returns 其他值表示执行失败,具体错误码查看**RetSatus**


### SetGestureMode

  
```
int32_t(* InputController::SetGestureMode) (uint32_t devIndex, uint32_t gestureMode)
```

**描述:**

设置手势模式

上层应用开关手势模式,即设置手势模式的对应使能bit

**参数:**

  | 名称 | 描述 | 
| -------- | -------- |
L
liyan 已提交
242
| devIndex | Input设备索引,用于标志多个Input设备,取值从0开始,最多支持32个设备。 | 
D
hdi api  
duangavin123 已提交
243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262
| gestureMode | 手势模式的开关状态 | 

**返回:**

Returns INPUT_SUCCESS 表示执行成功。

Returns 其他值表示执行失败,具体错误码查看**RetSatus**


### SetPowerStatus

  
```
int32_t(* InputController::SetPowerStatus) (uint32_t devIndex, uint32_t status)
```

**描述:**

设置电源状态

L
liyan 已提交
263
在系统休眠或者唤醒时,Input服务或电源管理模块设置电源状态,以使驱动IC能正常进入对应的休眠模式。
D
hdi api  
duangavin123 已提交
264 265 266 267 268

**参数:**

  | 名称 | 描述 | 
| -------- | -------- |
L
liyan 已提交
269 270
| devIndex | Input设备索引,用于标志多个Input设备,取值从0开始,最多支持32个设备。 | 
| status | 设置的电源状态,Input服务控制Input设备进入resume或者suspend等状态[PowerStatus](_input.md#powerstatus)。 | 
D
hdi api  
duangavin123 已提交
271 272 273 274 275 276

**返回:**

Returns INPUT_SUCCESS 表示执行成功。

Returns 其他值表示执行失败,具体错误码查看**RetSatus**