mirror of https://github.com/joan2937/pigpio
commit
a2997c58a3
|
@ -13,6 +13,8 @@ build
|
||||||
dist
|
dist
|
||||||
*.egg-info
|
*.egg-info
|
||||||
|
|
||||||
|
tmp/
|
||||||
|
|
||||||
# DOC files
|
# DOC files
|
||||||
DOC/dbase/pigpio.sqlite.*
|
DOC/dbase/pigpio.sqlite.*
|
||||||
DOC/tmp
|
DOC/tmp
|
||||||
|
|
Binary file not shown.
|
@ -501,6 +501,13 @@ gpioHardwareRevision
|
||||||
|
|
||||||
Related code.
|
Related code.
|
||||||
|
|
||||||
|
?4|https://pypi.org/project/nrf24/|2020-04-20|NRF24
|
||||||
|
Python Package Index (Pypi) NRF24 module.
|
||||||
|
pip install nrf24
|
||||||
|
|
||||||
|
?4|https://github.com/bjarne-hansen/py-nrf24|2020-04-20|NRF24
|
||||||
|
Code and example usage of the Pypi NRF24 module. Cleaned up and added support for reading from multiple pipes using open_reading_pipe(pipe, address) and open_writing_pipe(address) in order to be more "compatible" with the way NRF24 is used on Arduinos.
|
||||||
|
|
||||||
?4|https://github.com/stripcode/pigpio-stepper-motor|2016-08-12|Stepper Motor
|
?4|https://github.com/stripcode/pigpio-stepper-motor|2016-08-12|Stepper Motor
|
||||||
Stepper motor code.
|
Stepper motor code.
|
||||||
|
|
||||||
|
|
|
@ -320,7 +320,7 @@ WVAG trips :: Add generic pulses to waveform :: gpioWaveAddGeneric
|
||||||
WVAS u b db sb o bvs :: Add serial data to waveform :: gpioWaveAddSerial
|
WVAS u b db sb o bvs :: Add serial data to waveform :: gpioWaveAddSerial
|
||||||
|
|
||||||
WVCRE :: Create a waveform :: gpioWaveCreate
|
WVCRE :: Create a waveform :: gpioWaveCreate
|
||||||
WVCAP :: Create a waveform of fixed size :: gpioWaveCreatePad
|
WVCAP percent :: Create a waveform of fixed size :: gpioWaveCreatePad
|
||||||
WVDEL wid :: Delete selected waveform :: gpioWaveDelete
|
WVDEL wid :: Delete selected waveform :: gpioWaveDelete
|
||||||
|
|
||||||
WVTX wid :: Transmits waveform once :: gpioWaveTxSend
|
WVTX wid :: Transmits waveform once :: gpioWaveTxSend
|
||||||
|
@ -2610,7 +2610,7 @@ $ pigs wvas 7 38400 8 2 0 0x41 0x42
|
||||||
WVTAT ::
|
WVTAT ::
|
||||||
|
|
||||||
This command returns the id of the waveform currently
|
This command returns the id of the waveform currently
|
||||||
being transmitted.
|
being transmitted. Chained waves are not supported.
|
||||||
|
|
||||||
Returns the waveform id or one of the following special
|
Returns the waveform id or one of the following special
|
||||||
values:
|
values:
|
||||||
|
@ -2786,20 +2786,13 @@ ERROR: attempt to create an empty waveform
|
||||||
|
|
||||||
WVCAP ::
|
WVCAP ::
|
||||||
|
|
||||||
Similar to [*WVCRE*], this command creates a waveform but pads the consumed
|
Create a waveform of fixed size. Similar to [*WVCRE*], this command creates a waveform but pads the consumed resources to a fixed size, specified as a [*percent*] of the total resources. Padded waves of equal size can be re-cycled efficiently allowing newly created waves to re-use the resources of deleted waves of the same dimension.
|
||||||
resources to a fixed size, specified as a percent of total resource.
|
|
||||||
Padded waves of equal size can be re-cycled efficiently allowing newly
|
|
||||||
created waves to re-use the resources of deleted waves of the same dimension.
|
|
||||||
|
|
||||||
Upon success a wave id (>=0) is returned. On error a negative status
|
Upon success a wave id (>=0) is returned. On error a negative status code will be returned.
|
||||||
code will be returned.
|
|
||||||
|
|
||||||
The data provided by the [*WVAG*] and [*WVAS*] commands are
|
The data provided by the [*WVAG*] and [*WVAS*] commands are consumed by this command.
|
||||||
consumed by this command.
|
|
||||||
|
|
||||||
As many waveforms may be created as there is space available.
|
As many waveforms may be created as there is space available. The wave id is passed to [*WVTX*] or [*WVTXR*] to specify the waveform to transmit.
|
||||||
The wave id is passed to [*WVTX*] or [*WVTXR*] to specify the
|
|
||||||
waveform to transmit.
|
|
||||||
|
|
||||||
Normal usage would be
|
Normal usage would be
|
||||||
|
|
||||||
|
@ -2813,8 +2806,9 @@ Step 4. [*WVTX*] or [*WVTXR*] with the id of the waveform to transmit.
|
||||||
|
|
||||||
Repeat steps 2 - 4 as needed.
|
Repeat steps 2 - 4 as needed.
|
||||||
|
|
||||||
Step 5. Any wave id can now be deleted and another wave of the same size
|
Step 5. Any wave id can now be deleted and another wave of the same size can be created in its place.
|
||||||
can be created in its place.
|
|
||||||
|
Example
|
||||||
|
|
||||||
...
|
...
|
||||||
# Create a wave that consumes 50% of the total resource:
|
# Create a wave that consumes 50% of the total resource:
|
||||||
|
@ -3200,6 +3194,11 @@ must match an entry in /opt/pigpio/access.
|
||||||
pdc :: hardware PWM dutycycle (0-1000000)
|
pdc :: hardware PWM dutycycle (0-1000000)
|
||||||
The command expects a dutycycle.
|
The command expects a dutycycle.
|
||||||
|
|
||||||
|
percent :: percent (1-100)
|
||||||
|
The percent of wave resources to allocate to a wave. It can be useful
|
||||||
|
to create waves of fixed sizes to prevent wave fragmentation (where
|
||||||
|
there are plenty of resources but not a large enough contiguous space).
|
||||||
|
|
||||||
pf :: hardware PWM frequency (1-125M, 1-187.5M for the BCM2711)
|
pf :: hardware PWM frequency (1-125M, 1-187.5M for the BCM2711)
|
||||||
The command expects a frequency.
|
The command expects a frequency.
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta name="generator" content="Bluefish 2.2.10" >
|
<meta name="generator" content="Bluefish 2.2.11" >
|
||||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
|
||||||
<title>download</title>
|
<title>download</title>
|
||||||
</head>
|
</head>
|
||||||
|
@ -14,12 +14,14 @@ pigpiod).<br>
|
||||||
compilation of pigpio.c, takes 100 seconds on early model
|
compilation of pigpio.c, takes 100 seconds on early model
|
||||||
Pis. Be patient. The overall install takes just over 3
|
Pis. Be patient. The overall install takes just over 3
|
||||||
minutes.</span><br style="font-weight: bold;">
|
minutes.</span><br style="font-weight: bold;">
|
||||||
<h3>Download and install (V75)<br></h3>
|
<h3>Download and install latest version<br></h3>
|
||||||
<code>wget https://github.com/joan2937/pigpio/archive/v75.zip<br>
|
<code>
|
||||||
unzip v75.zip<br>
|
wget https://github.com/joan2937/pigpio/archive/master.zip<br>
|
||||||
cd pigpio-75<br>
|
unzip master.zip<br>
|
||||||
|
cd pigpio-master<br>
|
||||||
make<br>
|
make<br>
|
||||||
sudo make install<br></code><br>
|
sudo make install<br>
|
||||||
|
</code>
|
||||||
<br>
|
<br>
|
||||||
If the Python part of the install fails it may be because you need
|
If the Python part of the install fails it may be because you need
|
||||||
the setup tools.<br>
|
the setup tools.<br>
|
||||||
|
|
|
@ -10,13 +10,6 @@
|
||||||
pigpio is a library for the Raspberry which allows control of the
|
pigpio is a library for the Raspberry which allows control of the
|
||||||
General Purpose Input Outputs (GPIO). pigpio works on all
|
General Purpose Input Outputs (GPIO). pigpio works on all
|
||||||
versions of the Pi.
|
versions of the Pi.
|
||||||
<p><b>At the moment pigpio on the Pi4B is experimental. I am not
|
|
||||||
sure if the DMA channels being used are safe. The Pi4B defaults are
|
|
||||||
primary channel 7, secondary channel 6. If these channels do not
|
|
||||||
work you will have to experiment. You can set the channels used by
|
|
||||||
the pigpio daemon by invoking it with the -d and -e options, e.g.
|
|
||||||
<small>sudo pigpiod -d 5 -e 8</small> to specify primary 5,
|
|
||||||
secondary 8.</b></p>
|
|
||||||
<p><a href="download.html">Download</a><br></p>
|
<p><a href="download.html">Download</a><br></p>
|
||||||
<h3>Features<br></h3>
|
<h3>Features<br></h3>
|
||||||
<ul>
|
<ul>
|
||||||
|
@ -627,7 +620,7 @@ links.<br></p>
|
||||||
Languages</h3>
|
Languages</h3>
|
||||||
<p>There are several third party projects which provide wrappers
|
<p>There are several third party projects which provide wrappers
|
||||||
for pigpio.<br></p>
|
for pigpio.<br></p>
|
||||||
<p>Some I am aware of are:<br></p>
|
<p>Some are listed here:<br></p>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="https://github.com/skvamme/pigpio">Erlang</a>
|
<li><a href="https://github.com/skvamme/pigpio">Erlang</a>
|
||||||
(skvamme)</li>
|
(skvamme)</li>
|
||||||
|
@ -642,7 +635,9 @@ diozero, a high level wrapper around pigpio, Pi4J, wiringPi etc
|
||||||
"https://github.com/unosquare/pigpio-dotnet">.NET/mono</a>
|
"https://github.com/unosquare/pigpio-dotnet">.NET/mono</a>
|
||||||
(unosquare)</li>
|
(unosquare)</li>
|
||||||
<li><a href="https://github.com/fivdi/pigpio">Node.js</a>
|
<li><a href="https://github.com/fivdi/pigpio">Node.js</a>
|
||||||
(fivdi)</li>
|
A wrapper for the pigpio C library (fivdi)</li>
|
||||||
|
<li><a href="https://github.com/guymcswain/pigpio-client">Node.js</a>
|
||||||
|
A client for pigpio socket interface (guymcswain)</li>
|
||||||
<li><a href="https://metacpan.org/pod/RPi::PIGPIO">Perl</a> (Gligan
|
<li><a href="https://metacpan.org/pod/RPi::PIGPIO">Perl</a> (Gligan
|
||||||
Calin Horea)</li>
|
Calin Horea)</li>
|
||||||
<li><a href=
|
<li><a href=
|
||||||
|
@ -652,6 +647,8 @@ Calin Horea)</li>
|
||||||
"https://github.com/vasmalltalk/pigpio-vast">Smalltalk</a>(Instantiations)</li>
|
"https://github.com/vasmalltalk/pigpio-vast">Smalltalk</a>(Instantiations)</li>
|
||||||
<li><a href=
|
<li><a href=
|
||||||
"https://github.com/UBogun/Xojo-pigpio">Xojo</a>(UBogun)</li>
|
"https://github.com/UBogun/Xojo-pigpio">Xojo</a>(UBogun)</li>
|
||||||
|
<li><a href=
|
||||||
|
"https://github.com/eugenedakin/pigpio-GPIO">Xojo</a>(Eugene Dakin)</li>
|
||||||
</ul>
|
</ul>
|
||||||
<hr style="width: 100%; height: 2px;">
|
<hr style="width: 100%; height: 2px;">
|
||||||
<p><font size="-2">The PWM and servo pulses are timed using the DMA
|
<p><font size="-2">The PWM and servo pulses are timed using the DMA
|
||||||
|
|
46
pigpio.3
46
pigpio.3
|
@ -189,6 +189,28 @@ error PI_INITIALISED.
|
||||||
|
|
||||||
.br
|
.br
|
||||||
|
|
||||||
|
.br
|
||||||
|
If you intend to rely on signals sent to your application, you should
|
||||||
|
turn off the internal signal handling as shown in this example:
|
||||||
|
|
||||||
|
.br
|
||||||
|
|
||||||
|
.br
|
||||||
|
|
||||||
|
.EX
|
||||||
|
int cfg = gpioCfgGetInternals();
|
||||||
|
.br
|
||||||
|
cfg |= PI_CFG_NOSIGHANDLER; // (1<<10)
|
||||||
|
.br
|
||||||
|
gpioCfgSetInternals(cfg);
|
||||||
|
.br
|
||||||
|
int status = gpioInitialise();
|
||||||
|
.br
|
||||||
|
|
||||||
|
.EE
|
||||||
|
|
||||||
|
.br
|
||||||
|
|
||||||
.br
|
.br
|
||||||
|
|
||||||
.SH OVERVIEW
|
.SH OVERVIEW
|
||||||
|
@ -689,8 +711,6 @@ gpioCfgMemAlloc Configure DMA memory allocation mode
|
||||||
gpioCfgNetAddr Configure allowed network addresses
|
gpioCfgNetAddr Configure allowed network addresses
|
||||||
.br
|
.br
|
||||||
|
|
||||||
.br
|
|
||||||
gpioCfgInternals Configure misc. internals (DEPRECATED)
|
|
||||||
.br
|
.br
|
||||||
gpioCfgGetInternals Get internal configuration settings
|
gpioCfgGetInternals Get internal configuration settings
|
||||||
.br
|
.br
|
||||||
|
@ -3026,7 +3046,7 @@ int main(int argc, char *argv[])
|
||||||
.IP "\fBint gpioWaveTxAt(void)\fP"
|
.IP "\fBint gpioWaveTxAt(void)\fP"
|
||||||
.IP "" 4
|
.IP "" 4
|
||||||
This function returns the id of the waveform currently being
|
This function returns the id of the waveform currently being
|
||||||
transmitted.
|
transmitted using \fBgpioWaveTxSend\fP. Chained waves are not supported.
|
||||||
|
|
||||||
.br
|
.br
|
||||||
|
|
||||||
|
@ -7896,22 +7916,6 @@ numSockAddr: 0-256 (0 means all addresses allowed)
|
||||||
|
|
||||||
.EE
|
.EE
|
||||||
|
|
||||||
.IP "\fBint gpioCfgInternals(unsigned cfgWhat, unsigned cfgVal)\fP"
|
|
||||||
.IP "" 4
|
|
||||||
Used to tune internal settings.
|
|
||||||
|
|
||||||
.br
|
|
||||||
|
|
||||||
.br
|
|
||||||
|
|
||||||
.EX
|
|
||||||
cfgWhat: see source code
|
|
||||||
.br
|
|
||||||
cfgVal: see source code
|
|
||||||
.br
|
|
||||||
|
|
||||||
.EE
|
|
||||||
|
|
||||||
.IP "\fBuint32_t gpioCfgGetInternals(void)\fP"
|
.IP "\fBuint32_t gpioCfgGetInternals(void)\fP"
|
||||||
.IP "" 4
|
.IP "" 4
|
||||||
This function returns the current library internal configuration
|
This function returns the current library internal configuration
|
||||||
|
@ -7932,6 +7936,10 @@ cfgVal: see source code
|
||||||
|
|
||||||
.EE
|
.EE
|
||||||
|
|
||||||
|
.br
|
||||||
|
|
||||||
|
.br
|
||||||
|
|
||||||
.IP "\fBint gpioCustom1(unsigned arg1, unsigned arg2, char *argx, unsigned argc)\fP"
|
.IP "\fBint gpioCustom1(unsigned arg1, unsigned arg2, char *argx, unsigned argc)\fP"
|
||||||
.IP "" 4
|
.IP "" 4
|
||||||
This function is available for user customisation.
|
This function is available for user customisation.
|
||||||
|
|
72
pigpio.c
72
pigpio.c
|
@ -25,7 +25,7 @@ OTHER DEALINGS IN THE SOFTWARE.
|
||||||
For more information, please refer to <http://unlicense.org/>
|
For more information, please refer to <http://unlicense.org/>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* pigpio version 76 */
|
/* pigpio version 77 */
|
||||||
|
|
||||||
/* include ------------------------------------------------------- */
|
/* include ------------------------------------------------------- */
|
||||||
|
|
||||||
|
@ -950,6 +950,7 @@ typedef struct
|
||||||
uint32_t nfRBitV;
|
uint32_t nfRBitV;
|
||||||
|
|
||||||
uint32_t gfSteadyUs;
|
uint32_t gfSteadyUs;
|
||||||
|
uint8_t gfInitialised;
|
||||||
uint32_t gfTick;
|
uint32_t gfTick;
|
||||||
uint32_t gfLBitV;
|
uint32_t gfLBitV;
|
||||||
uint32_t gfRBitV;
|
uint32_t gfRBitV;
|
||||||
|
@ -3000,7 +3001,9 @@ static void waveCBsOOLs(int *numCBs, int *numBOOLs, int *numTOOLs)
|
||||||
|
|
||||||
for (i=0; i<numWaves; i++)
|
for (i=0; i<numWaves; i++)
|
||||||
{
|
{
|
||||||
if (waves[i].gpioOn || waves[i].gpioOff) {numCB++; numBOOL++;}
|
if (waves[i].gpioOn) {numBOOL++;}
|
||||||
|
if (waves[i].gpioOff) {numBOOL++;}
|
||||||
|
if (waves[i].gpioOn || waves[i].gpioOff) {numCB++;}
|
||||||
if (waves[i].flags & WAVE_FLAG_READ) {numCB++; numTOOL++;}
|
if (waves[i].flags & WAVE_FLAG_READ) {numCB++; numTOOL++;}
|
||||||
if (waves[i].flags & WAVE_FLAG_TICK) {numCB++; numTOOL++;}
|
if (waves[i].flags & WAVE_FLAG_TICK) {numCB++; numTOOL++;}
|
||||||
|
|
||||||
|
@ -5683,7 +5686,7 @@ unsigned alert_delays[]=
|
||||||
static void alertGlitchFilter(gpioSample_t *sample, int numSamples)
|
static void alertGlitchFilter(gpioSample_t *sample, int numSamples)
|
||||||
{
|
{
|
||||||
int i, j, diff;
|
int i, j, diff;
|
||||||
uint32_t steadyUs, changedTick, RBitV, LBitV;
|
uint32_t steadyUs, changedTick, RBitV, LBitV, initialised;
|
||||||
uint32_t bit, bitV;
|
uint32_t bit, bitV;
|
||||||
|
|
||||||
for (i=0; i<=PI_MAX_USER_GPIO; i++)
|
for (i=0; i<=PI_MAX_USER_GPIO; i++)
|
||||||
|
@ -5692,6 +5695,17 @@ static void alertGlitchFilter(gpioSample_t *sample, int numSamples)
|
||||||
|
|
||||||
if (monitorBits & bit & gFilterBits)
|
if (monitorBits & bit & gFilterBits)
|
||||||
{
|
{
|
||||||
|
initialised = gpioAlert[i].gfInitialised;
|
||||||
|
if (!initialised && numSamples > 0)
|
||||||
|
{
|
||||||
|
/* Initialise filter with first sample */
|
||||||
|
bitV = sample[0].level & bit;
|
||||||
|
gpioAlert[i].gfRBitV = bitV;
|
||||||
|
gpioAlert[i].gfLBitV = bitV;
|
||||||
|
gpioAlert[i].gfTick = sample[0].tick;
|
||||||
|
gpioAlert[i].gfInitialised = 1;
|
||||||
|
}
|
||||||
|
|
||||||
steadyUs = gpioAlert[i].gfSteadyUs;
|
steadyUs = gpioAlert[i].gfSteadyUs;
|
||||||
RBitV = gpioAlert[i].gfRBitV;
|
RBitV = gpioAlert[i].gfRBitV;
|
||||||
LBitV = gpioAlert[i].gfLBitV;
|
LBitV = gpioAlert[i].gfLBitV;
|
||||||
|
@ -12333,18 +12347,8 @@ int gpioGlitchFilter(unsigned gpio, unsigned steady)
|
||||||
|
|
||||||
if (steady)
|
if (steady)
|
||||||
{
|
{
|
||||||
gpioAlert[gpio].gfTick = systReg[SYST_CLO];
|
/* Initialise values next time we process alerts */
|
||||||
|
gpioAlert[gpio].gfInitialised = 0;
|
||||||
if (gpioRead_Bits_0_31() & (1<<gpio))
|
|
||||||
{
|
|
||||||
gpioAlert[gpio].gfLBitV = (1<<gpio);
|
|
||||||
gpioAlert[gpio].gfRBitV = 0 ;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
gpioAlert[gpio].gfLBitV = 0 ;
|
|
||||||
gpioAlert[gpio].gfRBitV = (1<<gpio);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gpioAlert[gpio].gfSteadyUs = steady;
|
gpioAlert[gpio].gfSteadyUs = steady;
|
||||||
|
@ -13998,44 +14002,6 @@ int gpioCfgSetInternals(uint32_t cfgVal)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int gpioCfgInternals(unsigned cfgWhat, unsigned cfgVal)
|
|
||||||
{
|
|
||||||
int retVal = PI_BAD_CFG_INTERNAL;
|
|
||||||
|
|
||||||
DBG(DBG_USER, "cfgWhat=%u, cfgVal=%d", cfgWhat, cfgVal);
|
|
||||||
|
|
||||||
switch(cfgWhat)
|
|
||||||
{
|
|
||||||
case 562484977:
|
|
||||||
|
|
||||||
if (cfgVal) gpioCfg.internals |= PI_CFG_STATS;
|
|
||||||
else gpioCfg.internals &= (~PI_CFG_STATS);
|
|
||||||
|
|
||||||
DBG(DBG_ALWAYS, "show stats is %u", cfgVal);
|
|
||||||
|
|
||||||
retVal = 0;
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 984762879:
|
|
||||||
|
|
||||||
if ((cfgVal >= DBG_ALWAYS) && (cfgVal <= DBG_MAX_LEVEL))
|
|
||||||
{
|
|
||||||
|
|
||||||
gpioCfg.dbgLevel = cfgVal;
|
|
||||||
gpioCfg.internals = (gpioCfg.internals & (~0xF)) | cfgVal;
|
|
||||||
|
|
||||||
DBG(DBG_ALWAYS, "Debug level is %u", cfgVal);
|
|
||||||
|
|
||||||
retVal = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return retVal;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* include any user customisations */
|
/* include any user customisations */
|
||||||
|
|
||||||
|
|
28
pigpio.h
28
pigpio.h
|
@ -30,7 +30,7 @@ For more information, please refer to <http://unlicense.org/>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|
||||||
#define PIGPIO_VERSION 76
|
#define PIGPIO_VERSION 77
|
||||||
|
|
||||||
/*TEXT
|
/*TEXT
|
||||||
|
|
||||||
|
@ -106,6 +106,16 @@ return error PI_NOT_INITIALISED.
|
||||||
If the library is initialised the [*gpioCfg**] functions will return
|
If the library is initialised the [*gpioCfg**] functions will return
|
||||||
error PI_INITIALISED.
|
error PI_INITIALISED.
|
||||||
|
|
||||||
|
If you intend to rely on signals sent to your application, you should
|
||||||
|
turn off the internal signal handling as shown in this example:
|
||||||
|
|
||||||
|
. .
|
||||||
|
int cfg = gpioCfgGetInternals();
|
||||||
|
cfg |= PI_CFG_NOSIGHANDLER; // (1<<10)
|
||||||
|
gpioCfgSetInternals(cfg);
|
||||||
|
int status = gpioInitialise();
|
||||||
|
. .
|
||||||
|
|
||||||
TEXT*/
|
TEXT*/
|
||||||
|
|
||||||
/*OVERVIEW
|
/*OVERVIEW
|
||||||
|
@ -377,7 +387,6 @@ gpioCfgSocketPort Configure socket port
|
||||||
gpioCfgMemAlloc Configure DMA memory allocation mode
|
gpioCfgMemAlloc Configure DMA memory allocation mode
|
||||||
gpioCfgNetAddr Configure allowed network addresses
|
gpioCfgNetAddr Configure allowed network addresses
|
||||||
|
|
||||||
gpioCfgInternals Configure misc. internals (DEPRECATED)
|
|
||||||
gpioCfgGetInternals Get internal configuration settings
|
gpioCfgGetInternals Get internal configuration settings
|
||||||
gpioCfgSetInternals Set internal configuration settings
|
gpioCfgSetInternals Set internal configuration settings
|
||||||
|
|
||||||
|
@ -2181,7 +2190,7 @@ D*/
|
||||||
int gpioWaveTxAt(void);
|
int gpioWaveTxAt(void);
|
||||||
/*D
|
/*D
|
||||||
This function returns the id of the waveform currently being
|
This function returns the id of the waveform currently being
|
||||||
transmitted.
|
transmitted using [*gpioWaveTxSend*]. Chained waves are not supported.
|
||||||
|
|
||||||
Returns the waveform id or one of the following special values:
|
Returns the waveform id or one of the following special values:
|
||||||
|
|
||||||
|
@ -4975,18 +4984,6 @@ numSockAddr: 0-256 (0 means all addresses allowed)
|
||||||
D*/
|
D*/
|
||||||
|
|
||||||
|
|
||||||
/*F*/
|
|
||||||
int gpioCfgInternals(unsigned cfgWhat, unsigned cfgVal);
|
|
||||||
/*D
|
|
||||||
Used to tune internal settings.
|
|
||||||
|
|
||||||
. .
|
|
||||||
cfgWhat: see source code
|
|
||||||
cfgVal: see source code
|
|
||||||
. .
|
|
||||||
D*/
|
|
||||||
|
|
||||||
|
|
||||||
/*F*/
|
/*F*/
|
||||||
uint32_t gpioCfgGetInternals(void);
|
uint32_t gpioCfgGetInternals(void);
|
||||||
/*D
|
/*D
|
||||||
|
@ -5003,6 +5000,7 @@ settings.
|
||||||
. .
|
. .
|
||||||
cfgVal: see source code
|
cfgVal: see source code
|
||||||
. .
|
. .
|
||||||
|
|
||||||
D*/
|
D*/
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2466,7 +2466,7 @@ class pi():
|
||||||
def wave_tx_at(self):
|
def wave_tx_at(self):
|
||||||
"""
|
"""
|
||||||
Returns the id of the waveform currently being
|
Returns the id of the waveform currently being
|
||||||
transmitted.
|
transmitted using [*wave_send**]. Chained waves are not supported.
|
||||||
|
|
||||||
Returns the waveform id or one of the following special
|
Returns the waveform id or one of the following special
|
||||||
values:
|
values:
|
||||||
|
@ -5055,7 +5055,7 @@ class pi():
|
||||||
by calling the tally function. The count may be reset to zero
|
by calling the tally function. The count may be reset to zero
|
||||||
by calling the reset_tally function.
|
by calling the reset_tally function.
|
||||||
|
|
||||||
The callback may be cancelled by calling the event_cancel function.
|
The callback may be canceled by calling the cancel function.
|
||||||
|
|
||||||
An event may have multiple callbacks (although I can't think of
|
An event may have multiple callbacks (although I can't think of
|
||||||
a reason to do so).
|
a reason to do so).
|
||||||
|
@ -5072,7 +5072,7 @@ class pi():
|
||||||
|
|
||||||
cb2.reset_tally()
|
cb2.reset_tally()
|
||||||
|
|
||||||
cb1.event_cancel() # To cancel callback cb1.
|
cb1.cancel() # To cancel callback cb1.
|
||||||
...
|
...
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
|
@ -2829,7 +2829,7 @@ int main(int argc, char *argv[])
|
||||||
.IP "\fBint wave_tx_at(int pi)\fP"
|
.IP "\fBint wave_tx_at(int pi)\fP"
|
||||||
.IP "" 4
|
.IP "" 4
|
||||||
This function returns the id of the waveform currently being
|
This function returns the id of the waveform currently being
|
||||||
transmitted.
|
transmitted by \fBwave_send*\fP. Chained waves are not supported.
|
||||||
|
|
||||||
.br
|
.br
|
||||||
|
|
||||||
|
|
|
@ -1609,7 +1609,7 @@ D*/
|
||||||
int wave_tx_at(int pi);
|
int wave_tx_at(int pi);
|
||||||
/*D
|
/*D
|
||||||
This function returns the id of the waveform currently being
|
This function returns the id of the waveform currently being
|
||||||
transmitted.
|
transmitted by [*wave_send**]. Chained waves are not supported.
|
||||||
|
|
||||||
. .
|
. .
|
||||||
pi: >=0 (as returned by [*pigpio_start*]).
|
pi: >=0 (as returned by [*pigpio_start*]).
|
||||||
|
|
36
pigs.1
36
pigs.1
|
@ -548,8 +548,8 @@ Add serial data to waveform
|
||||||
.B WVCRE
|
.B WVCRE
|
||||||
Create a waveform
|
Create a waveform
|
||||||
.P
|
.P
|
||||||
.B WVCAP
|
.B WVCAP percent
|
||||||
Create a waveform of fixed size
|
Create a waveform of fixed size
|
||||||
.P
|
.P
|
||||||
.B WVDEL wid
|
.B WVDEL wid
|
||||||
Delete selected waveform
|
Delete selected waveform
|
||||||
|
@ -4823,7 +4823,7 @@ $ pigs wvas 7 38400 8 2 0 0x41 0x42
|
||||||
|
|
||||||
.br
|
.br
|
||||||
This command returns the id of the waveform currently
|
This command returns the id of the waveform currently
|
||||||
being transmitted.
|
being transmitted. Chained waves are not supported.
|
||||||
|
|
||||||
.br
|
.br
|
||||||
Returns the waveform id or one of the following special
|
Returns the waveform id or one of the following special
|
||||||
|
@ -5142,27 +5142,20 @@ ERROR: attempt to create an empty waveform
|
||||||
|
|
||||||
.br
|
.br
|
||||||
|
|
||||||
.IP "\fBWVCAP \fP - Create a waveform of fixed size"
|
.IP "\fBWVCAP percent\fP - Create a waveform of fixed size"
|
||||||
.IP "" 4
|
.IP "" 4
|
||||||
|
|
||||||
.br
|
.br
|
||||||
Similar to \fBWVCRE\fP, this command creates a waveform but pads the consumed
|
Create a waveform of fixed size. Similar to \fBWVCRE\fP, this command creates a waveform but pads the consumed resources to a fixed size, specified as a \fBpercent\fP of the total resources. Padded waves of equal size can be re-cycled efficiently allowing newly created waves to re-use the resources of deleted waves of the same dimension.
|
||||||
resources to a fixed size, specified as a percent of total resource.
|
|
||||||
Padded waves of equal size can be re-cycled efficiently allowing newly
|
|
||||||
created waves to re-use the resources of deleted waves of the same dimension.
|
|
||||||
|
|
||||||
.br
|
.br
|
||||||
Upon success a wave id (>=0) is returned. On error a negative status
|
Upon success a wave id (>=0) is returned. On error a negative status code will be returned.
|
||||||
code will be returned.
|
|
||||||
|
|
||||||
.br
|
.br
|
||||||
The data provided by the \fBWVAG\fP and \fBWVAS\fP commands are
|
The data provided by the \fBWVAG\fP and \fBWVAS\fP commands are consumed by this command.
|
||||||
consumed by this command.
|
|
||||||
|
|
||||||
.br
|
.br
|
||||||
As many waveforms may be created as there is space available.
|
As many waveforms may be created as there is space available. The wave id is passed to \fBWVTX\fP or \fBWVTXR\fP to specify the waveform to transmit.
|
||||||
The wave id is passed to \fBWVTX\fP or \fBWVTXR\fP to specify the
|
|
||||||
waveform to transmit.
|
|
||||||
|
|
||||||
.br
|
.br
|
||||||
Normal usage would be
|
Normal usage would be
|
||||||
|
@ -5183,8 +5176,10 @@ Step 4. \fBWVTX\fP or \fBWVTXR\fP with the id of the waveform to transmit.
|
||||||
Repeat steps 2 - 4 as needed.
|
Repeat steps 2 - 4 as needed.
|
||||||
|
|
||||||
.br
|
.br
|
||||||
Step 5. Any wave id can now be deleted and another wave of the same size
|
Step 5. Any wave id can now be deleted and another wave of the same size can be created in its place.
|
||||||
can be created in its place.
|
|
||||||
|
.br
|
||||||
|
Example
|
||||||
|
|
||||||
.br
|
.br
|
||||||
|
|
||||||
|
@ -5881,6 +5876,13 @@ The command expects a dutycycle.
|
||||||
|
|
||||||
.br
|
.br
|
||||||
|
|
||||||
|
.IP "\fBpercent\fP - percent (1-100)" 0
|
||||||
|
The percent of wave resources to allocate to a wave. It can be useful
|
||||||
|
to create waves of fixed sizes to prevent wave fragmentation (where
|
||||||
|
there are plenty of resources but not a large enough contiguous space).
|
||||||
|
|
||||||
|
.br
|
||||||
|
|
||||||
.IP "\fBpf\fP - hardware PWM frequency (1-125M, 1-187.5M for the BCM2711)" 0
|
.IP "\fBpf\fP - hardware PWM frequency (1-125M, 1-187.5M for the BCM2711)" 0
|
||||||
The command expects a frequency.
|
The command expects a frequency.
|
||||||
|
|
||||||
|
|
31
util/pigpiod
31
util/pigpiod
|
@ -1,31 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
### BEGIN INIT INFO
|
|
||||||
# Provides: pigpiod
|
|
||||||
# Required-Start:
|
|
||||||
# Required-Stop:
|
|
||||||
# Default-Start: 2 3 4 5
|
|
||||||
# Default-Stop: 0 1 6
|
|
||||||
# Short-Description: pigpio daemon
|
|
||||||
# Description: pigpio daemon required to control GPIO pins via pigpio $
|
|
||||||
### END INIT INFO
|
|
||||||
|
|
||||||
# Actions
|
|
||||||
case "$1" in
|
|
||||||
start)
|
|
||||||
pigpiod
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
pkill pigpiod
|
|
||||||
;;
|
|
||||||
restart)
|
|
||||||
pkill pigpiod
|
|
||||||
pigpiod
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Usage: $0 start" >&2
|
|
||||||
exit 3
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
|
|
Loading…
Reference in New Issue