head/sys/arm/xilinx/zy7_gpio.c
/* Get a specific pin's input value. */
Get a specific pin's input value.
Get a specific pin ' s input value .
static int
zy7_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *value)
{
	struct zy7_gpio_softc *sc = device_get_softc(dev);
	if (!VALID_PIN(pin))
		return (EINVAL);
	*value = (RD4(sc, ZY7_GPIO_DATA_RO(pin >> 5)) >> (pin & 31)) & 1;
	return (0);
}
static int zy7_gpio_pin_get ( device_t dev , uint32_t pin , unsigned int * value ) { struct zy7_gpio_softc * sc = device_get_softc ( dev ) ; if ( ! VALID_PIN ( pin ) ) return ( EINVAL ) ; * value = ( RD4 ( sc , ZY7_GPIO_DATA_RO ( pin >> 5 ) ) >> ( pin & 31 ) ) & 1 ; return ( 0 ) ; }
Get a specific pin's input value.
Get a specific pin ' s input value .