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

Function gpio_direction_input

bsp/dm365/drivers/gpio.c:68–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66
67
68int gpio_direction_input(unsigned int gpio)
69{
70 unsigned int offset;
71 int ret=0;
72
73 rt_ubase_t temp = rt_hw_interrupt_disable();
74 ret = gpio_to_base(gpio);
75 if (ret < 0) {
76 goto gpio_free;
77 }
78 offset = gpio & ((1 << GPIO_GRP_MASK) -1);
79
80 gpio_dirin(offset);
81
82gpio_free:
83 rt_hw_interrupt_enable(temp);
84
85 return ret;
86}
87
88int gpio_direction_output(unsigned int gpio, int value)
89{

Callers

nothing calls this directly

Calls 3

gpio_to_baseFunction · 0.85
rt_hw_interrupt_disableFunction · 0.50
rt_hw_interrupt_enableFunction · 0.50

Tested by

no test coverage detected