*/
/*
-This version is for pigpio version 48+
+This version is for pigpio version 53+
*/
#include <stdio.h>
{PI_SOCK_READ_FAILED , "socket read failed"},
{PI_SOCK_WRIT_FAILED , "socket write failed"},
{PI_TOO_MANY_PARAM , "too many script parameters (> 10)"},
- {PI_NOT_HALTED , "script already running or failed"},
+ {PI_SCRIPT_NOT_READY , "script initialising"},
{PI_BAD_TAG , "script has unresolved tag"},
{PI_BAD_MICS_DELAY , "bad MICS delay (too large)"},
{PI_BAD_MILS_DELAY , "bad MILS delay (too large)"},
*/
/*
-This version is for pigpio version 23+
+This version is for pigpio version 53+
*/
#ifndef COMMAND_H
.br
.br
-https://github.com/richardghirst/PiBits/tree/master/ServoBlaster
+See \fBhttps://github.com/richardghirst/PiBits/tree/master/ServoBlaster\fP
+
.br
.br
.EX
gpio: 0-53
.br
-level: 0,1
+level: 0-1
.br
.EE
.br
.br
-The selectable frequencies depend upon the sample rate which
-may be 1, 2, 4, 5, 8, or 10 microseconds (default 5).
+If PWM is currently active on the GPIO it will be
+switched off and then back on at the new frequency.
.br
.br
.br
-If PWM is currently active on the GPIO it will be
-switched off and then back on at the new frequency.
+The selectable frequencies depend upon the sample rate which
+may be 1, 2, 4, 5, 8, or 10 microseconds (default 5).
.br
.br
.br
-Returns , 0 (off), 500 (most anti-clockwise) to 2500 (most clockwise)
+Returns 0 (off), 500 (most anti-clockwise) to 2500 (most clockwise)
if OK, otherwise PI_BAD_USER_GPIO or PI_NOT_SERVO_GPIO.
.IP "\fBint gpioSetAlertFunc(unsigned user_gpio, gpioAlertFunc_t f)\fP"
.br
.br
-gpioSetAlertFunc(4F, aFunction);
+gpioSetAlertFunc(4, aFunction);
.br
.EE
.br
stop_bits: 2-8
.br
- offset: 0-
+ offset: >=0
.br
- numBytes: 1-
+ numBytes: >=1
.br
str: an array of chars (which may contain nulls)
.br
.EX
user_gpio: 0-31
.br
-invert: 0-1
+ invert: 0-1
.br
.EE
.br
buf: an array to receive the read bytes
.br
- bufSize: 0-
+ bufSize: >=0
.br
.EE
.br
.EX
- i2cBus: 0-1
+ i2cBus: >=0
.br
- i2cAddr: 0x00-0x7F
+ i2cAddr: 0-0x7F
.br
i2cFlags: 0
.br
.br
+.br
+Physically buses 0 and 1 are available on the Pi. Higher numbered buses
+will be available if a kernel supported bus multiplexor is being used.
+
+.br
+
.br
Returns a handle (>=0) if OK, otherwise PI_BAD_I2C_BUS, PI_BAD_I2C_ADDR,
PI_BAD_FLAGS, PI_NO_HANDLE, or PI_I2C_OPEN_FAILED.
.br
+.br
+See \fBhttp://abyz.co.uk/rpi/pigpio/pigs.html#Scripts\fP for details.
+
+.br
+
.br
.EX
.br
-.IP "\fBfrequency\fP: 0-" 0
+.IP "\fBfrequency\fP: >=0" 0
.br
.br
-.IP "\fBhandle\fP: 0-" 0
+.IP "\fBhandle\fP: >=0" 0
.br
.br
-.IP "\fBi2cAddr\fP" 0
+.IP "\fBi2cAddr\fP: 0-0x7F" 0
The address of a device on the I2C bus.
.br
.br
-.IP "\fBi2cBus\fP: 0-1" 0
+.IP "\fBi2cBus\fP: >=0" 0
.br
.br
-An I2C bus, 0 or 1.
+An I2C bus number.
.br
.br
#define PI_TOO_MANY_PARAM -61 // too many script parameters (> 10)
.br
-#define PI_NOT_HALTED -62 // script already running or failed
+#define PI_NOT_HALTED -62 // DEPRECATED
+.br
+#define PI_SCRIPT_NOT_READY -62 // script initialising
.br
#define PI_BAD_TAG -63 // script has unresolved tag
.br
.br
.br
-#define PI_DEFAULT_CFG_INTERNALS 0
+#define PI_DEFAULT_CFG_INTERNALS 0
.br
.br
For more information, please refer to <http://unlicense.org/>
*/
-/* pigpio version 52 */
+/* pigpio version 53 */
/* include ------------------------------------------------------- */
CHECK_INITED;
- if (i2cBus >= PI_NUM_I2C_BUS)
- SOFT_ERROR(PI_BAD_I2C_BUS, "bad I2C bus (%d)", i2cBus);
-
if (i2cAddr > PI_MAX_I2C_ADDR)
SOFT_ERROR(PI_BAD_I2C_ADDR, "bad I2C address (%d)", i2cAddr);
if ((fd = open(dev, O_RDWR)) < 0)
{
i2cInfo[slot].state = PI_I2C_CLOSED;
- return PI_I2C_OPEN_FAILED;
+ return PI_BAD_I2C_BUS;
}
}
{
pthread_mutex_lock(&gpioScript[script_id].pthMutex);
- if (gpioScript[script_id].run_state == PI_SCRIPT_HALTED)
+ if (gpioScript[script_id].run_state != PI_SCRIPT_INITING)
{
if ((numParam > 0) && (param != 0))
{
}
else
{
- status = PI_NOT_HALTED;
+ status = PI_SCRIPT_NOT_READY;
}
pthread_mutex_unlock(&gpioScript[script_id].pthMutex);
#include <stdint.h>
#include <pthread.h>
-#define PIGPIO_VERSION 52
+#define PIGPIO_VERSION 53
/*TEXT
This use was inspired by Richard Hirst's servoblaster kernel module.
-[https://github.com/richardghirst/PiBits/tree/master/ServoBlaster]
+See [[https://github.com/richardghirst/PiBits/tree/master/ServoBlaster]]
*Usage*
#define PI_SPI_SLOTS 16
#define PI_SER_SLOTS 8
-#define PI_NUM_I2C_BUS 2
#define PI_MAX_I2C_ADDR 0x7F
#define PI_NUM_AUX_SPI_CHANNEL 3
. .
gpio: 0-53
-level: 0,1
+level: 0-1
. .
Returns 0 if OK, otherwise PI_BAD_GPIO or PI_BAD_LEVEL.
Returns the numerically closest frequency if OK, otherwise
PI_BAD_USER_GPIO.
-The selectable frequencies depend upon the sample rate which
-may be 1, 2, 4, 5, 8, or 10 microseconds (default 5).
+If PWM is currently active on the GPIO it will be
+switched off and then back on at the new frequency.
Each GPIO can be independently set to one of 18 different PWM
frequencies.
-If PWM is currently active on the GPIO it will be
-switched off and then back on at the new frequency.
+The selectable frequencies depend upon the sample rate which
+may be 1, 2, 4, 5, 8, or 10 microseconds (default 5).
The frequencies for each sample rate are:
user_gpio: 0-31
. .
-Returns , 0 (off), 500 (most anti-clockwise) to 2500 (most clockwise)
+Returns 0 (off), 500 (most anti-clockwise) to 2500 (most clockwise)
if OK, otherwise PI_BAD_USER_GPIO or PI_NOT_SERVO_GPIO.
D*/
// call aFunction whenever GPIO 4 changes state
-gpioSetAlertFunc(4F, aFunction);
+gpioSetAlertFunc(4, aFunction);
...
D*/
baud: 50-1000000
data_bits: 1-32
stop_bits: 2-8
- offset: 0-
- numBytes: 1-
+ offset: >=0
+ numBytes: >=1
str: an array of chars (which may contain nulls)
. .
. .
user_gpio: 0-31
-invert: 0-1
+ invert: 0-1
. .
Returns 0 if OK, otherwise PI_BAD_USER_GPIO, PI_GPIO_IN_USE,
. .
user_gpio: 0-31, previously opened with [*gpioSerialReadOpen*]
buf: an array to receive the read bytes
- bufSize: 0-
+ bufSize: >=0
. .
Returns the number of bytes copied if OK, otherwise PI_BAD_USER_GPIO
This returns a handle for the device at the address on the I2C bus.
. .
- i2cBus: 0-1
- i2cAddr: 0x00-0x7F
+ i2cBus: >=0
+ i2cAddr: 0-0x7F
i2cFlags: 0
. .
No flags are currently defined. This parameter should be set to zero.
+Physically buses 0 and 1 are available on the Pi. Higher numbered buses
+will be available if a kernel supported bus multiplexor is being used.
+
Returns a handle (>=0) if OK, otherwise PI_BAD_I2C_BUS, PI_BAD_I2C_ADDR,
PI_BAD_FLAGS, PI_NO_HANDLE, or PI_I2C_OPEN_FAILED.
/*D
This function stores a null terminated script for later execution.
+See [[http://abyz.co.uk/rpi/pigpio/pigs.html#Scripts]] for details.
+
. .
script: the text of the script
. .
A function.
-frequency::0-
+frequency::>=0
The number of times a GPIO is swiched on and off per second. This
can be set per GPIO and may be as little as 5Hz or as much as
[*gpioWaveAddGeneric*]
[*gpioWaveAddSerial*]
-handle::0-
+handle::>=0
A number referencing an object opened by one of
[*serOpen*]
[*spiOpen*]
-i2cAddr::
+i2cAddr:: 0-0x7F
The address of a device on the I2C bus.
-i2cBus::0-1
+i2cBus::>=0
-An I2C bus, 0 or 1.
+An I2C bus number.
i2cFlags::0
#define PI_SOCK_READ_FAILED -59 // socket read failed
#define PI_SOCK_WRIT_FAILED -60 // socket write failed
#define PI_TOO_MANY_PARAM -61 // too many script parameters (> 10)
-#define PI_NOT_HALTED -62 // script already running or failed
+#define PI_NOT_HALTED -62 // DEPRECATED
+#define PI_SCRIPT_NOT_READY -62 // script initialising
#define PI_BAD_TAG -63 // script has unresolved tag
#define PI_BAD_MICS_DELAY -64 // bad MICS delay (too large)
#define PI_BAD_MILS_DELAY -65 // bad MILS delay (too large)
#define PI_DEFAULT_UPDATE_MASK_COMPUTE 0x00FFFFFFFFFFFFLL
#define PI_DEFAULT_MEM_ALLOC_MODE PI_MEM_ALLOC_AUTO
-#define PI_DEFAULT_CFG_INTERNALS 0
+#define PI_DEFAULT_CFG_INTERNALS 0
/*DEF_E*/
wave_add_serial Adds serial data to the waveform
wave_create Creates a waveform from added data
-wave_delete Deletes one or more waveforms
+wave_delete Deletes a waveform
wave_send_once Transmits a waveform once
wave_send_repeat Transmits a waveform repeatedly
import os
import atexit
-VERSION = "1.30"
+VERSION = "1.31"
exceptions = True
PI_SOCK_READ_FAILED =-59
PI_SOCK_WRIT_FAILED =-60
PI_TOO_MANY_PARAM =-61
-PI_NOT_HALTED =-62
+PI_SCRIPT_NOT_READY =-62
PI_BAD_TAG =-63
PI_BAD_MICS_DELAY =-64
PI_BAD_MILS_DELAY =-65
[PI_SOCK_READ_FAILED , "socket read failed"],
[PI_SOCK_WRIT_FAILED , "socket write failed"],
[PI_TOO_MANY_PARAM , "too many script parameters (> 10)"],
- [PI_NOT_HALTED , "script already running or failed"],
+ [PI_SCRIPT_NOT_READY , "script initialising"],
[PI_BAD_TAG , "script has unresolved tag"],
[PI_BAD_MICS_DELAY , "bad MICS delay (too large)"],
[PI_BAD_MILS_DELAY , "bad MILS delay (too large)"],
user_gpio:= 0-31.
frequency:= >=0 Hz
- Returns the frequency actually set.
+ Returns the numerically closest frequency if OK, otherwise
+ PI_BAD_USER_GPIO or PI_NOT_PERMITTED.
+
+ If PWM is currently active on the GPIO it will be switched
+ off and then back on at the new frequency.
+
+ Each GPIO can be independently set to one of 18 different
+ PWM frequencies.
+
+ The selectable frequencies depend upon the sample rate which
+ may be 1, 2, 4, 5, 8, or 10 microseconds (default 5). The
+ sample rate is set when the pigpio daemon is started.
+
+ The frequencies for each sample rate are:
+
+ . .
+ Hertz
+
+ 1: 40000 20000 10000 8000 5000 4000 2500 2000 1600
+ 1250 1000 800 500 400 250 200 100 50
+
+ 2: 20000 10000 5000 4000 2500 2000 1250 1000 800
+ 625 500 400 250 200 125 100 50 25
+
+ 4: 10000 5000 2500 2000 1250 1000 625 500 400
+ 313 250 200 125 100 63 50 25 13
+ sample
+ rate
+ (us) 5: 8000 4000 2000 1600 1000 800 500 400 320
+ 250 200 160 100 80 50 40 20 10
+
+ 8: 5000 2500 1250 1000 625 500 313 250 200
+ 156 125 100 63 50 31 25 13 6
+
+ 10: 4000 2000 1000 800 500 400 250 200 160
+ 125 100 80 50 40 25 20 10 5
+ . .
...
pi.set_PWM_frequency(4,0)
"""
Returns a handle (>=0) for the device at the I2C bus address.
- i2c_bus:= 0-1.
- i2c_address:= 0x00-0x7F.
+ i2c_bus:= >=0.
+ i2c_address:= 0-0x7F.
i2c_flags:= 0, no flags are currently defined.
Normally you would only use the [*i2c_**] functions if
you will always run on the local Pi use the standard SMBus
module instead.
+ Physically buses 0 and 1 are available on the Pi. Higher
+ numbered buses will be available if a kernel supported bus
+ multiplexor is being used.
+
For the SMBus commands the low level transactions are shown
at the end of the function description. The following
abbreviations are used.
"""
Store a script for later execution.
+ See [[http://abyz.co.uk/rpi/pigpio/pigs.html#Scripts]] for
+ details.
+
script:= the script text as a series of bytes.
Returns a >=0 script id if OK.
Invert serial logic.
user_gpio:= 0-31 (opened in a prior call to [*bb_serial_read_open*])
- invert:= 0-1 (1 invert, 0 normal)
+ invert:= 0-1 (1 invert, 0 normal)
...
status = pi.bb_serial_invert(17, 1)
user_gpio:= 0-31.
edge:= EITHER_EDGE, RISING_EDGE (default), or
FALLING_EDGE.
- wait_timeout:= 0.0- (default 60.0).
+ wait_timeout:= >=0.0 (default 60.0).
The function returns when the edge is detected or after
the number of seconds specified by timeout has expired.
This connects to the pigpio daemon and reserves resources
to be used for sending commands and receiving notifications.
+ An instance attribute [*connected*] may be used to check the
+ success of the connection. If the connection is established
+ successfully [*connected*] will be True, otherwise False.
+
...
pi = pigio.pi() # use defaults
pi = pigpio.pi('mypi') # specify host, default port
pi = pigpio.pi('mypi', 7777) # specify host and port
+
+ pi = pigpio.pi() # exit script if no connection
+ if not pi.connected:
+ exit()
...
"""
self.connected = True
clkfreq: 4689-250M
The hardware clock frequency.
+ connected:
+ True if a connection was established, False otherwise.
+
count:
The number of bytes of data to be transferred.
data:
Data to be transmitted, a series of bytes.
- delay: 1-
+ delay: >=1
The length of a pulse in microseconds.
dutycycle: 0-range_
PI_SOCK_READ_FAILED = -59
PI_SOCK_WRIT_FAILED = -60
PI_TOO_MANY_PARAM = -61
- PI_NOT_HALTED = -62
+ PI_SCRIPT_NOT_READY = -62
PI_BAD_TAG = -63
PI_BAD_MICS_DELAY = -64
PI_BAD_MILS_DELAY = -65
gpio: 0-53
A Broadcom numbered GPIO. All the user GPIO are in the range 0-31.
- There are 54 General Purpose Input Outputs (GPIO) named gpio0
- through gpio53.
+ There are 54 General Purpose Input Outputs (GPIO) named GPIO0
+ through GPIO53.
- They are split into two banks. Bank 1 consists of gpio0
- through gpio31. Bank 2 consists of gpio32 through gpio53.
+ They are split into two banks. Bank 1 consists of GPIO0
+ through GPIO31. Bank 2 consists of GPIO32 through GPIO53.
All the GPIO which are safe for the user to read and write are in
bank 1. Not all GPIO in bank 1 are safe though. Type 1 boards
This mask selects the GPIO to be switched on at the start
of a pulse.
- handle: 0-
+ handle: >=0
A number referencing an object opened by one of [*i2c_open*],
[*notify_open*], [*serial_open*], [*spi_open*].
i2c_*:
One of the i2c_ functions.
- i2c_address:
+ i2c_address: 0-0x7F
The address of a device on the I2C bus.
- i2c_bus: 0-1
+ i2c_bus: >=0
An I2C bus number.
- i2c_flags: 32 bit
+ i2c_flags: 0
No I2C flags are currently defined.
invert: 0-1
WAVE_MODE_ONE_SHOT_SYNC = 2
WAVE_MODE_REPEAT_SYNC = 3
- offset: 0-
+ offset: >=0
The offset wave data starts from the beginning of the waveform
being currently defined.
script:
The text of a script to store on the pigpio daemon.
- script_id: 0-
+ script_id: >=0
A number referencing a script created by [*store_script*].
SDA:
wave_add_*:
One of [*wave_add_new*] , [*wave_add_generic*], [*wave_add_serial*].
- wave_id: 0-
+ wave_id: >=0
A number referencing a wave created by [*wave_create*].
wave_send_*:
.EX
user_gpio: 0-31.
.br
-frequency: 0- (Hz).
+frequency: >=0 (Hz).
.br
.EE
.br
.br
-The selectable frequencies depend upon the sample rate which
-may be 1, 2, 4, 5, 8, or 10 microseconds (default 5). The
-sample rate is set when the C pigpio library is started.
+If PWM is currently active on the GPIO it will be switched
+off and then back on at the new frequency.
.br
.br
.br
-If PWM is currently active on the GPIO it will be switched
-off and then back on at the new frequency.
+The selectable frequencies depend upon the sample rate which
+may be 1, 2, 4, 5, 8, or 10 microseconds (default 5). The
+sample rate is set when the pigpio daemon is started.
.br
+.br
+The frequencies for each sample rate are:
+
.br
-.EX
-1us 40000, 20000, 10000, 8000, 5000, 4000, 2500, 2000, 1600,
.br
- 1250, 1000, 800, 500, 400, 250, 200, 100, 50
+
+.EX
+ Hertz
.br
.br
-2us 20000, 10000, 5000, 4000, 2500, 2000, 1250, 1000, 800,
+ 1: 40000 20000 10000 8000 5000 4000 2500 2000 1600
.br
- 625, 500, 400, 250, 200, 125, 100, 50 , 25
+ 1250 1000 800 500 400 250 200 100 50
.br
.br
-4us 10000, 5000, 2500, 2000, 1250, 1000, 625, 500, 400,
+ 2: 20000 10000 5000 4000 2500 2000 1250 1000 800
.br
- 313, 250, 200, 125, 100, 63, 50, 25, 13
+ 625 500 400 250 200 125 100 50 25
.br
.br
-5us 8000, 4000, 2000, 1600, 1000, 800, 500, 400, 320,
+ 4: 10000 5000 2500 2000 1250 1000 625 500 400
.br
- 250, 200, 160, 100 , 80, 50, 40, 20, 10
+ 313 250 200 125 100 63 50 25 13
+.br
+sample
+.br
+ rate
+.br
+ (us) 5: 8000 4000 2000 1600 1000 800 500 400 320
+.br
+ 250 200 160 100 80 50 40 20 10
.br
.br
-8us 5000, 2500, 1250, 1000, 625, 500, 313, 250, 200,
+ 8: 5000 2500 1250 1000 625 500 313 250 200
.br
- 156, 125, 100, 63, 50, 31, 25, 13, 6
+ 156 125 100 63 50 31 25 13 6
.br
.br
-10us 4000, 2000, 1000, 800, 500, 400, 250, 200, 160,
+ 10: 4000 2000 1000 800 500 400 250 200 160
.br
- 125, 100, 80, 50, 40, 25, 20, 10, 5
+ 125 100 80 50 40 25 20 10 5
.br
.EE
.br
stop_bits: number of stop half bits (2-8)
.br
- offset: 0-
+ offset: >=0
.br
- numBytes: 1-
+ numBytes: >=1
.br
str: an array of chars.
.br
.br
+.br
+See \fBhttp://abyz.co.uk/rpi/pigpio/pigs.html#Scripts\fP for details.
+
+.br
+
.br
.EX
.br
buf: an array to receive the read bytes.
.br
- bufSize: 0-
+ bufSize: >=0
.br
.EE
.br
.EX
- i2c_bus: 0-1.
+ i2c_bus: >=0.
.br
- i2c_addr: 0x00-0x7F.
+ i2c_addr: 0-0x7F.
.br
i2c_flags: 0.
.br
.br
+.br
+Physically buses 0 and 1 are available on the Pi. Higher numbered buses
+will be available if a kernel supported bus multiplexor is being used.
+
+.br
+
.br
Returns a handle (>=0) if OK, otherwise PI_BAD_I2C_BUS, PI_BAD_I2C_ADDR,
PI_BAD_FLAGS, PI_NO_HANDLE, or PI_I2C_OPEN_FAILED.
.br
-.IP "\fBfrequency\fP: 0-" 0
+.IP "\fBfrequency\fP: >=0" 0
The number of times a GPIO is swiched on and off per second. This
can be set per GPIO and may be as little as 5Hz or as much as
40KHz. The GPIO will be on for a proportion of the time as defined
.br
-.IP "\fBhandle\fP: 0-" 0
+.IP "\fBhandle\fP: >=0" 0
A number referencing an object opened by one of \fBi2c_open\fP, \fBnotify_open\fP,
\fBserial_open\fP, and \fBspi_open\fP.
.br
-.IP "\fBi2c_addr\fP" 0
+.IP "\fBi2c_addr\fP: 0-0x7F" 0
The address of a device on the I2C bus.
.br
.br
-.IP "\fBi2c_bus\fP: 0-1" 0
-An I2C bus, 0 or 1.
+.IP "\fBi2c_bus\fP: >=0" 0
+An I2C bus number.
.br
For more information, please refer to <http://unlicense.org/>
*/
-/* PIGPIOD_IF_VERSION 21 */
+/* PIGPIOD_IF_VERSION 23 */
#include <stdio.h>
#include <stdlib.h>
#include "pigpio.h"
-#define PIGPIOD_IF_VERSION 22
+#define PIGPIOD_IF_VERSION 23
/*TEXT
. .
user_gpio: 0-31.
-frequency: 0- (Hz).
+frequency: >=0 (Hz).
. .
Returns the numerically closest frequency if OK, otherwise
PI_BAD_USER_GPIO or PI_NOT_PERMITTED.
-The selectable frequencies depend upon the sample rate which
-may be 1, 2, 4, 5, 8, or 10 microseconds (default 5). The
-sample rate is set when the C pigpio library is started.
+If PWM is currently active on the GPIO it will be switched
+off and then back on at the new frequency.
Each GPIO can be independently set to one of 18 different
PWM frequencies.
-If PWM is currently active on the GPIO it will be switched
-off and then back on at the new frequency.
+The selectable frequencies depend upon the sample rate which
+may be 1, 2, 4, 5, 8, or 10 microseconds (default 5). The
+sample rate is set when the pigpio daemon is started.
+
+The frequencies for each sample rate are:
. .
-1us 40000, 20000, 10000, 8000, 5000, 4000, 2500, 2000, 1600,
- 1250, 1000, 800, 500, 400, 250, 200, 100, 50
+ Hertz
-2us 20000, 10000, 5000, 4000, 2500, 2000, 1250, 1000, 800,
- 625, 500, 400, 250, 200, 125, 100, 50 , 25
+ 1: 40000 20000 10000 8000 5000 4000 2500 2000 1600
+ 1250 1000 800 500 400 250 200 100 50
-4us 10000, 5000, 2500, 2000, 1250, 1000, 625, 500, 400,
- 313, 250, 200, 125, 100, 63, 50, 25, 13
+ 2: 20000 10000 5000 4000 2500 2000 1250 1000 800
+ 625 500 400 250 200 125 100 50 25
-5us 8000, 4000, 2000, 1600, 1000, 800, 500, 400, 320,
- 250, 200, 160, 100 , 80, 50, 40, 20, 10
+ 4: 10000 5000 2500 2000 1250 1000 625 500 400
+ 313 250 200 125 100 63 50 25 13
+sample
+ rate
+ (us) 5: 8000 4000 2000 1600 1000 800 500 400 320
+ 250 200 160 100 80 50 40 20 10
-8us 5000, 2500, 1250, 1000, 625, 500, 313, 250, 200,
- 156, 125, 100, 63, 50, 31, 25, 13, 6
+ 8: 5000 2500 1250 1000 625 500 313 250 200
+ 156 125 100 63 50 31 25 13 6
-10us 4000, 2000, 1000, 800, 500, 400, 250, 200, 160,
- 125, 100, 80, 50, 40, 25, 20, 10, 5
+ 10: 4000 2000 1000 800 500 400 250 200 160
+ 125 100 80 50 40 25 20 10 5
. .
D*/
baud: 50-1000000
data_bits: number of data bits (1-32)
stop_bits: number of stop half bits (2-8)
- offset: 0-
- numBytes: 1-
+ offset: >=0
+ numBytes: >=1
str: an array of chars.
. .
/*D
This function stores a script for later execution.
+See [[http://abyz.co.uk/rpi/pigpio/pigs.html#Scripts]] for details.
+
. .
script: the text of the script.
. .
. .
user_gpio: 0-31, previously opened with [*bb_serial_read_open*].
buf: an array to receive the read bytes.
- bufSize: 0-
+ bufSize: >=0
. .
Returns the number of bytes copied if OK, otherwise PI_BAD_USER_GPIO
This returns a handle for the device at address i2c_addr on bus i2c_bus.
. .
- i2c_bus: 0-1.
- i2c_addr: 0x00-0x7F.
+ i2c_bus: >=0.
+ i2c_addr: 0-0x7F.
i2c_flags: 0.
. .
No flags are currently defined. This parameter should be set to zero.
+Physically buses 0 and 1 are available on the Pi. Higher numbered buses
+will be available if a kernel supported bus multiplexor is being used.
+
Returns a handle (>=0) if OK, otherwise PI_BAD_I2C_BUS, PI_BAD_I2C_ADDR,
PI_BAD_FLAGS, PI_NO_HANDLE, or PI_I2C_OPEN_FAILED.
f::
A function.
-frequency::0-
+frequency::>=0
The number of times a GPIO is swiched on and off per second. This
can be set per GPIO and may be as little as 5Hz or as much as
40KHz. The GPIO will be on for a proportion of the time as defined
typedef void *(gpioThreadFunc_t) (void *);
. .
-handle::0-
+handle::>=0
A number referencing an object opened by one of [*i2c_open*], [*notify_open*],
[*serial_open*], and [*spi_open*].
-i2c_addr::
+i2c_addr:: 0-0x7F
The address of a device on the I2C bus.
-i2c_bus::0-1
-An I2C bus, 0 or 1.
+i2c_bus::>=0
+An I2C bus number.
i2c_flags::0
Flags which modify an I2C open command. None are currently defined.
.br
.EX
-pi: 0- (as returned by \fBpigpio_start\fP).
+pi: >=0 (as returned by \fBpigpio_start\fP).
.br
.EE
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
gpio: 0-53.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
gpio: 0-53.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
gpio: 0-53.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
gpio:0-53.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
gpio: 0-53.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
user_gpio: 0-31.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
user_gpio: 0-31.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
user_gpio: 0-31.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
user_gpio: 0-31.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
user_gpio: 0-31.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
user_gpio: 0-31.
.br
-frequency: 0- (Hz).
+frequency: >=0 (Hz).
.br
.EE
.br
.br
-The selectable frequencies depend upon the sample rate which
-may be 1, 2, 4, 5, 8, or 10 microseconds (default 5). The
-sample rate is set when the C pigpio library is started.
+If PWM is currently active on the GPIO it will be switched
+off and then back on at the new frequency.
.br
.br
.br
-If PWM is currently active on the GPIO it will be switched
-off and then back on at the new frequency.
+The selectable frequencies depend upon the sample rate which
+may be 1, 2, 4, 5, 8, or 10 microseconds (default 5). The
+sample rate is set when the pigpio daemon is started.
.br
+.br
+The frequencies for each sample rate are:
+
.br
-.EX
-1us 40000, 20000, 10000, 8000, 5000, 4000, 2500, 2000, 1600,
.br
- 1250, 1000, 800, 500, 400, 250, 200, 100, 50
+
+.EX
+ Hertz
.br
.br
-2us 20000, 10000, 5000, 4000, 2500, 2000, 1250, 1000, 800,
+ 1: 40000 20000 10000 8000 5000 4000 2500 2000 1600
.br
- 625, 500, 400, 250, 200, 125, 100, 50 , 25
+ 1250 1000 800 500 400 250 200 100 50
.br
.br
-4us 10000, 5000, 2500, 2000, 1250, 1000, 625, 500, 400,
+ 2: 20000 10000 5000 4000 2500 2000 1250 1000 800
.br
- 313, 250, 200, 125, 100, 63, 50, 25, 13
+ 625 500 400 250 200 125 100 50 25
.br
.br
-5us 8000, 4000, 2000, 1600, 1000, 800, 500, 400, 320,
+ 4: 10000 5000 2500 2000 1250 1000 625 500 400
.br
- 250, 200, 160, 100 , 80, 50, 40, 20, 10
+ 313 250 200 125 100 63 50 25 13
+.br
+sample
+.br
+ rate
+.br
+ (us) 5: 8000 4000 2000 1600 1000 800 500 400 320
+.br
+ 250 200 160 100 80 50 40 20 10
.br
.br
-8us 5000, 2500, 1250, 1000, 625, 500, 313, 250, 200,
+ 8: 5000 2500 1250 1000 625 500 313 250 200
.br
- 156, 125, 100, 63, 50, 31, 25, 13, 6
+ 156 125 100 63 50 31 25 13 6
.br
.br
-10us 4000, 2000, 1000, 800, 500, 400, 250, 200, 160,
+ 10: 4000 2000 1000 800 500 400 250 200 160
.br
- 125, 100, 80, 50, 40, 25, 20, 10, 5
+ 125 100 80 50 40 25 20 10 5
.br
.EE
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
user_gpio: 0-31.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
user_gpio: 0-31.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
user_gpio: 0-31.
.br
.br
.EX
-pi: 0- (as returned by \fBpigpio_start\fP).
+pi: >=0 (as returned by \fBpigpio_start\fP).
.br
.EE
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
handle: 0-31 (as returned by \fBnotify_open\fP)
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
handle: 0-31 (as returned by \fBnotify_open\fP)
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
handle: 0-31 (as returned by \fBnotify_open\fP)
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
user_gpio: 0-31.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
user_gpio: 0-31
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
user_gpio: 0-31
.br
.br
.EX
-pi: 0- (as returned by \fBpigpio_start\fP).
+pi: >=0 (as returned by \fBpigpio_start\fP).
.br
.EE
.br
.EX
-pi: 0- (as returned by \fBpigpio_start\fP).
+pi: >=0 (as returned by \fBpigpio_start\fP).
.br
.EE
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
bits: a bit mask with 1 set if the corresponding GPIO is
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
bits: a bit mask with 1 set if the corresponding GPIO is
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
bits: a bit mask with 1 set if the corresponding GPIO is
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
bits: a bit mask with 1 set if the corresponding GPIO is
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
gpio: see description
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
gpio: see descripton
.br
.br
.EX
-pi: 0- (as returned by \fBpigpio_start\fP).
+pi: >=0 (as returned by \fBpigpio_start\fP).
.br
.EE
.br
.EX
-pi: 0- (as returned by \fBpigpio_start\fP).
+pi: >=0 (as returned by \fBpigpio_start\fP).
.br
.EE
.br
.EX
-pi: 0- (as returned by \fBpigpio_start\fP).
+pi: >=0 (as returned by \fBpigpio_start\fP).
.br
.EE
.br
.EX
-pi: 0- (as returned by \fBpigpio_start\fP).
+pi: >=0 (as returned by \fBpigpio_start\fP).
.br
.EE
.br
.EX
-pi: 0- (as returned by \fBpigpio_start\fP).
+pi: >=0 (as returned by \fBpigpio_start\fP).
.br
.EE
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
numPulses: the number of pulses.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
user_gpio: 0-31.
.br
.br
stop_bits: number of stop half bits (2-8)
.br
- offset: 0-
+ offset: >=0
.br
- numBytes: 1-
+ numBytes: >=1
.br
str: an array of chars.
.br
.br
.EX
-pi: 0- (as returned by \fBpigpio_start\fP).
+pi: >=0 (as returned by \fBpigpio_start\fP).
.br
.EE
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
wave_id: >=0, as returned by \fBwave_create\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
wave_id: >=0, as returned by \fBwave_create\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
wave_id: >=0, as returned by \fBwave_create\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
wave_id: >=0, as returned by \fBwave_create\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
buf: pointer to the wave_ids and optional command codes
.br
.br
.EX
-pi: 0- (as returned by \fBpigpio_start\fP).
+pi: >=0 (as returned by \fBpigpio_start\fP).
.br
.EE
.br
.EX
-pi: 0- (as returned by \fBpigpio_start\fP).
+pi: >=0 (as returned by \fBpigpio_start\fP).
.br
.EE
.br
.EX
-pi: 0- (as returned by \fBpigpio_start\fP).
+pi: >=0 (as returned by \fBpigpio_start\fP).
.br
.EE
.br
.EX
-pi: 0- (as returned by \fBpigpio_start\fP).
+pi: >=0 (as returned by \fBpigpio_start\fP).
.br
.EE
.br
.EX
-pi: 0- (as returned by \fBpigpio_start\fP).
+pi: >=0 (as returned by \fBpigpio_start\fP).
.br
.EE
.br
.EX
-pi: 0- (as returned by \fBpigpio_start\fP).
+pi: >=0 (as returned by \fBpigpio_start\fP).
.br
.EE
.br
.EX
-pi: 0- (as returned by \fBpigpio_start\fP).
+pi: >=0 (as returned by \fBpigpio_start\fP).
.br
.EE
.br
.EX
-pi: 0- (as returned by \fBpigpio_start\fP).
+pi: >=0 (as returned by \fBpigpio_start\fP).
.br
.EE
.br
.EX
-pi: 0- (as returned by \fBpigpio_start\fP).
+pi: >=0 (as returned by \fBpigpio_start\fP).
.br
.EE
.br
.EX
-pi: 0- (as returned by \fBpigpio_start\fP).
+pi: >=0 (as returned by \fBpigpio_start\fP).
.br
.EE
.br
.EX
-pi: 0- (as returned by \fBpigpio_start\fP).
+pi: >=0 (as returned by \fBpigpio_start\fP).
.br
.EE
.br
.EX
-pi: 0- (as returned by \fBpigpio_start\fP).
+pi: >=0 (as returned by \fBpigpio_start\fP).
.br
.EE
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
user_gpio: 0-31.
.br
.br
+.br
+See \fBhttp://abyz.co.uk/rpi/pigpio/pigs.html#Scripts\fP for details.
+
+.br
+
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
script: the text of the script.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
script_id: >=0, as returned by \fBstore_script\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
script_id: >=0, as returned by \fBstore_script\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
script_id: >=0, as returned by \fBstore_script\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
script_id: >=0, as returned by \fBstore_script\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
user_gpio: 0-31.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
user_gpio: 0-31, previously opened with \fBbb_serial_read_open\fP.
.br
buf: an array to receive the read bytes.
.br
- bufSize: 0-
+ bufSize: >=0
.br
.EE
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
user_gpio: 0-31, previously opened with \fBbb_serial_read_open\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
user_gpio: 0-31, previously opened with \fBbb_serial_read_open\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
- i2c_bus: 0-1.
+ i2c_bus: >=0.
.br
- i2c_addr: 0x00-0x7F.
+ i2c_addr: 0-0x7F.
.br
i2c_flags: 0.
.br
.br
+.br
+Physically buses 0 and 1 are available on the Pi. Higher numbered buses
+will be available if a kernel supported bus multiplexor is being used.
+
+.br
+
.br
Returns a handle (>=0) if OK, otherwise PI_BAD_I2C_BUS, PI_BAD_I2C_ADDR,
PI_BAD_FLAGS, PI_NO_HANDLE, or PI_I2C_OPEN_FAILED.
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
handle: >=0, as returned by a call to \fBi2c_open\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
handle: >=0, as returned by a call to \fBi2c_open\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
handle: >=0, as returned by a call to \fBi2c_open\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
handle: >=0, as returned by a call to \fBi2c_open\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
handle: >=0, as returned by a call to \fBi2c_open\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
handle: >=0, as returned by a call to \fBi2c_open\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
handle: >=0, as returned by a call to \fBi2c_open\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
handle: >=0, as returned by a call to \fBi2c_open\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
handle: >=0, as returned by a call to \fBi2c_open\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
handle: >=0, as returned by a call to \fBi2c_open\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
handle: >=0, as returned by a call to \fBi2c_open\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
handle: >=0, as returned by a call to \fBi2c_open\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
handle: >=0, as returned by a call to \fBi2c_open\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
handle: >=0, as returned by a call to \fBi2c_open\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
handle: >=0, as returned by a call to \fBi2c_open\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
handle: >=0, as returned by a call to \fBi2c_open\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
handle: >=0, as returned by a call to \fBi2cOpen\fP
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
SDA: 0-31
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
SDA: 0-31, the SDA GPIO used in a prior call to \fBbb_i2c_open\fP
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
SDA: 0-31 (as used in a prior call to \fBbb_i2c_open\fP)
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
spi_channel: 0-1 (0-2 for the auxiliary device).
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
handle: >=0, as returned by a call to \fBspi_open\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
handle: >=0, as returned by a call to \fBspi_open\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
handle: >=0, as returned by a call to \fBspi_open\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
handle: >=0, as returned by a call to \fBspi_open\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
ser_tty: the serial device to open, /dev/tty*.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
handle: >=0, as returned by a call to \fBserial_open\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
handle: >=0, as returned by a call to \fBserial_open\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
handle: >=0, as returned by a call to \fBserial_open\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
handle: >=0, as returned by a call to \fBserial_open\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
handle: >=0, as returned by a call to \fBserial_open\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
handle: >=0, as returned by a call to \fBserial_open\fP.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
arg1: >=0
.br
The return value is an integer indicating the number of returned bytes.
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
arg1: >=0
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
user_gpio: 0-31.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
user_gpio: 0-31.
.br
.br
.EX
- pi: 0- (as returned by \fBpigpio_start\fP).
+ pi: >=0 (as returned by \fBpigpio_start\fP).
.br
user_gpio: 0-31.
.br
.br
-.IP "\fBfrequency\fP: 0-" 0
+.IP "\fBfrequency\fP: >=0" 0
The number of times a GPIO is swiched on and off per second. This
can be set per GPIO and may be as little as 5Hz or as much as
40KHz. The GPIO will be on for a proportion of the time as defined
.br
-.IP "\fBhandle\fP: 0-" 0
+.IP "\fBhandle\fP: >=0" 0
A number referencing an object opened by one of \fBi2c_open\fP, \fBnotify_open\fP,
\fBserial_open\fP, and \fBspi_open\fP.
.br
-.IP "\fBi2c_addr\fP" 0
+.IP "\fBi2c_addr\fP: 0-0x7F" 0
The address of a device on the I2C bus.
.br
.br
-.IP "\fBi2c_bus\fP: 0-1" 0
-An I2C bus, 0 or 1.
+.IP "\fBi2c_bus\fP: >=0" 0
+An I2C bus number.
.br
For more information, please refer to <http://unlicense.org/>
*/
-/* PIGPIOD_IF2_VERSION 5 */
+/* PIGPIOD_IF2_VERSION 6 */
#include <stdio.h>
#include <stdlib.h>
#include "pigpio.h"
-#define PIGPIOD_IF2_VERSION 5
+#define PIGPIOD_IF2_VERSION 6
/*TEXT
resources used by the library.
. .
-pi: 0- (as returned by [*pigpio_start*]).
+pi: >=0 (as returned by [*pigpio_start*]).
. .
D*/
Set the GPIO mode.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
gpio: 0-53.
mode: PI_INPUT, PI_OUTPUT, PI_ALT0, _ALT1,
PI_ALT2, PI_ALT3, PI_ALT4, PI_ALT5.
Get the GPIO mode.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
gpio: 0-53.
. .
Set or clear the GPIO pull-up/down resistor.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
gpio: 0-53.
pud: PI_PUD_UP, PI_PUD_DOWN, PI_PUD_OFF.
. .
Read the GPIO level.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
gpio:0-53.
. .
Write the GPIO level.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
gpio: 0-53.
level: 0, 1.
. .
Start (non-zero dutycycle) or stop (0) PWM pulses on the GPIO.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
user_gpio: 0-31.
dutycycle: 0-range (range defaults to 255).
. .
Return the PWM dutycycle in use on a GPIO.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
user_gpio: 0-31.
. .
Set the range of PWM values to be used on the GPIO.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
user_gpio: 0-31.
range: 25-40000.
. .
Get the range of PWM values being used on the GPIO.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
user_gpio: 0-31.
. .
Get the real underlying range of PWM values being used on the GPIO.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
user_gpio: 0-31.
. .
Set the frequency (in Hz) of the PWM to be used on the GPIO.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
user_gpio: 0-31.
-frequency: 0- (Hz).
+frequency: >=0 (Hz).
. .
Returns the numerically closest frequency if OK, otherwise
PI_BAD_USER_GPIO or PI_NOT_PERMITTED.
-The selectable frequencies depend upon the sample rate which
-may be 1, 2, 4, 5, 8, or 10 microseconds (default 5). The
-sample rate is set when the C pigpio library is started.
+If PWM is currently active on the GPIO it will be switched
+off and then back on at the new frequency.
Each GPIO can be independently set to one of 18 different
PWM frequencies.
-If PWM is currently active on the GPIO it will be switched
-off and then back on at the new frequency.
+The selectable frequencies depend upon the sample rate which
+may be 1, 2, 4, 5, 8, or 10 microseconds (default 5). The
+sample rate is set when the pigpio daemon is started.
+
+The frequencies for each sample rate are:
. .
-1us 40000, 20000, 10000, 8000, 5000, 4000, 2500, 2000, 1600,
- 1250, 1000, 800, 500, 400, 250, 200, 100, 50
+ Hertz
-2us 20000, 10000, 5000, 4000, 2500, 2000, 1250, 1000, 800,
- 625, 500, 400, 250, 200, 125, 100, 50 , 25
+ 1: 40000 20000 10000 8000 5000 4000 2500 2000 1600
+ 1250 1000 800 500 400 250 200 100 50
-4us 10000, 5000, 2500, 2000, 1250, 1000, 625, 500, 400,
- 313, 250, 200, 125, 100, 63, 50, 25, 13
+ 2: 20000 10000 5000 4000 2500 2000 1250 1000 800
+ 625 500 400 250 200 125 100 50 25
-5us 8000, 4000, 2000, 1600, 1000, 800, 500, 400, 320,
- 250, 200, 160, 100 , 80, 50, 40, 20, 10
+ 4: 10000 5000 2500 2000 1250 1000 625 500 400
+ 313 250 200 125 100 63 50 25 13
+sample
+ rate
+ (us) 5: 8000 4000 2000 1600 1000 800 500 400 320
+ 250 200 160 100 80 50 40 20 10
-8us 5000, 2500, 1250, 1000, 625, 500, 313, 250, 200,
- 156, 125, 100, 63, 50, 31, 25, 13, 6
+ 8: 5000 2500 1250 1000 625 500 313 250 200
+ 156 125 100 63 50 31 25 13 6
-10us 4000, 2000, 1000, 800, 500, 400, 250, 200, 160,
- 125, 100, 80, 50, 40, 25, 20, 10, 5
+ 10: 4000 2000 1000 800 500 400 250 200 160
+ 125 100 80 50 40 25 20 10 5
. .
D*/
Get the frequency of PWM being used on the GPIO.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
user_gpio: 0-31.
. .
Start (500-2500) or stop (0) servo pulses on the GPIO.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
user_gpio: 0-31.
pulsewidth: 0 (off), 500 (anti-clockwise) - 2500 (clockwise).
. .
Return the servo pulsewidth in use on a GPIO.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
user_gpio: 0-31.
. .
Get a free notification handle.
. .
-pi: 0- (as returned by [*pigpio_start*]).
+pi: >=0 (as returned by [*pigpio_start*]).
. .
Returns a handle greater than or equal to zero if OK,
Start notifications on a previously opened handle.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
handle: 0-31 (as returned by [*notify_open*])
bits: a mask indicating the GPIO to be notified.
. .
Pause notifications on a previously opened handle.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
handle: 0-31 (as returned by [*notify_open*])
. .
release the handle for reuse.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
handle: 0-31 (as returned by [*notify_open*])
. .
Sets a watchdog for a GPIO.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
user_gpio: 0-31.
timeout: 0-60000.
. .
[*steady*] microseconds are ignored.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
user_gpio: 0-31
steady: 0-300000
. .
which the process repeats.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
user_gpio: 0-31
steady: 0-300000
active: 0-1000000
Read the levels of the bank 1 GPIO (GPIO 0-31).
. .
-pi: 0- (as returned by [*pigpio_start*]).
+pi: >=0 (as returned by [*pigpio_start*]).
. .
The returned 32 bit integer has a bit set if the corresponding
Read the levels of the bank 2 GPIO (GPIO 32-53).
. .
-pi: 0- (as returned by [*pigpio_start*]).
+pi: >=0 (as returned by [*pigpio_start*]).
. .
The returned 32 bit integer has a bit set if the corresponding
Clears GPIO 0-31 if the corresponding bit in bits is set.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
bits: a bit mask with 1 set if the corresponding GPIO is
to be cleared.
. .
Clears GPIO 32-53 if the corresponding bit (0-21) in bits is set.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
bits: a bit mask with 1 set if the corresponding GPIO is
to be cleared.
. .
Sets GPIO 0-31 if the corresponding bit in bits is set.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
bits: a bit mask with 1 set if the corresponding GPIO is
to be set.
. .
Sets GPIO 32-53 if the corresponding bit (0-21) in bits is set.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
bits: a bit mask with 1 set if the corresponding GPIO is
to be set.
. .
Frequencies above 30MHz are unlikely to work.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
gpio: see description
frequency: 0 (off) or 4689-250000000 (250M)
. .
daemon is started (option -t).
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
gpio: see descripton
PWMfreq: 0 (off) or 1-125000000 (125M)
PWMduty: 0 (off) to 1000000 (1M)(fully on)
Gets the current system tick.
. .
-pi: 0- (as returned by [*pigpio_start*]).
+pi: >=0 (as returned by [*pigpio_start*]).
. .
Tick is the number of microseconds since system boot.
Get the Pi's hardware revision number.
. .
-pi: 0- (as returned by [*pigpio_start*]).
+pi: >=0 (as returned by [*pigpio_start*]).
. .
The hardware revision is the last few characters on the Revision line
Returns the pigpio version.
. .
-pi: 0- (as returned by [*pigpio_start*]).
+pi: >=0 (as returned by [*pigpio_start*]).
. .
D*/
[*wave_add_**] functions.
. .
-pi: 0- (as returned by [*pigpio_start*]).
+pi: >=0 (as returned by [*pigpio_start*]).
. .
Returns 0 if OK.
created with the [*wave_create*] function.
. .
-pi: 0- (as returned by [*pigpio_start*]).
+pi: >=0 (as returned by [*pigpio_start*]).
. .
Returns 0 if OK.
This function adds a number of pulses to the current waveform.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
numPulses: the number of pulses.
pulses: an array of pulses.
. .
microseconds from the start of the waveform.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
user_gpio: 0-31.
baud: 50-1000000
data_bits: number of data bits (1-32)
stop_bits: number of stop half bits (2-8)
- offset: 0-
- numBytes: 1-
+ offset: >=0
+ numBytes: >=1
str: an array of chars.
. .
PI_TOO_MANY_CBS, PI_TOO_MANY_OOL, or PI_NO_WAVEFORM_ID.
. .
-pi: 0- (as returned by [*pigpio_start*]).
+pi: >=0 (as returned by [*pigpio_start*]).
. .
The data provided by the [*wave_add_**] functions is consumed by this
This function deletes the waveform with id wave_id.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
wave_id: >=0, as returned by [*wave_create*].
. .
NOTE: Any hardware PWM started by [*hardware_PWM*] will be cancelled.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
wave_id: >=0, as returned by [*wave_create*].
. .
NOTE: Any hardware PWM started by [*hardware_PWM*] will be cancelled.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
wave_id: >=0, as returned by [*wave_create*].
. .
Transmits the waveform with id wave_id using mode mode.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
wave_id: >=0, as returned by [*wave_create*].
mode: PI_WAVE_MODE_ONE_SHOT, PI_WAVE_MODE_REPEAT,
PI_WAVE_MODE_ONE_SHOT_SYNC, or PI_WAVE_MODE_REPEAT_SYNC.
codes and related data.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
buf: pointer to the wave_ids and optional command codes
bufSize: the number of bytes in buf
. .
transmitted.
. .
-pi: 0- (as returned by [*pigpio_start*]).
+pi: >=0 (as returned by [*pigpio_start*]).
. .
Returns the waveform id or one of the following special values:
transmitted.
. .
-pi: 0- (as returned by [*pigpio_start*]).
+pi: >=0 (as returned by [*pigpio_start*]).
. .
Returns 1 if a waveform is currently being transmitted, otherwise 0.
This function stops the transmission of the current waveform.
. .
-pi: 0- (as returned by [*pigpio_start*]).
+pi: >=0 (as returned by [*pigpio_start*]).
. .
Returns 0 if OK.
waveform.
. .
-pi: 0- (as returned by [*pigpio_start*]).
+pi: >=0 (as returned by [*pigpio_start*]).
. .
D*/
created since the pigpio daemon was started.
. .
-pi: 0- (as returned by [*pigpio_start*]).
+pi: >=0 (as returned by [*pigpio_start*]).
. .
D*/
microseconds.
. .
-pi: 0- (as returned by [*pigpio_start*]).
+pi: >=0 (as returned by [*pigpio_start*]).
. .
D*/
This function returns the length in pulses of the current waveform.
. .
-pi: 0- (as returned by [*pigpio_start*]).
+pi: >=0 (as returned by [*pigpio_start*]).
. .
D*/
created since the pigpio daemon was started.
. .
-pi: 0- (as returned by [*pigpio_start*]).
+pi: >=0 (as returned by [*pigpio_start*]).
. .
D*/
This function returns the maximum possible size of a waveform in pulses.
. .
-pi: 0- (as returned by [*pigpio_start*]).
+pi: >=0 (as returned by [*pigpio_start*]).
. .
D*/
waveform.
. .
-pi: 0- (as returned by [*pigpio_start*]).
+pi: >=0 (as returned by [*pigpio_start*]).
. .
D*/
waveform created since the pigpio daemon was started.
. .
-pi: 0- (as returned by [*pigpio_start*]).
+pi: >=0 (as returned by [*pigpio_start*]).
. .
D*/
control blocks.
. .
-pi: 0- (as returned by [*pigpio_start*]).
+pi: >=0 (as returned by [*pigpio_start*]).
. .
D*/
level for pulseLen microseconds and then reset to not level.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
user_gpio: 0-31.
pulseLen: 1-100.
level: 0,1.
/*D
This function stores a script for later execution.
+See [[http://abyz.co.uk/rpi/pigpio/pigs.html#Scripts]] for details.
+
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
script: the text of the script.
. .
This function runs a stored script.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
script_id: >=0, as returned by [*store_script*].
numPar: 0-10, the number of parameters.
param: an array of parameters.
as the current values of parameters 0 to 9.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
script_id: >=0, as returned by [*store_script*].
param: an array to hold the returned 10 parameters.
. .
This function stops a running script.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
script_id: >=0, as returned by [*store_script*].
. .
This function deletes a stored script.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
script_id: >=0, as returned by [*store_script*].
. .
This function opens a GPIO for bit bang reading of serial data.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
user_gpio: 0-31.
baud: 50-250000
data_bits: 1-32
bit bang serial cyclic buffer to the buffer starting at buf.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
user_gpio: 0-31, previously opened with [*bb_serial_read_open*].
buf: an array to receive the read bytes.
- bufSize: 0-
+ bufSize: >=0
. .
Returns the number of bytes copied if OK, otherwise PI_BAD_USER_GPIO
This function closes a GPIO for bit bang reading of serial data.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
user_gpio: 0-31, previously opened with [*bb_serial_read_open*].
. .
This function inverts serial logic for big bang serial reads.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
user_gpio: 0-31, previously opened with [*bb_serial_read_open*].
invert: 0-1, 1 invert, 0 normal.
. .
This returns a handle for the device at address i2c_addr on bus i2c_bus.
. .
- pi: 0- (as returned by [*pigpio_start*]).
- i2c_bus: 0-1.
- i2c_addr: 0x00-0x7F.
+ pi: >=0 (as returned by [*pigpio_start*]).
+ i2c_bus: >=0.
+ i2c_addr: 0-0x7F.
i2c_flags: 0.
. .
No flags are currently defined. This parameter should be set to zero.
+Physically buses 0 and 1 are available on the Pi. Higher numbered buses
+will be available if a kernel supported bus multiplexor is being used.
+
Returns a handle (>=0) if OK, otherwise PI_BAD_I2C_BUS, PI_BAD_I2C_ADDR,
PI_BAD_FLAGS, PI_NO_HANDLE, or PI_I2C_OPEN_FAILED.
This closes the I2C device associated with the handle.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
handle: >=0, as returned by a call to [*i2c_open*].
. .
with handle.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
handle: >=0, as returned by a call to [*i2c_open*].
bit: 0-1, the value to write.
. .
This sends a single byte to the device associated with handle.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
handle: >=0, as returned by a call to [*i2c_open*].
bVal: 0-0xFF, the value to write.
. .
This reads a single byte from the device associated with handle.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
handle: >=0, as returned by a call to [*i2c_open*].
. .
associated with handle.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
handle: >=0, as returned by a call to [*i2c_open*].
i2c_reg: 0-255, the register to write.
bVal: 0-0xFF, the value to write.
associated with handle.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
handle: >=0, as returned by a call to [*i2c_open*].
i2c_reg: 0-255, the register to write.
wVal: 0-0xFFFF, the value to write.
associated with handle.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
handle: >=0, as returned by a call to [*i2c_open*].
i2c_reg: 0-255, the register to read.
. .
associated with handle.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
handle: >=0, as returned by a call to [*i2c_open*].
i2c_reg: 0-255, the register to read.
. .
associated with handle and and reads 16 bits of data in return.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
handle: >=0, as returned by a call to [*i2c_open*].
i2c_reg: 0-255, the register to write/read.
wVal: 0-0xFFFF, the value to write.
associated with handle.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
handle: >=0, as returned by a call to [*i2c_open*].
i2c_reg: 0-255, the register to write.
buf: an array with the data to send.
the device associated with handle.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
handle: >=0, as returned by a call to [*i2c_open*].
i2c_reg: 0-255, the register to read.
buf: an array to receive the read data.
of bytes of data in return.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
handle: >=0, as returned by a call to [*i2c_open*].
i2c_reg: 0-255, the register to write/read.
buf: an array with the data to send and to receive the read data.
associated with handle . The count may be 1-32.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
handle: >=0, as returned by a call to [*i2c_open*].
i2c_reg: 0-255, the register to read.
buf: an array to receive the read data.
associated with handle.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
handle: >=0, as returned by a call to [*i2c_open*].
i2c_reg: 0-255, the register to write.
buf: the data to write.
This reads count bytes from the raw device into buf.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
handle: >=0, as returned by a call to [*i2c_open*].
buf: an array to receive the read data bytes.
count: >0, the number of bytes to read.
This writes count bytes from buf to the raw device.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
handle: >=0, as returned by a call to [*i2c_open*].
buf: an array containing the data bytes to write.
count: >0, the number of bytes to write.
which contains the concatenated command codes and associated data.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
handle: >=0, as returned by a call to [*i2cOpen*]
inBuf: pointer to the concatenated I2C commands, see below
inLen: size of command buffer
o I2C on any pair of spare GPIO
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
SDA: 0-31
SCL: 0-31
baud: 50-500000
opened with [*bb_i2c_open*].
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
SDA: 0-31, the SDA GPIO used in a prior call to [*bb_i2c_open*]
. .
which contains the concatenated command codes and associated data.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
SDA: 0-31 (as used in a prior call to [*bb_i2c_open*])
inBuf: pointer to the concatenated I2C commands, see below
inLen: size of command buffer
selectable word size in bits.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
spi_channel: 0-1 (0-2 for the auxiliary device).
baud: 32K-125M (values above 30M are unlikely to work).
spi_flags: see below.
This functions closes the SPI device identified by the handle.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
handle: >=0, as returned by a call to [*spi_open*].
. .
device associated with the handle.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
handle: >=0, as returned by a call to [*spi_open*].
buf: an array to receive the read data bytes.
count: the number of bytes to read.
device associated with the handle.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
handle: >=0, as returned by a call to [*spi_open*].
buf: the data bytes to write.
count: the number of bytes to write.
data are read from the device and placed in rxBuf.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
handle: >=0, as returned by a call to [*spi_open*].
txBuf: the data bytes to write.
rxBuf: the received data bytes.
with specified flags.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
ser_tty: the serial device to open, /dev/tty*.
baud: the baud rate in bits per second, see below.
ser_flags: 0.
This function closes the serial device associated with handle.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
handle: >=0, as returned by a call to [*serial_open*].
. .
This function writes bVal to the serial port associated with handle.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
handle: >=0, as returned by a call to [*serial_open*].
. .
This function reads a byte from the serial port associated with handle.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
handle: >=0, as returned by a call to [*serial_open*].
. .
associated with handle.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
handle: >=0, as returned by a call to [*serial_open*].
buf: the array of bytes to write.
count: the number of bytes to write.
associated with handle and writes them to buf.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
handle: >=0, as returned by a call to [*serial_open*].
buf: an array to receive the read data.
count: the maximum number of bytes to read.
device associated with handle.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
handle: >=0, as returned by a call to [*serial_open*].
. .
It returns a single integer value.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
arg1: >=0
arg2: >=0
argx: extra (byte) arguments
The return value is an integer indicating the number of returned bytes.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
arg1: >=0
argc: extra (byte) arguments
count: number of extra arguments
This function initialises a new callback.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
user_gpio: 0-31.
edge: RISING_EDGE, FALLING_EDGE, or EITHER_EDGE.
f: the callback function.
This function initialises a new callback.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
user_gpio: 0-31.
edge: RISING_EDGE, FALLING_EDGE, or EITHER_EDGE.
f: the callback function.
seconds.
. .
- pi: 0- (as returned by [*pigpio_start*]).
+ pi: >=0 (as returned by [*pigpio_start*]).
user_gpio: 0-31.
edge: RISING_EDGE, FALLING_EDGE, or EITHER_EDGE.
timeout: >=0.
f::
A function.
-frequency::0-
+frequency::>=0
The number of times a GPIO is swiched on and off per second. This
can be set per GPIO and may be as little as 5Hz or as much as
40KHz. The GPIO will be on for a proportion of the time as defined
typedef void *(gpioThreadFunc_t) (void *);
. .
-handle::0-
+handle::>=0
A number referencing an object opened by one of [*i2c_open*], [*notify_open*],
[*serial_open*], and [*spi_open*].
-i2c_addr::
+i2c_addr::0-0x7F
The address of a device on the I2C bus.
-i2c_bus::0-1
-An I2C bus, 0 or 1.
+i2c_bus::>=0
+An I2C bus number.
i2c_flags::0
Flags which modify an I2C open command. None are currently defined.
This command returns a handle to access device \fBid\fP on I2C bus \fBib\fP.
The device is opened with flags \fBif\fP.
+.br
+Physically buses 0 and 1 are available on the Pi. Higher
+numbered buses will be available if a kernel supported bus
+multiplexor is being used.
+
.br
No flags are currently defined. The parameter \fBif\fP should be 0.
.br
.br
-while [[ $(pigs wvbsy) -eq 1 ]]; do sleep 0.1; done
+while \fB $(pigs wvbsy) -eq 1 \fP; do sleep 0.1; done
.br
.br
.br
-.IP "\fBib\fP - I2C bus (0-1)" 0
-The command expects an I2C bus.
+.IP "\fBib\fP - I2C bus (>=0)" 0
+The command expects an I2C bus number.
.br
-.IP "\fBid\fP - I2C device (0x08-0x77)" 0
+.IP "\fBid\fP - I2C device (0-0x7F)" 0
The command expects the address of an I2C device.
.br
.br
.EX
-time (pigs procr 0 10000000; while a=$(pigs procp 0); [[ ${a::1} -eq 2 ]];\
+time (pigs procr 0 10000000; while a=$(pigs procp 0); \fB ${a::1} -eq 2 \fP;\
.br
do sleep 0.2; done)
.br
.br
.EX
-time (pigs procr 0 10000000; while a=$(pigs procp 0); [[ ${a::1} -eq 2 ]];\
+time (pigs procr 0 10000000; while a=$(pigs procp 0); \fB ${a::1} -eq 2 \fP;\
.br
do sleep 0.2; done)
.br
from distutils.core import setup
setup(name='pigpio',
- version='1.30',
+ version='1.31',
author='joan',
author_email='joan@abyz.co.uk',
maintainer='joan',