InputController

Overview

Related Modules:

Input

Description:

Provides interfaces for controlling the business process of input devices.

The interfaces can be called to control the power status, enable or disable a feature, get driver chip information, and control the production test.

Summary

Data Fields

Variable Name

Description

SetPowerStatus )(uint32_t devIndex, uint32_t status)

int32_t( 

Sets the power status.

GetPowerStatus )(uint32_t devIndex, uint32_t status)

int32_t( 

Gets the power status.

GetDeviceType )(uint32_t devIndex, uint32_t deviceType)

int32_t( 

Gets the type of the input device based on the specified device index.

GetChipInfo )(uint32_t devIndex, char chipInfo, uint32_t length)

int32_t( 

Gets the chip information of the specified device.

GetVendorName )(uint32_t devIndex, char vendorName, uint32_t length)

int32_t( 

Gets the module vendor name of the specified device.

GetChipName )(uint32_t devIndex, char chipName, uint32_t length)

int32_t( 

Gets the driver chip name of the specified device.

SetGestureMode )(uint32_t devIndex, uint32_t gestureMode)

int32_t( 

Sets the gesture mode.

RunCapacitanceTest )(uint32_t devIndex, uint32_t testType, char result, uint32_t length)

int32_t( 

Conducts a capacitance self-test.

RunExtraCommand )(uint32_t devIndex, InputExtraCmdcmd)

int32_t( 

Executes the extra command.

Details

Field Documentation

GetChipInfo

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

Description:

Gets the chip information of the specified device.

A product is usually equipped with modules and driver ICs provided by multiple vendors. An input service can call this function to get the specific information if needed.

Parameters:

Name

Description

devIndexIndicates the index of an input device. A maximum of 32 input devices are supported. The value ranges from 0 to 31, and value 0 represents the first input device.
chipInfoIndicates the pointer to the chip information.
lengthIndicates the length of the chip information.

Returns:

Returns 0 if the operation is successful; returns an error code defined in RetStatus otherwise.

GetChipName

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

Description:

Gets the driver chip name of the specified device.

Parameters:

Name

Description

devIndexIndicates the index of an input device. A maximum of 32 input devices are supported. The value ranges from 0 to 31, and value 0 represents the first input device.
chipNameIndicates the pointer to the driver chip name.
lengthIndicates the length of the driver chip name.

Returns:

Returns 0 if the operation is successful; returns an error code defined in RetStatus otherwise.

GetDeviceType

  1. int32_t(*InputController::GetDeviceType)(uint32_t devIndex,uint32_t*deviceType)

Description:

Gets the type of the input device based on the specified device index.

Parameters:

Name

Description

devIndexIndicates the index of an input device. A maximum of 32 input devices are supported. The value ranges from 0 to 31, and value 0 represents the first input device.
deviceTypeIndicates the pointer to the device type. For details, see InputDevType.

Returns:

Returns 0 if the operation is successful; returns an error code defined in RetStatus otherwise.

GetPowerStatus

  1. int32_t(*InputController::GetPowerStatus)(uint32_t devIndex,uint32_t*status)

Description:

Gets the power status.

The input service or the power management module can set the power status for the input device when the OS is in the Resume or Suspend status, so that the driver IC of the device can normally enter the specified status. You can call this function to obtain the power status.

Parameters:

Name

Description

devIndexIndicates the index of an input device. A maximum of 32 input devices are supported. The value ranges from 0 to 31, and value 0 represents the first input device.
statusIndicates the pointer to the power status of the device. For details, see PowerStatus.

Returns:

Returns 0 if the operation is successful; returns an error code defined in RetStatus otherwise.

GetVendorName

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

Description:

Gets the module vendor name of the specified device.

Parameters:

Name

Description

devIndexIndicates the index of an input device. A maximum of 32 input devices are supported. The value ranges from 0 to 31, and value 0 represents the first input device.
vendorNameIndicates the pointer to the module vendor name.
lengthIndicates the length of the vendor name.

Returns:

Returns 0 if the operation is successful; returns an error code defined in RetStatus otherwise.

RunCapacitanceTest

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

Description:

Conducts a capacitance self-test.

The capacitance self-test items are defined by the component vendor, such as the tests on the raw data, short circuit, open circuit, interference, and row/column difference.

Parameters:

Name

Description

devIndexIndicates the index of an input device. A maximum of 32 input devices are supported. The value ranges from 0 to 31, and value 0 represents the first input device.
testTypeIndicates the capacitance test type. For details, see CapacitanceTest.
resultIndicates the pointer to the capacitance test result. The value is SUCC for a successful operation and is an error code for a failed operation.
lengthIndicates the length of the test result.

Returns:

Returns 0 if the operation is successful; returns an error code defined in RetStatus otherwise.

RunExtraCommand

  1. int32_t(*InputController::RunExtraCommand)(uint32_t devIndex,[InputExtraCmd]($api-api-SmartVision-Devices-InputExtraCmd.md)*cmd)

Description:

Executes the extra command.

Parameters:

Name

Description

devIndexIndicates the index of an input device. A maximum of 32 input devices are supported. The value ranges from 0 to 31, and value 0 represents the first input device.
cmdIndicates the pointer to the extra command data packet, including the command codes and parameters. For details, see InputExtraCmd.

Returns:

Returns 0 if the operation is successful; returns an error code defined in RetStatus otherwise.

SetGestureMode

  1. int32_t(*InputController::SetGestureMode)(uint32_t devIndex,uint32_t gestureMode)

Description:

Sets the gesture mode.

The input service can use this function to enable or disable the gesture mode by setting EnableBit of the gesture mode.

Parameters:

Name

Description

devIndexIndicates the index of an input device. A maximum of 32 input devices are supported. The value ranges from 0 to 31, and value 0 represents the first input device.
gestureModeIndicates the gesture mode to set.

Returns:

Returns 0 if the operation is successful; returns an error code defined in RetStatus otherwise.

SetPowerStatus

  1. int32_t(*InputController::SetPowerStatus)(uint32_t devIndex,uint32_t status)

Description:

Sets the power status.

This function is called only when the power status of the OS is changed. The input service or the power management module can call this function to set the power status for the input device when the OS is in the Resume or Suspend status, so that the driver integrated circuit (IC) of the device can normally enter the specified status.

Parameters:

Name

Description

devIndexIndicates the index of an input device. A maximum of 32 input devices are supported. The value ranges from 0 to 31, and value 0 represents the first input device.
statusIndicates the power status to set. The input service will notify the input device of entering the Resume or Suspend state specified by PowerStatus.

Returns:

Returns 0 if the operation is successful; returns an error code defined in RetStatus otherwise.