- Uses: common-lisp
- Used by: cl-wiringpi2-examples
Not documented.
1
Type: bit
Not documented.
0
Type: bit
Not documented.
(analog-read pin)
Returns the value on the analog input `PIN’. Note, apparently there are no analog pins on the Raspberry Pi itself; read will return a dummy value there.
(analog-write pin value)
Writes the given `VALUE’ to the supplied analog `PIN’. Note, apparently there are no analog pins on the Raspberry Pi itself - the write will be non-effective there.
(delay milliseconds)
Pause the execution for at least `MILLISECONDS’ milliseconds. Maximum delay is approximately 49 days.
(delay-microseconds microseconds)
Pause the execution for at least `MICROSECONDS’ microseconds. Maximum delay is approximately 71 minutes.
(digital-read pin)
Read the state of `PIN’. Returns numeric value of the pin state; compare with constants `+LOW+’ and `+HIGH+’.
(digital-write pin value)
Write `VALUE’ to `PIN’. Use constants `+LOW+’ and `+HIGH+’ for `VALUE’.
(microseconds)
Returns the number of microseconds since the call to setup function. Note that the number will wrap around after around 71 minutes.
(milliseconds)
Returns the number of milliseconds since the call to setup function. Note that the number will wrap around after around 49 days.
(pi-board-info)
Returns the hardware information of Raspberry Pi board. Result is an plist with following keys:
- :MODEL - keyword describing the Raspberry Pi model
- :REVISION - number describing the Raspberry Pi revision (see `PI-BOARD-REVISION’)
- :MEMORY - number of megabytes of RAM the board has
- :MAKER - keyword identifying the maker of the board
- :OVERVOLTED - `T’ if the board was overclocked; `NIL’ otherwise.
Models: :A, :B, :B+, :CM, :ALPHA, :2, :3, :ZERO, :07, :UNKNOWN
Makers: :SONY :EGOMAN :MBEST :UNKNOWN
(pi-board-info*)
Like `PI-BOARD-INFO’, but gives the raw values returned from the Wiring Pi library. They are, in sequence: model id, revision id, memory, maker id, overvolted state.
(pi-board-revision)
Returns the board version of the Raspberry Pi. It will be either 1 or 2.
Revision 1 means early Model A and B’s. Revision 2 is everything else - B, B+, CM, Pi 2, Pi Zero, Pi3. Some of the pins in Broadcom numeration change their numbers depending on the board revision.
(pin-mode pin)
Try to get the mode `PIN’ is in. Returns either :INPUT or :OUTPUT for valid I/O modes, or :ALT-0 - :ALT-5 for 6 different ‘alternate functions’.
See also `(SETF PIN-MODE)’, `PIN-MODE*’.
(setf (pin-mode pin) mode)
Try to set `PIN’ to `MODE’. Available modes are:
- :INPUT
- :OUTPUT
- :PWM-OUTPUT
- :GPIO-CLOCK
This function has no effect in :SYS mode.
(pin-mode* pin)
Returns the raw bits of `PIN’ mode as an integer.
(pwm-write pin value)
Write `VALUE’ to PWM register for the given `PIN’. The range for `VALUE’ is 0-1024 for Raspberry Pi’s on-board PWM pin (pin 1, BMC_GPIO 18, physical: 12).
(set-pull-resistor-mode pin mode)
Set the mode of pull-up / pull-down resistors on the `PIN’. Available modes are:
- :OFF - no pull up / down
- :PULL-UP - pull up (to 3.3V)
- :PULL-DOWN - pull down (pull to ground)
`PIN’ should be set to input.
(setup &key (mode wiring-pi) (terminate-on-error nil))
Initialize the Wiring Pi library. `MODE’ determines the type of initialization:
- :WIRING-PI - use Wiring Pi pin numeration
- :PHYS - use physical pin numeration
- :GPIO, :BROADCOM - use Broadcom pin numeration
- :SYS - use the /sys/class/gpio interface instead of accessing the hardware directly
Note that all modes except :SYS require the program to be run with superuser privileges. Pin numeration under :SYS mode is the same as in :GPIO/:BROADCOM mode.
You should call this function only once per execution of the program. For convenience, calling it again with the same `MODE’ will be ignored; otherwise an error will be signalled.
Set `TERMINATE-ON-ERROR’ to `NIL’ to restore the default behaviour of Wiring Pi 2 causing the process to terminate if setup function fails.
NIL
Type: null
Mode in which Wiring Pi was initialized.
(in-sys-mode)
Check if initialization was done in :SYS mode.
(initializedp)
Check if the WiringPi library was initialized.
(setenv variable value &optional (overwritep t))
Not documented.
- =cl-wiringpi2::*setup-mode*=, Variable
- =cl-wiringpi2-ffi:+high+=, Constant
- =cl-wiringpi2-ffi:+low+=, Constant
- =cl-wiringpi2:analog-read=, Function
- =cl-wiringpi2:analog-write=, Function
- =cl-wiringpi2:delay=, Function
- =cl-wiringpi2:delay-microseconds=, Function
- =cl-wiringpi2:digital-read=, Function
- =cl-wiringpi2:digital-write=, Function
- =cl-wiringpi2::in-sys-mode=, Function
- =cl-wiringpi2::initializedp=, Function
- =cl-wiringpi2:microseconds=, Function
- =cl-wiringpi2:milliseconds=, Function
- =cl-wiringpi2:pi-board-info=, Function
- =cl-wiringpi2:pi-board-info*=, Function
- =cl-wiringpi2:pi-board-revision=, Function
- =cl-wiringpi2:pin-mode=, Function
- =cl-wiringpi2:pin-mode*=, Function
- =cl-wiringpi2:pwm-write=, Function
- =cl-wiringpi2:set-pull-resistor-mode=, Function
- =cl-wiringpi2::setenv=, Function
- =cl-wiringpi2:setup=, Function
This documentation was generated from Common Lisp source code using CLOD, version 1.0. The latest version of CLOD is available here.