Project

General

Profile

Raspberry PI GPIO Scol plugin
Scol functions definition

Functions

int _GPIOdelay (mmachine m)
 _GPIOdelay : This function make a delay in millisecond
 
int _GPIOdelayMicroseconds (mmachine m)
 _GPIOdelayMicroseconds : This function make a delay in microsecond
 
int _crGPIOpin (mmachine m)
 _crGPIOpin : This function create a GPIO pin object
 
int _dsGPIOpin (mmachine m)
 _dsGPIOpin : This function destroy a GPIO pin object
 
int _setGPIOpinPullMode (mmachine m)
 _setGPIOpinPullMode : This function set the pull-up or pull-down resistor mode on a GPIO pin
 
int _GPIOdigitalWrite (mmachine m)
 _GPIOdigitalWrite : This function write a high or low value on a GPIO pin
 
int _GPIOdigitalRead (mmachine m)
 _GPIOdigitalRead : This function read a high or low value on a GPIO pin
 
int _GPIOanalogWrite (mmachine m)
 _GPIOanalogWrite : This function write an analogic value on a GPIO pin
 
int _GPIOanalogRead (mmachine m)
 _GPIOanalogRead : This function read an analogic value on a GPIO pin
 
int _GPIOpwmWrite (mmachine m)
 _GPIOpwmWrite : This function write a value on a PWM GPIO pin (pin 18 on RPI), use softPWM for other pins
 
int _crGPIOlcd (mmachine m)
 _crGPIOlcd : This function initialize a 4bits or 8 bits display based in Hitachi (HD44780U)
 
int _dsGPIOlcd (mmachine m)
 _dsGPIOlcd : This function destroy a GPIO LCD object
 
int _GPIOlcdHome (mmachine m)
 _GPIOlcdHome : This function set the cursor to home state on lcd display
 
int _GPIOlcdClear (mmachine m)
 _GPIOlcdClear : This function clear an lcd display
 
int _GPIOlcdDisplay (mmachine m)
 _GPIOlcdDisplay : This function change the display state On/Off of an lcd display
 
int _GPIOlcdCursor (mmachine m)
 _GPIOlcdCursor : This function change the cursor state On/Off of an lcd display
 
int _GPIOlcdCursorBlink (mmachine m)
 _GPIOlcdCursorBlink : This function change the cursor blink state On/Off of an lcd display
 
int _GPIOlcdPosition (mmachine m)
 _GPIOlcdPosition : This function set the cursor position for next text input of an lcd display
 
int _GPIOlcdPuts (mmachine m)
 _GPIOlcdPuts : This function add text at the current cursor position of an lcd display
 
int _crGPIOservo (mmachine m)
 _crGPIOservo : This function create a GPIO servo motor object
 
int _dsGPIOservo (mmachine m)
 _dsGPIOservo : This function destroy a GPIO servo motor object
 
int _setGPIOservoAngle (mmachine m)
 _setGPIOservoAngle : This function set a servo motor angle
 
int _crGPIOshiftDriver (mmachine m)
 _crGPIOshiftDriver : This function create a GPIO shift driver, it can change a shift register values in threaded loop
 
int _dsGPIOshiftDriver (mmachine m)
 _dsGPIOshiftDriver : This function destroy a GPIO shift driver object
 
int _setGPIOshiftDriverValues (mmachine m)
 _setGPIOshiftDriverValues : This function set a servo motor angle
 
int _crGPIOi2c (mmachine m)
 _crGPIOi2c : This function create a GPIO I2C object
 
int _dsGPIOi2c (mmachine m)
 _dsGPIOi2c : This function destroy a GPIO I2C object
 
int _GPIOi2cWrite (mmachine m)
 _GPIOi2cWrite : This function write a value on a GPIO I2C device
 
int _GPIOi2cRead (mmachine m)
 _GPIOi2cRead : This function read the value on a GPIO I2C device
 
int _GPIOi2cWrite8 (mmachine m)
 _GPIOi2cWrite8 : This function write a value on a GPIO I2C device 8bits register
 
int _GPIOi2cRead8 (mmachine m)
 _GPIOi2cRead8 : This function read the value on a GPIO I2C device 8bits register
 
int _GPIOi2cWrite16 (mmachine m)
 _GPIOi2cWrite16 : This function write a value on a GPIO I2C device 16bits register
 
int _GPIOi2cRead16 (mmachine m)
 _GPIOi2cRead16 : This function read the value on a GPIO I2C device 16bits register
 
int _crGPIOpca9685 (mmachine m)
 _crGPIOpca9685 : This function create a GPIO I2C PCA9685 object
 
int _dsGPIOpca9685 (mmachine m)
 _dsGPIOpca9685 : This function destroy a GPIO I2C PCA9685 object
 
int _GPIOpca9685Write (mmachine m)
 _GPIOpca9685Write : This function write a value on a GPIO I2C PCA9685 device
 
int _GPIOpca9685Read (mmachine m)
 _GPIOpca9685Read : This function read the value on a GPIO I2C PCA9685 device
 
int _GPIOpca9685Reset (mmachine m)
 _GPIOpca9685Reset : This function reset a GPIO I2C PCA9685 device
 
int _GPIOpca9685SetFrequency (mmachine m)
 _GPIOpca9685SetFrequency : This function change the PWM frequency on a GPIO I2C PCA9685 device
 
int _crGPIOecho (mmachine m)
 _crGPIOecho : This function create a GPIO echo object It allows to read a sensor value with a trigger pin and a echo pin like SR04 sensor
 
int _dsGPIOecho (mmachine m)
 _dsGPIOecho : This function destroy a GPIO echo object
 
int _getGPIOechoValue (mmachine m)
 _getGPIOechoValue : This function read the distance of an echo object
 

Detailed Description

Scol functions definition

Function Documentation

◆ _crGPIOecho()

int _crGPIOecho ( mmachine  m)

_crGPIOecho : This function create a GPIO echo object It allows to read a sensor value with a trigger pin and a echo pin like SR04 sensor

Prototype: fun [Chn I I] ObjGpioEcho

Parameters
Chnthe scol channel
Ithe GPIO pin number on trigger
Ithe GPIO pin number on echo / input
Returns
ObjGpioEcho : the new object on success, nil otherwise

Definition at line 1620 of file plugin.cpp.

◆ _crGPIOi2c()

int _crGPIOi2c ( mmachine  m)

_crGPIOi2c : This function create a GPIO I2C object

Prototype: fun [Chn I] ObjGpioI2C

Parameters
Chnthe scol channel
Ithe I2C device id
Returns
ObjGpioI2C : the new object on success, nil otherwise

Definition at line 1071 of file plugin.cpp.

◆ _crGPIOlcd()

int _crGPIOlcd ( mmachine  m)

_crGPIOlcd : This function initialize a 4bits or 8 bits display based in Hitachi (HD44780U)

Prototype: fun [Chn I I I I I I I I I I I I I] ObjGpioLcd

Parameters
Chnscol channel
Inumber of rows
Inumber of cols
Ibits (4 or 8)
Irs gpio pin
Istrb gpio pin
Id0 gpio pin for data
Id1 gpio pin for data
Id2 gpio pin for data
Id3 gpio pin for data
Id4 gpio pin for data
Id5 gpio pin for data
Id6 gpio pin for data
Id7 gpio pin for data
Returns
ObjGpioLcd : the display handle on success, nil otherwise

Definition at line 447 of file plugin.cpp.

◆ _crGPIOpca9685()

int _crGPIOpca9685 ( mmachine  m)

_crGPIOpca9685 : This function create a GPIO I2C PCA9685 object

Prototype: fun [Chn I I I] ObjGpioPCA9685

Parameters
Chnthe scol channel
Ithe I2C device id
Ipin base (300 by default)
IPWM frequency (50hz by default)
Returns
ObjGpioPCA9685 : the new object on success, nil otherwise

Definition at line 1386 of file plugin.cpp.

◆ _crGPIOpin()

int _crGPIOpin ( mmachine  m)

_crGPIOpin : This function create a GPIO pin object

Prototype: fun [Chn I I] ObjGpioPin

Parameters
Chnthe scol channel
Ithe GPIO pin number
Ipin mode: GPIO_INPUT, GPIO_OUTPUT, GPIO_DIGITAL_INPUT (soft emulated using a capacitor), GPIO_CLOCK (only for pin 4), GPIO_PWM_OUTPUT (hardware for pin 18, use fost mode for other pins)
Returns
ObjGpioPin : the new object on success, nil otherwise

Definition at line 144 of file plugin.cpp.

◆ _crGPIOservo()

int _crGPIOservo ( mmachine  m)

_crGPIOservo : This function create a GPIO servo motor object

Prototype: fun [Chn I F] ObjGpioServo

Parameters
Chnthe scol channel
Ithe GPIO pin number
Finitial angle value (from 0 to 180 degree)
Returns
ObjGpioServo : the new object on success, nil otherwise

Definition at line 816 of file plugin.cpp.

◆ _crGPIOshiftDriver()

int _crGPIOshiftDriver ( mmachine  m)

_crGPIOshiftDriver : This function create a GPIO shift driver, it can change a shift register values in threaded loop

Prototype: fun [Chn I I I I] ObjGpioShiftDriver

Parameters
Chnthe scol channel
Ithe data GPIO pin number
Ithe clock GPIO pin number
Ithe latch GPIO pin number
Inumber of outputs (8, 16, 24, 32)
Returns
ObjGpioShiftDriver : the new object on success, nil otherwise

Definition at line 937 of file plugin.cpp.

◆ _dsGPIOecho()

int _dsGPIOecho ( mmachine  m)

_dsGPIOecho : This function destroy a GPIO echo object

Prototype: fun [ObjGpioEcho] I

Parameters
ObjGpioEchothe echo object
Returns
I : 1 on success, nil otherwise

Definition at line 1663 of file plugin.cpp.

◆ _dsGPIOi2c()

int _dsGPIOi2c ( mmachine  m)

_dsGPIOi2c : This function destroy a GPIO I2C object

Prototype: fun [ObjGpioI2C] I

Parameters
ObjGpioI2Cthe I2C object
Returns
I : 1 on success, nil otherwise

Definition at line 1112 of file plugin.cpp.

◆ _dsGPIOlcd()

int _dsGPIOlcd ( mmachine  m)

_dsGPIOlcd : This function destroy a GPIO LCD object

Prototype: fun [ObjGpioLcd] I

Parameters
ObjGpioLcdthe lcd object
Returns
I : 1 on success, nil otherwise

Definition at line 510 of file plugin.cpp.

◆ _dsGPIOpca9685()

int _dsGPIOpca9685 ( mmachine  m)

_dsGPIOpca9685 : This function destroy a GPIO I2C PCA9685 object

Prototype: fun [ObjGpioPCA9685] I

Parameters
ObjGpioPCA9685the I2C object
Returns
I : 1 on success, nil otherwise

Definition at line 1439 of file plugin.cpp.

◆ _dsGPIOpin()

int _dsGPIOpin ( mmachine  m)

_dsGPIOpin : This function destroy a GPIO pin object

Prototype: fun [ObjGpioPin] I

Parameters
ObjGpioPinthe pin object
Returns
I : 1 on success, nil otherwise

Definition at line 194 of file plugin.cpp.

◆ _dsGPIOservo()

int _dsGPIOservo ( mmachine  m)

_dsGPIOservo : This function destroy a GPIO servo motor object

Prototype: fun [ObjGpioServo] I

Parameters
ObjGpioServothe servo object
Returns
I : 1 on success, nil otherwise

Definition at line 862 of file plugin.cpp.

◆ _dsGPIOshiftDriver()

int _dsGPIOshiftDriver ( mmachine  m)

_dsGPIOshiftDriver : This function destroy a GPIO shift driver object

Prototype: fun [ObjGpioShiftDriver] I

Parameters
ObjGpioServothe servo object
Returns
I : 1 on success, nil otherwise

Definition at line 984 of file plugin.cpp.

◆ _getGPIOechoValue()

int _getGPIOechoValue ( mmachine  m)

_getGPIOechoValue : This function read the distance of an echo object

Prototype: fun [ObjGpioEcho] I

Parameters
ObjGpioEchothe echo object
Returns
I : the distance in cm on success, nil otherwise

Definition at line 1695 of file plugin.cpp.

◆ _GPIOanalogRead()

int _GPIOanalogRead ( mmachine  m)

_GPIOanalogRead : This function read an analogic value on a GPIO pin

Prototype: fun [ObjGpioPin] I

Parameters
ObjGpioPinthe pin object
Returns
I : GPIO_LOW or GPIO_HIGH on success, nil otherwise

Definition at line 368 of file plugin.cpp.

◆ _GPIOanalogWrite()

int _GPIOanalogWrite ( mmachine  m)

_GPIOanalogWrite : This function write an analogic value on a GPIO pin

Prototype: fun [ObjGpioPin I] I

Parameters
ObjGpioPinthe pin object
Ivalue
Returns
I : 1 on success, nil otherwise

Definition at line 333 of file plugin.cpp.

◆ _GPIOdelay()

int _GPIOdelay ( mmachine  m)

_GPIOdelay : This function make a delay in millisecond

Prototype: fun [I] I

Parameters
Idelay in millisecond
Returns
I : 1 on success, nil otherwise

Definition at line 92 of file plugin.cpp.

◆ _GPIOdelayMicroseconds()

int _GPIOdelayMicroseconds ( mmachine  m)

_GPIOdelayMicroseconds : This function make a delay in microsecond

Prototype: fun [I] I

Parameters
Idelay in microsecond
Returns
I : 1 on success, nil otherwise

Definition at line 117 of file plugin.cpp.

◆ _GPIOdigitalRead()

int _GPIOdigitalRead ( mmachine  m)

_GPIOdigitalRead : This function read a high or low value on a GPIO pin

Prototype: fun [ObjGpioPin] I

Parameters
ObjGpioPinthe pin object
Returns
I : GPIO_LOW or GPIO_HIGH on success, nil otherwise

Definition at line 302 of file plugin.cpp.

◆ _GPIOdigitalWrite()

int _GPIOdigitalWrite ( mmachine  m)

_GPIOdigitalWrite : This function write a high or low value on a GPIO pin

Prototype: fun [ObjGpioPin I] I

Parameters
ObjGpioPinthe pin object
Ivalue: GPIO_LOW, GPIO_HIGH
Returns
I : 1 on success, nil otherwise

Definition at line 262 of file plugin.cpp.

◆ _GPIOi2cRead()

int _GPIOi2cRead ( mmachine  m)

_GPIOi2cRead : This function read the value on a GPIO I2C device

Prototype: fun [ObjGpioI2C] I

Parameters
ObjGpioI2Cthe I2C object
Returns
I : value on success, nil otherwise

Definition at line 1179 of file plugin.cpp.

◆ _GPIOi2cRead16()

int _GPIOi2cRead16 ( mmachine  m)

_GPIOi2cRead16 : This function read the value on a GPIO I2C device 16bits register

Prototype: fun [ObjGpioI2C I] I

Parameters
ObjGpioI2Cthe I2C object
Iregister
Returns
I : value on success, nil otherwise

Definition at line 1343 of file plugin.cpp.

◆ _GPIOi2cRead8()

int _GPIOi2cRead8 ( mmachine  m)

_GPIOi2cRead8 : This function read the value on a GPIO I2C device 8bits register

Prototype: fun [ObjGpioI2C I] I

Parameters
ObjGpioI2Cthe I2C object
Iregister
Returns
I : value on success, nil otherwise

Definition at line 1256 of file plugin.cpp.

◆ _GPIOi2cWrite()

int _GPIOi2cWrite ( mmachine  m)

_GPIOi2cWrite : This function write a value on a GPIO I2C device

Prototype: fun [ObjGpioI2C I] I

Parameters
ObjGpioI2Cthe I2C object
Ivalue
Returns
I : 1 on success, nil otherwise

Definition at line 1144 of file plugin.cpp.

◆ _GPIOi2cWrite16()

int _GPIOi2cWrite16 ( mmachine  m)

_GPIOi2cWrite16 : This function write a value on a GPIO I2C device 16bits register

Prototype: fun [ObjGpioI2C I I] I

Parameters
ObjGpioI2Cthe I2C object
Iregister
Ivalue
Returns
I : 1 on success, nil otherwise

Definition at line 1298 of file plugin.cpp.

◆ _GPIOi2cWrite8()

int _GPIOi2cWrite8 ( mmachine  m)

_GPIOi2cWrite8 : This function write a value on a GPIO I2C device 8bits register

Prototype: fun [ObjGpioI2C I I] I

Parameters
ObjGpioI2Cthe I2C object
Iregister
Ivalue
Returns
I : 1 on success, nil otherwise

Definition at line 1211 of file plugin.cpp.

◆ _GPIOlcdClear()

int _GPIOlcdClear ( mmachine  m)

_GPIOlcdClear : This function clear an lcd display

Prototype: fun [ObjGpioLcd] I

Parameters
ObjGpioLcdthe lcd handle
Returns
I : 1 on success, nil otherwise

Definition at line 573 of file plugin.cpp.

◆ _GPIOlcdCursor()

int _GPIOlcdCursor ( mmachine  m)

_GPIOlcdCursor : This function change the cursor state On/Off of an lcd display

Prototype: fun [ObjGpioLcd I] I

Parameters
ObjGpioLcdthe lcd handle
Istate, 0 off, 1 on
Returns
I : 1 on success, nil otherwise

Definition at line 645 of file plugin.cpp.

◆ _GPIOlcdCursorBlink()

int _GPIOlcdCursorBlink ( mmachine  m)

_GPIOlcdCursorBlink : This function change the cursor blink state On/Off of an lcd display

Prototype: fun [ObjGpioLcd I] I

Parameters
ObjGpioLcdthe lcd handle
Istate, 0 off, 1 on
Returns
I : 1 on success, nil otherwise

Definition at line 684 of file plugin.cpp.

◆ _GPIOlcdDisplay()

int _GPIOlcdDisplay ( mmachine  m)

_GPIOlcdDisplay : This function change the display state On/Off of an lcd display

Prototype: fun [ObjGpioLcd I] I

Parameters
ObjGpioLcdthe lcd handle
Istate, 0 off, 1 on
Returns
I : 1 on success, nil otherwise

Definition at line 606 of file plugin.cpp.

◆ _GPIOlcdHome()

int _GPIOlcdHome ( mmachine  m)

_GPIOlcdHome : This function set the cursor to home state on lcd display

Prototype: fun [ObjGpioLcd] I

Parameters
ObjGpioLcdthe lcd handle
Returns
I : 1 on success, nil otherwise

Definition at line 541 of file plugin.cpp.

◆ _GPIOlcdPosition()

int _GPIOlcdPosition ( mmachine  m)

_GPIOlcdPosition : This function set the cursor position for next text input of an lcd display

Prototype: fun [ObjGpioLcd I] I

Parameters
ObjGpioLcdthe lcd handle
IX cols position
IY rows position
Returns
I : 1 on success, nil otherwise

Definition at line 724 of file plugin.cpp.

◆ _GPIOlcdPuts()

int _GPIOlcdPuts ( mmachine  m)

_GPIOlcdPuts : This function add text at the current cursor position of an lcd display

Prototype: fun [ObjGpioLcd S] I

Parameters
ObjGpioLcdthe lcd handle
Stext to print on the lcd display
Returns
I : 1 on success, nil otherwise

Definition at line 769 of file plugin.cpp.

◆ _GPIOpca9685Read()

int _GPIOpca9685Read ( mmachine  m)

_GPIOpca9685Read : This function read the value on a GPIO I2C PCA9685 device

Prototype: fun [ObjGpioPCA9685 I] I

Parameters
ObjGpioPCA9685the I2C object
Ipin / channel
Returns
I : value on success, nil otherwise

Definition at line 1511 of file plugin.cpp.

◆ _GPIOpca9685Reset()

int _GPIOpca9685Reset ( mmachine  m)

_GPIOpca9685Reset : This function reset a GPIO I2C PCA9685 device

Prototype: fun [ObjGpioPCA9685] I

Parameters
ObjGpioPCA9685the I2C object
Returns
I : 1 on success, nil otherwise

Definition at line 1544 of file plugin.cpp.

◆ _GPIOpca9685SetFrequency()

int _GPIOpca9685SetFrequency ( mmachine  m)

_GPIOpca9685SetFrequency : This function change the PWM frequency on a GPIO I2C PCA9685 device

Prototype: fun [ObjGpioPCA9685 I] I

Parameters
ObjGpioPCA9685the I2C object
Inew frequency (hz)
Returns
I : 1 on success, nil otherwise

Definition at line 1577 of file plugin.cpp.

◆ _GPIOpca9685Write()

int _GPIOpca9685Write ( mmachine  m)

_GPIOpca9685Write : This function write a value on a GPIO I2C PCA9685 device

Prototype: fun [ObjGpioPCA9685 I I] I

Parameters
ObjGpioPCA9685the I2C object
Ipin / channel
Ivalue
Returns
I : 1 on success, nil otherwise

Definition at line 1473 of file plugin.cpp.

◆ _GPIOpwmWrite()

int _GPIOpwmWrite ( mmachine  m)

_GPIOpwmWrite : This function write a value on a PWM GPIO pin (pin 18 on RPI), use softPWM for other pins

Prototype: fun [ObjGpioPin I] I

Parameters
ObjGpioPinthe pin object
Ivalue between 0 to 1023
Returns
I : 1 on success, nil otherwise

Definition at line 399 of file plugin.cpp.

◆ _setGPIOpinPullMode()

int _setGPIOpinPullMode ( mmachine  m)

_setGPIOpinPullMode : This function set the pull-up or pull-down resistor mode on a GPIO pin

Prototype: fun [ObjGpioPin I] I

Parameters
ObjGpioPinthe pin object
Ipin pull resistor mode: GPIO_PUD_DOWN, GPIO_PUD_UP, GPIO_PUD_OFF
Returns
I : 1 on success, nil otherwise

Definition at line 226 of file plugin.cpp.

◆ _setGPIOservoAngle()

int _setGPIOservoAngle ( mmachine  m)

_setGPIOservoAngle : This function set a servo motor angle

Prototype: fun [ObjGpioServo F] I

Parameters
ObjGpioServothe servo object
Fthe angle value to set on the servo (from 0 to 180 degree)
Returns
I : 1 on success, nil otherwise

Definition at line 895 of file plugin.cpp.

◆ _setGPIOshiftDriverValues()

int _setGPIOshiftDriverValues ( mmachine  m)

_setGPIOshiftDriverValues : This function set a servo motor angle

Prototype: fun [ObjGpioShiftDriver [[I I] r1]] I

Parameters
ObjGpioShiftDriverthe shift register object
[II] r1: a list of tuple containing the shift value and the time in microseconds to wait until it read the next value
Returns
I : 1 on success, nil otherwise

Definition at line 1017 of file plugin.cpp.