1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-25 00:51:21 +00:00

Port for libk8055 to provide support for the Velleman K8055 USB

Experiment Board. Package also include k8055 command line tool.

WWW: http://www.horizon9.org/~geroy/

PR:		ports/161440
Submitted by:	Jake Smith <jake@xz.cx>
Feature safe:	yes
This commit is contained in:
Martin Wilke 2011-11-25 18:36:29 +00:00
parent 4626221edc
commit 6ad1b3600e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=286440
5 changed files with 148 additions and 0 deletions

View File

@ -852,6 +852,7 @@
SUBDIR += libiqxmlrpc
SUBDIR += libisofs
SUBDIR += libixp
SUBDIR += libk8055
SUBDIR += liblas
SUBDIR += libleaftag
SUBDIR += liblogging

31
devel/libk8055/Makefile Normal file
View File

@ -0,0 +1,31 @@
# New ports collection makefile for: libk8055
# Date created: 9 October 2011
# Whom: Jake Smith <jake@xz.cx>
#
# $FreeBSD$
#
PORTNAME= libk8055
PORTVERSION= 0.2
CATEGORIES= devel
MASTER_SITES= http://www.horizon9.org/~geroy/download/k8055/ \
http://xz.cx/downloads/k8055/
MAINTAINER= jake@xz.cx
COMMENT= Velleman K8055 USB experimental board support and command line tool
MAN1= k8055.1
MANCOMPRESSED= yes
USE_LDCONFIG= yes
PLIST_FILES= bin/k8055 \
lib/libk8055.c \
lib/libk8055.o \
lib/libk8055.so \
lib/libk8055.so.0.2 \
include/k8055.h
post-patch:
@${RM} ${WRKSRC}/libk8055.c.orig
.include <bsd.port.mk>

2
devel/libk8055/distinfo Normal file
View File

@ -0,0 +1,2 @@
SHA256 (libk8055-0.2.tar.gz) = be936622f2ab10f0b79ce853757f65a5a9436ca921e23185ac1f65c4be87eb29
SIZE (libk8055-0.2.tar.gz) = 8529

View File

@ -0,0 +1,109 @@
--- libk8055.c 2006-07-29 11:02:26.000000000 +0100
+++ libk8055.c.orig 2011-10-09 21:34:57.693521803 +0100
@@ -83,7 +83,7 @@
return -1; /*throw -1 to show that OpenDevice failed */
}
else
- open_status=usb_interrupt_read(device_handle,0x81,data_in,8,20);
+ open_status=usb_interrupt_read(device_handle,0x81,(char *)data_in,8,20);
if (open_status!=8)
return -1;
else
@@ -101,7 +101,7 @@
long ReadAnalogChannel(long Channelno){
int open_status=0;
- open_status=usb_interrupt_read(device_handle,0x81,data_in,8,20);
+ open_status=usb_interrupt_read(device_handle,0x81,(char *)data_in,8,20);
if (open_status==8){
if (Channelno==2)
return data_in[3];
@@ -114,7 +114,7 @@
int ReadAllAnalog(long* data1, long* data2){
int open_status=0;
- open_status=usb_interrupt_read(device_handle,0x81,data_in,8,20);
+ open_status=usb_interrupt_read(device_handle,0x81,(char *)data_in,8,20);
if (open_status==8){
*data1=data_in[2];
*data2=data_in[3];
@@ -131,8 +131,8 @@
data_out[3]=(unsigned char)data;
else
data_out[2]=(unsigned char)data;
- open_status=usb_interrupt_write(device_handle,0x01,data_out,8,20);
- open_status=usb_interrupt_write(device_handle,0x01,data_out,8,20);
+ open_status=usb_interrupt_write(device_handle,0x01,(char *)data_out,8,20);
+ open_status=usb_interrupt_write(device_handle,0x01,(char *)data_out,8,20);
if (open_status!=8)
return -1;
else
@@ -144,8 +144,8 @@
data_out[0]=0x05; /* analog out or digital out command */
data_out[2]=(unsigned char)data1;
data_out[3]=(unsigned char)data2;
- open_status=usb_interrupt_write(device_handle,0x01,data_out,8,20);
- open_status=usb_interrupt_write(device_handle,0x01,data_out,8,20);
+ open_status=usb_interrupt_write(device_handle,0x01,(char *)data_out,8,20);
+ open_status=usb_interrupt_write(device_handle,0x01,(char *)data_out,8,20);
if (open_status!=8)
return -1;
else
@@ -179,8 +179,8 @@
int open_status=0;
data_out[0]=0x05; /* analog out or digital out command */
data_out[1]=(unsigned char)data;
- open_status=usb_interrupt_write(device_handle,0x01,data_out,8,20);
- open_status=usb_interrupt_write(device_handle,0x01,data_out,8,20);
+ open_status=usb_interrupt_write(device_handle,0x01,(char *)data_out,8,20);
+ open_status=usb_interrupt_write(device_handle,0x01,(char *)data_out,8,20);
if (open_status!=8)
return -1;
else
@@ -225,7 +225,7 @@
int open_status=0,i;
unsigned char mask=8;
if (channel>0 && channel<6){
- open_status=usb_interrupt_read(device_handle,0x81,data_in,8,20);
+ open_status=usb_interrupt_read(device_handle,0x81,(char *)data_in,8,20);
if (open_status==8){
for (i=1;i<=channel;i++)
if (i!=3) mask*=2;
@@ -244,7 +244,7 @@
long ReadAllDigital(){
int open_status=0,i,return_data=0;
unsigned char mask=8,pow=1;
- open_status=usb_interrupt_read(device_handle,0x81,data_in,8,20);
+ open_status=usb_interrupt_read(device_handle,0x81,(char *)data_in,8,20);
if (open_status==8){
for (i=1;i<=5;i++){
mask*=2;
@@ -269,8 +269,8 @@
if (counternr==1 || counternr==2){
data_out[0]=0x02+(unsigned char)counternr; /* counter selection */
data_out[3+counternr]=0x00;
- open_status=usb_interrupt_write(device_handle,0x01,data_out,8,20);
- open_status=usb_interrupt_write(device_handle,0x01,data_out,8,20);
+ open_status=usb_interrupt_write(device_handle,0x01,(char *)data_out,8,20);
+ open_status=usb_interrupt_write(device_handle,0x01,(char *)data_out,8,20);
if (open_status==8)
return 0;
else
@@ -283,7 +283,7 @@
long ReadCounter(long counterno){
int open_status=0;
if (counterno==1 || counterno==2){
- open_status=usb_interrupt_read(device_handle,0x81,data_in,8,20);
+ open_status=usb_interrupt_read(device_handle,0x81,(char *)data_in,8,20);
if (open_status==8){
if (counterno==2)
return data_in[6];
@@ -316,7 +316,7 @@
value+=1;
data_out[5+counterno]=(unsigned char)value;
if (DEBUG) fprintf(stderr,"Debouncetime%d value for k8055:%d\n",(int)counterno,data_out[5+counterno]);
- open_status=usb_interrupt_write(device_handle,0x01,data_out,8,20);
+ open_status=usb_interrupt_write(device_handle,0x01,(char *)data_out,8,20);
if (open_status==8)
return 0;
else

5
devel/libk8055/pkg-descr Normal file
View File

@ -0,0 +1,5 @@
Port for libk8055 to provide support for the Velleman K8055 USB
Experiment Board. Package also include k8055 command line tool. Now
you can use it with shells scripts/cron jobs.
WWW: http://www.horizon9.org/~geroy/