The cl-k8055 Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The cl-k8055 Reference Manual

This is the cl-k8055 Reference Manual, version 1.0.0, generated automatically by Declt version 2.3 "Robert April" on Tue Feb 20 08:07:40 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

About cl-k8055d

Interface for the Velleman K8055 USB kit through the K8055 linux driver. The driver library is included for x86-64 and ARM.

How To

First you will need to install the udev rules into your system in order to be able to connect to and use the Velleman device from a standard user account without administrator privileges. To do so, copy the velleman.rules file to /etc/udev/rules.d/. You may need to restart your system in order for the rules to take effect.

Connect to the board/s.

(k8055:connect)

Read out or set some values to the inputs/outputs.

;; Inputs
(k8055:digital 0)
(k8055:analog 0)
(k8055:analogf 0)
(k8055:analogv 0)
;; Outputs
(setf (k8055:digital 1) T)
(setf (k8055:analog 0) 120)
(setf (k8055:analogf 0) 0.25)
(setf (k8055:analogv 0) 5.0)
;; Counters
(k8055:counter 0)
(k8055:reset-counter 0)

If the voltage mapping that is provided by default (4.7V for outputs, 10V for inputs) is not correct, you can adjust it with the voltage accessor.

Once you're done, you should probably disconnect again.

(k8055:disconnect)

Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 cl-k8055

Maintainer

Nicolas Hafner <shinmera@tymoon.eu>

Author

Nicolas Hafner <shinmera@tymoon.eu>

Home Page

https://github.com/Shinmera/cl-k8055

License

Artistic

Description

Bindings to the k8055 DAQ hobby board.

Version

1.0.0

Dependencies
Source

cl-k8055.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 cl-k8055.asd

Location

cl-k8055.asd

Systems

cl-k8055 (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 cl-k8055/package.lisp

Parent

cl-k8055 (system)

Location

package.lisp

Packages

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.3 cl-k8055/low-level.lisp

Dependency

package.lisp (file)

Parent

cl-k8055 (system)

Location

low-level.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.4 cl-k8055/wrapper.lisp

Dependency

low-level.lisp (file)

Parent

cl-k8055 (system)

Location

wrapper.lisp

Exported Definitions
Internal Definitions

Previous: , Up: Lisp files   [Contents][Index]

3.1.5 cl-k8055/documentation.lisp

Dependency

wrapper.lisp (file)

Parent

cl-k8055 (system)

Location

documentation.lisp


Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Next: , Previous: , Up: Packages   [Contents][Index]

4.1 cl-k8055

Source

package.lisp (file)

Nicknames
Use List

common-lisp

Exported Definitions
Internal Definitions

Previous: , Up: Packages   [Contents][Index]

4.2 cl-k8055-cffi

Source

package.lisp (file)

Nickname

org.shirakumo.k8055.cffi

Use List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Special variables

Special Variable: *default-max-attempts*

The default maximum number of retries for a request to the board.

Package

cl-k8055

Source

wrapper.lisp (file)

Special Variable: *static*

Pathname pointing to the static/ directory in the source tree.

See *HERE*

Package

cl-k8055-cffi

Source

low-level.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Functions

Function: analog CHANNEL

Accessor to the analog inputs and outputs.

The values should be integers, which will be truncated to the range [0,255].
The channel must be an integer in [1,2].

Package

cl-k8055

Source

wrapper.lisp (file)

Writer

(setf analog) (function)

Function: (setf analog) VALUE CHANNEL
Package

cl-k8055

Source

wrapper.lisp (file)

Reader

analog (function)

Function: analogf CHANNEL

Accessor to the analog inputs and outputs.

The values should be floats, truncated to the range [0,1].

See ANALOG

Package

cl-k8055

Source

wrapper.lisp (file)

Writer

(setf analogf) (function)

Function: (setf analogf) VALUE CHANNEL
Package

cl-k8055

Source

wrapper.lisp (file)

Reader

analogf (function)

Function: analogv CHANNEL

Accessor to the analog inputs and outputs.

The values should be voltage floats, truncated to the respective input/output voltages.

See VOLTAGE
See ANALOGF

Package

cl-k8055

Source

wrapper.lisp (file)

Writer

(setf analogv) (function)

Function: (setf analogv) VALUE CHANNEL
Package

cl-k8055

Source

wrapper.lisp (file)

Reader

analogv (function)

Function: clear-all-analog ()

Set the output value of both analog channels to 0.

Package

cl-k8055-cffi

Source

low-level.lisp (file)

Function: clear-all-digital ()

Turn off all digital channels.

Package

cl-k8055-cffi

Source

low-level.lisp (file)

Function: clear-analog-channel CHANNEL

Set the output value of an analog channel to 0.

Package

cl-k8055-cffi

Source

low-level.lisp (file)

Function: clear-digital-channel CHANNEL

Turn off a digital channel.

Package

cl-k8055-cffi

Source

low-level.lisp (file)

Function: close-device ()

Close the opened device.

Package

cl-k8055-cffi

Source

low-level.lisp (file)

Function: connect ()

Attempt to connect to both devices.

Signals an error if it was unsuccessful.

Package

cl-k8055

Source

wrapper.lisp (file)

Function: counter COUNTER

Reads the value of a counter.

Package

cl-k8055

Source

wrapper.lisp (file)

Function: (setf counter-debounce-time) VALUE COUNTER

Sets the debounce time of a counter.

Package

cl-k8055

Source

wrapper.lisp (file)

Function: digital CHANNEL

Accessor to the digital inputs and outputs.

The values should be booleans.
The channel must be an integer in [1,8].

Package

cl-k8055

Source

wrapper.lisp (file)

Writer

(setf digital) (function)

Function: (setf digital) VALUE CHANNEL
Package

cl-k8055

Source

wrapper.lisp (file)

Reader

digital (function)

Function: disconnect ()

Disconnect from the devices.

Package

cl-k8055

Source

wrapper.lisp (file)

Function: open-device CARD-ADDRESS

Open the devices at the specified addresses. Card-addresses should be a two-bit mask.

Package

cl-k8055-cffi

Source

low-level.lisp (file)

Function: output-all-analog DATA1 DATA2

Set the output values of both analog channels.

Package

cl-k8055-cffi

Source

low-level.lisp (file)

Function: output-analog-channel CHANNEL DATA

Set the output value of an analog channel.

Package

cl-k8055-cffi

Source

low-level.lisp (file)

Function: read-all-analog DATA1 DATA2

Read both analog channels at once.

Package

cl-k8055-cffi

Source

low-level.lisp (file)

Function: read-all-digital ()

Read the values of all digital channels.

Package

cl-k8055-cffi

Source

low-level.lisp (file)

Function: read-all-values DATA1 DATA2 DATA3 DATA4 DATA5

Read all inputs on the board at once.

Package

cl-k8055-cffi

Source

low-level.lisp (file)

Function: read-analog-channel CHANNEL

Read the value from an analog channel.

Package

cl-k8055-cffi

Source

low-level.lisp (file)

Function: read-counter COUNTER-NR

Read the value of a counter.

Package

cl-k8055-cffi

Source

low-level.lisp (file)

Function: read-digital-channel CHANNEL

Read the value of a digital channel.

Package

cl-k8055-cffi

Source

low-level.lisp (file)

Function: reset-counter COUNTER

Resets a counter.

Package

cl-k8055

Source

wrapper.lisp (file)

Function: reset-counter COUNTER-NR

Reset a counter.

Package

cl-k8055-cffi

Source

low-level.lisp (file)

Function: search-devices ()

Return a two bit mask of the available devices on the system.

Package

cl-k8055-cffi

Source

low-level.lisp (file)

Function: set-all-analog ()

Set the output value of both analog channels to 255.

Package

cl-k8055-cffi

Source

low-level.lisp (file)

Function: set-all-digital ()

Turn on all digital channels.

Package

cl-k8055-cffi

Source

low-level.lisp (file)

Function: set-all-values DIGITAL ANALOG1 ANALOG2

Set all outpouts on the board at once.

Package

cl-k8055-cffi

Source

low-level.lisp (file)

Function: set-analog-channel CHANNEL

Set the output value of an analog channel to 255.

Package

cl-k8055-cffi

Source

low-level.lisp (file)

Function: set-counter-debounce-time COUNTER-NR DEBOUNCE-TIME

Set the debouncing time of a counter to a specific value.

Package

cl-k8055-cffi

Source

low-level.lisp (file)

Function: set-current-device LNG-CARD-ADDRESS

Change the current device address.

Package

cl-k8055-cffi

Source

low-level.lisp (file)

Function: set-digital-channel CHANNEL

Turn on a digital channel.

Package

cl-k8055-cffi

Source

low-level.lisp (file)

Function: version ()

Return the library version.

Package

cl-k8055-cffi

Source

low-level.lisp (file)

Function: voltage DIRECTION CHANNEL

Accessor to the voltage maps for the analog ouputs and inputs.

Direction should be one of :IN :OUT, and the value a
float designating the upper-bound voltage number.

See *VOLTAGE-MAP*

Package

cl-k8055

Source

wrapper.lisp (file)

Writer

(setf voltage) (function)

Function: (setf voltage) VALUE DIRECTION CHANNEL
Package

cl-k8055

Source

wrapper.lisp (file)

Reader

voltage (function)

Function: write-all-digital DATA

Write all the digital outputs at once. Should be a bitmask.

Package

cl-k8055-cffi

Source

low-level.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Special variables

Special Variable: *here*

Pathname pointing to the low-level.lisp file.

Package

cl-k8055-cffi

Source

low-level.lisp (file)

Special Variable: *voltage-map*

A map of voltages for the analog inputs/outputs.

Package

cl-k8055

Source

wrapper.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Macros

Macro: define-cfun NAME RETURN &body ARGS

Convenience wrapper for our C function definitions.

Sets the proper library, converts the name automatically, and sets the convention to :stdcall as required by the lib.

Package

cl-k8055-cffi

Source

low-level.lisp (file)

Macro: with-positive-return (&optional MAX-ATTEMPTS) &body BODY

Convenience wrapper around CALL-WITH-POSITIVE-RETURN, ensuring that the body returns a positive value.

See CALL-WITH-POSITIVE-RETURN

Package

cl-k8055

Source

wrapper.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.3 Functions

Function: call-with-positive-return FUNCTION &optional MAX-ATTEMPTS

Retries calling the function until it returns a positive value.

If MAX-ATTEMPTS is exceeded, an error is signalled.

See *DEFAULT-MAX-ATTEMPTS*

Package

cl-k8055

Source

wrapper.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   C   F   L  
Index Entry  Section

C
cl-k8055.asd: The cl-k8055<dot>asd file
cl-k8055/documentation.lisp: The cl-k8055/documentation<dot>lisp file
cl-k8055/low-level.lisp: The cl-k8055/low-level<dot>lisp file
cl-k8055/package.lisp: The cl-k8055/package<dot>lisp file
cl-k8055/wrapper.lisp: The cl-k8055/wrapper<dot>lisp file

F
File, Lisp, cl-k8055.asd: The cl-k8055<dot>asd file
File, Lisp, cl-k8055/documentation.lisp: The cl-k8055/documentation<dot>lisp file
File, Lisp, cl-k8055/low-level.lisp: The cl-k8055/low-level<dot>lisp file
File, Lisp, cl-k8055/package.lisp: The cl-k8055/package<dot>lisp file
File, Lisp, cl-k8055/wrapper.lisp: The cl-k8055/wrapper<dot>lisp file

L
Lisp File, cl-k8055.asd: The cl-k8055<dot>asd file
Lisp File, cl-k8055/documentation.lisp: The cl-k8055/documentation<dot>lisp file
Lisp File, cl-k8055/low-level.lisp: The cl-k8055/low-level<dot>lisp file
Lisp File, cl-k8055/package.lisp: The cl-k8055/package<dot>lisp file
Lisp File, cl-k8055/wrapper.lisp: The cl-k8055/wrapper<dot>lisp file

Jump to:   C   F   L  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   (  
A   C   D   F   M   O   R   S   V   W  
Index Entry  Section

(
(setf analog): Exported functions
(setf analogf): Exported functions
(setf analogv): Exported functions
(setf counter-debounce-time): Exported functions
(setf digital): Exported functions
(setf voltage): Exported functions

A
analog: Exported functions
analogf: Exported functions
analogv: Exported functions

C
call-with-positive-return: Internal functions
clear-all-analog: Exported functions
clear-all-digital: Exported functions
clear-analog-channel: Exported functions
clear-digital-channel: Exported functions
close-device: Exported functions
connect: Exported functions
counter: Exported functions

D
define-cfun: Internal macros
digital: Exported functions
disconnect: Exported functions

F
Function, (setf analog): Exported functions
Function, (setf analogf): Exported functions
Function, (setf analogv): Exported functions
Function, (setf counter-debounce-time): Exported functions
Function, (setf digital): Exported functions
Function, (setf voltage): Exported functions
Function, analog: Exported functions
Function, analogf: Exported functions
Function, analogv: Exported functions
Function, call-with-positive-return: Internal functions
Function, clear-all-analog: Exported functions
Function, clear-all-digital: Exported functions
Function, clear-analog-channel: Exported functions
Function, clear-digital-channel: Exported functions
Function, close-device: Exported functions
Function, connect: Exported functions
Function, counter: Exported functions
Function, digital: Exported functions
Function, disconnect: Exported functions
Function, open-device: Exported functions
Function, output-all-analog: Exported functions
Function, output-analog-channel: Exported functions
Function, read-all-analog: Exported functions
Function, read-all-digital: Exported functions
Function, read-all-values: Exported functions
Function, read-analog-channel: Exported functions
Function, read-counter: Exported functions
Function, read-digital-channel: Exported functions
Function, reset-counter: Exported functions
Function, reset-counter: Exported functions
Function, search-devices: Exported functions
Function, set-all-analog: Exported functions
Function, set-all-digital: Exported functions
Function, set-all-values: Exported functions
Function, set-analog-channel: Exported functions
Function, set-counter-debounce-time: Exported functions
Function, set-current-device: Exported functions
Function, set-digital-channel: Exported functions
Function, version: Exported functions
Function, voltage: Exported functions
Function, write-all-digital: Exported functions

M
Macro, define-cfun: Internal macros
Macro, with-positive-return: Internal macros

O
open-device: Exported functions
output-all-analog: Exported functions
output-analog-channel: Exported functions

R
read-all-analog: Exported functions
read-all-digital: Exported functions
read-all-values: Exported functions
read-analog-channel: Exported functions
read-counter: Exported functions
read-digital-channel: Exported functions
reset-counter: Exported functions
reset-counter: Exported functions

S
search-devices: Exported functions
set-all-analog: Exported functions
set-all-digital: Exported functions
set-all-values: Exported functions
set-analog-channel: Exported functions
set-counter-debounce-time: Exported functions
set-current-device: Exported functions
set-digital-channel: Exported functions

V
version: Exported functions
voltage: Exported functions

W
with-positive-return: Internal macros
write-all-digital: Exported functions

Jump to:   (  
A   C   D   F   M   O   R   S   V   W  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *  
S  
Index Entry  Section

*
*default-max-attempts*: Exported special variables
*here*: Internal special variables
*static*: Exported special variables
*voltage-map*: Internal special variables

S
Special Variable, *default-max-attempts*: Exported special variables
Special Variable, *here*: Internal special variables
Special Variable, *static*: Exported special variables
Special Variable, *voltage-map*: Internal special variables

Jump to:   *  
S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   P   S  
Index Entry  Section

C
cl-k8055: The cl-k8055 system
cl-k8055: The cl-k8055 package
cl-k8055-cffi: The cl-k8055-cffi package

P
Package, cl-k8055: The cl-k8055 package
Package, cl-k8055-cffi: The cl-k8055-cffi package

S
System, cl-k8055: The cl-k8055 system

Jump to:   C   P   S