From d5f32d33012c56ad229803ccd267d8d734392f6a Mon Sep 17 00:00:00 2001 From: joan Date: Sun, 4 Feb 2018 18:59:37 +0000 Subject: [PATCH] Docs plus reverse PR #164 flag meaning --- pig2vcd.1 | 4 +-- pigpio.3 | 75 ++++++++++++++++++++++++++++++++++++++++++++++++--- pigpio.c | 12 ++++----- pigpio.h | 36 +++++++++++++++++++++++-- pigpiod.1 | 4 +-- pigpiod_if.3 | 4 +-- pigpiod_if2.3 | 4 +-- pigs.1 | 4 +-- 8 files changed, 122 insertions(+), 21 deletions(-) diff --git a/pig2vcd.1 b/pig2vcd.1 index b2c64b4..e5271ee 100644 --- a/pig2vcd.1 +++ b/pig2vcd.1 @@ -2,7 +2,7 @@ ." Process this file with ." groff -man -Tascii pig2vcd.1 ." -.TH pig2vcd 1 2012-2017 Linux "pigpio archive" +.TH pig2vcd 1 2012-2018 Linux "pigpio archive" .SH NAME pig2vd - A utility to convert pigpio notifications to VCD. @@ -243,4 +243,4 @@ The state lines contain the new state followed by the gpio identifier. pigpiod(1), pigs(1), pigpio(3), pigpiod_if(3), pigpiod_if2(3) .SH AUTHOR -joan@abyz.co.uk +joan@abyz.me.uk diff --git a/pigpio.3 b/pigpio.3 index fac81d9..6fdff76 100644 --- a/pigpio.3 +++ b/pigpio.3 @@ -2,7 +2,7 @@ ." Process this file with ." groff -man -Tascii pigpio.3 ." -.TH pigpio 3 2012-2017 Linux "pigpio archive" +.TH pigpio 3 2012-2018 Linux "pigpio archive" .SH NAME pigpio - A C library to manipulate the Pi's GPIO. @@ -330,6 +330,11 @@ gpioSetMode(22,PI_ALT0); // Set GPIO22 to alternative mode 0. .EE +.br + +.br +See \fBhttp://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2835/BCM2835-ARM-Peripherals.pdf\fP page 102 for an overview of the modes. + .IP "\fBint gpioGetMode(unsigned gpio)\fP" .IP "" 4 Gets the GPIO mode. @@ -1299,6 +1304,36 @@ interrupt timeout expires. .br +.br + +.EX +Parameter Value Meaning +.br + +.br +GPIO 0-53 The GPIO which has changed state +.br + +.br +level 0-2 0 = change to low (a falling edge) +.br + 1 = change to high (a rising edge) +.br + 2 = no level change (interrupt timeout) +.br + +.br +tick 32 bit The number of microseconds since boot +.br + WARNING: this wraps around from +.br + 4294967295 to 0 roughly every 72 minutes +.br + +.EE + +.br + .br The underlying Linux sysfs GPIO interface is used to provide the interrupt services. @@ -1378,6 +1413,40 @@ current tick, and the userdata pointer. .br +.br + +.EX +Parameter Value Meaning +.br + +.br +GPIO 0-53 The GPIO which has changed state +.br + +.br +level 0-2 0 = change to low (a falling edge) +.br + 1 = change to high (a rising edge) +.br + 2 = no level change (interrupt timeout) +.br + +.br +tick 32 bit The number of microseconds since boot +.br + WARNING: this wraps around from +.br + 4294967295 to 0 roughly every 72 minutes +.br + +.br +userdata pointer Pointer to an arbitrary object +.br + +.EE + +.br + .br Only one of \fBgpioSetISRFunc\fP or \fBgpioSetISRFuncEx\fP can be registered per GPIO. @@ -5050,7 +5119,7 @@ This function stores a null terminated script for later execution. .br .br -See \fBhttp://abyz.co.uk/rpi/pigpio/pigs.html#Scripts\fP for details. +See \fBhttp://abyz.me.uk/rpi/pigpio/pigs.html#Scripts\fP for details. .br @@ -10222,4 +10291,4 @@ A 16-bit word value. pigpiod(1), pig2vcd(1), pigs(1), pigpiod_if(3), pigpiod_if2(3) .SH AUTHOR -joan@abyz.co.uk +joan@abyz.me.uk diff --git a/pigpio.c b/pigpio.c index da5a809..9337595 100644 --- a/pigpio.c +++ b/pigpio.c @@ -25,7 +25,7 @@ OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to */ -/* pigpio version 64 */ +/* pigpio version 65 */ /* include ------------------------------------------------------- */ @@ -204,8 +204,8 @@ bit 0 READ_LAST_NOT_SET_ERROR #define DO_DBG(level, format, arg...) \ { \ - if (gpioCfg.dbgLevel >= level && \ - (gpioCfg.internals & PI_CFG_SIGHANDLER)) \ + if ((gpioCfg.dbgLevel >= level) && \ + (!(gpioCfg.internals & PI_CFG_SIGHANDLER))) \ fprintf(stderr, "%s %s: " format "\n" , \ myTimeStamp(), __FUNCTION__ , ## arg); \ } @@ -1346,7 +1346,7 @@ static volatile gpioCfg_t gpioCfg = PI_DEFAULT_MEM_ALLOC_MODE, 0, /* dbgLevel */ 0, /* alertFreq */ - PI_CFG_SIGHANDLER, /* internals */ + 0, /* internals */ }; /* no initialisation required */ @@ -8135,7 +8135,7 @@ int initInitialise(void) } #ifndef EMBEDDED_IN_VM - if(gpioCfg.internals & PI_CFG_SIGHANDLER) + if (!(gpioCfg.internals & PI_CFG_SIGHANDLER)) sigSetHandler(); #endif @@ -8534,7 +8534,7 @@ void gpioTerminate(void) #ifndef EMBEDDED_IN_VM if ((gpioCfg.internals & PI_CFG_STATS) && - (gpioCfg.internals & PI_CFG_SIGHANDLER)) + (!(gpioCfg.internals & PI_CFG_SIGHANDLER))) { fprintf(stderr, "\n#####################################################\n"); diff --git a/pigpio.h b/pigpio.h index 3ae2a09..1cedc09 100644 --- a/pigpio.h +++ b/pigpio.h @@ -31,7 +31,7 @@ For more information, please refer to #include #include -#define PIGPIO_VERSION 64 +#define PIGPIO_VERSION 6507 /*TEXT @@ -980,6 +980,8 @@ gpioSetMode(18, PI_OUTPUT); // Set GPIO18 as output. gpioSetMode(22,PI_ALT0); // Set GPIO22 to alternative mode 0. ... + +See [[http://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2835/BCM2835-ARM-Peripherals.pdf]] page 102 for an overview of the modes. D*/ @@ -1494,6 +1496,20 @@ The function is passed the GPIO, the current level, and the current tick. The level will be PI_TIMEOUT if the optional interrupt timeout expires. +. . +Parameter Value Meaning + +GPIO 0-53 The GPIO which has changed state + +level 0-2 0 = change to low (a falling edge) + 1 = change to high (a rising edge) + 2 = no level change (interrupt timeout) + +tick 32 bit The number of microseconds since boot + WARNING: this wraps around from + 4294967295 to 0 roughly every 72 minutes +. . + The underlying Linux sysfs GPIO interface is used to provide the interrupt services. @@ -1547,6 +1563,22 @@ or PI_BAD_ISR_INIT. The function is passed the GPIO, the current level, the current tick, and the userdata pointer. +. . +Parameter Value Meaning + +GPIO 0-53 The GPIO which has changed state + +level 0-2 0 = change to low (a falling edge) + 1 = change to high (a rising edge) + 2 = no level change (interrupt timeout) + +tick 32 bit The number of microseconds since boot + WARNING: this wraps around from + 4294967295 to 0 roughly every 72 minutes + +userdata pointer Pointer to an arbitrary object +. . + Only one of [*gpioSetISRFunc*] or [*gpioSetISRFuncEx*] can be registered per GPIO. @@ -3671,7 +3703,7 @@ int gpioStoreScript(char *script); /*D This function stores a null terminated script for later execution. -See [[http://abyz.co.uk/rpi/pigpio/pigs.html#Scripts]] for details. +See [[http://abyz.me.uk/rpi/pigpio/pigs.html#Scripts]] for details. . . script: the text of the script diff --git a/pigpiod.1 b/pigpiod.1 index d677a88..db10b5f 100644 --- a/pigpiod.1 +++ b/pigpiod.1 @@ -2,7 +2,7 @@ ." Process this file with ." groff -man -Tascii pigpiod.1 ." -.TH pigpiod 1 2012-2017 Linux "pigpio archive" +.TH pigpiod 1 2012-2018 Linux "pigpio archive" .SH NAME pigpiod - A utility to start the pigpio library as a daemon. @@ -265,4 +265,4 @@ A full channel only requires one DMA control block regardless of the length of a pig2vcd(1), pigs(1), pigpio(3), pigpiod_if(3), pigpiod_if2(3) .SH AUTHOR -joan@abyz.co.uk +joan@abyz.me.uk diff --git a/pigpiod_if.3 b/pigpiod_if.3 index 5c5cb0f..7e0754d 100644 --- a/pigpiod_if.3 +++ b/pigpiod_if.3 @@ -2,7 +2,7 @@ ." Process this file with ." groff -man -Tascii pigpiod_if.3 ." -.TH pigpiod_if 3 2012-2017 Linux "pigpio archive" +.TH pigpiod_if 3 2012-2018 Linux "pigpio archive" .SH NAME pigpiod_if - A C library to interface to the pigpio daemon. @@ -4944,4 +4944,4 @@ typedef enum pigpiod(1), pig2vcd(1), pigs(1), pigpio(3), pigpiod_if2(3) .SH AUTHOR -joan@abyz.co.uk +joan@abyz.me.uk diff --git a/pigpiod_if2.3 b/pigpiod_if2.3 index 5bb17ff..b66b8c4 100644 --- a/pigpiod_if2.3 +++ b/pigpiod_if2.3 @@ -2,7 +2,7 @@ ." Process this file with ." groff -man -Tascii pigpiod_if2.3 ." -.TH pigpiod_if2 3 2012-2017 Linux "pigpio archive" +.TH pigpiod_if2 3 2012-2018 Linux "pigpio archive" .SH NAME pigpiod_if2 - A C library to interface to the pigpio daemon. @@ -7315,4 +7315,4 @@ typedef enum pigpiod(1), pig2vcd(1), pigs(1), pigpio(3), pigpiod_if(3) .SH AUTHOR -joan@abyz.co.uk +joan@abyz.me.uk diff --git a/pigs.1 b/pigs.1 index 535497b..b16595b 100644 --- a/pigs.1 +++ b/pigs.1 @@ -2,7 +2,7 @@ ." Process this file with ." groff -man -Tascii foo.1 ." -.TH pigs 1 2012-2017 Linux "pigpio archive" +.TH pigs 1 2012-2018 Linux "pigpio archive" .SH NAME pigs - command line socket access to the pigpio daemon. @@ -5727,4 +5727,4 @@ the current GPIO levels. pigpiod(1), pig2vcd(1), pigpio(3), pigpiod_if(3), pigpiod_if2(3) .SH AUTHOR -joan@abyz.co.uk +joan@abyz.me.uk