MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / gpio_get_value

Function gpio_get_value

bsp/dm365/drivers/gpio.c:142–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142int gpio_get_value(unsigned int gpio)
143{
144 unsigned int offset;
145 int ret=0;
146
147 rt_ubase_t temp = rt_hw_interrupt_disable();
148 ret = gpio_to_base(gpio);
149 if (ret < 0) {
150 goto gpio_free;
151 }
152
153 offset = gpio & ((1 << GPIO_GRP_MASK) -1);
154 ret = gpio_get(offset);
155
156gpio_free:
157 rt_hw_interrupt_enable(temp);
158
159 return ret;
160}
161
162

Callers

nothing calls this directly

Calls 4

gpio_to_baseFunction · 0.85
rt_hw_interrupt_disableFunction · 0.50
gpio_getFunction · 0.50
rt_hw_interrupt_enableFunction · 0.50

Tested by

no test coverage detected