From owner-freebsd-arm@FreeBSD.ORG Sun Dec 14 14:04:06 2014 Return-Path: Delivered-To: freebsd-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 E7B12900 for ; Sun, 14 Dec 2014 14:04:06 +0000 (UTC) Received: from mail-wi0-x233.google.com (mail-wi0-x233.google.com [IPv6:2a00:1450:400c:c05::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 71E7ECB3 for ; Sun, 14 Dec 2014 14:04:06 +0000 (UTC) Received: by mail-wi0-f179.google.com with SMTP id ex7so6637454wid.12 for ; Sun, 14 Dec 2014 06:04:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=iG2hCbCXXe6Bnsc9Pnd4GFNqH9ELvgzCN+kRJa4ZSLU=; b=sdpVeFN8RStPWUA4JQF6hL4UCkm9uovX3kW/qQU0fC6B/0cZsvZ6FxIWCYKcz4XlV7 DI9DLvnOfEPBEbwo2PiYhXol+ayl+WUtWKKyk/JWvqEG1GxuGZpqGjnPLlNMbNjXYqtR YVcL3nPbBVWfKqd4CM2b1MFr6Kgd68lMfeb7uyaZV0aPlT8eyb48ovmyqftP1i/nrmcR FI8GEabkXl8j4Ohxtippy4qEvUCFYImCjX2qFz6S7cXnMnBNr6LrxLKAi9sSLMO2eL3i xBFCDetN6VhY8X3aYl4Wi11h1NGY41OOeeYErTh/tO9dH0nByyDTobjNAax6J0IFxFYc 2cBQ== X-Received: by 10.194.193.2 with SMTP id hk2mr42847108wjc.40.1418565843875; Sun, 14 Dec 2014 06:04:03 -0800 (PST) Received: from ketas-laptop.mydomain ([2001:ad0:91f:0:21a:6bff:fe66:2ad3]) by mx.google.com with ESMTPSA id nb8sm9506982wic.7.2014.12.14.06.04.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 14 Dec 2014 06:04:02 -0800 (PST) Sender: Sulev-Madis Silber Message-ID: <548D98CE.7030307@hot.ee> Date: Sun, 14 Dec 2014 16:03:58 +0200 From: "Sulev-Madis Silber (ketas)" User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:15.0) Gecko/20120912 Thunderbird/15.0.1 MIME-Version: 1.0 To: =?UTF-8?B?UmVuw6kgTGFkYW4=?= Subject: Re: using GPIO on 10.1-release References: <201412131505.sBDF55IM070058@mech-as221.men.bris.ac.uk> <1772909.5HItWhHBl0@quad> In-Reply-To: X-TagToolbar-Keys: D20141214160356505 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: freebsd-arm 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: Sun, 14 Dec 2014 14:04:07 -0000 On 2014-12-13 18:17, René Ladan wrote: > Op 13 dec. 2014 16:23 schreef "Maxim V FIlimonov" : >> >> On Saturday 13 December 2014 07:05:06 Anton Shterenlikht wrote: >>> Hi >>> >>> My son is bugging me to teach him something 'cool' on RPi. >>> I've got 10.1-release working on RPi-B. >>> >>> I've seen some tutorials on using LEDs via >>> GPIO, but those are implemented in python >>> using RPi-GPIO module [1], which doesn't seem to >>> exist on ports. (Or am I looking in the wrong place?) >>> >>> Anyway, what is the easiest way to start on >>> GPIO programming on RPi-B 10.1-release, >>> preferably using what is available via ports >>> already? >>> >> >> Use gpioctl, it's already in the base system. > > Or look at comms/dcf77pi for some examples in C (in the input.c file) Or you can still use https://github.com/gonzoua/freebsd-gpio If you find examples there too "example-ish", I use it like this: http://ketas.si.pri.ee/bbb/bbb-poe-daemon/util/gpio.pl (pin config part needs rewrite to remove gpioctl exec) Well, only if you and / or him likes Perl. There is also new GPIO code somewhere, which supports features like interrupts. I haven't really seen it or tried to get that working (loos@ & rpaulo@ likely know more). I also don't know about RPi, I only have BBB which I can say works well and has lot of features, including some unsupported ones. Curses per some time period seems higher with RPi. Though, it's cheaper device... And you already have it.