The cl-k8055 Reference Manual

This is the cl-k8055 Reference Manual, version 1.0.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 04:08:04 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 cl-k8055

Bindings to the k8055 DAQ hobby board.

Maintainer

Yukari Hafner <>

Author

Yukari Hafner <>

Home Page

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

Source Control

(GIT https://github.com/Shinmera/cl-k8055.git)

Bug Tracker

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

License

zlib

Version

1.0.0

Dependencies
  • cffi (system).
  • cl-ppcre (system).
  • trivial-features (system).
  • documentation-utils (system).
Source

cl-k8055.asd.

Child Components

3 Files

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


3.1 Lisp


3.1.1 cl-k8055/cl-k8055.asd

Source

cl-k8055.asd.

Parent Component

cl-k8055 (system).

ASDF Systems

cl-k8055.


3.1.2 cl-k8055/package.lisp

Source

cl-k8055.asd.

Parent Component

cl-k8055 (system).

Packages

3.1.3 cl-k8055/low-level.lisp

Dependency

package.lisp (file).

Source

cl-k8055.asd.

Parent Component

cl-k8055 (system).

Public Interface
Internals

3.1.4 cl-k8055/wrapper.lisp

Dependency

low-level.lisp (file).

Source

cl-k8055.asd.

Parent Component

cl-k8055 (system).

Public Interface
Internals

3.1.5 cl-k8055/documentation.lisp

Dependency

wrapper.lisp (file).

Source

cl-k8055.asd.

Parent Component

cl-k8055 (system).


4 Packages

Packages are listed by definition order.


4.1 cl-k8055

Source

package.lisp.

Nicknames
  • k8055
  • org.shirakumo.k8055
Use List

common-lisp.

Public Interface
Internals

4.2 cl-k8055-cffi

Source

package.lisp.

Nickname

org.shirakumo.k8055.cffi

Use List
  • cffi.
  • common-lisp.
Public Interface
Internals

5 Definitions

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


5.1 Public Interface


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.

Special Variable: *static*

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

See *HERE*

Package

cl-k8055-cffi.

Source

low-level.lisp.


5.1.2 Ordinary 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.

Function: (setf analog) (channel)
Package

cl-k8055.

Source

wrapper.lisp.

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.

Function: (setf analogf) (channel)
Package

cl-k8055.

Source

wrapper.lisp.

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.

Function: (setf analogv) (channel)
Package

cl-k8055.

Source

wrapper.lisp.

Function: clear-all-analog ()

Set the output value of both analog channels to 0.

Package

cl-k8055-cffi.

Source

low-level.lisp.

Function: clear-all-digital ()

Turn off all digital channels.

Package

cl-k8055-cffi.

Source

low-level.lisp.

Function: clear-analog-channel (channel)

Set the output value of an analog channel to 0.

Package

cl-k8055-cffi.

Source

low-level.lisp.

Function: clear-digital-channel (channel)

Turn off a digital channel.

Package

cl-k8055-cffi.

Source

low-level.lisp.

Function: close-device ()

Close the opened device.

Package

cl-k8055-cffi.

Source

low-level.lisp.

Function: connect ()

Attempt to connect to both devices.

Signals an error if it was unsuccessful.

Package

cl-k8055.

Source

wrapper.lisp.

Function: counter (counter)

Reads the value of a counter.

Package

cl-k8055.

Source

wrapper.lisp.

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

Sets the debounce time of a counter.

Package

cl-k8055.

Source

wrapper.lisp.

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.

Function: (setf digital) (channel)
Package

cl-k8055.

Source

wrapper.lisp.

Function: disconnect ()

Disconnect from the devices.

Package

cl-k8055.

Source

wrapper.lisp.

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.

Function: output-all-analog (data1 data2)

Set the output values of both analog channels.

Package

cl-k8055-cffi.

Source

low-level.lisp.

Function: output-analog-channel (channel data)

Set the output value of an analog channel.

Package

cl-k8055-cffi.

Source

low-level.lisp.

Function: read-all-analog (data1 data2)

Read both analog channels at once.

Package

cl-k8055-cffi.

Source

low-level.lisp.

Function: read-all-digital ()

Read the values of all digital channels.

Package

cl-k8055-cffi.

Source

low-level.lisp.

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.

Function: read-analog-channel (channel)

Read the value from an analog channel.

Package

cl-k8055-cffi.

Source

low-level.lisp.

Function: read-counter (counter-nr)

Read the value of a counter.

Package

cl-k8055-cffi.

Source

low-level.lisp.

Function: read-digital-channel (channel)

Read the value of a digital channel.

Package

cl-k8055-cffi.

Source

low-level.lisp.

Function: reset-counter (counter)

Resets a counter.

Package

cl-k8055.

Source

wrapper.lisp.

Function: reset-counter (counter-nr)

Reset a counter.

Package

cl-k8055-cffi.

Source

low-level.lisp.

Function: search-devices ()

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

Package

cl-k8055-cffi.

Source

low-level.lisp.

Function: set-all-analog ()

Set the output value of both analog channels to 255.

Package

cl-k8055-cffi.

Source

low-level.lisp.

Function: set-all-digital ()

Turn on all digital channels.

Package

cl-k8055-cffi.

Source

low-level.lisp.

Function: set-all-values (digital analog1 analog2)

Set all outpouts on the board at once.

Package

cl-k8055-cffi.

Source

low-level.lisp.

Function: set-analog-channel (channel)

Set the output value of an analog channel to 255.

Package

cl-k8055-cffi.

Source

low-level.lisp.

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.

Function: set-current-device (lng-card-address)

Change the current device address.

Package

cl-k8055-cffi.

Source

low-level.lisp.

Function: set-digital-channel (channel)

Turn on a digital channel.

Package

cl-k8055-cffi.

Source

low-level.lisp.

Function: version ()

Return the library version.

Package

cl-k8055-cffi.

Source

low-level.lisp.

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.

Function: (setf voltage) (direction channel)
Package

cl-k8055.

Source

wrapper.lisp.

Function: write-all-digital (data)

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

Package

cl-k8055-cffi.

Source

low-level.lisp.


5.2 Internals


5.2.1 Special variables

Special Variable: *here*

Pathname pointing to the low-level.lisp file.

Package

cl-k8055-cffi.

Source

low-level.lisp.

Special Variable: *voltage-map*

A map of voltages for the analog inputs/outputs.

Package

cl-k8055.

Source

wrapper.lisp.


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.

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.


5.2.3 Ordinary 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.


Appendix A Indexes


A.1 Concepts


A.2 Functions

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

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

A
analog: Public ordinary functions
analogf: Public ordinary functions
analogv: Public ordinary functions

C
call-with-positive-return: Private ordinary functions
clear-all-analog: Public ordinary functions
clear-all-digital: Public ordinary functions
clear-analog-channel: Public ordinary functions
clear-digital-channel: Public ordinary functions
close-device: Public ordinary functions
connect: Public ordinary functions
counter: Public ordinary functions

D
define-cfun: Private macros
digital: Public ordinary functions
disconnect: Public ordinary functions

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

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

O
open-device: Public ordinary functions
output-all-analog: Public ordinary functions
output-analog-channel: Public ordinary functions

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

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

V
version: Public ordinary functions
voltage: Public ordinary functions

W
with-positive-return: Private macros
write-all-digital: Public ordinary functions