ITuner picoLCD 20x2 support

Tom McLaughlin tmclaugh at sdf.lonestar.org
Sat Nov 10 10:52:00 PST 2007


> Hi all,
> 
> I'm looking at building a wi-fi point using an ALIX.1c board and I'm
> currently evaluating cases for it.  I noticed this fine case but I'm
> wondering if anyone has any experience getting the LCD display working on
> it which is an ITuner picoLCD 20x2:
> 
> http://www.mini-box.com/M200-LCD-Enclosure
> 
> A quick look through usbdevs shows an entry that should recognize it.  We
> have lcdproc in ports which has a driver (though, not built by the port
> currently) for it but it relies on the vendor supplied usblcd library
> which is at least available via source.  Before I spend twice as much as
> the model below it I'd like to know if anyone has had any luck with it.

Okay, attached is a port for the driver.  I had to "work around" our
lack usb_get_driver_np() and usb_detach_kernel_driver_np() in libusb.
By "work around" I mean "comment out" since I couldn't find any patches
in the ports tree as an example of how to patch this correctly, only
googled comments about doing that to get other devices to work on
FreeBSD.  I'd like to fix this correctly though.  If anyone has one of
these hanging around please let me know if it works.  Thanks.

tom
-- 
| tmclaugh at sdf.lonestar.org                 tmclaugh at FreeBSD.org |
| FreeBSD                                       http://www.FreeBSD.org |
-------------- next part --------------
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	./usblcd
#	./usblcd/Makefile
#	./usblcd/distinfo
#	./usblcd/pkg-descr
#	./usblcd/files
#	./usblcd/files/patch-lib_hid.c
#	./usblcd/files/patch-autogen.c
#	./usblcd/pkg-plist
#
echo c - ./usblcd
mkdir -p ./usblcd > /dev/null 2>&1
echo x - ./usblcd/Makefile
sed 's/^X//' >./usblcd/Makefile << 'END-of-./usblcd/Makefile'
X# New ports collection makefile for:	usblcd
X# Date created:				10 November 2007
X# Whom:					tom McLaughlin <tmclaugh at FreeBSD.org>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	usblcd
XPORTVERSION=	0.1.4
XCATEGORIES=	devel
XMASTER_SITES=	http://resources.mini-box.com/online/picoLCD%2020x2%20(OEM)/Software/Linux/Binaries/
XDISTNAME=	${PORTNAME}-src-${PORTVERSION}
XEXTRACT_SUFX=	.tgz
X
XWRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION}
X
XMAINTAINER=	tmclaugh at FreeBSD.org
XCOMMENT=	Library for the Mini-Box picoLCD 2x20 USB display
X
XLIB_DEPENDS=	usb:${PORTSDIR}/devel/libusb
X
XUSE_LDCONFIG=	yes
XUSE_AUTOTOOLS=	libtool:15 automake:19 autoconf:261
XGNU_CONFIGURE=	yes
XCONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
XCONFIGURE_ENV+=	CPPFLAGS="-I${LOCALBASE}/include" \
X		LDFLAGS="-L${LOCALBASE}/lib"
X
Xpost-patch:
X	@${REINPLACE_CMD} 's|[(]libdir[)]/pkgconfig|(prefix)/libdata/pkgconfig|g' ${WRKSRC}/Makefile.am
X
Xpre-configure:
X	@cd ${WRKSRC}; ${AUTOTOOLS_ENV} ${SH} ./autogen.sh
X
X.include <bsd.port.mk>
END-of-./usblcd/Makefile
echo x - ./usblcd/distinfo
sed 's/^X//' >./usblcd/distinfo << 'END-of-./usblcd/distinfo'
XMD5 (usblcd-src-0.1.4.tgz) = d4b6e4fca4006dab3fca99c948756880
XSHA256 (usblcd-src-0.1.4.tgz) = e3a37fda1145d41998385dfd34d55793ff2788e33c220e5882c487369d9af4d9
XSIZE (usblcd-src-0.1.4.tgz) = 76712
END-of-./usblcd/distinfo
echo x - ./usblcd/pkg-descr
sed 's/^X//' >./usblcd/pkg-descr << 'END-of-./usblcd/pkg-descr'
XThe Mini-Box USB LCD is an intelligent 2x20 character USB LCD display
Xmodule with InfraRed receiver and keypad interface. It has a built in
X8x5 dots ASCII character font with 8 used definable characters and
Xprovides 8 GPO (General Purpose Output) pins. Internal EEPROM allows
Xfirmware upgrading and splash screen definition. On power on
XMini-Box USB LCD is able to show up to 10 user defined splash screns
Xwith custom timing, order and led/gpo status.
X
XWWW: http://www.mini-box.com/picoLCD-20x2-OEM
END-of-./usblcd/pkg-descr
echo c - ./usblcd/files
mkdir -p ./usblcd/files > /dev/null 2>&1
echo x - ./usblcd/files/patch-lib_hid.c
sed 's/^X//' >./usblcd/files/patch-lib_hid.c << 'END-of-./usblcd/files/patch-lib_hid.c'
X--- lib/hid.c.orig	2006-12-07 15:30:30.000000000 -0500
X+++ lib/hid.c	2007-11-10 10:46:24.621463000 -0500
X@@ -140,13 +140,13 @@
X     
X     signal(SIGTERM, release_usb_device);
X 
X-    ret = usb_get_driver_np((*hiddev)->handle, 0, buf, sizeof(buf));
X+/*    ret = usb_get_driver_np((*hiddev)->handle, 0, buf, sizeof(buf));
X 
X     if (ret == 0) {
X 	printf("interface 0 already claimed by driver \"%s\", attempting to detach it\n", buf);
X 	ret = usb_detach_kernel_driver_np((*hiddev)->handle, 0);
X 	printf("usb_detach_kernel_driver_np returned %d\n", ret);
X-    }
X+    }*/
X     ret = usb_claim_interface((*hiddev)->handle, 0);
X     if (ret != 0) {
X 	printf("claim failed with error %d\n", ret);
END-of-./usblcd/files/patch-lib_hid.c
echo x - ./usblcd/files/patch-autogen.c
sed 's/^X//' >./usblcd/files/patch-autogen.c << 'END-of-./usblcd/files/patch-autogen.c'
X--- autogen.sh.orig	2006-01-08 23:03:23.000000000 -0500
X+++ autogen.sh	2007-11-10 11:57:45.181418000 -0500
X@@ -58,15 +58,15 @@
X echo "Generating configuration files for $package, please wait...."
X 
X echo "  aclocal $ACLOCAL_FLAGS"
X-aclocal $ACLOCAL_FLAGS
X+$ACLOCAL $ACLOCAL_FLAGS
X echo "  autoheader"
X-autoheader
X+$AUTOHEADER
X echo "  libtoolize --automake"
X-libtoolize --automake
X+$LIBTOOLIZE --automake
X echo "  automake --add-missing"
X-automake --add-missing 
X+$AUTOMAKE --add-missing 
X echo "  autoconf"
X-autoconf
X+$AUTOCONF
X 
X cd $olddir
X-$srcdir/configure "$@" && echo
X+#$srcdir/configure "$@" && echo
END-of-./usblcd/files/patch-autogen.c
echo x - ./usblcd/pkg-plist
sed 's/^X//' >./usblcd/pkg-plist << 'END-of-./usblcd/pkg-plist'
Xbin/usblcd
Xinclude/driver.h
Xinclude/usblcd.h
Xinclude/usblcd_util.h
Xinclude/widgets.h
Xlib/libusblcd.a
Xlib/libusblcd.la
Xlib/libusblcd.so
Xlib/libusblcd.so.0
Xlibdata/pkgconfig/libusblcd.pc
END-of-./usblcd/pkg-plist
exit



More information about the freebsd-embedded mailing list