src/gpio.c
/**
 * @brief Set GPIO to read active low
 * 
 * Set the GPIO pin to read values in the active low state
 *
 * @param gpio GPIO pin number
 * @param option Write any number greater than zero to set the logic to active low
 *
 * @return 0 on success, or -1 on failure and errno is set
 */
@brief Set GPIO to read active low

Set the GPIO pin to read values in the active low state

@param gpio GPIO pin number
@param option Write any number greater than zero to set the logic to active low

@return 0 on success, or -1 on failure and errno is set
@brief Set GPIO to read active low Set the GPIO pin to read values in the active low state @param gpio GPIO pin number @param option Write any number greater than zero to set the logic to active low @return 0 on success or - 1 on failure and errno is set
int gpio_set_active_low(unsigned int gpio, unsigned int option) {
	int fd = gpio_fd_open(gpio, SYSFS_GPIO_ACTIVE_LOW, O_WRONLY);
	if (fd < 0) {
		return fd;
	}
	if (option == FALSE) {
		write(fd, "0", 2);
	} else {
		write(fd, "1", 2);
	}
	close(fd);
	return 0;
}
int gpio_set_active_low ( unsigned int gpio , unsigned int option ) { int fd = gpio_fd_open ( gpio , SYSFS_GPIO_ACTIVE_LOW , O_WRONLY ) ; if ( fd < 0 ) { return fd ; } if ( option == FALSE ) { write ( fd , " " , 2 ) ; } else { write ( fd , " " , 2 ) ; } close ( fd ) ; return 0 ; }
@brief Set GPIO to read active low
@brief Set GPIO to read active low