dsmi_gpio_get_value
Prototype
int dsmi_gpio_get_value(int device_id, unsigned int gpio, int *p_value)
Description
Obtains the level of 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 |
p_value |
Output |
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_get_value(deviceid, gpio, &value); if(ret != 0){ //To-do: records logs. return ret; } ...