From owner-freebsd-ports@FreeBSD.ORG Fri Nov 22 21:51:07 2013 Return-Path: Delivered-To: ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DC3D6118 for ; Fri, 22 Nov 2013 21:51:06 +0000 (UTC) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id 6BE94209B for ; Fri, 22 Nov 2013 21:51:06 +0000 (UTC) Received: from outgoing.leidinger.net (p5DD45A9E.dip0.t-ipconnect.de [93.212.90.158]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id 6A7E8844113; Fri, 22 Nov 2013 22:50:44 +0100 (CET) Received: from unknown (Titan.Leidinger.net [192.168.1.17]) by outgoing.leidinger.net (Postfix) with ESMTP id EEF261910; Fri, 22 Nov 2013 22:50:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=leidinger.net; s=outgoing-alex; t=1385157041; bh=Pv8PT3ChZS5PAI68XBexjd9qoOtHLHPRouAKSBUtUIw=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=LXXXuWsPRh0BHQeXG1hd8qjrDEcYrY+reendH4baolt6qoPNgFfrNtbfDpSa+om2a TGnnQ+BtBqTOUgBM9fbOCmRoLy192FLNdiKJfNOknLPXM7gRdBTT01V4Q0DgLOFPwM q0BvjWmyHzwX4BgkBkpXmXhHmwmLSPvqGVl3FqRwSrTOrc/RHqh1hNEgmOQc+HEkok 4DwiA/70MHUWeslzkQDtvl5rNTnuKAbQSI+vIdnv9ginTeEk7EyVJ6fn66w1lmaZ6R 1v4aQA9vF+U/Ay4XvKSJJ2/AfCU7Hek+lObkPpYFa+jhH6dcS5OLYZVDvqG2/T0rU3 y9VGOYnGOBwhQ== Date: Fri, 22 Nov 2013 22:50:42 +0100 From: Alexander Leidinger To: ports@FreeBSD.org Subject: Re: Porting a software which uses INP_GPIO? Message-ID: <20131122225042.00007aad@unknown> In-Reply-To: <44bo1d5u3z.fsf@be-well.ilk.org> References: <20131121214359.000006f6@unknown> <44bo1d5u3z.fsf@be-well.ilk.org> X-Mailer: Claws Mail 3.9.2-55-g74b05b (GTK+ 2.16.6; i586-pc-mingw32msvc) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: 6A7E8844113.A1016 X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=-1.193, required 6, autolearn=disabled, ALL_TRUSTED -1.00, AWL -0.08, DKIM_SIGNED 0.10, DKIM_VALID -0.10, DKIM_VALID_AU -0.10, T_RP_MATCHES_RCVD -0.01, URIBL_BLOCKED 0.00) X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1385761844.86669@8QBH5fGpNd6+KY4fYfNXRA X-EBL-Spam-Status: No Cc: freebsd-ports-local@be-well.ilk.org X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Nov 2013 21:51:07 -0000 On Thu, 21 Nov 2013 16:21:20 -0500 Lowell Gilbert wrote: > Alexander Leidinger writes: > > > I try to compile a software on FreeBSD which wants to use INP_GPIO, > > OUTP_GPIO and some oder *GPIO* things. > > > > A quick googling shows me some raspberry pi sites. Is this something > > linux-specific (so that I can forget this software on FreeBSD as > > long as we don't gain something similar)? > > > > Searching for gpio in names of ports didn't show a hit and in the > > basesystem includes I can't find it either. > > GPIO is a way to do pin assignments for a chip package at run-time. I > use it on embedded platforms all the time, but it isn't normally > available on a PC. There's a gpioctl(1) that should be able to set the > a pin for input or output, as those flags indicate, or > programmatically I guess it would be GPIO_PIN_INPUT or > GPIO_PIN_OUTPUT in /usr/include/sys/gpio.h but again, you need to > have the hardware for it. I have the hardware. Currently it is accessed from an old Laptop with the Windows-binary of the program. I would like to replace the Laptop and use a FreeBSD version of the program. The code in question is: ---snip--- const int banks[4]={18,23,24,25}; [...] for(i=0;i<4;i++) { INP_GPIO(banks[i]); OUT_GPIO(banks[i]); if(i==bank) { GPIO_SET = 1 << banks[i]; // enable bank } else { GPIO_CLR = 1 << banks[i];// disable bank } } ---snip--- When looking at sys/gpio.h, I have no idea how I shall translate the above into something FreeBSD understands. Could you please explain how the above translates into "FreeBSD-gpio-speak"? Bye, Alexander. -- http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137