From owner-freebsd-arch@FreeBSD.ORG Mon Apr 27 10:48:51 2015 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D677F9B; Mon, 27 Apr 2015 10:48:51 +0000 (UTC) Received: from mailhost.netlabit.sk (mailhost.netlabit.sk [84.245.65.72]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 359E61117; Mon, 27 Apr 2015 10:48:50 +0000 (UTC) Received: from zeta.dino.sk (fw1.dino.sk [84.245.95.252]) (AUTH: LOGIN milan) by mailhost.netlabit.sk with ESMTPA; Mon, 27 Apr 2015 12:48:41 +0200 id 00347808.553E1409.00006044 Date: Mon, 27 Apr 2015 12:48:41 +0200 From: Milan Obuch To: Adrian Chadd Cc: freebsd-arch@freebsd.org Subject: Re: using libgpio to bitbang LCDs! Message-ID: <20150427124841.7b8a59bc@zeta.dino.sk> In-Reply-To: References: X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.27; i386-portbld-freebsd10.1) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Apr 2015 10:48:51 -0000 On Sat, 11 Apr 2015 23:45:55 -0700 Adrian Chadd wrote: > Hi, > > The library source code and a demo program is available here: > > https://github.com/erikarn/freebsd-liblcd > > It includes the wiring needed to hook the example OLED board up > (http://www.adafruit.com/products/684) to a Carambola 2 evaluation > board. > > Anything you can get 5v and 5 GPIO pins from will work. (Well, as long > as there's also libgpio / gpio API support for your device..) > > > > -adrian > Hi, I downloaded master.zip from github and now I am trying to modify it for my hardware - Raspberry PI and TFT display with ILI9341 chip https://learn.adafruit.com/adafruit-pitft-28-inch-resistive-touchscreen-display-raspberry-pi My original attempt to use SPI failed probably because ILI9341 does not use pure SPI, but there is one extension - DC pin. I did not manage to satisfy chip's timing/bit sequence/whatever, so I would like to try bit banging. I found two small issues with archive downloaded - freebsd-liblcd-master/src/beastie_ili9340c_320x240/Makefile seems to ba a copy of freebsd-liblcd-master/src/beastie_ssd1351_128x128/Makefile, I think there should be a difference, after my fix --- beastie_ili9340c_320x240/Makefile 2015-04-23 21:40:10.693847000 +0200 +++ beastie_ssd1351_128x128/Makefile 2015-04-13 00:58:06.000000000 +0200 @@ -3,7 +3,7 @@ .include -PROG=beastie_ili9340c_320x240 +PROG=beastie_ssd1351_128x128 SRCS=main.c CFLAGS+=-I../../lib/liblcd LDFLAGS+=-L../../lib/liblcd The second issue is when doing 'make install' binaries produced are being installed into / directory. While both are not fatal for me, they are annoyances at least. I found following in source files: /* Configured for the carambola 2 board */ cfg.gpio_unit = 0; cfg.pin_cs = 19; cfg.pin_rst = 20; cfg.pin_dc = 21; cfg.pin_sck = 22; cfg.pin_mosi = 23; I see there no 'pin_miso', so does this mean only one directional communication is being used, no status reading, or both reading and writing are being carried over one pin? If the former, then all I should to do is change pin numbers in above given excerption to ones valid for Raspberry Pi, if the later, I can't use this without more modifications. Also, I have simple monochrome display with PCD8544 chip, which should use basically the same bus design, so it could be used for this too, with some modification. Regards, Milan