Skip to content

Commit

Permalink
Merge pull request #365 from joan2937/v77-release
Browse files Browse the repository at this point in the history
V77 release
  • Loading branch information
guymcswain authored Jun 28, 2020
2 parents 30e6b35 + 0c1fb8b commit a2997c5
Show file tree
Hide file tree
Showing 14 changed files with 120 additions and 170 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ build
dist
*.egg-info

tmp/

# DOC files
DOC/dbase/pigpio.sqlite.*
DOC/tmp
Expand Down
Binary file modified DOC/dbase/pigpio.sqlite
Binary file not shown.
7 changes: 7 additions & 0 deletions DOC/src/defs/examples.def
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,13 @@ gpioHardwareRevision

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
Stepper motor code.

Expand Down
29 changes: 14 additions & 15 deletions DOC/src/defs/pigs.def
Original file line number Diff line number Diff line change
Expand Up @@ -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

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

WVTX wid :: Transmits waveform once :: gpioWaveTxSend
Expand Down Expand Up @@ -2610,7 +2610,7 @@ $ pigs wvas 7 38400 8 2 0 0x41 0x42
WVTAT ::

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
values:
Expand Down Expand Up @@ -2786,20 +2786,13 @@ ERROR: attempt to create an empty waveform

WVCAP ::

Similar to [*WVCRE*], this command creates a waveform but pads the consumed
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.
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.

Upon success a wave id (>=0) is returned. On error a negative status
code will be returned.
Upon success a wave id (>=0) is returned. On error a negative status code will be returned.

The data provided by the [*WVAG*] and [*WVAS*] commands are
consumed by this command.
The data provided by the [*WVAG*] and [*WVAS*] commands are consumed by this command.

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.
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.

Normal usage would be

Expand All @@ -2813,8 +2806,9 @@ Step 4. [*WVTX*] or [*WVTXR*] with the id of the waveform to transmit.

Repeat steps 2 - 4 as needed.

Step 5. Any wave id can now be deleted and another wave of the same size
can be created in its place.
Step 5. Any wave id can now be deleted and another wave of the same size can be created in its place.

Example

...
# Create a wave that consumes 50% of the total resource:
Expand Down Expand Up @@ -3200,6 +3194,11 @@ must match an entry in /opt/pigpio/access.
pdc :: hardware PWM dutycycle (0-1000000)
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)
The command expects a frequency.

Expand Down
14 changes: 8 additions & 6 deletions DOC/src/html/download.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<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">
<title>download</title>
</head>
Expand All @@ -14,12 +14,14 @@
compilation of pigpio.c, takes 100 seconds on early model
Pis.&nbsp; Be patient.&nbsp; The overall install takes just over 3
minutes.</span><br style="font-weight: bold;">
<h3>Download and install (V75)<br></h3>
<code>wget https://github.com/joan2937/pigpio/archive/v75.zip<br>
unzip v75.zip<br>
cd pigpio-75<br>
<h3>Download and install latest version<br></h3>
<code>
wget https://github.com/joan2937/pigpio/archive/master.zip<br>
unzip master.zip<br>
cd pigpio-master<br>
make<br>
sudo make install<br></code><br>
sudo make install<br>
</code>
<br>
If the Python part of the install fails it may be because you need
the setup tools.<br>
Expand Down
15 changes: 6 additions & 9 deletions DOC/src/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@
pigpio is a library for the Raspberry which allows control of the
General Purpose Input Outputs (GPIO).&nbsp; pigpio works on all
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>
<h3>Features<br></h3>
<ul>
Expand Down Expand Up @@ -627,7 +620,7 @@ <h3><a name="Other_Languages" id="Other_Languages"></a>Other
Languages</h3>
<p>There are several third party projects which provide wrappers
for pigpio.<br></p>
<p>Some I am aware of are:<br></p>
<p>Some are listed here:<br></p>
<ul>
<li><a href="https://github.com/skvamme/pigpio">Erlang</a>
(skvamme)</li>
Expand All @@ -642,7 +635,9 @@ <h3><a name="Other_Languages" id="Other_Languages"></a>Other
"https://github.com/unosquare/pigpio-dotnet">.NET/mono</a>
(unosquare)</li>
<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
Calin Horea)</li>
<li><a href=
Expand All @@ -652,6 +647,8 @@ <h3><a name="Other_Languages" id="Other_Languages"></a>Other
"https://github.com/vasmalltalk/pigpio-vast">Smalltalk</a>(Instantiations)</li>
<li><a href=
"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>
<hr style="width: 100%; height: 2px;">
<p><font size="-2">The PWM and servo pulses are timed using the DMA
Expand Down
46 changes: 27 additions & 19 deletions pigpio.3
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,28 @@ error PI_INITIALISED.

.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

.SH OVERVIEW
Expand Down Expand Up @@ -689,8 +711,6 @@ gpioCfgMemAlloc Configure DMA memory allocation mode
gpioCfgNetAddr Configure allowed network addresses
.br

.br
gpioCfgInternals Configure misc. internals (DEPRECATED)
.br
gpioCfgGetInternals Get internal configuration settings
.br
Expand Down Expand Up @@ -3026,7 +3046,7 @@ int main(int argc, char *argv[])
.IP "\fBint gpioWaveTxAt(void)\fP"
.IP "" 4
This function returns the id of the waveform currently being
transmitted.
transmitted using \fBgpioWaveTxSend\fP. Chained waves are not supported.

.br

Expand Down Expand Up @@ -7896,22 +7916,6 @@ numSockAddr: 0-256 (0 means all addresses allowed)
.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 "" 4
This function returns the current library internal configuration
Expand All @@ -7932,6 +7936,10 @@ cfgVal: see source code
.EE

.br

.br

.IP "\fBint gpioCustom1(unsigned arg1, unsigned arg2, char *argx, unsigned argc)\fP"
.IP "" 4
This function is available for user customisation.
Expand Down
72 changes: 19 additions & 53 deletions pigpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <http://unlicense.org/>
*/

/* pigpio version 76 */
/* pigpio version 77 */

/* include ------------------------------------------------------- */

Expand Down Expand Up @@ -950,6 +950,7 @@ typedef struct
uint32_t nfRBitV;

uint32_t gfSteadyUs;
uint8_t gfInitialised;
uint32_t gfTick;
uint32_t gfLBitV;
uint32_t gfRBitV;
Expand Down Expand Up @@ -3000,7 +3001,9 @@ static void waveCBsOOLs(int *numCBs, int *numBOOLs, int *numTOOLs)

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_TICK) {numCB++; numTOOL++;}

Expand Down Expand Up @@ -5683,7 +5686,7 @@ unsigned alert_delays[]=
static void alertGlitchFilter(gpioSample_t *sample, int numSamples)
{
int i, j, diff;
uint32_t steadyUs, changedTick, RBitV, LBitV;
uint32_t steadyUs, changedTick, RBitV, LBitV, initialised;
uint32_t bit, bitV;

for (i=0; i<=PI_MAX_USER_GPIO; i++)
Expand All @@ -5692,6 +5695,17 @@ static void alertGlitchFilter(gpioSample_t *sample, int numSamples)

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;
RBitV = gpioAlert[i].gfRBitV;
LBitV = gpioAlert[i].gfLBitV;
Expand Down Expand Up @@ -12333,18 +12347,8 @@ int gpioGlitchFilter(unsigned gpio, unsigned steady)

if (steady)
{
gpioAlert[gpio].gfTick = systReg[SYST_CLO];

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);
}
/* Initialise values next time we process alerts */
gpioAlert[gpio].gfInitialised = 0;
}

gpioAlert[gpio].gfSteadyUs = steady;
Expand Down Expand Up @@ -13998,44 +14002,6 @@ int gpioCfgSetInternals(uint32_t cfgVal)
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 */

Expand Down
Loading

0 comments on commit a2997c5

Please sign in to comment.