FreeBSD/sys/arm/xilinx/zy7_gpio.c
/* Toggle a pin's output value. */
Toggle a pin's output value.
Toggle a pin ' s output value .
static int
zy7_gpio_pin_toggle(device_t dev, uint32_t pin)
{
	struct zy7_gpio_softc *sc = device_get_softc(dev);
	if (!VALID_PIN(pin))
		return (EINVAL);
	ZGPIO_LOCK(sc);
	WR4(sc, ZY7_GPIO_DATA(pin >> 5),
	    RD4(sc, ZY7_GPIO_DATA(pin >> 5)) ^ (1 << (pin & 31)));
	ZGPIO_UNLOCK(sc);
	return (0);
}
static int zy7_gpio_pin_toggle ( device_t dev , uint32_t pin ) { struct zy7_gpio_softc * sc = device_get_softc ( dev ) ; if ( ! VALID_PIN ( pin ) ) return ( EINVAL ) ; ZGPIO_LOCK ( sc ) ; WR4 ( sc , ZY7_GPIO_DATA ( pin >> 5 ) , RD4 ( sc , ZY7_GPIO_DATA ( pin >> 5 ) ) ^ ( 1 << ( pin & 31 ) ) ) ; ZGPIO_UNLOCK ( sc ) ; return ( 0 ) ; }
Toggle a pin's output value.
Toggle a pin ' s output value .