From owner-freebsd-arm@FreeBSD.ORG Fri Nov 7 07:49:47 2014 Return-Path: Delivered-To: arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 868296B0; Fri, 7 Nov 2014 07:49:47 +0000 (UTC) Received: from alogt.com (alogt.com [69.36.191.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 60B18875; Fri, 7 Nov 2014 07:49:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=alogt.com; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=xNSuxj3M3cNgwnq1eA7Vl7BE/hzTSnx+LwltMoYBs7I=; b=sytGKNRtFkk224wgDy+FpfFjO3svyy7cJhEi69k/6kyJ3tB69XrpIYT2MdX8YE5OAFDk8F/wlJu31bcixfL2zAUIVNViAAWcibQVhjG/aLC31p2Xdya15vcLxWFV1xt5wscPBLP9/0CKEvUgDN1AIVLlwAMNkRndCC2LMJc10Fk=; Received: from [182.10.35.123] (port=28832 helo=X220.alogt.com) by sl-508-2.slc.westdc.net with esmtpa (Exim 4.82) (envelope-from ) id 1XmeIj-001R94-M9; Fri, 07 Nov 2014 00:49:46 -0700 Date: Fri, 7 Nov 2014 15:49:41 +0800 From: Erich Dollansky To: Rui Paulo Subject: Re: libgpio Message-ID: <20141107154941.3694a9c9@X220.alogt.com> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - sl-508-2.slc.westdc.net X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - alogt.com X-Get-Message-Sender-Via: sl-508-2.slc.westdc.net: authenticated_id: erichsfreebsdlist@alogt.com X-Source: X-Source-Args: X-Source-Dir: Cc: arm@freebsd.org, embedded@freebsd.org X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 07:49:47 -0000 Hi, On Thu, 06 Nov 2014 22:41:12 -0800 Rui Paulo wrote: > Some time ago, I wrote a gpio library as a way to interact with the > kernel gpio driver in a more sensible way (hiding the details of > opening a /dev file, handling all the ioctls, etc.). > > Here's the project code: > > https://bitbucket.org/rpaulo/libgpio/src > > Here's the header file: > > https://bitbucket.org/rpaulo/libgpio/src/1dfe793d0b0cd6caff2e196cf667a5c06bbade8d/libgpio.h?at=default > > It looks like some people started using the library and I was I am one of them. > wondering if it would be a good candidate for the base system. I It would. > would rewrite gpioctl to use it and I'm open to changing the library > API. > > Any comments? The only thing I would really change is to add functions which include the opening and closing of the port. With other words, the application only calls something like gpio_pin_write (Name, Pin, value) or gpio_pin_write (Pin, value) and gpio_pin_write opens and closes the device. Plus a function to set the device name to be used for all later calls. Erich