Uniot Core
0.8.1
Loading...
Searching...
No Matches
Primitives

Contains Lisp primitive functions for hardware interaction. More...

Collaboration diagram for Primitives:

Functions

Object uniot::primitive::dwrite (Root root, VarObject env, VarObject list)
 
Object uniot::primitive::dread (Root root, VarObject env, VarObject list)
 Digital read primitive function for reading pin input state.
 
Object uniot::primitive::awrite (Root root, VarObject env, VarObject list)
 Analog write primitive function for setting PWM output.
 
Object uniot::primitive::aread (Root root, VarObject env, VarObject list)
 Analog read primitive function for reading analog input.
 
Object uniot::primitive::bclicked (Root root, VarObject env, VarObject list)
 Button clicked primitive function for checking button click status.
 

Detailed Description

Contains Lisp primitive functions for hardware interaction.

Writes a digital value (HIGH/LOW) to the specified GPIO pin. Takes two arguments: pin index and boolean state. Returns the boolean state that was set. Throws an error if the pin is out of valid range.

Parameters
rootThe Lisp environment root
envThe current environment object
listList of arguments (pin number and state)
Return values
ObjectBoolean value representing the set state

Function Documentation

◆ aread()

Object uniot::primitive::aread ( Root root,
VarObject env,
VarObject list )

Analog read primitive function for reading analog input.

Reads an analog value from the specified GPIO pin. Takes one argument: pin index. Returns the integer value that was read (0-1023). Throws an error if the pin is out of valid range.

Parameters
rootThe Lisp environment root
envThe current environment object
listList of arguments (pin number)
Return values
ObjectInteger value representing the read analog value

◆ awrite()

Object uniot::primitive::awrite ( Root root,
VarObject env,
VarObject list )

Analog write primitive function for setting PWM output.

Writes an analog value (PWM) to the specified GPIO pin. Takes two arguments: pin index and integer value (0-1023). Returns the integer value that was set. Throws an error if the pin is out of valid range.

Parameters
rootThe Lisp environment root
envThe current environment object
listList of arguments (pin number and value)
Return values
ObjectInteger value representing the set PWM value

◆ bclicked()

Object uniot::primitive::bclicked ( Root root,
VarObject env,
VarObject list )

Button clicked primitive function for checking button click status.

Checks if a button with the specified ID has been clicked. Takes one argument: button ID. Returns true if the button was clicked (and resets the click status). Throws an error if the button ID is invalid.

Parameters
rootThe Lisp environment root
envThe current environment object
listList of arguments (button ID)
Return values
ObjectBoolean value indicating if button was clicked

◆ dread()

Object uniot::primitive::dread ( Root root,
VarObject env,
VarObject list )

Digital read primitive function for reading pin input state.

Reads a digital value (HIGH/LOW) from the specified GPIO pin. Takes one argument: pin index. Returns the boolean state that was read. Throws an error if the pin is out of valid range.

Parameters
rootThe Lisp environment root
envThe current environment object
listList of arguments (pin number)
Return values
ObjectBoolean value representing the read state

◆ dwrite()

Object uniot::primitive::dwrite ( Root root,
VarObject env,
VarObject list )