dsmi_gpio_direction_input
Prototype
int dsmi_gpio_direction_input(int device_id, unsigned int gpio)
Description
Sets the GPIO direction to input.
In the EP scenario, storage AI cards work with Dorado storage products.
Parameters
Parameter |
Input/Output |
Description |
---|---|---|
device_id |
Input |
Device ID For Ascend 310 AI Processors, the value range is 0–63. Obtain the actual device ID by calling dsmi_list_device. |
gpio |
Input |
Pin |
Returns
Type |
Description |
---|---|
int |
0 on success; else, failure |
Restrictions
Run the caller application as the root user on a physical machine. Otherwise, a permission error is returned.
This API works with Firmware 1.73.5.6.50 or later.
Example
int ret = 0; int deviceid = 0; unsigned int gpio = 444; ret = dsmi_gpio_direction_input(deviceid, gpio); if(ret != 0){ //To-do: records logs. return ret; } ...