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

Function ls1c_pin_read

bsp/loongson/ls1cdev/drivers/drv_gpio.c:54–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52
53
54rt_ssize_t ls1c_pin_read(struct rt_device *device, rt_base_t pin)
55{
56 unsigned int gpio = pin;
57 rt_ssize_t value = PIN_LOW;
58
59 if (0 == gpio_get(gpio))
60 {
61 value = PIN_LOW;
62 }
63 else
64 {
65 value = PIN_HIGH;
66 }
67
68 return value;
69}
70
71rt_err_t ls1c_pin_attach_irq(struct rt_device *device, rt_base_t pin,
72 rt_uint8_t mode, void (*hdr)(void *args), void *args)

Callers

nothing calls this directly

Calls 1

gpio_getFunction · 0.50

Tested by

no test coverage detected