dsmi_gpio_set_value
Prototype
int dsmi_gpio_set_value(int device_id, unsigned int gpio, int value)
Description
Sets the level for a GPIO pin.
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 |
value |
Input |
High or low level |
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; int value = 0; ret = dsmi_gpio_set_value(deviceid, gpio, value); if(ret != 0){ //To-do: records logs. return ret; } ...