V47
authorjoan <joan@abyz.co.uk>
Tue, 1 Mar 2016 21:41:36 +0000 (21:41 +0000)
committerjoan <joan@abyz.co.uk>
Tue, 1 Mar 2016 21:41:36 +0000 (21:41 +0000)
15 files changed:
command.c
pigpio.3
pigpio.c
pigpio.h
pigpio.py
pigpiod.1
pigpiod_if.3
pigpiod_if.h
pigpiod_if2.3
pigpiod_if2.c
pigpiod_if2.h
pigs.1
setup.py
x_pigs
x_pipe

index 32b59de0f654d09436186401b079ffa299863dd7..32619ba32c831400d8fe07d832e67885bafa3a9e 100644 (file)
--- a/command.c
+++ b/command.c
@@ -26,7 +26,7 @@ For more information, please refer to <http://unlicense.org/>
 */
 
 /*
-This version is for pigpio version 46+
+This version is for pigpio version 47+
 */
 
 #include <stdio.h>
@@ -172,6 +172,7 @@ cmdInfo_t cmdInfo[]=
 
    {PI_CMD_WVAG,  "WVAG",  192, 2}, // gpioWaveAddGeneric
    {PI_CMD_WVAS,  "WVAS",  196, 2}, // gpioWaveAddSerial
+   {PI_CMD_WVTAT, "WVTAT", 101, 2}, // gpioWaveTxAt
    {PI_CMD_WVBSY, "WVBSY", 101, 2}, // gpioWaveTxBusy
    {PI_CMD_WVCHA, "WVCHA", 197, 0}, // gpioWaveChain
    {PI_CMD_WVCLR, "WVCLR", 101, 0}, // gpioWaveClear
@@ -235,15 +236,15 @@ cmdInfo_t cmdInfo[]=
 
 
 char * cmdUsage = "\n\
-BC1 bits         Clear gpios in bank 1\n\
-BC2 bits         Clear gpios in bank 2\n\
+BC1 bits         Clear GPIO in bank 1\n\
+BC2 bits         Clear GPIO in bank 2\n\
 BI2CC sda        Close bit bang I2C\n\
 BI2CO sda scl baud | Open bit bang I2C\n\
 BI2CZ sda ...    I2C bit bang multiple transactions\n\
-BR1              Read bank 1 gpios\n\
-BR2              Read bank 2 gpios\n\
-BS1 bits         Set gpios in bank 2\n\
-BS2 bits         Set gpios in bank 2\n\
+BR1              Read bank 1 GPIO\n\
+BR2              Read bank 2 GPIO\n\
+BS1 bits         Set GPIO in bank 2\n\
+BS2 bits         Set GPIO in bank 2\n\
 \n\
 CF1 ...          Custom function 1\n\
 CF2 ...          Custom function 2\n\
@@ -251,11 +252,11 @@ CF2 ...          Custom function 2\n\
 CGI              Configuration get internals\n\
 CSI v            Configuration set internals\n\
 \n\
-FG g steady      Set glitch filter on gpio\n\
-FN g steady active | Set noise filter on gpio\n\
+FG g steady      Set glitch filter on GPIO\n\
+FN g steady active | Set noise filter on GPIO\n\
 \n\
-GDC g            Get PWM dutycycle for gpio\n\
-GPW g            Get servo pulsewidth for gpio\n\
+GDC g            Get PWM dutycycle for GPIO\n\
+GPW g            Get servo pulsewidth for GPIO\n\
 \n\
 H/HELP           Display command help\n\
 HC g f           Set hardware clock frequency\n\
@@ -281,8 +282,8 @@ I2CWS h b        SMBus Write Byte: write byte\n\
 I2CWW h r word   SMBus Write Word Data: write word to register\n\
 I2CZ  h ...      I2C multiple transactions\n\
 \n\
-M/MODES g mode   Set gpio mode\n\
-MG/MODEG g       Get gpio mode\n\
+M/MODES g mode   Set GPIO mode\n\
+MG/MODEG g       Get GPIO mode\n\
 MICS n           Delay for microseconds\n\
 MILS n           Delay for milliseconds\n\
 \n\
@@ -291,24 +292,24 @@ NC h             Close notification\n\
 NO               Request a notification\n\
 NP h             Pause notification\n\
 \n\
-P/PWM g v        Set gpio PWM value\n\
+P/PWM g v        Set GPIO PWM value\n\
 PARSE text       Validate script\n\
-PFG g            Get gpio PWM frequency\n\
-PFS g v          Set gpio PWM frequency\n\
+PFG g            Get GPIO PWM frequency\n\
+PFS g v          Set GPIO PWM frequency\n\
 PIGPV            Get pigpio library version\n\
-PRG g            Get gpio PWM range\n\
+PRG g            Get GPIO PWM range\n\
 PROC text        Store script\n\
 PROCD sid        Delete script\n\
 PROCP sid        Get script status and parameters\n\
 PROCR sid ...    Run script\n\
 PROCS sid        Stop script\n\
-PRRG g           Get gpio PWM real range\n\
-PRS g v          Set gpio PWM range\n\
-PUD g pud        Set gpio pull up/down\n\
+PRRG g           Get GPIO PWM real range\n\
+PRS g v          Set GPIO PWM range\n\
+PUD g pud        Set GPIO pull up/down\n\
 \n\
-R/READ g         Read gpio level\n\
+R/READ g         Read GPIO level\n\
 \n\
-S/SERVO g v      Set gpio servo pulsewidth\n\
+S/SERVO g v      Set GPIO servo pulsewidth\n\
 SERC h           Close serial handle\n\
 SERDA h          Check for serial data ready to read\n\
 SERO text baud flags | Open serial device at baud with flags\n\
@@ -316,9 +317,9 @@ SERR h n         Read bytes from serial handle\n\
 SERRB h          Read byte from serial handle\n\
 SERW h ...       Write bytes to serial handle\n\
 SERWB h byte        Write byte to serial handle\n\
-SLR g v          Read bit bang serial data from gpio\n\
-SLRC g           Close gpio for bit bang serial data\n\
-SLRO g baud bitlen | Open gpio for bit bang serial data\n\
+SLR g v          Read bit bang serial data from GPIO\n\
+SLRC g           Close GPIO for bit bang serial data\n\
+SLRO g baud bitlen | Open GPIO for bit bang serial data\n\
 SLRI g invert    Invert serial logic (1 invert, 0 normal)\n\
 SPIC h           SPI close handle\n\
 SPIO channel baud flags | SPI open channel at baud with flags\n\
@@ -327,10 +328,10 @@ SPIW h ...       SPI write bytes to handle\n\
 SPIX h ...       SPI transfer bytes to handle\n\
 \n\
 T/TICK           Get current tick\n\
-TRIG g micros l  Trigger level for micros on gpio\n\
+TRIG g micros l  Trigger level for micros on GPIO\n\
 \n\
-W/WRITE g l      Write level to gpio\n\
-WDOG g millis    Set millisecond watchdog on gpio\n\
+W/WRITE g l      Write level to GPIO\n\
+WDOG g millis    Set millisecond watchdog on GPIO\n\
 WVAG triplets    Wave add generic pulses\n\
 WVAS g baud bitlen stopbits offset ... | Wave add serial data\n\
 WVBSY            Check if wave busy\n\
@@ -345,6 +346,7 @@ WVNEW            Start a new empty wave\n\
 WVSC 0,1,2       Wave get DMA control block stats\n\
 WVSM 0,1,2       Wave get micros stats\n\
 WVSP 0,1,2       Wave get pulses stats\n\
+WVTAT            Returns the current transmitting wave\n\
 WVTX wid         Transmit wave as one-shot\n\
 WVTXM wid wmde   Transmit wave using mode\n\
 WVTXR wid        Transmit wave repeatedly\n\
@@ -364,8 +366,8 @@ typedef struct
 static errInfo_t errInfo[]=
 {
    {PI_INIT_FAILED      , "pigpio initialisation failed"},
-   {PI_BAD_USER_GPIO    , "gpio not 0-31"},
-   {PI_BAD_GPIO         , "gpio not 0-53"},
+   {PI_BAD_USER_GPIO    , "GPIO not 0-31"},
+   {PI_BAD_GPIO         , "GPIO not 0-53"},
    {PI_BAD_MODE         , "mode not 0-7"},
    {PI_BAD_LEVEL        , "level not 0-1"},
    {PI_BAD_PUD          , "pud not 0-2"},
@@ -400,11 +402,11 @@ static errInfo_t errInfo[]=
    {PI_BAD_WAVE_BAUD    , "baud rate not 50-250K(RX)/50-1M(TX)"},
    {PI_TOO_MANY_PULSES  , "waveform has too many pulses"},
    {PI_TOO_MANY_CHARS   , "waveform has too many chars"},
-   {PI_NOT_SERIAL_GPIO  , "no bit bang serial read in progress on gpio"},
+   {PI_NOT_SERIAL_GPIO  , "no bit bang serial read in progress on GPIO"},
    {PI_BAD_SERIAL_STRUC , "bad (null) serial structure parameter"},
    {PI_BAD_SERIAL_BUF   , "bad (null) serial buf parameter"}, 
-   {PI_NOT_PERMITTED    , "no permission to update gpio"},
-   {PI_SOME_PERMITTED   , "no permission to update one or more gpios"},
+   {PI_NOT_PERMITTED    , "no permission to update GPIO"},
+   {PI_SOME_PERMITTED   , "no permission to update one or more GPIO"},
    {PI_BAD_WVSC_COMMND  , "bad WVSC subcommand"},
    {PI_BAD_WVSM_COMMND  , "bad WVSM subcommand"},
    {PI_BAD_WVSP_COMMND  , "bad WVSP subcommand"},
@@ -412,7 +414,7 @@ static errInfo_t errInfo[]=
    {PI_BAD_SCRIPT       , "invalid script"},
    {PI_BAD_SCRIPT_ID    , "unknown script id"},
    {PI_BAD_SER_OFFSET   , "add serial data offset > 30 minute"},
-   {PI_GPIO_IN_USE      , "gpio already in use"},
+   {PI_GPIO_IN_USE      , "GPIO already in use"},
    {PI_BAD_SERIAL_COUNT , "must read at least a byte at a time"},
    {PI_BAD_PARAM_NUM    , "script parameter id not 0-9"},
    {PI_DUP_TAG          , "script has duplicate tag"},
@@ -454,10 +456,10 @@ static errInfo_t errInfo[]=
    {PI_SPI_XFER_FAILED  , "spi xfer/read/write failed"},
    {PI_BAD_POINTER      , "bad (NULL) pointer"},
    {PI_NO_AUX_SPI       , "need a B+ for auxiliary SPI"},
-   {PI_NOT_PWM_GPIO     , "gpio is not in use for PWM"},
-   {PI_NOT_SERVO_GPIO   , "gpio is not in use for servo pulses"},
-   {PI_NOT_HCLK_GPIO    , "gpio has no hardware clock"},
-   {PI_NOT_HPWM_GPIO    , "gpio has no hardware PWM"},
+   {PI_NOT_PWM_GPIO     , "GPIO is not in use for PWM"},
+   {PI_NOT_SERVO_GPIO   , "GPIO is not in use for servo pulses"},
+   {PI_NOT_HCLK_GPIO    , "GPIO has no hardware clock"},
+   {PI_NOT_HPWM_GPIO    , "GPIO has no hardware PWM"},
    {PI_BAD_HPWM_FREQ    , "hardware PWM frequency not 1-125M"},
    {PI_BAD_HPWM_DUTY    , "hardware PWM dutycycle not 0-1M"},
    {PI_BAD_HCLK_FREQ    , "hardware clock frequency not 4689-250M"},
@@ -470,7 +472,7 @@ static errInfo_t errInfo[]=
    {PI_TOO_MANY_SEGS    , "too many I2C transaction segments"},
    {PI_BAD_I2C_SEG      , "an I2C transaction segment failed"},
    {PI_BAD_SMBUS_CMD    , "SMBus command not supported by driver"},
-   {PI_NOT_I2C_GPIO     , "no bit bang I2C in progress on gpio"},
+   {PI_NOT_I2C_GPIO     , "no bit bang I2C in progress on GPIO"},
    {PI_BAD_I2C_WLEN     , "bad I2C write length"},
    {PI_BAD_I2C_RLEN     , "bad I2C read length"},
    {PI_BAD_I2C_CMD      , "bad I2C command"},
index c4dd556ffe9645817f09cb903c66659597a77268..cc7264d85c5a4ed12e558aff450351ccfbf15487 100644 (file)
--- a/pigpio.3
+++ b/pigpio.3
@@ -4,7 +4,7 @@
 ."
 .TH pigpio 3 2012-2015 Linux "pigpio archive"
 .SH NAME
-pigpio - A C library to manipulate the Pi's gpios.
+pigpio - A C library to manipulate the Pi's GPIO.
 
 .SH SYNOPSIS
 
@@ -20,7 +20,7 @@ sudo ./prog
 .br
 
 .br
-pigpio is a C library for the Raspberry which allows control of the gpios.
+pigpio is a C library for the Raspberry which allows control of the GPIO.
 
 .br
 
@@ -29,17 +29,17 @@ pigpio is a C library for the Raspberry which allows control of the gpios.
 .br
 
 .br
-o PWM on any of gpios 0-31
+o PWM on any of GPIO 0-31
 
 .br
 
 .br
-o servo pulses on any of gpios 0-31
+o servo pulses on any of GPIO 0-31
 
 .br
 
 .br
-o callbacks when any of gpios 0-31 change state
+o callbacks when any of GPIO 0-31 change state
 
 .br
 
@@ -49,17 +49,17 @@ o callbacks at timed intervals
 .br
 
 .br
-o reading/writing all of the gpios in a bank as one operation
+o reading/writing all of the GPIO in a bank as one operation
 
 .br
 
 .br
-o individually setting gpio modes, reading and writing
+o individually setting GPIO modes, reading and writing
 
 .br
 
 .br
-o notifications when any of gpios 0-31 change state
+o notifications when any of GPIO 0-31 change state
 
 .br
 
@@ -69,7 +69,7 @@ o the construction of output waveforms with microsecond timing
 .br
 
 .br
-o rudimentary permission control over gpios
+o rudimentary permission control over GPIO
 
 .br
 
@@ -89,11 +89,11 @@ o creating and running scripts
 .br
 
 .br
-.SS gpios
+.SS GPIO
 .br
 
 .br
-ALL gpios are identified by their Broadcom number.
+ALL GPIO are identified by their Broadcom number.
 
 .br
 
@@ -250,7 +250,7 @@ gpioTerminate();
 
 .IP "\fBint gpioSetMode(unsigned gpio, unsigned mode)\fP"
 .IP "" 4
-Sets the gpio mode, typically input or output.
+Sets the GPIO mode, typically input or output.
 
 .br
 
@@ -296,7 +296,7 @@ gpioSetMode(22,PI_ALT0);    // Set gpio22 to alternative mode 0.
 
 .IP "\fBint gpioGetMode(unsigned gpio)\fP"
 .IP "" 4
-Gets the gpio mode.
+Gets the GPIO mode.
 
 .br
 
@@ -311,7 +311,7 @@ gpio: 0-53
 .br
 
 .br
-Returns the gpio mode if OK, otherwise PI_BAD_GPIO.
+Returns the GPIO mode if OK, otherwise PI_BAD_GPIO.
 
 .br
 
@@ -333,7 +333,7 @@ if (gpioGetMode(17) != PI_ALT0)
 
 .IP "\fBint gpioSetPullUpDown(unsigned gpio, unsigned pud)\fP"
 .IP "" 4
-Sets or clears resistor pull ups or downs on the gpio.
+Sets or clears resistor pull ups or downs on the GPIO.
 
 .br
 
@@ -374,7 +374,7 @@ gpioSetPullUpDown(23, PI_PUD_OFF);  // Clear any pull-ups/downs.
 
 .IP "\fBint gpioRead(unsigned gpio)\fP"
 .IP "" 4
-Reads the gpio level, on or off.
+Reads the GPIO level, on or off.
 
 .br
 
@@ -389,7 +389,7 @@ gpio: 0-53
 .br
 
 .br
-Returns the gpio level if OK, otherwise PI_BAD_GPIO.
+Returns the GPIO level if OK, otherwise PI_BAD_GPIO.
 
 .br
 
@@ -403,14 +403,14 @@ Arduino style: digitalRead.
 .br
 
 .EX
-printf("gpio24 is level %d\n", gpioRead(24));
+printf("gpio24 is level %d", gpioRead(24));
 .br
 
 .EE
 
 .IP "\fBint gpioWrite(unsigned gpio, unsigned level)\fP"
 .IP "" 4
-Sets the gpio level, on or off.
+Sets the GPIO level, on or off.
 
 .br
 
@@ -432,7 +432,7 @@ Returns 0 if OK, otherwise PI_BAD_GPIO or PI_BAD_LEVEL.
 .br
 
 .br
-If PWM or servo pulses are active on the gpio they are switched off.
+If PWM or servo pulses are active on the GPIO they are switched off.
 
 .br
 
@@ -453,7 +453,7 @@ gpioWrite(24, 1); // Set gpio24 high.
 
 .IP "\fBint gpioPWM(unsigned user_gpio, unsigned dutycycle)\fP"
 .IP "" 4
-Starts PWM on the gpio, dutycycle between 0 (off) and range (fully on).
+Starts PWM on the GPIO, dutycycle between 0 (off) and range (fully on).
 Range defaults to 255.
 
 .br
@@ -512,7 +512,7 @@ gpioPWM(23, 0);   // Sets gpio23 full off.
 
 .IP "\fBint gpioGetPWMdutycycle(unsigned user_gpio)\fP"
 .IP "" 4
-Returns the PWM dutycycle setting for the gpio.
+Returns the PWM dutycycle setting for the GPIO.
 
 .br
 
@@ -534,18 +534,18 @@ PI_BAD_USER_GPIO or PI_NOT_PWM_GPIO.
 
 .br
 For normal PWM the dutycycle will be out of the defined range
-for the gpio (see \fBgpioGetPWMrange\fP).
+for the GPIO (see \fBgpioGetPWMrange\fP).
 
 .br
 
 .br
-If a hardware clock is active on the gpio the reported dutycycle
+If a hardware clock is active on the GPIO the reported dutycycle
 will be 500000 (500k) out of 1000000 (1M).
 
 .br
 
 .br
-If hardware PWM is active on the gpio the reported dutycycle
+If hardware PWM is active on the GPIO the reported dutycycle
 will be out of a 1000000 (1M).
 
 .br
@@ -555,7 +555,7 @@ Normal PWM range defaults to 255.
 
 .IP "\fBint gpioSetPWMrange(unsigned user_gpio, unsigned range)\fP"
 .IP "" 4
-Selects the dutycycle range to be used for the gpio.  Subsequent calls
+Selects the dutycycle range to be used for the GPIO.  Subsequent calls
 to gpioPWM will use a dutycycle between 0 (off) and range (fully on).
 
 .br
@@ -573,13 +573,13 @@ user_gpio: 0-31
 .br
 
 .br
-Returns the real range for the given gpio's frequency if OK,
+Returns the real range for the given GPIO's frequency if OK,
 otherwise PI_BAD_USER_GPIO or PI_BAD_DUTYRANGE.
 
 .br
 
 .br
-If PWM is currently active on the gpio its dutycycle will be scaled
+If PWM is currently active on the GPIO its dutycycle will be scaled
 to reflect the new range.
 
 .br
@@ -623,7 +623,7 @@ gpioSetPWMrange(24, 2000); // Now 2000 is fully on
 
 .IP "\fBint gpioGetPWMrange(unsigned user_gpio)\fP"
 .IP "" 4
-Returns the dutycycle range used for the gpio if OK, otherwise
+Returns the dutycycle range used for the GPIO if OK, otherwise
 PI_BAD_USER_GPIO.
 
 .br
@@ -639,7 +639,7 @@ user_gpio: 0-31
 .br
 
 .br
-If a hardware clock or hardware PWM is active on the gpio
+If a hardware clock or hardware PWM is active on the GPIO
 the reported range will be 1000000 (1M).
 
 .br
@@ -656,7 +656,7 @@ r = gpioGetPWMrange(23);
 
 .IP "\fBint gpioGetPWMrealRange(unsigned user_gpio)\fP"
 .IP "" 4
-Returns the real range used for the gpio if OK, otherwise
+Returns the real range used for the GPIO if OK, otherwise
 PI_BAD_USER_GPIO.
 
 .br
@@ -672,13 +672,13 @@ user_gpio: 0-31
 .br
 
 .br
-If a hardware clock is active on the gpio the reported real
+If a hardware clock is active on the GPIO the reported real
 range will be 1000000 (1M).
 
 .br
 
 .br
-If hardware PWM is active on the gpio the reported real range
+If hardware PWM is active on the GPIO the reported real range
 will be approximately 250M divided by the set PWM frequency.
 
 .br
@@ -695,7 +695,7 @@ rr = gpioGetPWMrealRange(17);
 
 .IP "\fBint gpioSetPWMfrequency(unsigned user_gpio, unsigned frequency)\fP"
 .IP "" 4
-Sets the frequency in hertz to be used for the gpio.
+Sets the frequency in hertz to be used for the GPIO.
 
 .br
 
@@ -724,13 +724,13 @@ may be 1, 2, 4, 5, 8, or 10 microseconds (default 5).
 .br
 
 .br
-Each gpio can be independently set to one of 18 different PWM
+Each GPIO can be independently set to one of 18 different PWM
 frequencies.
 
 .br
 
 .br
-If PWM is currently active on the gpio it will be
+If PWM is currently active on the GPIO it will be
 switched off and then back on at the new frequency.
 
 .br
@@ -808,7 +808,7 @@ gpioSetPWMfrequency(25, 100000); // Set gpio25 to highest frequency.
 
 .IP "\fBint gpioGetPWMfrequency(unsigned user_gpio)\fP"
 .IP "" 4
-Returns the frequency (in hertz) used for the gpio if OK, otherwise
+Returns the frequency (in hertz) used for the GPIO if OK, otherwise
 PI_BAD_USER_GPIO.
 
 .br
@@ -824,19 +824,19 @@ user_gpio: 0-31
 .br
 
 .br
-For normal PWM the frequency will be that defined for the gpio by
+For normal PWM the frequency will be that defined for the GPIO by
 \fBgpioSetPWMfrequency\fP.
 
 .br
 
 .br
-If a hardware clock is active on the gpio the reported frequency
+If a hardware clock is active on the GPIO the reported frequency
 will be that set by \fBgpioHardwareClock\fP.
 
 .br
 
 .br
-If hardware PWM is active on the gpio the reported frequency
+If hardware PWM is active on the GPIO the reported frequency
 will be that set by \fBgpioHardwarePWM\fP.
 
 .br
@@ -853,7 +853,7 @@ f = gpioGetPWMfrequency(23); // Get frequency used for gpio23.
 
 .IP "\fBint gpioServo(unsigned user_gpio, unsigned pulsewidth)\fP"
 .IP "" 4
-Starts servo pulses on the gpio, 0 (off), 500 (most anti-clockwise) to
+Starts servo pulses on the GPIO, 0 (off), 500 (most anti-clockwise) to
 2500 (most clockwise).
 
 .br
@@ -885,8 +885,8 @@ to move beyond its limits.
 
 .br
 The following causes an on pulse of 1500 microseconds duration to be
-transmitted on gpio 17 at a rate of 50 times per second. This will
-command a servo connected to gpio 17 to rotate to its mid-point.
+transmitted on GPIO 17 at a rate of 50 times per second. This will
+command a servo connected to GPIO 17 to rotate to its mid-point.
 
 .br
 
@@ -970,7 +970,7 @@ e.g. gpioPWM(25, 1500) will set a 1500 us pulse.
 
 .IP "\fBint gpioGetServoPulsewidth(unsigned user_gpio)\fP"
 .IP "" 4
-Returns the servo pulsewidth setting for the gpio.
+Returns the servo pulsewidth setting for the GPIO.
 
 .br
 
@@ -991,7 +991,7 @@ if OK, otherwise PI_BAD_USER_GPIO or PI_NOT_SERVO_GPIO.
 .IP "\fBint gpioSetAlertFunc(unsigned user_gpio, gpioAlertFunc_t f)\fP"
 .IP "" 4
 Registers a function to be called (a callback) when the specified
-gpio changes state.
+GPIO changes state.
 
 .br
 
@@ -1013,12 +1013,12 @@ Returns 0 if OK, otherwise PI_BAD_USER_GPIO.
 .br
 
 .br
-One function may be registered per gpio.
+One function may be registered per GPIO.
 
 .br
 
 .br
-The function is passed the gpio, the new level, and the tick.
+The function is passed the GPIO, the new level, and the tick.
 
 .br
 
@@ -1028,7 +1028,7 @@ The alert may be cancelled by passing NULL as the function.
 .br
 
 .br
-The gpios are sampled at a rate set when the library is started.
+The GPIO are sampled at a rate set when the library is started.
 
 .br
 
@@ -1097,13 +1097,13 @@ void aFunction(int gpio, int level, uint32_t tick)
 .br
 {
 .br
-   printf("gpio %d became %d at %d\n", gpio, level, tick);
+   printf("GPIO %d became %d at %d", gpio, level, tick);
 .br
 }
 .br
 
 .br
-// call aFunction whenever gpio 4 changes state
+// call aFunction whenever GPIO 4 changes state
 .br
 
 .br
@@ -1115,7 +1115,7 @@ gpioSetAlertFunc(4F, aFunction);
 .IP "\fBint gpioSetAlertFuncEx(unsigned user_gpio, gpioAlertFuncEx_t f, void *userdata)\fP"
 .IP "" 4
 Registers a function to be called (a callback) when the specified
-gpio changes state.
+GPIO changes state.
 
 .br
 
@@ -1139,19 +1139,19 @@ Returns 0 if OK, otherwise PI_BAD_USER_GPIO.
 .br
 
 .br
-One function may be registered per gpio.
+One function may be registered per GPIO.
 
 .br
 
 .br
-The function is passed the gpio, the new level, the tick, and
+The function is passed the GPIO, the new level, the tick, and
 the userdata pointer.
 
 .br
 
 .br
 Only one of \fBgpioSetAlertFunc\fP or \fBgpioSetAlertFuncEx\fP can be
-registered per gpio.
+registered per GPIO.
 
 .br
 
@@ -1161,7 +1161,7 @@ See \fBgpioSetAlertFunc\fP for further details.
 .IP "\fBint gpioSetISRFunc(unsigned user_gpio, unsigned edge, int timeout, gpioISRFunc_t f)\fP"
 .IP "" 4
 Registers a function to be called (a callback) whenever the specified
-gpio interrupt occurs.
+GPIO interrupt occurs.
 
 .br
 
@@ -1188,26 +1188,26 @@ or PI_BAD_ISR_INIT.
 .br
 
 .br
-One function may be registered per gpio.
+One function may be registered per GPIO.
 
 .br
 
 .br
-The function is passed the gpio, the current level, and the
+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.
 
 .br
 
 .br
-The underlying Linux sysfs gpio interface is used to provide
+The underlying Linux sysfs GPIO interface is used to provide
 the interrupt services.
 
 .br
 
 .br
 The first time the function is called, with a non-NULL f, the
-gpio is exported, set to be an input, and set to interrupt
+GPIO is exported, set to be an input, and set to interrupt
 on the given edge and timeout.
 
 .br
@@ -1220,7 +1220,7 @@ edge, timeout, or function.
 
 .br
 The ISR may be cancelled by passing a NULL f, in which case the
-gpio is unexported.
+GPIO is unexported.
 
 .br
 
@@ -1244,7 +1244,7 @@ interrupts only a few microseconds apart).
 .IP "\fBint gpioSetISRFuncEx(unsigned user_gpio, unsigned edge, int timeout, gpioISRFuncEx_t f, void *userdata)\fP"
 .IP "" 4
 Registers a function to be called (a callback) whenever the specified
-gpio interrupt occurs.
+GPIO interrupt occurs.
 
 .br
 
@@ -1273,14 +1273,14 @@ or PI_BAD_ISR_INIT.
 .br
 
 .br
-The function is passed the gpio, the current level, the
+The function is passed the GPIO, the current level, the
 current tick, and the userdata pointer.
 
 .br
 
 .br
 Only one of \fBgpioSetISRFunc\fP or \fBgpioSetISRFuncEx\fP can be
-registered per gpio.
+registered per GPIO.
 
 .br
 
@@ -1300,7 +1300,7 @@ otherwise PI_NO_HANDLE.
 .br
 
 .br
-A notification is a method for being notified of gpio state changes
+A notification is a method for being notified of GPIO state changes
 via a pipe or socket.
 
 .br
@@ -1395,7 +1395,7 @@ This function starts notifications on a previously opened handle.
 .EX
 handle: >=0, as returned by \fBgpioNotifyOpen\fP
 .br
-  bits: a bit mask indicating the gpios of interest
+  bits: a bit mask indicating the GPIO of interest
 .br
 
 .EE
@@ -1408,7 +1408,7 @@ Returns 0 if OK, otherwise PI_BAD_HANDLE.
 .br
 
 .br
-The notification sends state changes for each gpio whose corresponding
+The notification sends state changes for each GPIO whose corresponding
 bit in bits is set.
 
 .br
@@ -1450,7 +1450,7 @@ by one for each report.
 .br
 flags: two flags are defined, PI_NTFY_FLAGS_WDOG and PI_NTFY_FLAGS_ALIVE.
 If bit 5 is set (PI_NTFY_FLAGS_WDOG) then bits 0-4 of the flags
-indicate a gpio which has had a watchdog timeout; if bit 6 is set
+indicate a GPIO which has had a watchdog timeout; if bit 6 is set
 (PI_NTFY_FLAGS_ALIVE) this indicates a keep alive signal on the
 pipe/socket and is sent once a minute in the absence of other
 notification activity.
@@ -1464,8 +1464,8 @@ after 1h12m.
 .br
 
 .br
-level: indicates the level of each gpio.  If bit 1<<x is set then
-gpio x is high.
+level: indicates the level of each GPIO.  If bit 1<<x is set then
+GPIO x is high.
 
 .br
 
@@ -1474,7 +1474,7 @@ gpio x is high.
 .br
 
 .EX
-// Start notifications for gpios 1, 4, 6, 7, 10.
+// Start notifications for GPIO 1, 4, 6, 7, 10.
 .br
 
 .br
@@ -1641,7 +1641,7 @@ The pulses are interleaved in time order within the existing waveform
 
 .br
 Merging allows the waveform to be built in parts, that is the settings
-for gpio#1 can be added, and then gpio#2 etc.
+for GPIO#1 can be added, and then GPIO#2 etc.
 
 .br
 
@@ -1916,9 +1916,9 @@ The fields specify
 .br
 
 .br
-1) the gpios to be switched on at the start of the pulse.
+1) the GPIO to be switched on at the start of the pulse.
 .br
-2) the gpios to be switched off at the start of the pulse.
+2) the GPIO to be switched off at the start of the pulse.
 .br
 3) the delay in microseconds before the next pulse.
 
@@ -2124,7 +2124,7 @@ int main(int argc, char *argv[])
 .br
 
 .br
-   printf("start piscope, press return\n"); getchar();
+   printf("start piscope, press return"); getchar();
 .br
 
 .br
@@ -2192,7 +2192,7 @@ int main(int argc, char *argv[])
 .br
 
 .br
-   printf("stop piscope, press return\n"); getchar();
+   printf("stop piscope, press return"); getchar();
 .br
 
 .br
@@ -2203,6 +2203,23 @@ int main(int argc, char *argv[])
 
 .EE
 
+.IP "\fBint gpioWaveTxAt(void)\fP"
+.IP "" 4
+This function returns the id of the waveform currently being
+transmitted.
+
+.br
+
+.br
+Returns the waveform id or one of the following special values:
+
+.br
+
+.br
+PI_WAVE_NOT_FOUND (9998) - transmitted wave not found.
+.br
+PI_NO_TX_WAVE (9999) - no wave being transmitted.
+
 .IP "\fBint gpioWaveTxBusy(void)\fP"
 .IP "" 4
 This function checks to see if a waveform is currently being
@@ -2272,7 +2289,7 @@ control blocks.
 
 .IP "\fBint gpioSerialReadOpen(unsigned user_gpio, unsigned baud, unsigned data_bits)\fP"
 .IP "" 4
-This function opens a gpio for bit bang reading of serial data.
+This function opens a GPIO for bit bang reading of serial data.
 
 .br
 
@@ -2337,7 +2354,7 @@ PI_NOT_SERIAL_GPIO, or PI_BAD_SER_INVERT.
 .br
 
 .br
-The gpio must be opened for bit bang reading of serial data using
+The GPIO must be opened for bit bang reading of serial data using
 \fBgpioSerialReadOpen\fP prior to calling this function.
 
 .IP "\fBint gpioSerialRead(unsigned user_gpio, void *buf, size_t bufSize)\fP"
@@ -2382,7 +2399,7 @@ For \fBdata_bits\fP 17-32 there will be four bytes per character.
 
 .IP "\fBint gpioSerialReadClose(unsigned user_gpio)\fP"
 .IP "" 4
-This function closes a gpio for bit bang reading of serial data.
+This function closes a GPIO for bit bang reading of serial data.
 
 .br
 
@@ -3200,7 +3217,7 @@ End
 
 .IP "\fBint bbI2COpen(unsigned SDA, unsigned SCL, unsigned baud)\fP"
 .IP "" 4
-This function selects a pair of gpios for bit banging I2C at a
+This function selects a pair of GPIO for bit banging I2C at a
 specified baud rate.
 
 .br
@@ -3218,7 +3235,7 @@ o repeated starts
 .br
 o clock stretching
 .br
-o I2C on any pair of spare gpios
+o I2C on any pair of spare GPIO
 
 .br
 
@@ -3248,12 +3265,12 @@ NOTE:
 .br
 
 .br
-The gpios used for SDA and SCL must have pull-ups to 3V3 connected.  As
+The GPIO used for SDA and SCL must have pull-ups to 3V3 connected.  As
 a guide the hardware pull-ups on pins 3 and 5 are 1k8 in value.
 
 .IP "\fBint bbI2CClose(unsigned SDA)\fP"
 .IP "" 4
-This function stops bit banging I2C on a pair of gpios previously
+This function stops bit banging I2C on a pair of GPIO previously
 opened with \fBbbI2COpen\fP.
 
 .br
@@ -3261,7 +3278,7 @@ opened with \fBbbI2COpen\fP.
 .br
 
 .EX
-SDA: 0-31, the SDA gpio used in a prior call to \fBbbI2COpen\fP
+SDA: 0-31, the SDA GPIO used in a prior call to \fBbbI2COpen\fP
 .br
 
 .EE
@@ -3419,16 +3436,17 @@ active low chip select.
 .br
 
 .br
-An auxiliary SPI device is available on the A+/B+/Pi2/Zero and may be
-selected by setting the A bit in the flags.  The auxiliary
-device has 3 chip selects and a selectable word size in bits.
+An auxiliary SPI device is available on all models but the
+A and B and may be selected by setting the A bit in the flags.
+The auxiliary device has 3 chip selects and a selectable word
+size in bits.
 
 .br
 
 .br
 
 .EX
- spiChan: 0-1 (0-2 for A+/B+/Pi2/Zero auxiliary device)
+ spiChan: 0-1 (0-2 for the auxiliary SPI device)
 .br
     baud: 32K-125M (values above 30M are unlikely to work)
 .br
@@ -3496,13 +3514,12 @@ px is 0 if CEx is active low (default) and 1 for active high.
 .br
 
 .br
-ux is 0 if the CEx gpio is reserved for SPI (default) and 1 otherwise.
+ux is 0 if the CEx GPIO is reserved for SPI (default) and 1 otherwise.
 
 .br
 
 .br
-A is 0 for the standard SPI device, 1 for the auxiliary SPI.  The
-auxiliary device is only present on the A+/B+/Pi2/Zero.
+A is 0 for the standard SPI device, 1 for the auxiliary SPI.
 
 .br
 
@@ -3539,6 +3556,28 @@ sets 8 bits per word.  Auxiliary SPI device only.
 
 .br
 
+.br
+The \fBspiRead\fP, \fBspiWrite\fP, and \fBspiXfer\fP functions
+transfer data packed into 1, 2, or 4 bytes according to
+the word size in bits.
+
+.br
+
+.br
+For bits 1-8 there will be one byte per character.
+.br
+For bits 9-16 there will be two bytes per character.
+.br
+For bits 17-32 there will be four bytes per character.
+
+.br
+
+.br
+E.g. to transfer 32 12-bit words buf should contain 64 bytes
+and count should be 64.
+
+.br
+
 .br
 The other bits in flags should be set to zero.
 
@@ -3808,7 +3847,7 @@ otherwise PI_BAD_HANDLE.
 
 .IP "\fBint gpioTrigger(unsigned user_gpio, unsigned pulseLen, unsigned level)\fP"
 .IP "" 4
-This function sends a trigger pulse to a gpio.  The gpio is set to
+This function sends a trigger pulse to a GPIO.  The GPIO is set to
 level for pulseLen microseconds and then reset to not level.
 
 .br
@@ -3833,7 +3872,7 @@ or PI_BAD_PULSELEN.
 
 .IP "\fBint gpioSetWatchdog(unsigned user_gpio, unsigned timeout)\fP"
 .IP "" 4
-Sets a watchdog for a gpio.
+Sets a watchdog for a GPIO.
 
 .br
 
@@ -3860,7 +3899,7 @@ The watchdog is nominally in milliseconds.
 .br
 
 .br
-One watchdog may be registered per gpio.
+One watchdog may be registered per GPIO.
 
 .br
 
@@ -3870,16 +3909,16 @@ The watchdog may be cancelled by setting timeout to 0.
 .br
 
 .br
-If no level change has been detected for the gpio for timeout
+If no level change has been detected for the GPIO for timeout
 milliseconds:-
 
 .br
 
 .br
-1) any registered alert function for the gpio is called with
+1) any registered alert function for the GPIO is called with
    the level set to PI_TIMEOUT.
 .br
-2) any notification for the gpio has a report written to the
+2) any notification for the GPIO has a report written to the
    fifo with the flags set to indicate a watchdog timeout.
 
 .br
@@ -3893,13 +3932,13 @@ void aFunction(int gpio, int level, uint32_t tick)
 .br
 {
 .br
-   printf("gpio %d became %d at %d\n", gpio, level, tick);
+   printf("GPIO %d became %d at %d", gpio, level, tick);
 .br
 }
 .br
 
 .br
-// call aFunction whenever gpio 4 changes state
+// call aFunction whenever GPIO 4 changes state
 .br
 gpioSetAlertFunc(4, aFunction);
 .br
@@ -3914,14 +3953,14 @@ gpioSetWatchdog(4, 5);
 
 .IP "\fBint gpioNoiseFilter(unsigned user_gpio, unsigned steady, unsigned active)\fP"
 .IP "" 4
-Sets a noise filter on a gpio.
+Sets a noise filter on a GPIO.
 
 .br
 
 .br
-Level changes on the gpio are ignored until a level which has
+Level changes on the GPIO are ignored until a level which has
 been stable for \fBsteady\fP microseconds is detected.  Level changes
-on the gpio are then reported for \fBactive\fP microseconds after
+on the GPIO are then reported for \fBactive\fP microseconds after
 which the process repeats.
 
 .br
@@ -3952,12 +3991,12 @@ such reports.
 
 .IP "\fBint gpioGlitchFilter(unsigned user_gpio, unsigned steady)\fP"
 .IP "" 4
-Sets a glitch filter on a gpio.
+Sets a glitch filter on a GPIO.
 
 .br
 
 .br
-Level changes on the gpio are not reported unless the level
+Level changes on the GPIO are not reported unless the level
 has been stable for at least \fBsteady\fP microseconds.  The
 level is then reported.  Level changes of less than \fBsteady\fP
 microseconds are ignored.
@@ -3988,7 +4027,7 @@ after it was first detected.
 .IP "\fBint gpioSetGetSamplesFunc(gpioGetSamplesFunc_t f, uint32_t bits)\fP"
 .IP "" 4
 Registers a function to be called (a callback) every millisecond
-with the latest gpio samples.
+with the latest GPIO samples.
 
 .br
 
@@ -3997,7 +4036,7 @@ with the latest gpio samples.
 .EX
    f: the function to call
 .br
-bits: the gpios of interest
+bits: the GPIO of interest
 .br
 
 .EE
@@ -4032,14 +4071,14 @@ plus any active notifications.
 .br
 
 .br
-e.g.  if there are alerts for gpios 7, 8, and 9, notifications for gpios
-8, 10, 23, 24, and bits is (1<<23)|(1<<17) then samples for gpios
+e.g.  if there are alerts for GPIO 7, 8, and 9, notifications for GPIO
+8, 10, 23, 24, and bits is (1<<23)|(1<<17) then samples for GPIO
 7, 8, 9, 10, 17, 23, and 24 will be reported.
 
 .IP "\fBint gpioSetGetSamplesFuncEx(gpioGetSamplesFuncEx_t f, uint32_t bits, void *userdata)\fP"
 .IP "" 4
 Registers a function to be called (a callback) every millisecond
-with the latest gpio samples.
+with the latest GPIO samples.
 
 .br
 
@@ -4048,7 +4087,7 @@ with the latest gpio samples.
 .EX
        f: the function to call
 .br
-    bits: the gpios of interest
+    bits: the GPIO of interest
 .br
 userdata: a pointer to arbitrary user data
 .br
@@ -4126,7 +4165,7 @@ void bFunction(void)
 .br
 {
 .br
-   printf("two seconds have elapsed\n");
+   printf("two seconds have elapsed");
 .br
 }
 .br
@@ -4233,7 +4272,7 @@ void *myfunc(void *arg)
 .br
    {
 .br
-      printf("%s\n", arg);
+      printf("%s", arg);
 .br
       sleep(1);
 .br
@@ -4532,22 +4571,22 @@ See gpioSetSignalFunc for further details.
 
 .IP "\fBuint32_t gpioRead_Bits_0_31(void)\fP"
 .IP "" 4
-Returns the current level of gpios 0-31.
+Returns the current level of GPIO 0-31.
 
 .IP "\fBuint32_t gpioRead_Bits_32_53(void)\fP"
 .IP "" 4
-Returns the current level of gpios 32-53.
+Returns the current level of GPIO 32-53.
 
 .IP "\fBint gpioWrite_Bits_0_31_Clear(uint32_t bits)\fP"
 .IP "" 4
-Clears gpios 0-31 if the corresponding bit in bits is set.
+Clears GPIO 0-31 if the corresponding bit in bits is set.
 
 .br
 
 .br
 
 .EX
-bits: a bit mask of gpios to clear
+bits: a bit mask of GPIO to clear
 .br
 
 .EE
@@ -4564,7 +4603,7 @@ Returns 0 if OK.
 .br
 
 .EX
-// To clear (set to 0) gpios 4, 7, and 15
+// To clear (set to 0) GPIO 4, 7, and 15
 .br
 gpioWrite_Bits_0_31_Clear( (1<<4) | (1<<7) | (1<<15) );
 .br
@@ -4573,14 +4612,14 @@ gpioWrite_Bits_0_31_Clear( (1<<4) | (1<<7) | (1<<15) );
 
 .IP "\fBint gpioWrite_Bits_32_53_Clear(uint32_t bits)\fP"
 .IP "" 4
-Clears gpios 32-53 if the corresponding bit (0-21) in bits is set.
+Clears GPIO 32-53 if the corresponding bit (0-21) in bits is set.
 
 .br
 
 .br
 
 .EX
-bits: a bit mask of gpios to clear
+bits: a bit mask of GPIO to clear
 .br
 
 .EE
@@ -4592,14 +4631,14 @@ Returns 0 if OK.
 
 .IP "\fBint gpioWrite_Bits_0_31_Set(uint32_t bits)\fP"
 .IP "" 4
-Sets gpios 0-31 if the corresponding bit in bits is set.
+Sets GPIO 0-31 if the corresponding bit in bits is set.
 
 .br
 
 .br
 
 .EX
-bits: a bit mask of gpios to set
+bits: a bit mask of GPIO to set
 .br
 
 .EE
@@ -4611,14 +4650,14 @@ Returns 0 if OK.
 
 .IP "\fBint gpioWrite_Bits_32_53_Set(uint32_t bits)\fP"
 .IP "" 4
-Sets gpios 32-53 if the corresponding bit (0-21) in bits is set.
+Sets GPIO 32-53 if the corresponding bit (0-21) in bits is set.
 
 .br
 
 .br
 
 .EX
-bits: a bit mask of gpios to set
+bits: a bit mask of GPIO to set
 .br
 
 .EE
@@ -4635,7 +4674,7 @@ Returns 0 if OK.
 .br
 
 .EX
-// To set (set to 1) gpios 32, 40, and 53
+// To set (set to 1) GPIO 32, 40, and 53
 .br
 gpioWrite_Bits_32_53_Set((1<<(32-32)) | (1<<(40-32)) | (1<<(53-32)));
 .br
@@ -4644,7 +4683,7 @@ gpioWrite_Bits_32_53_Set((1<<(32-32)) | (1<<(40-32)) | (1<<(53-32)));
 
 .IP "\fBint gpioHardwareClock(unsigned gpio, unsigned clkfreq)\fP"
 .IP "" 4
-Starts a hardware clock on a gpio at the specified frequency.
+Starts a hardware clock on a GPIO at the specified frequency.
 Frequencies above 30MHz are unlikely to work.
 
 .br
@@ -4668,13 +4707,13 @@ PI_BAD_HCLK_FREQ,or PI_BAD_HCLK_PASS.
 .br
 
 .br
-The same clock is available on multiple gpios.  The latest
-frequency setting will be used by all gpios which share a clock.
+The same clock is available on multiple GPIO.  The latest
+frequency setting will be used by all GPIO which share a clock.
 
 .br
 
 .br
-The gpio must be one of the following.
+The GPIO must be one of the following.
 
 .br
 
@@ -4683,13 +4722,13 @@ The gpio must be one of the following.
 .EX
 4   clock 0  All models
 .br
-5   clock 1  A+/B+/Pi2/Zero and compute module only (reserved for system use)
+5   clock 1  All models but A and B (reserved for system use)
 .br
-6   clock 2  A+/B+/Pi2/Zero and compute module only
+6   clock 2  All models but A and B
 .br
-20  clock 0  A+/B+/Pi2/Zero and compute module only
+20  clock 0  All models but A and B
 .br
-21  clock 1  All models but Rev.2 B (reserved for system use)
+21  clock 1  All models but A and Rev.2 B (reserved for system use)
 .br
 
 .br
@@ -4711,11 +4750,11 @@ The gpio must be one of the following.
 .br
 Access to clock 1 is protected by a password as its use will likely
 crash the Pi.  The password is given by or'ing 0x5A000000 with the
-gpio number.
+GPIO number.
 
 .IP "\fBint gpioHardwarePWM(unsigned gpio, unsigned PWMfreq, unsigned PWMduty)\fP"
 .IP "" 4
-Starts hardware PWM on a gpio at the specified frequency and dutycycle.
+Starts hardware PWM on a GPIO at the specified frequency and dutycycle.
 Frequencies above 30MHz are unlikely to work.
 
 .br
@@ -4754,27 +4793,27 @@ PI_BAD_HPWM_DUTY, PI_BAD_HPWM_FREQ, or PI_HPWM_ILLEGAL.
 .br
 
 .br
-The same PWM channel is available on multiple gpios.  The latest
-frequency and dutycycle setting will be used by all gpios which
+The same PWM channel is available on multiple GPIO.  The latest
+frequency and dutycycle setting will be used by all GPIO which
 share a PWM channel.
 
 .br
 
 .br
-The gpio must be one of the following.
+The GPIO must be one of the following.
 
 .br
 
 .br
 
 .EX
-12  PWM channel 0  A+/B+/Pi2/Zero and compute module only
+12  PWM channel 0  All models but A and B
 .br
-13  PWM channel 1  A+/B+/Pi2/Zero and compute module only
+13  PWM channel 1  All models but A and B
 .br
 18  PWM channel 0  All models
 .br
-19  PWM channel 1  A+/B+/Pi2/Zero and compute module only
+19  PWM channel 1  All models but A and B
 .br
 
 .br
@@ -4860,7 +4899,7 @@ int secs, mics;
 .br
 gpioTime(PI_TIME_RELATIVE, &secs, &mics);
 .br
-printf("library started %d.%03d seconds ago\n", secs, mics/1000);
+printf("library started %d.%03d seconds ago", secs, mics/1000);
 .br
 
 .EE
@@ -5004,7 +5043,7 @@ diffTick = endTick - startTick;
 .br
 
 .br
-printf("some processing took %d microseconds\n", diffTick);
+printf("some processing took %d microseconds", diffTick);
 .br
 
 .EE
@@ -5028,7 +5067,7 @@ The hardware revision is the last few characters on the Revision line of
 .br
 
 .br
-The revision number can be used to determine the assignment of gpios
+The revision number can be used to determine the assignment of GPIO
 to pins (see \fBgpio\fP).
 
 .br
@@ -5066,7 +5105,7 @@ Returns the pigpio version.
 
 .IP "\fBint gpioCfgBufferSize(unsigned cfgMillis)\fP"
 .IP "" 4
-Configures pigpio to buffer cfgMillis milliseconds of gpio samples.
+Configures pigpio to buffer cfgMillis milliseconds of GPIO samples.
 
 .br
 
@@ -5235,14 +5274,14 @@ channel 5 for the secondary channel.
 .IP "\fBint gpioCfgPermissions(uint64_t updateMask)\fP"
 .IP "" 4
 Configures pigpio to only allow updates (writes or mode changes) for the
-gpios specified by the mask.
+GPIO specified by the mask.
 
 .br
 
 .br
 
 .EX
-updateMask: bit (1<<n) is set for each gpio n which may be updated
+updateMask: bit (1<<n) is set for each GPIO n which may be updated
 .br
 
 .EE
@@ -5251,8 +5290,8 @@ updateMask: bit (1<<n) is set for each gpio n which may be updated
 
 .br
 The default setting depends upon the board revision (Type 1, 2, or 3).
-The user gpios are added to the mask.  If the board revision is not
-recognised then gpios 0-31 are allowed.
+The user GPIO are added to the mask.  If the board revision is not
+recognised then GPIO 0-31 are allowed.
 
 .br
 
@@ -5473,7 +5512,7 @@ existing waveform (if any).
 .br
      offset: microseconds from the start of the waveform
 .br
-      spiSS: the slave select gpio
+      spiSS: the slave select GPIO
 .br
         buf: the bits to transmit, most significant bit first
 .br
@@ -5537,7 +5576,7 @@ The pulses are interleaved in time order within the existing waveform
 
 .br
 Merging allows the waveform to be built in parts, that is the settings
-for gpio#1 can be added, and then gpio#2 etc.
+for GPIO#1 can be added, and then GPIO#2 etc.
 
 .br
 
@@ -5849,7 +5888,7 @@ position 0.
 .br
 
 .IP "\fBbits\fP" 0
-A value used to select gpios.  If bit n of bits is set then gpio n is
+A value used to select GPIO.  If bit n of bits is set then GPIO n is
 selected.
 
 .br
@@ -5915,7 +5954,7 @@ A number identifying a DMA contol block.
 .br
 
 .br
-The gpio sample rate in microseconds.  The default is 5us, or 200 thousand
+The GPIO sample rate in microseconds.  The default is 5us, or 200 thousand
 samples per second.
 
 .br
@@ -6100,7 +6139,7 @@ The number may vary between 0 and range (default 255) where
 .br
 
 .IP "\fBedge\fP: 0-2" 0
-The type of gpio edge to generate an intrrupt.  See\fBgpioSetISRFunc\fP,
+The type of GPIO edge to generate an intrrupt.  See\fBgpioSetISRFunc\fP,
 and \fBgpioSetISRFuncEx\fP.
 
 .br
@@ -6137,9 +6176,9 @@ A function.
 .br
 
 .br
-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
+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
 by its dutycycle.
 
 .br
@@ -6151,12 +6190,12 @@ by its dutycycle.
 .br
 
 .br
-A Broadcom numbered gpio, in the range 0-53.
+A Broadcom numbered GPIO, in the range 0-53.
 
 .br
 
 .br
-There  are 54 General Purpose Input Outputs (gpios) named gpio0 through
+There  are 54 General Purpose Input Outputs (GPIO) named gpio0 through
 gpio53.
 
 .br
@@ -6168,9 +6207,9 @@ gpio31.  Bank 2 consists of gpio32 through gpio53.
 .br
 
 .br
-All the gpios which are safe for the user to read and write are in
-bank 1.  Not all gpios in bank 1 are safe though.  Type 1 boards
-have 17  safe gpios.  Type 2 boards have 21.  Type 3 boards have 26.
+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
+have 17  safe GPIO.  Type 2 boards have 21.  Type 3 boards have 26.
 
 .br
 
@@ -6180,7 +6219,7 @@ See \fBgpioHardwareRevision\fP.
 .br
 
 .br
-The user gpios are marked with an X in the following table.
+The user GPIO are marked with an X in the following table.
 
 .br
 
@@ -6553,7 +6592,7 @@ A flag used to set normal or inverted bit bang serial data level logic.
 .br
 
 .IP "\fBlevel\fP" 0
-The level of a gpio.  Low or High.
+The level of a GPIO.  Low or High.
 
 .br
 
@@ -6582,7 +6621,7 @@ PI_HIGH 1
 .br
 
 .br
-There is one exception.  If a watchdog expires on a gpio the level will be
+There is one exception.  If a watchdog expires on a GPIO the level will be
 reported as PI_TIMEOUT.  See \fBgpioSetWatchdog\fP.
 
 .br
@@ -6677,7 +6716,7 @@ A value representing milliseconds.
 .br
 
 .br
-The operational mode of a gpio, normally INPUT or OUTPUT.
+The operational mode of a GPIO, normally INPUT or OUTPUT.
 
 .br
 
@@ -6816,7 +6855,7 @@ The position of an item.
 .br
 
 .IP "\fBprimaryChannel\fP: 0-14" 0
-The DMA channel used to time the sampling of gpios and to time servo and
+The DMA channel used to time the sampling of GPIO and to time servo and
 PWM pulses.
 
 .br
@@ -6850,7 +6889,7 @@ A thread identifier.
 .br
 
 .br
-The setting of the pull up/down resistor for a gpio, which may be off,
+The setting of the pull up/down resistor for a GPIO, which may be off,
 pull-up, or pull-down.
 
 .EX
@@ -6992,11 +7031,11 @@ typedef struct
 .br
 {
 .br
-   int clk;     // gpio for clock
+   int clk;     // GPIO for clock
 .br
-   int mosi;    // gpio for MOSI
+   int mosi;    // GPIO for MOSI
 .br
-   int miso;    // gpio for MISO
+   int miso;    // GPIO for MISO
 .br
    int ss_pol;  // slave select off state
 .br
@@ -7055,6 +7094,14 @@ typedef struct
    uint16_t botOOL; // last OOL used by wave
 .br
    uint16_t topOOL; // first OOL used by wave
+.br
+   uint16_t deleted;
+.br
+   uint16_t numCB;
+.br
+   uint16_t numBOOL;
+.br
+   uint16_t numTOOL;
 .br
 } rawWaveInfo_t;
 .br
@@ -7103,7 +7150,7 @@ A pointer to a buffer to receive data.
 .br
 
 .br
-The user gpio to use for the clock when bit banging I2C.
+The user GPIO to use for the clock when bit banging I2C.
 
 .br
 
@@ -7136,7 +7183,7 @@ An id of a stored script as returned by \fBgpioStoreScript\fP.
 .br
 
 .br
-The user gpio to use for data when bit banging I2C.
+The user GPIO to use for data when bit banging I2C.
 
 .br
 
@@ -7241,7 +7288,7 @@ A pointer to a \fBrawSPI_t\fP structure.
 .br
 
 .IP "\fBspiBitFirst\fP" 0
-Gpio reads are made from spiBitFirst to spiBitLast.
+GPIO reads are made from spiBitFirst to spiBitLast.
 
 .br
 
@@ -7252,7 +7299,7 @@ Gpio reads are made from spiBitFirst to spiBitLast.
 .br
 
 .br
-Gpio reads are made from spiBitFirst to spiBitLast.
+GPIO reads are made from spiBitFirst to spiBitLast.
 
 .br
 
@@ -7280,7 +7327,7 @@ See \fBspiOpen\fP.
 .br
 
 .IP "\fBspiSS\fP" 0
-The SPI slave select gpio in a raw SPI transaction.
+The SPI slave select GPIO in a raw SPI transaction.
 
 .br
 
@@ -7334,7 +7381,7 @@ An array of characters.
 .br
 
 .IP "\fBtimeout\fP" 0
-A gpio level change timeout in milliseconds.
+A GPIO level change timeout in milliseconds.
 
 .br
 
@@ -7443,12 +7490,12 @@ A whole number >= 0.
 .br
 
 .br
-A 64 bit mask indicating which gpios may be written to by the user.
+A 64 bit mask indicating which GPIO may be written to by the user.
 
 .br
 
 .br
-If gpio#n may be written then bit (1<<n) is set.
+If GPIO#n may be written then bit (1<<n) is set.
 
 .br
 
@@ -7459,7 +7506,7 @@ If gpio#n may be written then bit (1<<n) is set.
 .br
 
 .br
-0-31, a Broadcom numbered gpio.
+0-31, a Broadcom numbered GPIO.
 
 .br
 
@@ -7820,6 +7867,8 @@ A 16-bit word value.
 .br
 #define PI_CMD_WVTXM 100
 .br
+#define PI_CMD_WVTAT 101
+.br
 
 .br
 
@@ -7831,9 +7880,9 @@ A 16-bit word value.
 .br
 #define PI_INIT_FAILED       -1 // gpioInitialise failed
 .br
-#define PI_BAD_USER_GPIO     -2 // gpio not 0-31
+#define PI_BAD_USER_GPIO     -2 // GPIO not 0-31
 .br
-#define PI_BAD_GPIO          -3 // gpio not 0-53
+#define PI_BAD_GPIO          -3 // GPIO not 0-53
 .br
 #define PI_BAD_MODE          -4 // mode not 0-7
 .br
@@ -7907,15 +7956,15 @@ A 16-bit word value.
 .br
 #define PI_TOO_MANY_CHARS   -37 // waveform has too many chars
 .br
-#define PI_NOT_SERIAL_GPIO  -38 // no bit bang serial read in progress on gpio
+#define PI_NOT_SERIAL_GPIO  -38 // no bit bang serial read in progress on GPIO
 .br
 #define PI_BAD_SERIAL_STRUC -39 // bad (null) serial structure parameter
 .br
 #define PI_BAD_SERIAL_BUF   -40 // bad (null) serial buf parameter
 .br
-#define PI_NOT_PERMITTED    -41 // gpio operation not permitted
+#define PI_NOT_PERMITTED    -41 // GPIO operation not permitted
 .br
-#define PI_SOME_PERMITTED   -42 // one or more gpios not permitted
+#define PI_SOME_PERMITTED   -42 // one or more GPIO not permitted
 .br
 #define PI_BAD_WVSC_COMMND  -43 // bad WVSC subcommand
 .br
@@ -7931,7 +7980,7 @@ A 16-bit word value.
 .br
 #define PI_BAD_SER_OFFSET   -49 // add serial data offset > 30 minutes
 .br
-#define PI_GPIO_IN_USE      -50 // gpio already in use
+#define PI_GPIO_IN_USE      -50 // GPIO already in use
 .br
 #define PI_BAD_SERIAL_COUNT -51 // must read at least a byte at a time
 .br
@@ -8013,15 +8062,15 @@ A 16-bit word value.
 .br
 #define PI_BAD_POINTER      -90 // bad (NULL) pointer
 .br
-#define PI_NO_AUX_SPI       -91 // need a A+/B+/Pi2/Zero for auxiliary SPI
+#define PI_NO_AUX_SPI       -91 // no auxiliary SPI on Pi A or B
 .br
-#define PI_NOT_PWM_GPIO     -92 // gpio is not in use for PWM
+#define PI_NOT_PWM_GPIO     -92 // GPIO is not in use for PWM
 .br
-#define PI_NOT_SERVO_GPIO   -93 // gpio is not in use for servo pulses
+#define PI_NOT_SERVO_GPIO   -93 // GPIO is not in use for servo pulses
 .br
-#define PI_NOT_HCLK_GPIO    -94 // gpio has no hardware clock
+#define PI_NOT_HCLK_GPIO    -94 // GPIO has no hardware clock
 .br
-#define PI_NOT_HPWM_GPIO    -95 // gpio has no hardware PWM
+#define PI_NOT_HPWM_GPIO    -95 // GPIO has no hardware PWM
 .br
 #define PI_BAD_HPWM_FREQ    -96 // hardware PWM frequency not 1-125M
 .br
@@ -8047,7 +8096,7 @@ A 16-bit word value.
 .br
 #define PI_BAD_SMBUS_CMD   -107 // SMBus command not supported by driver
 .br
-#define PI_NOT_I2C_GPIO    -108 // no bit bang I2C in progress on gpio
+#define PI_NOT_I2C_GPIO    -108 // no bit bang I2C in progress on GPIO
 .br
 #define PI_BAD_I2C_WLEN    -109 // bad I2C write length
 .br
index f8a038f7192ec66ee1bc130f419c6ef2adef76d5..039ccc5f1f2dce6951105b226a0dec9e2b6c25d3 100644 (file)
--- a/pigpio.c
+++ b/pigpio.c
@@ -25,7 +25,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 For more information, please refer to <http://unlicense.org/>
 */
 
-/* pigpio version 46 */
+/* pigpio version 47 */
 
 /* include ------------------------------------------------------- */
 
@@ -2181,6 +2181,8 @@ static int myDoCommand(uint32_t *p, unsigned bufSize, char *buf)
          }
          break;
 
+      case PI_CMD_WVTAT: res = gpioWaveTxAt(); break;
+
       case PI_CMD_WVTX:
          res = gpioWaveTxSend(p[1], PI_WAVE_MODE_ONE_SHOT); break;
 
@@ -4789,6 +4791,53 @@ static unsigned dmaNowAtICB(void)
 
 /* ----------------------------------------------------------------------- */
 
+static int dmaNowAtOCB(void)
+{
+   unsigned cb;
+   unsigned page;
+   uint32_t cbAddr;
+
+   cbAddr = dmaOut[DMA_CONBLK_AD];
+
+   if (!cbAddr) return -PI_NO_TX_WAVE;
+
+   page = 0;
+
+   /* which page are we dma'ing? */
+
+   while (1)
+   {
+      cb = (cbAddr - ((int)dmaOBus[page])) / 32;
+
+      if (cb < CBS_PER_OPAGE) return (page*CBS_PER_OPAGE) + cb;
+
+      if (page++ >= DMAO_PAGES) break;
+   }
+
+   /* Try twice */
+
+   cbAddr = dmaOut[DMA_CONBLK_AD];
+
+   if (!cbAddr) return -PI_NO_TX_WAVE;
+
+   page = 0;
+
+   /* which page are we dma'ing? */
+
+   while (1)
+   {
+      cb = (cbAddr - ((int)dmaOBus[page])) / 32;
+
+      if (cb < CBS_PER_OPAGE) return (page*CBS_PER_OPAGE) + cb;
+
+      if (page++ >= DMAO_PAGES) break;
+   }
+
+   return -PI_WAVE_NOT_FOUND;
+}
+
+/* ----------------------------------------------------------------------- */
+
 unsigned rawWaveCB(void)
 {
    unsigned cb;
@@ -8560,7 +8609,7 @@ int rawWaveAddSPI(
    unsigned spiBitLast,
    unsigned spiBits)
 {
-   int p, dbv, bit, halfbit;
+   int p, bit, dbv, halfbit;
    int rising_edge[2], read_cycle[2];
    uint32_t on_bits, off_bits;
    int tx_bit_pos;
@@ -8600,27 +8649,32 @@ int rawWaveAddSPI(
       p++;
    }
 
-   /* preset initial mosi bit in case it's read at leading clock bit */
-
    on_bits = 0;
    off_bits = 0;
 
    tx_bit_pos = 0;
 
+   /* preset initial mosi bit */
+
    if (getBitInBytes(tx_bit_pos, buf, spiTxBits))
    {
-      dbv = 1;
       on_bits  |= (1<<(spi->mosi));
+      dbv = 1;
    }
    else
    {
+      off_bits |= (1<<(spi->mosi));
       dbv = 0;
-      off_bits  |= (1<<(spi->mosi));
    }
 
+   if (!spi->clk_pha) tx_bit_pos ++;
+
    if (spi->ss_pol) off_bits |= (1<<spiSS);
    else             on_bits  |= (1<<spiSS);
 
+   if (spi->clk_pol) on_bits  |= (1<<(spi->clk));
+   else              off_bits |= (1<<(spi->clk));
+
    wf[2][p].gpioOn  = on_bits;
    wf[2][p].gpioOff = off_bits;
    wf[2][p].flags   = 0;
@@ -8649,7 +8703,7 @@ int rawWaveAddSPI(
          {
             if (getBitInBytes(tx_bit_pos, buf, spiTxBits))
             {
-               if (!dbv) on_bits |= (1<<(spi->mosi));
+               if (!dbv) on_bits  |= (1<<(spi->mosi));
                dbv = 1;
             }
             else
@@ -9345,6 +9399,30 @@ int gpioWaveTxBusy(void)
       return 0;
 }
 
+/*-------------------------------------------------------------------------*/
+
+int gpioWaveTxAt(void)
+{
+   int i, cb;
+
+   DBG(DBG_USER, "");
+
+   CHECK_INITED;
+
+   cb = dmaNowAtOCB();
+
+   if (cb < 0) return -cb;
+
+   for (i=0; i<PI_MAX_WAVES; i++)
+   {
+      if ( !waveInfo[i].deleted &&
+          (cb >= waveInfo[i].botCB) &&
+          (cb <= waveInfo[i].topCB) ) return i;
+   }
+
+   return PI_WAVE_NOT_FOUND;
+}
+
 /* ----------------------------------------------------------------------- */
 
 int gpioWaveTxStop(void)
index 3be23d4c2258598fd408b79770abcf8755c369e8..b7594885c24317bf150e6ba4d7fb0e920cdb9d36 100644 (file)
--- a/pigpio.h
+++ b/pigpio.h
@@ -31,31 +31,31 @@ For more information, please refer to <http://unlicense.org/>
 #include <stdint.h>
 #include <pthread.h>
 
-#define PIGPIO_VERSION 46
+#define PIGPIO_VERSION 47
 
 /*TEXT
 
-pigpio is a C library for the Raspberry which allows control of the gpios.
+pigpio is a C library for the Raspberry which allows control of the GPIO.
 
 *Features*
 
-o PWM on any of gpios 0-31
+o PWM on any of GPIO 0-31
 
-o servo pulses on any of gpios 0-31
+o servo pulses on any of GPIO 0-31
 
-o callbacks when any of gpios 0-31 change state
+o callbacks when any of GPIO 0-31 change state
 
 o callbacks at timed intervals
 
-o reading/writing all of the gpios in a bank as one operation
+o reading/writing all of the GPIO in a bank as one operation
 
-o individually setting gpio modes, reading and writing
+o individually setting GPIO modes, reading and writing
 
-o notifications when any of gpios 0-31 change state
+o notifications when any of GPIO 0-31 change state
 
 o the construction of output waveforms with microsecond timing
 
-o rudimentary permission control over gpios
+o rudimentary permission control over GPIO
 
 o a simple interface to start and stop new threads
 
@@ -63,9 +63,9 @@ o I2C, SPI, and serial link wrappers
 
 o creating and running scripts
 
-*gpios*
+*GPIO*
 
-ALL gpios are identified by their Broadcom number.
+ALL GPIO are identified by their Broadcom number.
 
 *Credits*
 
@@ -110,83 +110,83 @@ gpioTerminate              Stop library
 
 BEGINNER
 
-gpioSetMode                Set a gpio mode
-gpioGetMode                Get a gpio mode
+gpioSetMode                Set a GPIO mode
+gpioGetMode                Get a GPIO mode
 
-gpioSetPullUpDown          Set/clear gpio pull up/down resistor
+gpioSetPullUpDown          Set/clear GPIO pull up/down resistor
 
-gpioRead                   Read a gpio
-gpioWrite                  Write a gpio
+gpioRead                   Read a GPIO
+gpioWrite                  Write a GPIO
 
-gpioPWM                    Start/stop PWM pulses on a gpio
-gpioGetPWMdutycycle        Get dutycycle setting on a gpio
+gpioPWM                    Start/stop PWM pulses on a GPIO
+gpioGetPWMdutycycle        Get dutycycle setting on a GPIO
 
-gpioServo                  Start/stop servo pulses on a gpio
-gpioGetServoPulsewidth     Get pulsewidth setting on a gpio
+gpioServo                  Start/stop servo pulses on a GPIO
+gpioGetServoPulsewidth     Get pulsewidth setting on a GPIO
 
 gpioDelay                  Delay for a number of microseconds
 
-gpioSetAlertFunc           Request a gpio level change callback
+gpioSetAlertFunc           Request a GPIO level change callback
 
 gpioSetTimerFunc           Request a regular timed callback
 
 INTERMEDIATE
 
-gpioTrigger                Send a trigger pulse to a gpio.
+gpioTrigger                Send a trigger pulse to a GPIO.
 
-gpioSetWatchdog            Set a watchdog on a gpio.
+gpioSetWatchdog            Set a watchdog on a GPIO.
 
-gpioSetPWMrange            Configure PWM range for a gpio
-gpioGetPWMrange            Get configured PWM range for a gpio
+gpioSetPWMrange            Configure PWM range for a GPIO
+gpioGetPWMrange            Get configured PWM range for a GPIO
 
-gpioSetPWMfrequency        Configure PWM frequency for a gpio
-gpioGetPWMfrequency        Get configured PWM frequency for a gpio
+gpioSetPWMfrequency        Configure PWM frequency for a GPIO
+gpioGetPWMfrequency        Get configured PWM frequency for a GPIO
 
-gpioRead_Bits_0_31         Read all gpios in bank 1
-gpioRead_Bits_32_53        Read all gpios in bank 2
+gpioRead_Bits_0_31         Read all GPIO in bank 1
+gpioRead_Bits_32_53        Read all GPIO in bank 2
 
-gpioWrite_Bits_0_31_Clear  Clear selected gpios in bank 1
-gpioWrite_Bits_32_53_Clear Clear selected gpios in bank 2
+gpioWrite_Bits_0_31_Clear  Clear selected GPIO in bank 1
+gpioWrite_Bits_32_53_Clear Clear selected GPIO in bank 2
 
-gpioWrite_Bits_0_31_Set    Set selected gpios in bank 1
-gpioWrite_Bits_32_53_Set   Set selected gpios in bank 2
+gpioWrite_Bits_0_31_Set    Set selected GPIO in bank 1
+gpioWrite_Bits_32_53_Set   Set selected GPIO in bank 2
 
 gpioStartThread            Start a new thread
 gpioStopThread             Stop a previously started thread
 
 ADVANCED
 
-gpioGetPWMrealRange        Get underlying PWM range for a gpio
+gpioGetPWMrealRange        Get underlying PWM range for a GPIO
 
-gpioSetAlertFuncEx         Request a gpio change callback, extended
+gpioSetAlertFuncEx         Request a GPIO change callback, extended
 
-gpioSetISRFunc             Request a gpio interrupt callback
-gpioSetISRFuncEx           Request a gpio interrupt callback, extended
+gpioSetISRFunc             Request a GPIO interrupt callback
+gpioSetISRFuncEx           Request a GPIO interrupt callback, extended
 
 gpioSetSignalFunc          Request a signal callback
 gpioSetSignalFuncEx        Request a signal callback, extended
 
-gpioSetGetSamplesFunc      Requests a gpio samples callback
-gpioSetGetSamplesFuncEx    Requests a gpio samples callback, extended
+gpioSetGetSamplesFunc      Requests a GPIO samples callback
+gpioSetGetSamplesFuncEx    Requests a GPIO samples callback, extended
 
 gpioSetTimerFuncEx         Request a regular timed callback, extended
 
 gpioNotifyOpen             Request a notification handle
 gpioNotifyOpenWithSize     Request a notification handle with sized pipe
-gpioNotifyBegin            Start notifications for selected gpios
+gpioNotifyBegin            Start notifications for selected GPIO
 gpioNotifyPause            Pause notifications
 gpioNotifyClose            Close a notification
 
-gpioSerialReadOpen         Opens a gpio for bit bang serial reads
+gpioSerialReadOpen         Opens a GPIO for bit bang serial reads
 gpioSerialReadInvert       Configures normal/inverted for serial reads
-gpioSerialRead             Reads bit bang serial data from a gpio
-gpioSerialReadClose        Closes a gpio for bit bang serial reads
+gpioSerialRead             Reads bit bang serial data from a GPIO
+gpioSerialReadClose        Closes a GPIO for bit bang serial reads
 
-gpioHardwareClock          Start hardware clock on supported gpios
-gpioHardwarePWM            Start hardware PWM on supported gpios
+gpioHardwareClock          Start hardware clock on supported GPIO
+gpioHardwarePWM            Start hardware PWM on supported GPIO
 
-gpioGlitchFilter           Set a glitch filter on a gpio
-gpioNoiseFilter            Set a noise filter on a gpio
+gpioGlitchFilter           Set a glitch filter on a GPIO
+gpioNoiseFilter            Set a noise filter on a GPIO
 
 SCRIPTS
 
@@ -211,6 +211,8 @@ gpioWaveTxSend             Transmits a waveform
 
 gpioWaveChain              Transmits a chain of waveforms
 
+gpioWaveTxAt               Returns the current transmitting waveform
+
 gpioWaveTxBusy             Checks to see if the waveform has ended
 gpioWaveTxStop             Aborts the current waveform
 
@@ -255,8 +257,8 @@ i2cSegments                Performs multiple I2C transactions
 
 i2cZip                     Performs multiple I2C transactions
 
-bbI2COpen                  Opens gpios for bit banging I2C
-bbI2CClose                 Closes gpios for bit banging I2C
+bbI2COpen                  Opens GPIO for bit banging I2C
+bbI2CClose                 Closes GPIO for bit banging I2C
 bbI2CZip                   Performs multiple bit banged I2C transactions
 
 SPI
@@ -282,11 +284,11 @@ serDataAvailable           Returns number of bytes ready to be read
 
 CONFIGURATION
 
-gpioCfgBufferSize          Configure the gpio sample buffer size
-gpioCfgClock               Configure the gpio sample rate
+gpioCfgBufferSize          Configure the GPIO sample buffer size
+gpioCfgClock               Configure the GPIO sample rate
 gpioCfgDMAchannel          Configure the DMA channel (DEPRECATED)
 gpioCfgDMAchannels         Configure the DMA channels
-gpioCfgPermissions         Configure the gpio access permissions
+gpioCfgPermissions         Configure the GPIO access permissions
 gpioCfgInterfaces          Configure user interfaces
 gpioCfgSocketPort          Configure socket port
 gpioCfgMemAlloc            Configure DMA memory allocation mode
@@ -400,7 +402,7 @@ the maximum NUM_WAVE_CBS.
 OOLS are used from the bottom climbing up and from
 the top climbing down.
 
-The gpio on and off settings climb up from the bottom (botOOL/numBOOL).
+The GPIO on and off settings climb up from the bottom (botOOL/numBOOL).
 
 The level and tick read values are stored in descending locations
 from the top (topOOL/numTOOL).
@@ -422,9 +424,9 @@ typedef struct
 
 typedef struct
 {
-   int clk;     /* gpio for clock           */
-   int mosi;    /* gpio for MOSI            */
-   int miso;    /* gpio for MISO            */
+   int clk;     /* GPIO for clock           */
+   int mosi;    /* GPIO for MOSI            */
+   int miso;    /* GPIO for MISO            */
    int ss_pol;  /* slave select off state   */
    int ss_us;   /* delay after slave select */
    int clk_pol; /* clock off state          */
@@ -507,7 +509,7 @@ typedef void *(gpioThreadFunc_t) (void *);
 #define PI_LOW   0
 #define PI_HIGH  1
 
-/* level: only reported for gpio time-out, see gpioSetWatchdog */
+/* level: only reported for GPIO time-out, see gpioSetWatchdog */
 
 #define PI_TIMEOUT 2
 
@@ -576,11 +578,8 @@ typedef void *(gpioThreadFunc_t) (void *);
 #define PI_WAVE_MIN_BAUD      50
 #define PI_WAVE_MAX_BAUD 1000000
 
-//#define PI_SPI_MIN_BAUD     32000
-//#define PI_SPI_MAX_BAUD 125000000
-
-#define PI_SPI_MIN_BAUD     1
-#define PI_SPI_MAX_BAUD 500000000
+#define PI_SPI_MIN_BAUD     32000
+#define PI_SPI_MAX_BAUD 125000000
 
 #define PI_MIN_WAVE_DATABITS 1
 #define PI_MAX_WAVE_DATABITS 32
@@ -604,6 +603,11 @@ typedef void *(gpioThreadFunc_t) (void *);
 #define PI_WAVE_MODE_ONE_SHOT_SYNC 2
 #define PI_WAVE_MODE_REPEAT_SYNC   3
 
+/* special wave at return values */
+
+#define PI_WAVE_NOT_FOUND  9998 /* Transmitted wave not found. */
+#define PI_NO_TX_WAVE      9999 /* No wave being transmitted. */
+
 /* I2C, SPI, SER */
 
 #define PI_I2C_SLOTS 32
@@ -809,7 +813,7 @@ D*/
 /*F*/
 int gpioSetMode(unsigned gpio, unsigned mode);
 /*D
-Sets the gpio mode, typically input or output.
+Sets the GPIO mode, typically input or output.
 
 . .
 gpio: 0-53
@@ -833,13 +837,13 @@ D*/
 /*F*/
 int gpioGetMode(unsigned gpio);
 /*D
-Gets the gpio mode.
+Gets the GPIO mode.
 
 . .
 gpio: 0-53
 . .
 
-Returns the gpio mode if OK, otherwise PI_BAD_GPIO.
+Returns the GPIO mode if OK, otherwise PI_BAD_GPIO.
 
 ...
 if (gpioGetMode(17) != PI_ALT0)
@@ -853,7 +857,7 @@ D*/
 /*F*/
 int gpioSetPullUpDown(unsigned gpio, unsigned pud);
 /*D
-Sets or clears resistor pull ups or downs on the gpio.
+Sets or clears resistor pull ups or downs on the GPIO.
 
 . .
 gpio: 0-53
@@ -875,18 +879,18 @@ D*/
 /*F*/
 int gpioRead (unsigned gpio);
 /*D
-Reads the gpio level, on or off.
+Reads the GPIO level, on or off.
 
 . .
 gpio: 0-53
 . .
 
-Returns the gpio level if OK, otherwise PI_BAD_GPIO.
+Returns the GPIO level if OK, otherwise PI_BAD_GPIO.
 
 Arduino style: digitalRead.
 
 ...
-printf("gpio24 is level %d\n", gpioRead(24));
+printf("gpio24 is level %d", gpioRead(24));
 ...
 D*/
 
@@ -894,7 +898,7 @@ D*/
 /*F*/
 int gpioWrite(unsigned gpio, unsigned level);
 /*D
-Sets the gpio level, on or off.
+Sets the GPIO level, on or off.
 
 . .
  gpio: 0-53
@@ -903,7 +907,7 @@ level: 0,1
 
 Returns 0 if OK, otherwise PI_BAD_GPIO or PI_BAD_LEVEL.
 
-If PWM or servo pulses are active on the gpio they are switched off.
+If PWM or servo pulses are active on the GPIO they are switched off.
 
 Arduino style: digitalWrite
 
@@ -916,7 +920,7 @@ D*/
 /*F*/
 int gpioPWM(unsigned user_gpio, unsigned dutycycle);
 /*D
-Starts PWM on the gpio, dutycycle between 0 (off) and range (fully on).
+Starts PWM on the GPIO, dutycycle between 0 (off) and range (fully on).
 Range defaults to 255.
 
 . .
@@ -947,7 +951,7 @@ D*/
 /*F*/
 int gpioGetPWMdutycycle(unsigned user_gpio);
 /*D
-Returns the PWM dutycycle setting for the gpio.
+Returns the PWM dutycycle setting for the GPIO.
 
 . .
 user_gpio: 0-31
@@ -957,12 +961,12 @@ Returns between 0 (off) and range (fully on) if OK, otherwise
 PI_BAD_USER_GPIO or PI_NOT_PWM_GPIO.
 
 For normal PWM the dutycycle will be out of the defined range
-for the gpio (see [*gpioGetPWMrange*]).
+for the GPIO (see [*gpioGetPWMrange*]).
 
-If a hardware clock is active on the gpio the reported dutycycle
+If a hardware clock is active on the GPIO the reported dutycycle
 will be 500000 (500k) out of 1000000 (1M).
 
-If hardware PWM is active on the gpio the reported dutycycle
+If hardware PWM is active on the GPIO the reported dutycycle
 will be out of a 1000000 (1M).
 
 Normal PWM range defaults to 255.
@@ -972,7 +976,7 @@ D*/
 /*F*/
 int gpioSetPWMrange(unsigned user_gpio, unsigned range);
 /*D
-Selects the dutycycle range to be used for the gpio.  Subsequent calls
+Selects the dutycycle range to be used for the GPIO.  Subsequent calls
 to gpioPWM will use a dutycycle between 0 (off) and range (fully on).
 
 . .
@@ -980,10 +984,10 @@ user_gpio: 0-31
     range: 25-40000
 . .
 
-Returns the real range for the given gpio's frequency if OK,
+Returns the real range for the given GPIO's frequency if OK,
 otherwise PI_BAD_USER_GPIO or PI_BAD_DUTYRANGE.
 
-If PWM is currently active on the gpio its dutycycle will be scaled
+If PWM is currently active on the GPIO its dutycycle will be scaled
 to reflect the new range.
 
 The real range, the number of steps between fully off and fully
@@ -1007,14 +1011,14 @@ D*/
 /*F*/
 int gpioGetPWMrange(unsigned user_gpio);
 /*D
-Returns the dutycycle range used for the gpio if OK, otherwise
+Returns the dutycycle range used for the GPIO if OK, otherwise
 PI_BAD_USER_GPIO.
 
 . .
 user_gpio: 0-31
 . .
 
-If a hardware clock or hardware PWM is active on the gpio
+If a hardware clock or hardware PWM is active on the GPIO
 the reported range will be 1000000 (1M).
 
 ...
@@ -1026,17 +1030,17 @@ D*/
 /*F*/
 int gpioGetPWMrealRange(unsigned user_gpio);
 /*D
-Returns the real range used for the gpio if OK, otherwise
+Returns the real range used for the GPIO if OK, otherwise
 PI_BAD_USER_GPIO.
 
 . .
 user_gpio: 0-31
 . .
 
-If a hardware clock is active on the gpio the reported real
+If a hardware clock is active on the GPIO the reported real
 range will be 1000000 (1M).
 
-If hardware PWM is active on the gpio the reported real range
+If hardware PWM is active on the GPIO the reported real range
 will be approximately 250M divided by the set PWM frequency.
 
 ...
@@ -1048,7 +1052,7 @@ D*/
 /*F*/
 int gpioSetPWMfrequency(unsigned user_gpio, unsigned frequency);
 /*D
-Sets the frequency in hertz to be used for the gpio.
+Sets the frequency in hertz to be used for the GPIO.
 
 . .
 user_gpio: 0-31
@@ -1061,10 +1065,10 @@ 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).
 
-Each gpio can be independently set to one of 18 different PWM
+Each GPIO can be independently set to one of 18 different PWM
 frequencies.
 
-If PWM is currently active on the gpio it will be
+If PWM is currently active on the GPIO it will be
 switched off and then back on at the new frequency.
 
 The frequencies for each sample rate are:
@@ -1105,20 +1109,20 @@ D*/
 /*F*/
 int gpioGetPWMfrequency(unsigned user_gpio);
 /*D
-Returns the frequency (in hertz) used for the gpio if OK, otherwise
+Returns the frequency (in hertz) used for the GPIO if OK, otherwise
 PI_BAD_USER_GPIO.
 
 . .
 user_gpio: 0-31
 . .
 
-For normal PWM the frequency will be that defined for the gpio by
+For normal PWM the frequency will be that defined for the GPIO by
 [*gpioSetPWMfrequency*].
 
-If a hardware clock is active on the gpio the reported frequency
+If a hardware clock is active on the GPIO the reported frequency
 will be that set by [*gpioHardwareClock*].
 
-If hardware PWM is active on the gpio the reported frequency
+If hardware PWM is active on the GPIO the reported frequency
 will be that set by [*gpioHardwarePWM*].
 
 ...
@@ -1130,7 +1134,7 @@ D*/
 /*F*/
 int gpioServo(unsigned user_gpio, unsigned pulsewidth);
 /*D
-Starts servo pulses on the gpio, 0 (off), 500 (most anti-clockwise) to
+Starts servo pulses on the GPIO, 0 (off), 500 (most anti-clockwise) to
 2500 (most clockwise).
 
 . .
@@ -1146,8 +1150,8 @@ the mid-point of rotation.  You can DAMAGE a servo if you command it
 to move beyond its limits.
 
 The following causes an on pulse of 1500 microseconds duration to be
-transmitted on gpio 17 at a rate of 50 times per second. This will
-command a servo connected to gpio 17 to rotate to its mid-point.
+transmitted on GPIO 17 at a rate of 50 times per second. This will
+command a servo connected to GPIO 17 to rotate to its mid-point.
 
 ...
 gpioServo(17, 1000); // Move servo to safe position anti-clockwise.
@@ -1189,7 +1193,7 @@ D*/
 /*F*/
 int gpioGetServoPulsewidth(unsigned user_gpio);
 /*D
-Returns the servo pulsewidth setting for the gpio.
+Returns the servo pulsewidth setting for the GPIO.
 
 . .
 user_gpio: 0-31
@@ -1204,7 +1208,7 @@ D*/
 int gpioSetAlertFunc(unsigned user_gpio, gpioAlertFunc_t f);
 /*D
 Registers a function to be called (a callback) when the specified
-gpio changes state.
+GPIO changes state.
 
 . .
 user_gpio: 0-31
@@ -1213,13 +1217,13 @@ user_gpio: 0-31
 
 Returns 0 if OK, otherwise PI_BAD_USER_GPIO.
 
-One function may be registered per gpio.
+One function may be registered per GPIO.
 
-The function is passed the gpio, the new level, and the tick.
+The function is passed the GPIO, the new level, and the tick.
 
 The alert may be cancelled by passing NULL as the function.
 
-The gpios are sampled at a rate set when the library is started.
+The GPIO are sampled at a rate set when the library is started.
 
 If a value isn't specifically set the default of 5 us is used.
 
@@ -1251,10 +1255,10 @@ The tick value is the time stamp of the sample in microseconds, see
 ...
 void aFunction(int gpio, int level, uint32_t tick)
 {
-   printf("gpio %d became %d at %d\n", gpio, level, tick);
+   printf("GPIO %d became %d at %d", gpio, level, tick);
 }
 
-// call aFunction whenever gpio 4 changes state
+// call aFunction whenever GPIO 4 changes state
 
 gpioSetAlertFunc(4F, aFunction);
 ...
@@ -1266,7 +1270,7 @@ int gpioSetAlertFuncEx(
    unsigned user_gpio, gpioAlertFuncEx_t f, void *userdata);
 /*D
 Registers a function to be called (a callback) when the specified
-gpio changes state.
+GPIO changes state.
 
 . .
 user_gpio: 0-31
@@ -1276,13 +1280,13 @@ user_gpio: 0-31
 
 Returns 0 if OK, otherwise PI_BAD_USER_GPIO.
 
-One function may be registered per gpio.
+One function may be registered per GPIO.
 
-The function is passed the gpio, the new level, the tick, and
+The function is passed the GPIO, the new level, the tick, and
 the userdata pointer.
 
 Only one of [*gpioSetAlertFunc*] or [*gpioSetAlertFuncEx*] can be
-registered per gpio.
+registered per GPIO.
 
 See [*gpioSetAlertFunc*] for further details.
 D*/
@@ -1293,7 +1297,7 @@ int gpioSetISRFunc(
    unsigned user_gpio, unsigned edge, int timeout, gpioISRFunc_t f);
 /*D
 Registers a function to be called (a callback) whenever the specified
-gpio interrupt occurs.
+GPIO interrupt occurs.
 
 . .
 user_gpio: 0-31
@@ -1305,24 +1309,24 @@ user_gpio: 0-31
 Returns 0 if OK, otherwise PI_BAD_USER_GPIO, PI_BAD_EDGE,
 or PI_BAD_ISR_INIT.
 
-One function may be registered per gpio.
+One function may be registered per GPIO.
 
-The function is passed the gpio, the current level, and the
+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.
 
-The underlying Linux sysfs gpio interface is used to provide
+The underlying Linux sysfs GPIO interface is used to provide
 the interrupt services.
 
 The first time the function is called, with a non-NULL f, the
-gpio is exported, set to be an input, and set to interrupt
+GPIO is exported, set to be an input, and set to interrupt
 on the given edge and timeout.
 
 Subsequent calls, with a non-NULL f, can vary one or more of the
 edge, timeout, or function.
 
 The ISR may be cancelled by passing a NULL f, in which case the
-gpio is unexported.
+GPIO is unexported.
 
 The tick is that read at the time the process was informed of
 the interrupt.  This will be a variable number of microseconds
@@ -1348,7 +1352,7 @@ int gpioSetISRFuncEx(
    void *userdata);
 /*D
 Registers a function to be called (a callback) whenever the specified
-gpio interrupt occurs.
+GPIO interrupt occurs.
 
 . .
 user_gpio: 0-31
@@ -1361,11 +1365,11 @@ user_gpio: 0-31
 Returns 0 if OK, otherwise PI_BAD_USER_GPIO, PI_BAD_EDGE,
 or PI_BAD_ISR_INIT.
 
-The function is passed the gpio, the current level, the
+The function is passed the GPIO, the current level, the
 current tick, and the userdata pointer.
 
 Only one of [*gpioSetISRFunc*] or [*gpioSetISRFuncEx*] can be
-registered per gpio.
+registered per GPIO.
 
 See [*gpioSetISRFunc*] for further details.
 D*/
@@ -1379,7 +1383,7 @@ This function requests a free notification handle.
 Returns a handle greater than or equal to zero if OK,
 otherwise PI_NO_HANDLE.
 
-A notification is a method for being notified of gpio state changes
+A notification is a method for being notified of GPIO state changes
 via a pipe or socket.
 
 Pipe notifications for handle x will be available at the pipe
@@ -1435,12 +1439,12 @@ This function starts notifications on a previously opened handle.
 
 . .
 handle: >=0, as returned by [*gpioNotifyOpen*]
-  bits: a bit mask indicating the gpios of interest
+  bits: a bit mask indicating the GPIO of interest
 . .
 
 Returns 0 if OK, otherwise PI_BAD_HANDLE.
 
-The notification sends state changes for each gpio whose corresponding
+The notification sends state changes for each GPIO whose corresponding
 bit in bits is set.
 
 Each notification occupies 12 bytes in the fifo and has the
@@ -1461,7 +1465,7 @@ by one for each report.
 
 flags: two flags are defined, PI_NTFY_FLAGS_WDOG and PI_NTFY_FLAGS_ALIVE.
 If bit 5 is set (PI_NTFY_FLAGS_WDOG) then bits 0-4 of the flags
-indicate a gpio which has had a watchdog timeout; if bit 6 is set
+indicate a GPIO which has had a watchdog timeout; if bit 6 is set
 (PI_NTFY_FLAGS_ALIVE) this indicates a keep alive signal on the
 pipe/socket and is sent once a minute in the absence of other
 notification activity.
@@ -1469,11 +1473,11 @@ notification activity.
 tick: the number of microseconds since system boot.  It wraps around
 after 1h12m.
 
-level: indicates the level of each gpio.  If bit 1<<x is set then
-gpio x is high.
+level: indicates the level of each GPIO.  If bit 1<<x is set then
+GPIO x is high.
 
 ...
-// Start notifications for gpios 1, 4, 6, 7, 10.
+// Start notifications for GPIO 1, 4, 6, 7, 10.
 
 //                         1
 //                         0  76 4  1
@@ -1569,7 +1573,7 @@ The pulses are interleaved in time order within the existing waveform
 (if any).
 
 Merging allows the waveform to be built in parts, that is the settings
-for gpio#1 can be added, and then gpio#2 etc.
+for GPIO#1 can be added, and then GPIO#2 etc.
 
 If the added waveform is intended to start after or within the existing
 waveform then the first pulse should consist of a delay.
@@ -1715,8 +1719,8 @@ typedef struct
 
 The fields specify
 
-1) the gpios to be switched on at the start of the pulse. 
-2) the gpios to be switched off at the start of the pulse. 
+1) the GPIO to be switched on at the start of the pulse. 
+2) the GPIO to be switched off at the start of the pulse. 
 3) the delay in microseconds before the next pulse.
 
 Any or all the fields can be zero.  It doesn't make any sense to
@@ -1825,7 +1829,7 @@ int main(int argc, char *argv[])
 
    gpioSetMode(GPIO, PI_OUTPUT);
 
-   printf("start piscope, press return\n"); getchar();
+   printf("start piscope, press return"); getchar();
 
    for (i=0; i<WAVES; i++)
    {
@@ -1859,7 +1863,7 @@ int main(int argc, char *argv[])
 
    for (i=0; i<WAVES; i++) gpioWaveDelete(wid[i]);
 
-   printf("stop piscope, press return\n"); getchar();
+   printf("stop piscope, press return"); getchar();
 
    gpioTerminate();
 }
@@ -1867,6 +1871,19 @@ int main(int argc, char *argv[])
 D*/
 
 
+/*F*/
+int gpioWaveTxAt(void);
+/*D
+This function returns the id of the waveform currently being
+transmitted.
+
+Returns the waveform id or one of the following special values:
+
+PI_WAVE_NOT_FOUND (9998) - transmitted wave not found. 
+PI_NO_TX_WAVE (9999) - no wave being transmitted.
+D*/
+
+
 /*F*/
 int gpioWaveTxBusy(void);
 /*D
@@ -1961,7 +1978,7 @@ D*/
 /*F*/
 int gpioSerialReadOpen(unsigned user_gpio, unsigned baud, unsigned data_bits);
 /*D
-This function opens a gpio for bit bang reading of serial data.
+This function opens a GPIO for bit bang reading of serial data.
 
 . .
 user_gpio: 0-31
@@ -1995,7 +2012,7 @@ invert: 0-1
 Returns 0 if OK, otherwise PI_BAD_USER_GPIO, PI_GPIO_IN_USE,
 PI_NOT_SERIAL_GPIO, or PI_BAD_SER_INVERT.
 
-The gpio must be opened for bit bang reading of serial data using
+The GPIO must be opened for bit bang reading of serial data using
 [*gpioSerialReadOpen*] prior to calling this function.
 D*/
 
@@ -2027,7 +2044,7 @@ D*/
 /*F*/
 int gpioSerialReadClose(unsigned user_gpio);
 /*D
-This function closes a gpio for bit bang reading of serial data.
+This function closes a GPIO for bit bang reading of serial data.
 
 . .
 user_gpio: 0-31, previously opened with [*gpioSerialReadOpen*]
@@ -2510,7 +2527,7 @@ D*/
 /*F*/
 int bbI2COpen(unsigned SDA, unsigned SCL, unsigned baud);
 /*D
-This function selects a pair of gpios for bit banging I2C at a
+This function selects a pair of GPIO for bit banging I2C at a
 specified baud rate.
 
 Bit banging I2C allows for certain operations which are not possible
@@ -2519,7 +2536,7 @@ with the standard I2C driver.
 o baud rates as low as 50 
 o repeated starts 
 o clock stretching 
-o I2C on any pair of spare gpios
+o I2C on any pair of spare GPIO
 
 . .
  SDA: 0-31
@@ -2532,18 +2549,18 @@ PI_GPIO_IN_USE.
 
 NOTE:
 
-The gpios used for SDA and SCL must have pull-ups to 3V3 connected.  As
+The GPIO used for SDA and SCL must have pull-ups to 3V3 connected.  As
 a guide the hardware pull-ups on pins 3 and 5 are 1k8 in value.
 D*/
 
 /*F*/
 int bbI2CClose(unsigned SDA);
 /*D
-This function stops bit banging I2C on a pair of gpios previously
+This function stops bit banging I2C on a pair of GPIO previously
 opened with [*bbI2COpen*].
 
 . .
-SDA: 0-31, the SDA gpio used in a prior call to [*bbI2COpen*]
+SDA: 0-31, the SDA GPIO used in a prior call to [*bbI2COpen*]
 . .
 
 Returns 0 if OK, otherwise PI_BAD_USER_GPIO, or PI_NOT_I2C_GPIO.
@@ -2628,12 +2645,13 @@ Data will be transferred at baud bits per second.  The flags may
 be used to modify the default behaviour of 4-wire operation, mode 0,
 active low chip select.
 
-An auxiliary SPI device is available on the A+/B+/Pi2/Zero and may be
-selected by setting the A bit in the flags.  The auxiliary
-device has 3 chip selects and a selectable word size in bits.
+An auxiliary SPI device is available on all models but the
+A and B and may be selected by setting the A bit in the flags.
+The auxiliary device has 3 chip selects and a selectable word
+size in bits.
 
 . .
- spiChan: 0-1 (0-2 for A+/B+/Pi2/Zero auxiliary device)
+ spiChan: 0-1 (0-2 for the auxiliary SPI device)
     baud: 32K-125M (values above 30M are unlikely to work)
 spiFlags: see below
 . .
@@ -2662,10 +2680,9 @@ Mode POL PHA
 
 px is 0 if CEx is active low (default) and 1 for active high.
 
-ux is 0 if the CEx gpio is reserved for SPI (default) and 1 otherwise.
+ux is 0 if the CEx GPIO is reserved for SPI (default) and 1 otherwise.
 
-A is 0 for the standard SPI device, 1 for the auxiliary SPI.  The
-auxiliary device is only present on the A+/B+/Pi2/Zero.
+A is 0 for the standard SPI device, 1 for the auxiliary SPI.
 
 W is 0 if the device is not 3-wire, 1 if the device is 3-wire.  Standard
 SPI device only.
@@ -2685,6 +2702,17 @@ device only.
 bbbbbb defines the word size in bits (0-32).  The default (0)
 sets 8 bits per word.  Auxiliary SPI device only.
 
+The [*spiRead*], [*spiWrite*], and [*spiXfer*] functions
+transfer data packed into 1, 2, or 4 bytes according to
+the word size in bits.
+
+For bits 1-8 there will be one byte per character. 
+For bits 9-16 there will be two bytes per character. 
+For bits 17-32 there will be four bytes per character.
+
+E.g. to transfer 32 12-bit words buf should contain 64 bytes
+and count should be 64.
+
 The other bits in flags should be set to zero.
 D*/
 
@@ -2866,7 +2894,7 @@ D*/
 /*F*/
 int gpioTrigger(unsigned user_gpio, unsigned pulseLen, unsigned level);
 /*D
-This function sends a trigger pulse to a gpio.  The gpio is set to
+This function sends a trigger pulse to a GPIO.  The GPIO is set to
 level for pulseLen microseconds and then reset to not level.
 
 . .
@@ -2883,7 +2911,7 @@ D*/
 /*F*/
 int gpioSetWatchdog(unsigned user_gpio, unsigned timeout);
 /*D
-Sets a watchdog for a gpio.
+Sets a watchdog for a GPIO.
 
 . .
 user_gpio: 0-31
@@ -2894,25 +2922,25 @@ Returns 0 if OK, otherwise PI_BAD_USER_GPIO or PI_BAD_WDOG_TIMEOUT.
 
 The watchdog is nominally in milliseconds.
 
-One watchdog may be registered per gpio.
+One watchdog may be registered per GPIO.
 
 The watchdog may be cancelled by setting timeout to 0.
 
-If no level change has been detected for the gpio for timeout
+If no level change has been detected for the GPIO for timeout
 milliseconds:-
 
-1) any registered alert function for the gpio is called with
+1) any registered alert function for the GPIO is called with
    the level set to PI_TIMEOUT. 
-2) any notification for the gpio has a report written to the
+2) any notification for the GPIO has a report written to the
    fifo with the flags set to indicate a watchdog timeout.
 
 ...
 void aFunction(int gpio, int level, uint32_t tick)
 {
-   printf("gpio %d became %d at %d\n", gpio, level, tick);
+   printf("GPIO %d became %d at %d", gpio, level, tick);
 }
 
-// call aFunction whenever gpio 4 changes state
+// call aFunction whenever GPIO 4 changes state
 gpioSetAlertFunc(4, aFunction);
 
 //  or approximately every 5 millis
@@ -2924,11 +2952,11 @@ D*/
 /*F*/
 int gpioNoiseFilter(unsigned user_gpio, unsigned steady, unsigned active);
 /*D
-Sets a noise filter on a gpio.
+Sets a noise filter on a GPIO.
 
-Level changes on the gpio are ignored until a level which has
+Level changes on the GPIO are ignored until a level which has
 been stable for [*steady*] microseconds is detected.  Level changes
-on the gpio are then reported for [*active*] microseconds after
+on the GPIO are then reported for [*active*] microseconds after
 which the process repeats.
 
 . .
@@ -2948,9 +2976,9 @@ D*/
 /*F*/
 int gpioGlitchFilter(unsigned user_gpio, unsigned steady);
 /*D
-Sets a glitch filter on a gpio.
+Sets a glitch filter on a GPIO.
 
-Level changes on the gpio are not reported unless the level
+Level changes on the GPIO are not reported unless the level
 has been stable for at least [*steady*] microseconds.  The
 level is then reported.  Level changes of less than [*steady*]
 microseconds are ignored.
@@ -2971,11 +2999,11 @@ D*/
 int gpioSetGetSamplesFunc(gpioGetSamplesFunc_t f, uint32_t bits);
 /*D
 Registers a function to be called (a callback) every millisecond
-with the latest gpio samples.
+with the latest GPIO samples.
 
 . .
    f: the function to call
-bits: the gpios of interest
+bits: the GPIO of interest
 . .
 
 Returns 0 if OK.
@@ -2990,8 +3018,8 @@ The callback may be cancelled by passing NULL as the function.
 The samples returned will be the union of bits, plus any active alerts,
 plus any active notifications.
 
-e.g.  if there are alerts for gpios 7, 8, and 9, notifications for gpios
-8, 10, 23, 24, and bits is (1<<23)|(1<<17) then samples for gpios
+e.g.  if there are alerts for GPIO 7, 8, and 9, notifications for GPIO
+8, 10, 23, 24, and bits is (1<<23)|(1<<17) then samples for GPIO
 7, 8, 9, 10, 17, 23, and 24 will be reported.
 D*/
 
@@ -3001,11 +3029,11 @@ int gpioSetGetSamplesFuncEx(
    gpioGetSamplesFuncEx_t f, uint32_t bits, void *userdata);
 /*D
 Registers a function to be called (a callback) every millisecond
-with the latest gpio samples.
+with the latest GPIO samples.
 
 . .
        f: the function to call
-    bits: the gpios of interest
+    bits: the GPIO of interest
 userdata: a pointer to arbitrary user data
 . .
 
@@ -3043,7 +3071,7 @@ The timer may be cancelled by passing NULL as the function.
 ...
 void bFunction(void)
 {
-   printf("two seconds have elapsed\n");
+   printf("two seconds have elapsed");
 }
 
 // call bFunction every 2000 milliseconds
@@ -3101,7 +3129,7 @@ void *myfunc(void *arg)
 {
    while (1)
    {
-      printf("%s\n", arg);
+      printf("%s", arg);
       sleep(1);
    }
 }
@@ -3281,30 +3309,30 @@ D*/
 /*F*/
 uint32_t gpioRead_Bits_0_31(void);
 /*D
-Returns the current level of gpios 0-31.
+Returns the current level of GPIO 0-31.
 D*/
 
 
 /*F*/
 uint32_t gpioRead_Bits_32_53(void);
 /*D
-Returns the current level of gpios 32-53.
+Returns the current level of GPIO 32-53.
 D*/
 
 
 /*F*/
 int gpioWrite_Bits_0_31_Clear(uint32_t bits);
 /*D
-Clears gpios 0-31 if the corresponding bit in bits is set.
+Clears GPIO 0-31 if the corresponding bit in bits is set.
 
 . .
-bits: a bit mask of gpios to clear
+bits: a bit mask of GPIO to clear
 . .
 
 Returns 0 if OK.
 
 ...
-// To clear (set to 0) gpios 4, 7, and 15
+// To clear (set to 0) GPIO 4, 7, and 15
 gpioWrite_Bits_0_31_Clear( (1<<4) | (1<<7) | (1<<15) );
 ...
 D*/
@@ -3313,10 +3341,10 @@ D*/
 /*F*/
 int gpioWrite_Bits_32_53_Clear(uint32_t bits);
 /*D
-Clears gpios 32-53 if the corresponding bit (0-21) in bits is set.
+Clears GPIO 32-53 if the corresponding bit (0-21) in bits is set.
 
 . .
-bits: a bit mask of gpios to clear
+bits: a bit mask of GPIO to clear
 . .
 
 Returns 0 if OK.
@@ -3326,10 +3354,10 @@ D*/
 /*F*/
 int gpioWrite_Bits_0_31_Set(uint32_t bits);
 /*D
-Sets gpios 0-31 if the corresponding bit in bits is set.
+Sets GPIO 0-31 if the corresponding bit in bits is set.
 
 . .
-bits: a bit mask of gpios to set
+bits: a bit mask of GPIO to set
 . .
 
 Returns 0 if OK.
@@ -3339,16 +3367,16 @@ D*/
 /*F*/
 int gpioWrite_Bits_32_53_Set(uint32_t bits);
 /*D
-Sets gpios 32-53 if the corresponding bit (0-21) in bits is set.
+Sets GPIO 32-53 if the corresponding bit (0-21) in bits is set.
 
 . .
-bits: a bit mask of gpios to set
+bits: a bit mask of GPIO to set
 . .
 
 Returns 0 if OK.
 
 ...
-// To set (set to 1) gpios 32, 40, and 53
+// To set (set to 1) GPIO 32, 40, and 53
 gpioWrite_Bits_32_53_Set((1<<(32-32)) | (1<<(40-32)) | (1<<(53-32)));
 ...
 D*/
@@ -3356,7 +3384,7 @@ D*/
 /*F*/
 int gpioHardwareClock(unsigned gpio, unsigned clkfreq);
 /*D
-Starts a hardware clock on a gpio at the specified frequency.
+Starts a hardware clock on a GPIO at the specified frequency.
 Frequencies above 30MHz are unlikely to work.
 
 . .
@@ -3367,17 +3395,17 @@ clkfreq: 0 (off) or 4689-250000000 (250M)
 Returns 0 if OK, otherwise PI_BAD_GPIO, PI_NOT_HCLK_GPIO,
 PI_BAD_HCLK_FREQ,or PI_BAD_HCLK_PASS.
 
-The same clock is available on multiple gpios.  The latest
-frequency setting will be used by all gpios which share a clock.
+The same clock is available on multiple GPIO.  The latest
+frequency setting will be used by all GPIO which share a clock.
 
-The gpio must be one of the following.
+The GPIO must be one of the following.
 
 . .
 4   clock 0  All models
-5   clock 1  A+/B+/Pi2/Zero and compute module only (reserved for system use)
-6   clock 2  A+/B+/Pi2/Zero and compute module only
-20  clock 0  A+/B+/Pi2/Zero and compute module only
-21  clock 1  All models but Rev.2 B (reserved for system use)
+5   clock 1  All models but A and B (reserved for system use)
+6   clock 2  All models but A and B
+20  clock 0  All models but A and B
+21  clock 1  All models but A and Rev.2 B (reserved for system use)
 
 32  clock 0  Compute module only
 34  clock 0  Compute module only
@@ -3388,13 +3416,13 @@ The gpio must be one of the following.
 
 Access to clock 1 is protected by a password as its use will likely
 crash the Pi.  The password is given by or'ing 0x5A000000 with the
-gpio number.
+GPIO number.
 D*/
 
 /*F*/
 int gpioHardwarePWM(unsigned gpio, unsigned PWMfreq, unsigned PWMduty);
 /*D
-Starts hardware PWM on a gpio at the specified frequency and dutycycle.
+Starts hardware PWM on a GPIO at the specified frequency and dutycycle.
 Frequencies above 30MHz are unlikely to work.
 
 NOTE: Any waveform started by [*gpioWaveTxSend*], or
@@ -3413,17 +3441,17 @@ PWMduty: 0 (off) to 1000000 (1M)(fully on)
 Returns 0 if OK, otherwise PI_BAD_GPIO, PI_NOT_HPWM_GPIO,
 PI_BAD_HPWM_DUTY, PI_BAD_HPWM_FREQ, or PI_HPWM_ILLEGAL.
 
-The same PWM channel is available on multiple gpios.  The latest
-frequency and dutycycle setting will be used by all gpios which
+The same PWM channel is available on multiple GPIO.  The latest
+frequency and dutycycle setting will be used by all GPIO which
 share a PWM channel.
 
-The gpio must be one of the following.
+The GPIO must be one of the following.
 
 . .
-12  PWM channel 0  A+/B+/Pi2/Zero and compute module only
-13  PWM channel 1  A+/B+/Pi2/Zero and compute module only
+12  PWM channel 0  All models but A and B
+13  PWM channel 1  All models but A and B
 18  PWM channel 0  All models
-19  PWM channel 1  A+/B+/Pi2/Zero and compute module only
+19  PWM channel 1  All models but A and B
 
 40  PWM channel 0  Compute module only
 41  PWM channel 1  Compute module only
@@ -3467,7 +3495,7 @@ int secs, mics;
 
 // print the number of seconds since the library was started
 gpioTime(PI_TIME_RELATIVE, &secs, &mics);
-printf("library started %d.%03d seconds ago\n", secs, mics/1000);
+printf("library started %d.%03d seconds ago", secs, mics/1000);
 ...
 D*/
 
@@ -3548,7 +3576,7 @@ endTick = gpioTick();
 
 diffTick = endTick - startTick;
 
-printf("some processing took %d microseconds\n", diffTick);
+printf("some processing took %d microseconds", diffTick);
 ...
 D*/
 
@@ -3564,7 +3592,7 @@ number the function returns 0.
 The hardware revision is the last few characters on the Revision line of
 /proc/cpuinfo.
 
-The revision number can be used to determine the assignment of gpios
+The revision number can be used to determine the assignment of GPIO
 to pins (see [*gpio*]).
 
 There are at least three types of board.
@@ -3591,7 +3619,7 @@ D*/
 /*F*/
 int gpioCfgBufferSize(unsigned cfgMillis);
 /*D
-Configures pigpio to buffer cfgMillis milliseconds of gpio samples.
+Configures pigpio to buffer cfgMillis milliseconds of GPIO samples.
 
 . .
 cfgMillis: 100-10000
@@ -3689,15 +3717,15 @@ D*/
 int gpioCfgPermissions(uint64_t updateMask);
 /*D
 Configures pigpio to only allow updates (writes or mode changes) for the
-gpios specified by the mask.
+GPIO specified by the mask.
 
 . .
-updateMask: bit (1<<n) is set for each gpio n which may be updated
+updateMask: bit (1<<n) is set for each GPIO n which may be updated
 . .
 
 The default setting depends upon the board revision (Type 1, 2, or 3).
-The user gpios are added to the mask.  If the board revision is not
-recognised then gpios 0-31 are allowed.
+The user GPIO are added to the mask.  If the board revision is not
+recognised then GPIO 0-31 are allowed.
 
 Unknown board @ PI_DEFAULT_UPDATE_MASK_R0 @ 0xFFFFFFFF 
 Type 1 board  @ PI_DEFAULT_UPDATE_MASK_R1 @ 0x03E6CF93 
@@ -3846,7 +3874,7 @@ existing waveform (if any).
 . .
         spi: a pointer to a spi object
      offset: microseconds from the start of the waveform
-      spiSS: the slave select gpio
+      spiSS: the slave select GPIO
         buf: the bits to transmit, most significant bit first
   spiTxBits: the number of bits to write
 spiBitFirst: the first bit to read
@@ -3880,7 +3908,7 @@ The pulses are interleaved in time order within the existing waveform
 (if any).
 
 Merging allows the waveform to be built in parts, that is the settings
-for gpio#1 can be added, and then gpio#2 etc.
+for GPIO#1 can be added, and then GPIO#2 etc.
 
 If the added waveform is intended to start after or within the existing
 waveform then the first pulse should consist of a delay.
@@ -4080,7 +4108,7 @@ A bit position within a byte or word.  The least significant bit is
 position 0.
 
 bits::
-A value used to select gpios.  If bit n of bits is set then gpio n is
+A value used to select GPIO.  If bit n of bits is set then GPIO n is
 selected.
 
 A convenient way to set bit n is to or in (1<<n).
@@ -4105,7 +4133,7 @@ A number identifying a DMA contol block.
 
 cfgMicros::
 
-The gpio sample rate in microseconds.  The default is 5us, or 200 thousand
+The GPIO sample rate in microseconds.  The default is 5us, or 200 thousand
 samples per second.
 
 cfgMillis:: 100-10000
@@ -4180,7 +4208,7 @@ The number may vary between 0 and range (default 255) where
 0 is off and range is fully on.
 
 edge::0-2
-The type of gpio edge to generate an intrrupt.  See[*gpioSetISRFunc*],
+The type of GPIO edge to generate an intrrupt.  See[*gpioSetISRFunc*],
 and [*gpioSetISRFuncEx*].
 
 . .
@@ -4195,28 +4223,28 @@ A function.
 
 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
+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
 by its dutycycle.
 
 gpio::
 
-A Broadcom numbered gpio, in the range 0-53.
+A Broadcom numbered GPIO, in the range 0-53.
 
-There  are 54 General Purpose Input Outputs (gpios) named gpio0 through
+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.
 
-All the gpios which are safe for the user to read and write are in
-bank 1.  Not all gpios in bank 1 are safe though.  Type 1 boards
-have 17  safe gpios.  Type 2 boards have 21.  Type 3 boards have 26.
+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
+have 17  safe GPIO.  Type 2 boards have 21.  Type 3 boards have 26.
 
 See [*gpioHardwareRevision*].
 
-The user gpios are marked with an X in the following table.
+The user GPIO are marked with an X in the following table.
 
 . .
           0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
@@ -4374,7 +4402,7 @@ invert::
 A flag used to set normal or inverted bit bang serial data level logic.
 
 level::
-The level of a gpio.  Low or High.
+The level of a GPIO.  Low or High.
 
 . .
 PI_OFF 0
@@ -4387,7 +4415,7 @@ PI_LOW 0
 PI_HIGH 1
 . .
 
-There is one exception.  If a watchdog expires on a gpio the level will be
+There is one exception.  If a watchdog expires on a GPIO the level will be
 reported as PI_TIMEOUT.  See [*gpioSetWatchdog*].
 
 . .
@@ -4423,7 +4451,7 @@ A value representing milliseconds.
 
 mode::0-7
 
-The operational mode of a gpio, normally INPUT or OUTPUT.
+The operational mode of a GPIO, normally INPUT or OUTPUT.
 
 . .
 PI_INPUT 0
@@ -4485,7 +4513,7 @@ pos::
 The position of an item.
 
 primaryChannel:: 0-14
-The DMA channel used to time the sampling of gpios and to time servo and
+The DMA channel used to time the sampling of GPIO and to time servo and
 PWM pulses.
 
 *pth::
@@ -4498,7 +4526,7 @@ A thread identifier.
 
 pud::0-2
 
-The setting of the pull up/down resistor for a gpio, which may be off,
+The setting of the pull up/down resistor for a GPIO, which may be off,
 pull-up, or pull-down.
 . .
 PI_PUD_OFF 0
@@ -4560,9 +4588,9 @@ rawSPI_t::
 . .
 typedef struct
 {
-   int clk;     // gpio for clock
-   int mosi;    // gpio for MOSI
-   int miso;    // gpio for MISO
+   int clk;     // GPIO for clock
+   int mosi;    // GPIO for MOSI
+   int miso;    // GPIO for MISO
    int ss_pol;  // slave select off state
    int ss_us;   // delay after slave select
    int clk_pol; // clock off state
@@ -4590,6 +4618,10 @@ typedef struct
    uint16_t topCB;  // last CB used by wave
    uint16_t botOOL; // last OOL used by wave
    uint16_t topOOL; // first OOL used by wave
+   uint16_t deleted;
+   uint16_t numCB;
+   uint16_t numBOOL;
+   uint16_t numTOOL;
 } rawWaveInfo_t;
 . .
 
@@ -4607,7 +4639,7 @@ A pointer to a buffer to receive data.
 
 SCL::
 
-The user gpio to use for the clock when bit banging I2C.
+The user GPIO to use for the clock when bit banging I2C.
 
 *script::
 
@@ -4619,7 +4651,7 @@ An id of a stored script as returned by [*gpioStoreScript*].
 
 SDA::
 
-The user gpio to use for data when bit banging I2C.
+The user GPIO to use for data when bit banging I2C.
 
 secondaryChannel:: 0-6
 
@@ -4661,11 +4693,11 @@ A standard type used to indicate the size of an object in bytes.
 A pointer to a [*rawSPI_t*] structure.
 
 spiBitFirst::
-Gpio reads are made from spiBitFirst to spiBitLast.
+GPIO reads are made from spiBitFirst to spiBitLast.
 
 spiBitLast::
 
-Gpio reads are made from spiBitFirst to spiBitLast.
+GPIO reads are made from spiBitFirst to spiBitLast.
 
 spiBits::
 The number of bits to transfer in a raw SPI transaction.
@@ -4677,7 +4709,7 @@ spiFlags::
 See [*spiOpen*].
 
 spiSS::
-The SPI slave select gpio in a raw SPI transaction.
+The SPI slave select GPIO in a raw SPI transaction.
 
 spiTxBits::
 The number of bits to transfer dring a raw SPI transaction
@@ -4701,7 +4733,7 @@ PI_MAX_WAVE_HALFSTOPBITS 8
 An array of characters.
 
 timeout::
-A gpio level change timeout in milliseconds.
+A GPIO level change timeout in milliseconds.
 
 [*gpioSetWatchdog*]
 . .
@@ -4745,13 +4777,13 @@ A whole number >= 0.
 
 updateMask::
 
-A 64 bit mask indicating which gpios may be written to by the user.
+A 64 bit mask indicating which GPIO may be written to by the user.
 
-If gpio#n may be written then bit (1<<n) is set.
+If GPIO#n may be written then bit (1<<n) is set.
 
 user_gpio::
 
-0-31, a Broadcom numbered gpio.
+0-31, a Broadcom numbered GPIO.
 
 See [*gpio*].
 
@@ -4923,6 +4955,7 @@ PARAMS*/
 #define PI_CMD_NOIB  99
 
 #define PI_CMD_WVTXM 100
+#define PI_CMD_WVTAT 101
 
 /*DEF_E*/
 
@@ -4986,8 +5019,8 @@ after this command is issued.
 /*DEF_S Error Codes*/
 
 #define PI_INIT_FAILED       -1 // gpioInitialise failed
-#define PI_BAD_USER_GPIO     -2 // gpio not 0-31
-#define PI_BAD_GPIO          -3 // gpio not 0-53
+#define PI_BAD_USER_GPIO     -2 // GPIO not 0-31
+#define PI_BAD_GPIO          -3 // GPIO not 0-53
 #define PI_BAD_MODE          -4 // mode not 0-7
 #define PI_BAD_LEVEL         -5 // level not 0-1
 #define PI_BAD_PUD           -6 // pud not 0-2
@@ -5024,11 +5057,11 @@ after this command is issued.
 #define PI_BAD_WAVE_BAUD    -35 // baud rate not 50-250K(RX)/50-1M(TX)
 #define PI_TOO_MANY_PULSES  -36 // waveform has too many pulses
 #define PI_TOO_MANY_CHARS   -37 // waveform has too many chars
-#define PI_NOT_SERIAL_GPIO  -38 // no bit bang serial read in progress on gpio
+#define PI_NOT_SERIAL_GPIO  -38 // no bit bang serial read in progress on GPIO
 #define PI_BAD_SERIAL_STRUC -39 // bad (null) serial structure parameter
 #define PI_BAD_SERIAL_BUF   -40 // bad (null) serial buf parameter
-#define PI_NOT_PERMITTED    -41 // gpio operation not permitted
-#define PI_SOME_PERMITTED   -42 // one or more gpios not permitted
+#define PI_NOT_PERMITTED    -41 // GPIO operation not permitted
+#define PI_SOME_PERMITTED   -42 // one or more GPIO not permitted
 #define PI_BAD_WVSC_COMMND  -43 // bad WVSC subcommand
 #define PI_BAD_WVSM_COMMND  -44 // bad WVSM subcommand
 #define PI_BAD_WVSP_COMMND  -45 // bad WVSP subcommand
@@ -5036,7 +5069,7 @@ after this command is issued.
 #define PI_BAD_SCRIPT       -47 // invalid script
 #define PI_BAD_SCRIPT_ID    -48 // unknown script id
 #define PI_BAD_SER_OFFSET   -49 // add serial data offset > 30 minutes
-#define PI_GPIO_IN_USE      -50 // gpio already in use
+#define PI_GPIO_IN_USE      -50 // GPIO already in use
 #define PI_BAD_SERIAL_COUNT -51 // must read at least a byte at a time
 #define PI_BAD_PARAM_NUM    -52 // script parameter id not 0-9
 #define PI_DUP_TAG          -53 // script has duplicate tag
@@ -5077,11 +5110,11 @@ after this command is issued.
 #define PI_UNKNOWN_COMMAND  -88 // unknown command
 #define PI_SPI_XFER_FAILED  -89 // spi xfer/read/write failed
 #define PI_BAD_POINTER      -90 // bad (NULL) pointer
-#define PI_NO_AUX_SPI       -91 // need a A+/B+/Pi2/Zero for auxiliary SPI
-#define PI_NOT_PWM_GPIO     -92 // gpio is not in use for PWM
-#define PI_NOT_SERVO_GPIO   -93 // gpio is not in use for servo pulses
-#define PI_NOT_HCLK_GPIO    -94 // gpio has no hardware clock
-#define PI_NOT_HPWM_GPIO    -95 // gpio has no hardware PWM
+#define PI_NO_AUX_SPI       -91 // no auxiliary SPI on Pi A or B
+#define PI_NOT_PWM_GPIO     -92 // GPIO is not in use for PWM
+#define PI_NOT_SERVO_GPIO   -93 // GPIO is not in use for servo pulses
+#define PI_NOT_HCLK_GPIO    -94 // GPIO has no hardware clock
+#define PI_NOT_HPWM_GPIO    -95 // GPIO has no hardware PWM
 #define PI_BAD_HPWM_FREQ    -96 // hardware PWM frequency not 1-125M
 #define PI_BAD_HPWM_DUTY    -97 // hardware PWM dutycycle not 0-1M
 #define PI_BAD_HCLK_FREQ    -98 // hardware clock frequency not 4689-250M
@@ -5094,7 +5127,7 @@ after this command is issued.
 #define PI_TOO_MANY_SEGS   -105 // too many I2C transaction segments
 #define PI_BAD_I2C_SEG     -106 // an I2C transaction segment failed
 #define PI_BAD_SMBUS_CMD   -107 // SMBus command not supported by driver
-#define PI_NOT_I2C_GPIO    -108 // no bit bang I2C in progress on gpio
+#define PI_NOT_I2C_GPIO    -108 // no bit bang I2C in progress on GPIO
 #define PI_BAD_I2C_WLEN    -109 // bad I2C write length
 #define PI_BAD_I2C_RLEN    -110 // bad I2C read length
 #define PI_BAD_I2C_CMD     -111 // bad I2C command
index b960fdfdd8752bd9447806c5d40e6f1160c96f6b..b6b41d04ad788472c395deef7560e3c40af53654 100644 (file)
--- a/pigpio.py
+++ b/pigpio.py
@@ -1,7 +1,7 @@
 """
 pigpio is a Python module for the Raspberry which talks to
 the pigpio daemon to allow control of the general purpose
-input outputs (gpios).
+input outputs (GPIO).
 
 [http://abyz.co.uk/rpi/pigpio/python.html]
 
@@ -11,23 +11,23 @@ o the pigpio Python module can run on Windows, Macs, or Linux
 
 o controls one or more Pi's
 
-o independent PWM on any of gpios 0-31 simultaneously
+o independent PWM on any of GPIO 0-31 simultaneously
 
-o independent servo pulses on any of gpios 0-31 simultaneously
+o independent servo pulses on any of GPIO 0-31 simultaneously
 
-o callbacks when any of gpios 0-31 change state
+o callbacks when any of GPIO 0-31 change state
 
 o creating and transmitting precisely timed waveforms
 
-o reading/writing gpios and setting their modes
+o reading/writing GPIO and setting their modes
 
 o wrappers for I2C, SPI, and serial links
 
 o creating and running scripts on the pigpio daemon
 
-*gpios*
+*GPIO*
 
-ALL gpios are identified by their Broadcom number.
+ALL GPIO are identified by their Broadcom number.
 
 *Notes*
 
@@ -42,7 +42,7 @@ A number of settings are determined when the pigpio daemon is started.
 
 o the sample rate (1, 2, 4, 5, 8, or 10 us, default 5 us).
 
-o the set of gpios which may be updated (generally written to).  The
+o the set of GPIO which may be updated (generally written to).  The
   default set is those available on the Pi board revision.
 
 o the available PWM frequencies (see [*set_PWM_frequency*]).
@@ -69,7 +69,7 @@ pigpio.exceptions = True
 *Usage*
 
 This module uses the services of the C pigpio library.  pigpio
-must be running on the Pi(s) whose gpios are to be manipulated.
+must be running on the Pi(s) whose GPIO are to be manipulated.
 
 The normal way to start pigpio is as a daemon (during system
 start).
@@ -78,16 +78,16 @@ sudo pigpiod
 
 Your Python program must import pigpio and create one or more
 instances of the pigpio.pi class.  This class gives access to
-a specified Pi's gpios.
+a specified Pi's GPIO.
 
 ...
-pi1 = pigpio.pi()       # pi1 accesses the local Pi's gpios
-pi2 = pigpio.pi('tom')  # pi2 accesses tom's gpios
-pi3 = pigpio.pi('dick') # pi3 accesses dick's gpios
+pi1 = pigpio.pi()       # pi1 accesses the local Pi's GPIO
+pi2 = pigpio.pi('tom')  # pi2 accesses tom's GPIO
+pi3 = pigpio.pi('dick') # pi3 accesses dick's GPIO
 
-pi1.write(4, 0) # set local Pi's gpio 4 low
-pi2.write(4, 1) # set tom's gpio 4 to high
-pi3.read(4)     # get level of dick's gpio 4
+pi1.write(4, 0) # set local Pi's GPIO 4 low
+pi2.write(4, 1) # set tom's GPIO 4 to high
+pi3.read(4)     # get level of dick's GPIO 4
 ...
 
 The later example code snippets assume that pi is an instance of
@@ -102,62 +102,62 @@ stop                      Stop a Pi connection
 
 Beginner
 
-set_mode                  Set a gpio mode
-get_mode                  Get a gpio mode
-set_pull_up_down          Set/clear gpio pull up/down resistor
+set_mode                  Set a GPIO mode
+get_mode                  Get a GPIO mode
+set_pull_up_down          Set/clear GPIO pull up/down resistor
 
-read                      Read a gpio
-write                     Write a gpio
+read                      Read a GPIO
+write                     Write a GPIO
 
-set_PWM_dutycycle         Start/stop PWM pulses on a gpio
-get_PWM_dutycycle         Get PWM dutycycle set on a gpio
+set_PWM_dutycycle         Start/stop PWM pulses on a GPIO
+get_PWM_dutycycle         Get PWM dutycycle set on a GPIO
 
-set_servo_pulsewidth      Start/Stop servo pulses on a gpio
-get_servo_pulsewidth      Get servo pulsewidth set on a gpio
+set_servo_pulsewidth      Start/Stop servo pulses on a GPIO
+get_servo_pulsewidth      Get servo pulsewidth set on a GPIO
 
-callback                  Create gpio level change callback
-wait_for_edge             Wait for gpio level change
+callback                  Create GPIO level change callback
+wait_for_edge             Wait for GPIO level change
 
 Intermediate
 
-gpio_trigger              Send a trigger pulse to a gpio
+gpio_trigger              Send a trigger pulse to a GPIO
 
-set_watchdog              Set a watchdog on a gpio
+set_watchdog              Set a watchdog on a GPIO
 
-set_PWM_range             Configure PWM range of a gpio
-get_PWM_range             Get configured PWM range of a gpio
+set_PWM_range             Configure PWM range of a GPIO
+get_PWM_range             Get configured PWM range of a GPIO
 
-set_PWM_frequency         Set PWM frequency of a gpio
-get_PWM_frequency         Get PWM frequency of a gpio
+set_PWM_frequency         Set PWM frequency of a GPIO
+get_PWM_frequency         Get PWM frequency of a GPIO
 
-read_bank_1               Read all bank 1 gpios
-read_bank_2               Read all bank 2 gpios
+read_bank_1               Read all bank 1 GPIO
+read_bank_2               Read all bank 2 GPIO
 
-clear_bank_1              Clear selected gpios in bank 1
-clear_bank_2              Clear selected gpios in bank 2
+clear_bank_1              Clear selected GPIO in bank 1
+clear_bank_2              Clear selected GPIO in bank 2
 
-set_bank_1                Set selected gpios in bank 1
-set_bank_2                Set selected gpios in bank 2
+set_bank_1                Set selected GPIO in bank 1
+set_bank_2                Set selected GPIO in bank 2
 
 Advanced
 
-get_PWM_real_range        Get underlying PWM range for a gpio
+get_PWM_real_range        Get underlying PWM range for a GPIO
 
 notify_open               Request a notification handle
-notify_begin              Start notifications for selected gpios
+notify_begin              Start notifications for selected GPIO
 notify_pause              Pause notifications
 notify_close              Close a notification
 
-bb_serial_read_open       Open a gpio for bit bang serial reads
-bb_serial_read            Read bit bang serial data from  a gpio
-bb_serial_read_close      Close a gpio for bit bang serial reads
+bb_serial_read_open       Open a GPIO for bit bang serial reads
+bb_serial_read            Read bit bang serial data from  a GPIO
+bb_serial_read_close      Close a GPIO for bit bang serial reads
 bb_serial_invert          Invert serial logic (1 invert, 0 normal)
 
-hardware_clock            Start hardware clock on supported gpios
-hardware_PWM              Start hardware PWM on supported gpios
+hardware_clock            Start hardware clock on supported GPIO
+hardware_PWM              Start hardware PWM on supported GPIO
 
-set_glitch_filter         Set a glitch filter on a gpio
-set_noise_filter          Set a noise filter on a gpio
+set_glitch_filter         Set a glitch filter on a GPIO
+set_noise_filter          Set a noise filter on a GPIO
 
 Scripts
 
@@ -184,6 +184,7 @@ wave_send_using_mode      Transmits a waveform in the chosen mode
 
 wave_chain                Transmits a chain of waveforms
 
+wave_tx_at                Returns the current transmitting waveform
 wave_tx_busy              Checks to see if a waveform has ended
 wave_tx_stop              Aborts the current waveform
 
@@ -219,8 +220,8 @@ i2c_write_device          Writes the raw I2C device
 
 i2c_zip                   Performs multiple I2C transactions
 
-bb_i2c_open               Opens gpios for bit banging I2C
-bb_i2c_close              Closes gpios for bit banging I2C
+bb_i2c_open               Opens GPIO for bit banging I2C
+bb_i2c_close              Closes GPIO for bit banging I2C
 bb_i2c_zip                Performs multiple bit banged I2C transactions
 
 SPI
@@ -269,11 +270,11 @@ import threading
 import os
 import atexit
 
-VERSION = "1.27"
+VERSION = "1.29"
 
 exceptions = True
 
-# gpio levels
+# GPIO levels
 
 OFF   = 0
 LOW   = 0
@@ -285,13 +286,13 @@ SET  = 1
 
 TIMEOUT = 2
 
-# gpio edges
+# GPIO edges
 
 RISING_EDGE  = 0
 FALLING_EDGE = 1
 EITHER_EDGE  = 2
 
-# gpio modes
+# GPIO modes
 
 INPUT  = 0
 OUTPUT = 1
@@ -302,7 +303,7 @@ ALT3   = 7
 ALT4   = 3
 ALT5   = 2
 
-# gpio Pull Up Down
+# GPIO Pull Up Down
 
 PUD_OFF  = 0
 PUD_DOWN = 1
@@ -329,6 +330,9 @@ WAVE_MODE_REPEAT       =1
 WAVE_MODE_ONE_SHOT_SYNC=2
 WAVE_MODE_REPEAT_SYNC  =3
 
+WAVE_NOT_FOUND = 9998 # Transmitted wave not found.
+NO_TX_WAVE     = 9999 # No wave being transmitted.
+
 # pigpio command numbers
 
 _PI_CMD_MODES= 0
@@ -454,6 +458,7 @@ _PI_CMD_FG   =97
 _PI_CMD_FN   =98
 
 _PI_CMD_WVTXM=100
+_PI_CMD_WVAT =101
 
 # pigpio error numbers
 
@@ -589,8 +594,8 @@ PI_BAD_FILTER       =-125
 
 _errors=[
    [_PI_INIT_FAILED      , "pigpio initialisation failed"],
-   [PI_BAD_USER_GPIO     , "gpio not 0-31"],
-   [PI_BAD_GPIO          , "gpio not 0-53"],
+   [PI_BAD_USER_GPIO     , "GPIO not 0-31"],
+   [PI_BAD_GPIO          , "GPIO not 0-53"],
    [PI_BAD_MODE          , "mode not 0-7"],
    [PI_BAD_LEVEL         , "level not 0-1"],
    [PI_BAD_PUD           , "pud not 0-2"],
@@ -625,9 +630,9 @@ _errors=[
    [PI_BAD_WAVE_BAUD     , "baud rate not 50-250000(RX)/1000000(TX)"],
    [PI_TOO_MANY_PULSES   , "waveform has too many pulses"],
    [PI_TOO_MANY_CHARS    , "waveform has too many chars"],
-   [PI_NOT_SERIAL_GPIO   , "no bit bang serial read in progress on gpio"],
-   [PI_NOT_PERMITTED     , "no permission to update gpio"],
-   [PI_SOME_PERMITTED    , "no permission to update one or more gpios"],
+   [PI_NOT_SERIAL_GPIO   , "no bit bang serial read in progress on GPIO"],
+   [PI_NOT_PERMITTED     , "no permission to update GPIO"],
+   [PI_SOME_PERMITTED    , "no permission to update one or more GPIO"],
    [PI_BAD_WVSC_COMMND   , "bad WVSC subcommand"],
    [PI_BAD_WVSM_COMMND   , "bad WVSM subcommand"],
    [PI_BAD_WVSP_COMMND   , "bad WVSP subcommand"],
@@ -635,7 +640,7 @@ _errors=[
    [PI_BAD_SCRIPT        , "invalid script"],
    [PI_BAD_SCRIPT_ID     , "unknown script id"],
    [PI_BAD_SER_OFFSET    , "add serial data offset > 30 minute"],
-   [PI_GPIO_IN_USE       , "gpio already in use"],
+   [PI_GPIO_IN_USE       , "GPIO already in use"],
    [PI_BAD_SERIAL_COUNT  , "must read at least a byte at a time"],
    [PI_BAD_PARAM_NUM     , "script parameter id not 0-9"],
    [PI_DUP_TAG           , "script has duplicate tag"],
@@ -676,11 +681,11 @@ _errors=[
    [PI_UNKNOWN_COMMAND   , "unknown command"],
    [PI_SPI_XFER_FAILED   , "SPI xfer/read/write failed"],
    [_PI_BAD_POINTER      , "bad (NULL) pointer"],
-   [PI_NO_AUX_SPI        , "need a A+/B+/Pi2/Zero for auxiliary SPI"],
-   [PI_NOT_PWM_GPIO      , "gpio is not in use for PWM"],
-   [PI_NOT_SERVO_GPIO    , "gpio is not in use for servo pulses"],
-   [PI_NOT_HCLK_GPIO     , "gpio has no hardware clock"],
-   [PI_NOT_HPWM_GPIO     , "gpio has no hardware PWM"],
+   [PI_NO_AUX_SPI        , "no auxiliary SPI on Pi A or B"],
+   [PI_NOT_PWM_GPIO      , "GPIO is not in use for PWM"],
+   [PI_NOT_SERVO_GPIO    , "GPIO is not in use for servo pulses"],
+   [PI_NOT_HCLK_GPIO     , "GPIO has no hardware clock"],
+   [PI_NOT_HPWM_GPIO     , "GPIO has no hardware PWM"],
    [PI_BAD_HPWM_FREQ     , "hardware PWM frequency not 1-125M"],
    [PI_BAD_HPWM_DUTY     , "hardware PWM dutycycle not 0-1M"],
    [PI_BAD_HCLK_FREQ     , "hardware clock frequency not 4689-250M"],
@@ -693,7 +698,7 @@ _errors=[
    [_PI_TOO_MANY_SEGS    , "too many I2C transaction segments"],
    [_PI_BAD_I2C_SEG      , "an I2C transaction segment failed"],
    [PI_BAD_SMBUS_CMD     , "SMBus command not supported"],
-   [PI_NOT_I2C_GPIO      , "no bit bang I2C in progress on gpio"],
+   [PI_NOT_I2C_GPIO      , "no bit bang I2C in progress on GPIO"],
    [PI_BAD_I2C_WLEN      , "bad I2C write length"],
    [PI_BAD_I2C_RLEN      , "bad I2C read length"],
    [PI_BAD_I2C_CMD       , "bad I2C command"],
@@ -738,8 +743,8 @@ class pulse:
       """
       Initialises a pulse.
 
-       gpio_on:= the gpios to switch on at the start of the pulse.
-      gpio_off:= the gpios to switch off at the start of the pulse.
+       gpio_on:= the GPIO to switch on at the start of the pulse.
+      gpio_off:= the GPIO to switch off at the start of the pulse.
          delay:= the delay in microseconds before the next pulse.
 
       """
@@ -875,9 +880,9 @@ class _callback_ADT:
       """
       Initialises a callback ADT.
 
-      gpio:= Broadcom gpio number.
+      gpio:= Broadcom GPIO number.
       edge:= EITHER_EDGE, RISING_EDGE, or FALLING_EDGE.
-      func:= a user function taking three arguments (gpio, level, tick).
+      func:= a user function taking three arguments (GPIO, level, tick).
       """
       self.gpio = gpio
       self.edge = edge
@@ -963,7 +968,7 @@ class _callback_thread(threading.Thread):
       self.sl.s.close()
 
 class _callback:
-   """A class to provide gpio level change callbacks."""
+   """A class to provide GPIO level change callbacks."""
 
    def __init__(self, notify, user_gpio, edge=RISING_EDGE, func=None):
       """
@@ -1006,7 +1011,7 @@ class _callback:
       self.count = 0
 
 class _wait_for_edge:
-   """Encapsulates waiting for gpio edges."""
+   """Encapsulates waiting for GPIO edges."""
 
    def __init__(self, notify, gpio, edge, timeout):
       """Initialises a wait_for_edge."""
@@ -1034,22 +1039,22 @@ class pi():
 
    def set_mode(self, gpio, mode):
       """
-      Sets the gpio mode.
+      Sets the GPIO mode.
 
       gpio:= 0-53.
       mode:= INPUT, OUTPUT, ALT0, ALT1, ALT2, ALT3, ALT4, ALT5.
 
       ...
-      pi.set_mode( 4, pigpio.INPUT)  # gpio  4 as input
-      pi.set_mode(17, pigpio.OUTPUT) # gpio 17 as output
-      pi.set_mode(24, pigpio.ALT2)   # gpio 24 as ALT2
+      pi.set_mode( 4, pigpio.INPUT)  # GPIO  4 as input
+      pi.set_mode(17, pigpio.OUTPUT) # GPIO 17 as output
+      pi.set_mode(24, pigpio.ALT2)   # GPIO 24 as ALT2
       ...
       """
       return _u2i(_pigpio_command(self.sl, _PI_CMD_MODES, gpio, mode))
 
    def get_mode(self, gpio):
       """
-      Returns the gpio mode.
+      Returns the GPIO mode.
 
       gpio:= 0-53.
 
@@ -1075,7 +1080,7 @@ class pi():
 
    def set_pull_up_down(self, gpio, pud):
       """
-      Sets or clears the internal gpio pull-up/down resistor.
+      Sets or clears the internal GPIO pull-up/down resistor.
 
       gpio:= 0-53.
        pud:= PUD_UP, PUD_DOWN, PUD_OFF.
@@ -1090,7 +1095,7 @@ class pi():
 
    def read(self, gpio):
       """
-      Returns the gpio level.
+      Returns the GPIO level.
 
       gpio:= 0-53.
 
@@ -1110,12 +1115,12 @@ class pi():
 
    def write(self, gpio, level):
       """
-      Sets the gpio level.
+      Sets the GPIO level.
 
-       gpio:= 0-53.
+       GPIO:= 0-53.
       level:= 0, 1.
 
-      If PWM or servo pulses are active on the gpio they are
+      If PWM or servo pulses are active on the GPIO they are
       switched off.
 
       ...
@@ -1134,7 +1139,7 @@ class pi():
 
    def set_PWM_dutycycle(self, user_gpio, dutycycle):
       """
-      Starts (non-zero dutycycle) or stops (0) PWM pulses on the gpio.
+      Starts (non-zero dutycycle) or stops (0) PWM pulses on the GPIO.
 
       user_gpio:= 0-31.
       dutycycle:= 0-range (range defaults to 255).
@@ -1154,7 +1159,7 @@ class pi():
 
    def get_PWM_dutycycle(self, user_gpio):
       """
-      Returns the PWM dutycycle being used on the gpio.
+      Returns the PWM dutycycle being used on the GPIO.
 
       user_gpio:= 0-31.
 
@@ -1162,12 +1167,12 @@ class pi():
 
 
       For normal PWM the dutycycle will be out of the defined range
-      for the gpio (see [*get_PWM_range*]).
+      for the GPIO (see [*get_PWM_range*]).
 
-      If a hardware clock is active on the gpio the reported
+      If a hardware clock is active on the GPIO the reported
       dutycycle will be 500000 (500k) out of 1000000 (1M).
 
-      If hardware PWM is active on the gpio the reported dutycycle
+      If hardware PWM is active on the GPIO the reported dutycycle
       will be out of a 1000000 (1M).
 
       ...
@@ -1184,7 +1189,7 @@ class pi():
 
    def set_PWM_range(self, user_gpio, range_):
       """
-      Sets the range of PWM values to be used on the gpio.
+      Sets the range of PWM values to be used on the GPIO.
 
       user_gpio:= 0-31.
          range_:= 25-40000.
@@ -1199,11 +1204,11 @@ class pi():
 
    def get_PWM_range(self, user_gpio):
       """
-      Returns the range of PWM values being used on the gpio.
+      Returns the range of PWM values being used on the GPIO.
 
       user_gpio:= 0-31.
 
-      If a hardware clock or hardware PWM is active on the gpio
+      If a hardware clock or hardware PWM is active on the GPIO
       the reported range will be 1000000 (1M).
 
       ...
@@ -1217,14 +1222,14 @@ class pi():
    def get_PWM_real_range(self, user_gpio):
       """
       Returns the real (underlying) range of PWM values being
-      used on the gpio.
+      used on the GPIO.
 
       user_gpio:= 0-31.
 
-      If a hardware clock is active on the gpio the reported
+      If a hardware clock is active on the GPIO the reported
       real range will be 1000000 (1M).
 
-      If hardware PWM is active on the gpio the reported real range
+      If hardware PWM is active on the GPIO the reported real range
       will be approximately 250M divided by the set PWM frequency.
 
       ...
@@ -1237,7 +1242,7 @@ class pi():
 
    def set_PWM_frequency(self, user_gpio, frequency):
       """
-      Sets the frequency (in Hz) of the PWM to be used on the gpio.
+      Sets the frequency (in Hz) of the PWM to be used on the GPIO.
 
       user_gpio:= 0-31.
       frequency:= >=0 Hz
@@ -1259,19 +1264,19 @@ class pi():
 
    def get_PWM_frequency(self, user_gpio):
       """
-      Returns the frequency of PWM being used on the gpio.
+      Returns the frequency of PWM being used on the GPIO.
 
       user_gpio:= 0-31.
 
-      Returns the frequency (in Hz) used for the gpio.
+      Returns the frequency (in Hz) used for the GPIO.
 
-      For normal PWM the frequency will be that defined for the gpio
+      For normal PWM the frequency will be that defined for the GPIO
       by [*set_PWM_frequency*].
 
-      If a hardware clock is active on the gpio the reported frequency
+      If a hardware clock is active on the GPIO the reported frequency
       will be that set by [*hardware_clock*].
 
-      If hardware PWM is active on the gpio the reported frequency
+      If hardware PWM is active on the GPIO the reported frequency
       will be that set by [*hardware_PWM*].
 
       ...
@@ -1288,7 +1293,7 @@ class pi():
 
    def set_servo_pulsewidth(self, user_gpio, pulsewidth):
       """
-      Starts (500-2500) or stops (0) servo pulses on the gpio.
+      Starts (500-2500) or stops (0) servo pulses on the GPIO.
 
        user_gpio:= 0-31.
       pulsewidth:= 0 (off),
@@ -1316,7 +1321,7 @@ class pi():
 
    def get_servo_pulsewidth(self, user_gpio):
       """
-      Returns the servo pulsewidth being used on the gpio.
+      Returns the servo pulsewidth being used on the GPIO.
 
       user_gpio:= 0-31.
 
@@ -1338,7 +1343,7 @@ class pi():
       """
       Returns a notification handle (>=0).
 
-      A notification is a method for being notified of gpio state
+      A notification is a method for being notified of GPIO state
       changes via a pipe.
 
       Pipes are only accessible from the local machine so this
@@ -1366,7 +1371,7 @@ class pi():
 
       flags: two flags are defined, PI_NTFY_FLAGS_WDOG and
       PI_NTFY_FLAGS_ALIVE.  If bit 5 is set (PI_NTFY_FLAGS_WDOG)
-      then bits 0-4 of the flags indicate a gpio which has had a
+      then bits 0-4 of the flags indicate a GPIO which has had a
       watchdog timeout; if bit 6 is set (PI_NTFY_FLAGS_ALIVE) this
       indicates a keep alive signal on the pipe/socket and is sent
       once a minute in the absence of other notification activity.
@@ -1374,8 +1379,8 @@ class pi():
       tick: the number of microseconds since system boot.  It wraps
       around after 1h12m.
 
-      level: indicates the level of each gpio.  If bit 1<<x is set
-      then gpio x is high.
+      level: indicates the level of each GPIO.  If bit 1<<x is set
+      then GPIO x is high.
 
       ...
       h = pi.notify_open()
@@ -1390,12 +1395,12 @@ class pi():
       Starts notifications on a handle.
 
       handle:= >=0 (as returned by a prior call to [*notify_open*])
-        bits:= a 32 bit mask indicating the gpios to be notified.
+        bits:= a 32 bit mask indicating the GPIO to be notified.
 
-      The notification sends state changes for each gpio whose
+      The notification sends state changes for each GPIO whose
       corresponding bit in bits is set.
 
-      The following code starts notifications for gpios 1, 4,
+      The following code starts notifications for GPIO 1, 4,
       6, 7, and 10 (1234 = 0x04D2 = 0b0000010011010010).
 
       ...
@@ -1447,27 +1452,27 @@ class pi():
 
    def set_watchdog(self, user_gpio, wdog_timeout):
       """
-      Sets a watchdog timeout for a gpio.
+      Sets a watchdog timeout for a GPIO.
 
          user_gpio:= 0-31.
       wdog_timeout:= 0-60000.
 
       The watchdog is nominally in milliseconds.
 
-      Only one watchdog may be registered per gpio.
+      Only one watchdog may be registered per GPIO.
 
       The watchdog may be cancelled by setting timeout to 0.
 
-      If no level change has been detected for the gpio for timeout
-      milliseconds any notification for the gpio has a report written
+      If no level change has been detected for the GPIO for timeout
+      milliseconds any notification for the GPIO has a report written
       to the fifo with the flags set to indicate a watchdog timeout.
 
       The callback class interprets the flags and will
-      call registered callbacks for the gpio with level TIMEOUT.
+      call registered callbacks for the GPIO with level TIMEOUT.
 
       ...
-      pi.set_watchdog(23, 1000) # 1000 ms watchdog on gpio 23
-      pi.set_watchdog(23, 0)    # cancel watchdog on gpio 23
+      pi.set_watchdog(23, 1000) # 1000 ms watchdog on GPIO 23
+      pi.set_watchdog(23, 0)    # cancel watchdog on GPIO 23
       ...
       """
       return _u2i(_pigpio_command(
@@ -1475,10 +1480,10 @@ class pi():
 
    def read_bank_1(self):
       """
-      Returns the levels of the bank 1 gpios (gpios 0-31).
+      Returns the levels of the bank 1 GPIO (GPIO 0-31).
 
       The returned 32 bit integer has a bit set if the corresponding
-      gpio is high.  Gpio n has bit value (1<<n).
+      GPIO is high.  GPIO n has bit value (1<<n).
 
       ...
       print(bin(pi.read_bank_1()))
@@ -1489,10 +1494,10 @@ class pi():
 
    def read_bank_2(self):
       """
-      Returns the levels of the bank 2 gpios (gpios 32-53).
+      Returns the levels of the bank 2 GPIO (GPIO 32-53).
 
       The returned 32 bit integer has a bit set if the corresponding
-      gpio is high.  Gpio n has bit value (1<<(n-32)).
+      GPIO is high.  GPIO n has bit value (1<<(n-32)).
 
       ...
       print(bin(pi.read_bank_2()))
@@ -1503,13 +1508,13 @@ class pi():
 
    def clear_bank_1(self, bits):
       """
-      Clears gpios 0-31 if the corresponding bit in bits is set.
+      Clears GPIO 0-31 if the corresponding bit in bits is set.
 
-      bits:= a 32 bit mask with 1 set if the corresponding gpio is
+      bits:= a 32 bit mask with 1 set if the corresponding GPIO is
              to be cleared.
 
       A returned status of PI_SOME_PERMITTED indicates that the user
-      is not allowed to write to one or more of the gpios.
+      is not allowed to write to one or more of the GPIO.
 
       ...
       pi.clear_bank_1(int("111110010000",2))
@@ -1519,13 +1524,13 @@ class pi():
 
    def clear_bank_2(self, bits):
       """
-      Clears gpios 32-53 if the corresponding bit (0-21) in bits is set.
+      Clears GPIO 32-53 if the corresponding bit (0-21) in bits is set.
 
-      bits:= a 32 bit mask with 1 set if the corresponding gpio is
+      bits:= a 32 bit mask with 1 set if the corresponding GPIO is
              to be cleared.
 
       A returned status of PI_SOME_PERMITTED indicates that the user
-      is not allowed to write to one or more of the gpios.
+      is not allowed to write to one or more of the GPIO.
 
       ...
       pi.clear_bank_2(0x1010)
@@ -1535,13 +1540,13 @@ class pi():
 
    def set_bank_1(self, bits):
       """
-      Sets gpios 0-31 if the corresponding bit in bits is set.
+      Sets GPIO 0-31 if the corresponding bit in bits is set.
 
-      bits:= a 32 bit mask with 1 set if the corresponding gpio is
+      bits:= a 32 bit mask with 1 set if the corresponding GPIO is
              to be set.
 
       A returned status of PI_SOME_PERMITTED indicates that the user
-      is not allowed to write to one or more of the gpios.
+      is not allowed to write to one or more of the GPIO.
 
       ...
       pi.set_bank_1(int("111110010000",2))
@@ -1551,13 +1556,13 @@ class pi():
 
    def set_bank_2(self, bits):
       """
-      Sets gpios 32-53 if the corresponding bit (0-21) in bits is set.
+      Sets GPIO 32-53 if the corresponding bit (0-21) in bits is set.
 
-      bits:= a 32 bit mask with 1 set if the corresponding gpio is
+      bits:= a 32 bit mask with 1 set if the corresponding GPIO is
              to be set.
 
       A returned status of PI_SOME_PERMITTED indicates that the user
-      is not allowed to write to one or more of the gpios.
+      is not allowed to write to one or more of the GPIO.
 
       ...
       pi.set_bank_2(0x303)
@@ -1567,7 +1572,7 @@ class pi():
 
    def hardware_clock(self, gpio, clkfreq):
       """
-      Starts a hardware clock on a gpio at the specified frequency.
+      Starts a hardware clock on a GPIO at the specified frequency.
       Frequencies above 30MHz are unlikely to work.
 
          gpio:= see description
@@ -1577,18 +1582,17 @@ class pi():
       Returns 0 if OK, otherwise PI_NOT_PERMITTED, PI_BAD_GPIO,
       PI_NOT_HCLK_GPIO, PI_BAD_HCLK_FREQ,or PI_BAD_HCLK_PASS.
 
-      The same clock is available on multiple gpios.  The latest
-      frequency setting will be used by all gpios which share a clock.
+      The same clock is available on multiple GPIO.  The latest
+      frequency setting will be used by all GPIO which share a clock.
 
-      The gpio must be one of the following.
+      The GPIO must be one of the following.
 
       . .
       4   clock 0  All models
-      5   clock 1  A+/B+/Pi2/Zero and compute module only
-                   (reserved for system use)
-      6   clock 2  A+/B+/Pi2/Zero and compute module only
-      20  clock 0  A+/B+/Pi2/Zero and compute module only
-      21  clock 1  All models but Rev.2 B (reserved for system use)
+      5   clock 1  All models but A and B (reserved for system use)
+      6   clock 2  All models but A and B
+      20  clock 0  All models but A and B
+      21  clock 1  All models but A and Rev.2 B (reserved for system use)
 
       32  clock 0  Compute module only
       34  clock 0  Compute module only
@@ -1599,19 +1603,19 @@ class pi():
 
       Access to clock 1 is protected by a password as its use will
       likely crash the Pi.  The password is given by or'ing 0x5A000000
-      with the gpio number.
+      with the GPIO number.
 
       ...
-      pi.hardware_clock(4, 5000) # 5 KHz clock on gpio 4
+      pi.hardware_clock(4, 5000) # 5 KHz clock on GPIO 4
 
-      pi.hardware_clock(4, 40000000) # 40 MHz clock on gpio 4
+      pi.hardware_clock(4, 40000000) # 40 MHz clock on GPIO 4
       ...
       """
       return _u2i(_pigpio_command(self.sl, _PI_CMD_HC, gpio, clkfreq))
 
    def hardware_PWM(self, gpio, PWMfreq, PWMduty):
       """
-      Starts hardware PWM on a gpio at the specified frequency
+      Starts hardware PWM on a GPIO at the specified frequency
       and dutycycle. Frequencies above 30MHz are unlikely to work.
 
       NOTE: Any waveform started by [*wave_send_once*],
@@ -1628,17 +1632,17 @@ class pi():
       Returns 0 if OK, otherwise PI_NOT_PERMITTED, PI_BAD_GPIO,
       PI_NOT_HPWM_GPIO, PI_BAD_HPWM_DUTY, PI_BAD_HPWM_FREQ.
 
-      The same PWM channel is available on multiple gpios.
+      The same PWM channel is available on multiple GPIO.
       The latest frequency and dutycycle setting will be used
-      by all gpios which share a PWM channel.
+      by all GPIO which share a PWM channel.
 
-      The gpio must be one of the following.
+      The GPIO must be one of the following.
 
       . .
-      12  PWM channel 0  A+/B+/Pi2/Zero and compute module only
-      13  PWM channel 1  A+/B+/Pi2/Zero and compute module only
+      12  PWM channel 0  All models but A and B
+      13  PWM channel 1  All models but A and B
       18  PWM channel 0  All models
-      19  PWM channel 1  A+/B+/Pi2/Zero and compute module only
+      19  PWM channel 1  All models but A and B
 
       40  PWM channel 0  Compute module only
       41  PWM channel 1  Compute module only
@@ -1699,7 +1703,7 @@ class pi():
       Revision line of /proc/cpuinfo.
 
       The revision number can be used to determine the assignment
-      of gpios to pins (see [*gpio*]).
+      of GPIO to pins (see [*gpio*]).
 
       There are at least three types of board.
 
@@ -1766,7 +1770,7 @@ class pi():
       waveform (if any).
 
       Merging allows the waveform to be built in parts, that is the
-      settings for gpio#1 can be added, and then gpio#2 etc.
+      settings for GPIO#1 can be added, and then GPIO#2 etc.
 
       If the added waveform is intended to start after or within
       the existing waveform then the first pulse should consist
@@ -1839,7 +1843,7 @@ class pi():
       waveform (if any).  The serial data starts [*offset*]
       microseconds from the start of the waveform.
 
-      user_gpio:= gpio to transmit data.  You must set the gpio mode
+      user_gpio:= GPIO to transmit data.  You must set the GPIO mode
                   to output.
            baud:= 50-1000000 bits per second.
            data:= the bytes to write.
@@ -1920,8 +1924,8 @@ class pi():
 
       A pulse specifies
 
-      1) the gpios to be switched on at the start of the pulse. 
-      2) the gpios to be switched off at the start of the pulse. 
+      1) the GPIO to be switched on at the start of the pulse. 
+      2) the GPIO to be switched off at the start of the pulse. 
       3) the delay in microseconds before the next pulse.
 
       Any or all the fields can be zero.  It doesn't make any sense
@@ -2039,6 +2043,23 @@ class pi():
       """
       return _u2i(_pigpio_command(self.sl, _PI_CMD_WVTXM, wave_id, mode))
 
+   def wave_tx_at(self):
+      """
+      Returns the id of the waveform currently being
+      transmitted.
+
+      Returns the waveform id or one of the following special
+      values:
+
+      WAVE_NOT_FOUND (9998) - transmitted wave not found. 
+      NO_TX_WAVE (9999) - no wave being transmitted.
+
+      ...
+      wid = pi.wave_tx_at()
+      ...
+      """
+      return _u2i(_pigpio_command(self.sl, _PI_CMD_WVTAT, 0, 0))
+
    def wave_tx_busy(self):
       """
       Returns 1 if a waveform is currently being transmitted,
@@ -2818,7 +2839,7 @@ class pi():
 
    def bb_i2c_open(self, SDA, SCL, baud=100000):
       """
-      This function selects a pair of gpios for bit banging I2C at a
+      This function selects a pair of GPIO for bit banging I2C at a
       specified baud rate.
 
       Bit banging I2C allows for certain operations which are not possible
@@ -2827,7 +2848,7 @@ class pi():
       o baud rates as low as 50 
       o repeated starts 
       o clock stretching 
-      o I2C on any pair of spare gpios
+      o I2C on any pair of spare GPIO
 
        SDA:= 0-31
        SCL:= 0-31
@@ -2838,11 +2859,11 @@ class pi():
 
       NOTE:
 
-      The gpios used for SDA and SCL must have pull-ups to 3V3 connected.
+      The GPIO used for SDA and SCL must have pull-ups to 3V3 connected.
       As a guide the hardware pull-ups on pins 3 and 5 are 1k8 in value.
 
       ...
-      h = pi.bb_i2c_open(4, 5, 50000) # bit bang on gpio 4/5 at 50kbps
+      h = pi.bb_i2c_open(4, 5, 50000) # bit bang on GPIO 4/5 at 50kbps
       ...
       """
       # I p1 SDA
@@ -2857,10 +2878,10 @@ class pi():
 
    def bb_i2c_close(self, SDA):
       """
-      This function stops bit banging I2C on a pair of gpios
+      This function stops bit banging I2C on a pair of GPIO
       previously opened with [*bb_i2c_open*].
 
-      SDA:= 0-31, the SDA gpio used in a prior call to [*bb_i2c_open*]
+      SDA:= 0-31, the SDA GPIO used in a prior call to [*bb_i2c_open*]
 
       Returns 0 if OK, otherwise PI_BAD_USER_GPIO, or PI_NOT_I2C_GPIO.
 
@@ -2959,12 +2980,12 @@ class pi():
       modify the default behaviour of 4-wire operation, mode 0,
       active low chip select.
 
-      An auxiliary SPI device is available on the A+/B+/Pi2/Zero
-      and may be selected by setting the A bit in the flags.
-      The auxiliary device has 3 chip selects and a selectable
-      word size in bits.
+      An auxiliary SPI device is available on all models but the
+      A and B and may be selected by setting the A bit in the
+      flags. The auxiliary device has 3 chip selects and a
+      selectable word size in bits.
 
-      spi_channel:= 0-1 (0-2 for A+/B+/Pi2/Zero auxiliary device).
+      spi_channel:= 0-1 (0-2 for the auxiliary SPI device).
              baud:= 32K-125M (values above 30M are unlikely to work).
         spi_flags:= see below.
 
@@ -2995,11 +3016,10 @@ class pi():
 
       px is 0 if CEx is active low (default) and 1 for active high.
 
-      ux is 0 if the CEx gpio is reserved for SPI (default)
+      ux is 0 if the CEx GPIO is reserved for SPI (default)
       and 1 otherwise.
 
       A is 0 for the standard SPI device, 1 for the auxiliary SPI.
-      The auxiliary device is only present on the A+/B+/Pi2/Zero.
 
       W is 0 if the device is not 3-wire, 1 if the device is 3-wire.
       Standard SPI device only.
@@ -3019,6 +3039,16 @@ class pi():
       bbbbbb defines the word size in bits (0-32).  The default (0)
       sets 8 bits per word.  Auxiliary SPI device only.
 
+      The [*spi_read*], [*spi_write*], and [*spi_xfer*] functions
+      transfer data packed into 1, 2, or 4 bytes according to
+      the word size in bits.
+
+      For bits 1-8 there will be one byte per character. 
+      For bits 9-16 there will be two bytes per character. 
+      For bits 17-32 there will be four bytes per character.
+
+      E.g. 32 12-bit words will be transferred in 64 bytes.
+
       The other bits in flags should be set to zero.
 
       ...
@@ -3286,7 +3316,7 @@ class pi():
 
    def gpio_trigger(self, user_gpio, pulse_len=10, level=1):
       """
-      Send a trigger pulse to a gpio.  The gpio is set to
+      Send a trigger pulse to a GPIO.  The GPIO is set to
       level for pulse_len microseconds and then reset to not level.
 
       user_gpio:= 0-31
@@ -3310,9 +3340,9 @@ class pi():
 
    def set_glitch_filter(self, user_gpio, steady):
       """
-      Sets a glitch filter on a gpio.
+      Sets a glitch filter on a GPIO.
 
-      Level changes on the gpio are not reported unless the level
+      Level changes on the GPIO are not reported unless the level
       has been stable for at least [*steady*] microseconds.  The
       level is then reported.  Level changes of less than [*steady*]
       microseconds are ignored.
@@ -3333,11 +3363,11 @@ class pi():
 
    def set_noise_filter(self, user_gpio, steady, active):
       """
-      Sets a noise filter on a gpio.
+      Sets a noise filter on a GPIO.
 
-      Level changes on the gpio are ignored until a level which has
+      Level changes on the GPIO are ignored until a level which has
       been stable for [*steady*] microseconds is detected.  Level
-      changes on the gpio are then reported for [*active*]
+      changes on the GPIO are then reported for [*active*]
       microseconds after which the process repeats.
 
       user_gpio:= 0-31
@@ -3486,9 +3516,9 @@ class pi():
 
    def bb_serial_read_open(self, user_gpio, baud, bb_bits=8):
       """
-      Opens a gpio for bit bang reading of serial data.
+      Opens a GPIO for bit bang reading of serial data.
 
-      user_gpio:= 0-31, the gpio to use.
+      user_gpio:= 0-31, the GPIO to use.
            baud:= 50-250000, the baud rate.
         bb_bits:= 1-32, the number of bits per word, default 8.
 
@@ -3550,7 +3580,7 @@ class pi():
    
    def bb_serial_read_close(self, user_gpio):
       """
-      Closes a gpio for bit bang reading of serial data.
+      Closes a GPIO for bit bang reading of serial data.
 
       user_gpio:= 0-31 (opened in a prior call to [*bb_serial_read_open*])
 
@@ -3651,13 +3681,13 @@ class pi():
    def callback(self, user_gpio, edge=RISING_EDGE, func=None):
       """
       Calls a user supplied function (a callback) whenever the
-      specified gpio edge is detected.
+      specified GPIO edge is detected.
 
       user_gpio:= 0-31.
            edge:= EITHER_EDGE, RISING_EDGE (default), or FALLING_EDGE.
            func:= user supplied callback function.
 
-      The user supplied callback receives three parameters, the gpio,
+      The user supplied callback receives three parameters, the GPIO,
       the level, and the tick.
 
       If a user callback is not specified a default tally callback is
@@ -3667,7 +3697,7 @@ class pi():
 
       The callback may be cancelled by calling the cancel function.
 
-      A gpio may have multiple callbacks (although I can't think of
+      A GPIO may have multiple callbacks (although I can't think of
       a reason to do so).
 
       ...
@@ -3691,7 +3721,7 @@ class pi():
 
    def wait_for_edge(self, user_gpio, edge=RISING_EDGE, wait_timeout=60.0):
       """
-      Wait for an edge event on a gpio.
+      Wait for an edge event on a GPIO.
 
          user_gpio:= 0-31.
               edge:= EITHER_EDGE, RISING_EDGE (default), or
@@ -3728,7 +3758,7 @@ class pi():
                 host = os.getenv("PIGPIO_ADDR", ''),
                 port = os.getenv("PIGPIO_PORT", 8888)):
       """
-      Grants access to a Pi's gpios.
+      Grants access to a Pi's GPIO.
 
       host:= the host name of the Pi on which the pigpio daemon is
              running.  The default is localhost unless overridden by
@@ -3848,11 +3878,11 @@ def xref():
    A value of 0 or 1.
 
    bits: 32 bit number
-   A mask used to select gpios to be operated on.  If bit n is set
-   then gpio n is selected.  A convenient way of setting bit n is to
+   A mask used to select GPIO to be operated on.  If bit n is set
+   then GPIO n is selected.  A convenient way of setting bit n is to
    bit or in the value (1<<n).
 
-   To select gpios 1, 7, 23
+   To select GPIO 1, 7, 23
 
    bits = (1<<1) | (1<<7) | (1<<23)
 
@@ -3990,28 +4020,28 @@ def xref():
    . .
 
    frequency: 0-40000
-   Defines the frequency to be used for PWM on a gpio.
+   Defines the frequency to be used for PWM on a GPIO.
    The closest permitted frequency will be used.
 
    func:
    A user supplied callback function.
 
    gpio: 0-53
-   A Broadcom numbered gpio.  All the user gpios are in the range 0-31.
+   A Broadcom numbered GPIO.  All the user GPIO are in the range 0-31.
 
-   There  are 54 General Purpose Input Outputs (gpios) named gpio0
+   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.
 
-   All the gpios which are safe for the user to read and write are in
-   bank 1.  Not all gpios in bank 1 are safe though.  Type 1 boards
-   have 17  safe gpios.  Type 2 boards have 21.  Type 3 boards have 26.
+   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
+   have 17  safe GPIO.  Type 2 boards have 21.  Type 3 boards have 26.
 
    See [*get_hardware_revision*].
 
-   The user gpios are marked with an X in the following table.
+   The user GPIO are marked with an X in the following table.
 
    . .
              0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
@@ -4026,15 +4056,15 @@ def xref():
    . .
 
    gpio_off:
-   A mask used to select gpios to be operated on.  See [*bits*].
+   A mask used to select GPIO to be operated on.  See [*bits*].
 
-   This mask selects the gpios to be switched off at the start
+   This mask selects the GPIO to be switched off at the start
    of a pulse.
 
    gpio_on:
-   A mask used to select gpios to be operated on.  See [*bits*].
+   A mask used to select GPIO to be operated on.  See [*bits*].
 
-   This mask selects the gpios to be switched on at the start
+   This mask selects the GPIO to be switched on at the start
    of a pulse.
 
    handle: 0-
@@ -4071,7 +4101,7 @@ def xref():
 
    mode:
 
-   1.The operational mode of a gpio, normally INPUT or OUTPUT.
+   1.The operational mode of a GPIO, normally INPUT or OUTPUT.
 
    ALT0 = 4 
    ALT1 = 5 
@@ -4135,7 +4165,7 @@ def xref():
    should return, default 8192.
 
    SCL:
-   The user gpio to use for the clock when bit banging I2C.
+   The user GPIO to use for the clock when bit banging I2C.
 
    script:
    The text of a script to store on the pigpio daemon.
@@ -4144,7 +4174,7 @@ def xref():
    A number referencing a script created by [*store_script*].
 
    SDA:
-   The user gpio to use for data when bit banging I2C.
+   The user GPIO to use for data when bit banging I2C.
 
    ser_flags: 32 bit
    No serial flags are currently defined.
@@ -4181,11 +4211,11 @@ def xref():
    An unsigned 32 bit number.
 
    user_gpio: 0-31
-   A Broadcom numbered gpio.
+   A Broadcom numbered GPIO.
 
-   All the user gpios are in the range 0-31.
+   All the user GPIO are in the range 0-31.
 
-   Not all the gpios within this range are usable, some are reserved
+   Not all the GPIO within this range are usable, some are reserved
    for system use.
 
    See [*gpio*].
@@ -4203,8 +4233,8 @@ def xref():
    One of [*wave_send_once*], [*wave_send_repeat*].
 
    wdog_timeout: 0-60000
-   Defines a gpio watchdog timeout in milliseconds.  If no level
-   change is detected on the gpio for timeout millisecond a watchdog
+   Defines a GPIO watchdog timeout in milliseconds.  If no level
+   change is detected on the GPIO for timeout millisecond a watchdog
    timeout report is issued (with level TIMEOUT).
 
    word_val: 0-65535
index fc5c0fa438ace929041fab8d08cb8fabffe1b304..6c7dc6079bde9f90691a0f17ebafc8437075056b 100644 (file)
--- a/pigpiod.1
+++ b/pigpiod.1
@@ -35,7 +35,7 @@ DMA memory allocation mode
 default AUTO
 
 .IP "\fB-b value\fP"
-gpio sample buffer in milliseconds
+GPIO sample buffer in milliseconds
 100-10000
 default 120
 
@@ -90,9 +90,9 @@ display pigpio version and exit
 
 
 .IP "\fB-x mask\fP"
-gpios which may be updated
-A 54 bit mask with (1<<n) set if the user may update gpio #n.
-default is the set of user gpios for the board revision
+GPIO which may be updated
+A 54 bit mask with (1<<n) set if the user may update GPIO #n.
+default is the set of user GPIO for the board revision
 
 .br
 
@@ -125,12 +125,12 @@ pigpio provides a rudimentary permissions system for commands issued via the soc
 .br
 
 .br
-All gpios may be read.
+All GPIO may be read.
 
 .br
 
 .br
-Only the user gpios for the board type or those specified by the -x option may be updated.
+Only the user GPIO for the board type or those specified by the -x option may be updated.
 
 .br
 
@@ -154,21 +154,21 @@ In this context an update includes the following:
 .br
 
 .br
-gpio mode set
+GPIO mode set
 .br
-gpio pull/up down
+GPIO pull/up down
 .br
-gpio write
+GPIO write
 .br
-gpio set PWM (including range and frequency)
+GPIO set PWM (including range and frequency)
 .br
-gpio set servo
+GPIO set servo
 
 .br
 
 .br
 In addition the bank clear and set commands, and the wave commands will only
-affect updateable gpios.
+affect updateable GPIO.
 
 .br
 
@@ -178,18 +178,18 @@ There are several special cases.
 .br
 
 .br
-The activity LED (green) may be written (gpio 16 for type 1 and 2
-boards, gpio 47 for type 3 boards)
+The activity LED (green) may be written (GPIO 16 for type 1 and 2
+boards, GPIO 47 for type 3 boards)
 
 .br
 
 .br
-The power LED (red) may be written on type 3 boards (gpio 35).
+The power LED (red) may be written on type 3 boards (GPIO 35).
 
 .br
 
 .br
-The high USB power mode gpio may be written (gpio 38 for type 3 boards).
+The high USB power mode GPIO may be written (GPIO 38 for type 3 boards).
 
 .SH SEE ALSO
 
index f5336993635c7661420752931d7017318a1caeaa..3846c757366ccfba939242d74c86b021a241b6e9 100644 (file)
@@ -27,7 +27,7 @@ USE THE MORE VERSATILE pigpiod_if2 LIBRARY.
 
 .br
 pigpiod_if is a C library for the Raspberry which allows control
-of the gpios via the socket interface to the pigpio daemon.
+of the GPIO via the socket interface to the pigpio daemon.
 .br
 
 .br
@@ -37,17 +37,17 @@ of the gpios via the socket interface to the pigpio daemon.
 .br
 
 .br
-o PWM on any of gpios 0-31
+o PWM on any of GPIO 0-31
 
 .br
 
 .br
-o servo pulses on any of gpios 0-31
+o servo pulses on any of GPIO 0-31
 
 .br
 
 .br
-o callbacks when any of gpios 0-31 change state
+o callbacks when any of GPIO 0-31 change state
 
 .br
 
@@ -57,17 +57,17 @@ o callbacks at timed intervals
 .br
 
 .br
-o reading/writing all of the gpios in a bank as one operation
+o reading/writing all of the GPIO in a bank as one operation
 
 .br
 
 .br
-o individually setting gpio modes, reading and writing
+o individually setting GPIO modes, reading and writing
 
 .br
 
 .br
-o notifications when any of gpios 0-31 change state
+o notifications when any of GPIO 0-31 change state
 
 .br
 
@@ -77,7 +77,7 @@ o the construction of output waveforms with microsecond timing
 .br
 
 .br
-o rudimentary permission control over gpios
+o rudimentary permission control over GPIO
 
 .br
 
@@ -97,11 +97,11 @@ o creating and running scripts on the pigpio daemon
 .br
 
 .br
-.SS gpios
+.SS GPIO
 .br
 
 .br
-ALL gpios are identified by their Broadcom number.
+ALL GPIO are identified by their Broadcom number.
 
 .br
 
@@ -304,7 +304,7 @@ resources used by the library.
 
 .IP "\fBint set_mode(unsigned gpio, unsigned mode)\fP"
 .IP "" 4
-Set the gpio mode.
+Set the GPIO mode.
 
 .br
 
@@ -328,7 +328,7 @@ or PI_NOT_PERMITTED.
 
 .IP "\fBint get_mode(unsigned gpio)\fP"
 .IP "" 4
-Get the gpio mode.
+Get the GPIO mode.
 
 .br
 
@@ -343,11 +343,11 @@ gpio: 0-53.
 .br
 
 .br
-Returns the gpio mode if OK, otherwise PI_BAD_GPIO.
+Returns the GPIO mode if OK, otherwise PI_BAD_GPIO.
 
 .IP "\fBint set_pull_up_down(unsigned gpio, unsigned pud)\fP"
 .IP "" 4
-Set or clear the gpio pull-up/down resistor.
+Set or clear the GPIO pull-up/down resistor.
 
 .br
 
@@ -369,7 +369,7 @@ or PI_NOT_PERMITTED.
 
 .IP "\fBint gpio_read(unsigned gpio)\fP"
 .IP "" 4
-Read the gpio level.
+Read the GPIO level.
 
 .br
 
@@ -384,11 +384,11 @@ gpio:0-53.
 .br
 
 .br
-Returns the gpio level if OK, otherwise PI_BAD_GPIO.
+Returns the GPIO level if OK, otherwise PI_BAD_GPIO.
 
 .IP "\fBint gpio_write(unsigned gpio, unsigned level)\fP"
 .IP "" 4
-Write the gpio level.
+Write the GPIO level.
 
 .br
 
@@ -416,11 +416,11 @@ Notes
 .br
 
 .br
-If PWM or servo pulses are active on the gpio they are switched off.
+If PWM or servo pulses are active on the GPIO they are switched off.
 
 .IP "\fBint set_PWM_dutycycle(unsigned user_gpio, unsigned dutycycle)\fP"
 .IP "" 4
-Start (non-zero dutycycle) or stop (0) PWM pulses on the gpio.
+Start (non-zero dutycycle) or stop (0) PWM pulses on the GPIO.
 
 .br
 
@@ -449,7 +449,7 @@ default range of 255.
 
 .IP "\fBint get_PWM_dutycycle(unsigned user_gpio)\fP"
 .IP "" 4
-Return the PWM dutycycle in use on a gpio.
+Return the PWM dutycycle in use on a GPIO.
 
 .br
 
@@ -470,23 +470,23 @@ Returns 0 if OK, otherwise PI_BAD_USER_GPIO or PI_NOT_PWM_GPIO.
 
 .br
 For normal PWM the dutycycle will be out of the defined range
-for the gpio (see \fBget_PWM_range\fP).
+for the GPIO (see \fBget_PWM_range\fP).
 
 .br
 
 .br
-If a hardware clock is active on the gpio the reported dutycycle
+If a hardware clock is active on the GPIO the reported dutycycle
 will be 500000 (500k) out of 1000000 (1M).
 
 .br
 
 .br
-If hardware PWM is active on the gpio the reported dutycycle
+If hardware PWM is active on the GPIO the reported dutycycle
 will be out of a 1000000 (1M).
 
 .IP "\fBint set_PWM_range(unsigned user_gpio, unsigned range)\fP"
 .IP "" 4
-Set the range of PWM values to be used on the gpio.
+Set the range of PWM values to be used on the GPIO.
 
 .br
 
@@ -514,14 +514,14 @@ Notes
 .br
 
 .br
-If PWM is currently active on the gpio its dutycycle will be
+If PWM is currently active on the GPIO its dutycycle will be
 scaled to reflect the new range.
 
 .br
 
 .br
 The real range, the number of steps between fully off and fully on
-for each of the 18 available gpio frequencies is
+for each of the 18 available GPIO frequencies is
 
 .br
 
@@ -544,7 +544,7 @@ The real value set by set_PWM_range is (dutycycle * real range) / range.
 
 .IP "\fBint get_PWM_range(unsigned user_gpio)\fP"
 .IP "" 4
-Get the range of PWM values being used on the gpio.
+Get the range of PWM values being used on the GPIO.
 
 .br
 
@@ -559,18 +559,18 @@ user_gpio: 0-31.
 .br
 
 .br
-Returns the dutycycle range used for the gpio if OK,
+Returns the dutycycle range used for the GPIO if OK,
 otherwise PI_BAD_USER_GPIO.
 
 .br
 
 .br
-If a hardware clock or hardware PWM is active on the gpio the
+If a hardware clock or hardware PWM is active on the GPIO the
 reported range will be 1000000 (1M).
 
 .IP "\fBint get_PWM_real_range(unsigned user_gpio)\fP"
 .IP "" 4
-Get the real underlying range of PWM values being used on the gpio.
+Get the real underlying range of PWM values being used on the GPIO.
 
 .br
 
@@ -585,19 +585,19 @@ user_gpio: 0-31.
 .br
 
 .br
-Returns the real range used for the gpio if OK,
+Returns the real range used for the GPIO if OK,
 otherwise PI_BAD_USER_GPIO.
 
 .br
 
 .br
-If a hardware clock is active on the gpio the reported
+If a hardware clock is active on the GPIO the reported
 real range will be 1000000 (1M).
 
 .br
 
 .br
-If hardware PWM is active on the gpio the reported real range
+If hardware PWM is active on the GPIO the reported real range
 will be approximately 250M divided by the set PWM frequency.
 
 .br
@@ -606,7 +606,7 @@ will be approximately 250M divided by the set PWM frequency.
 
 .IP "\fBint set_PWM_frequency(unsigned user_gpio, unsigned frequency)\fP"
 .IP "" 4
-Set the frequency (in Hz) of the PWM to be used on the gpio.
+Set the frequency (in Hz) of the PWM to be used on the GPIO.
 
 .br
 
@@ -636,13 +636,13 @@ sample rate is set when the C pigpio library is started.
 .br
 
 .br
-Each gpio can be independently set to one of 18 different
+Each GPIO can be independently set to one of 18 different
 PWM frequencies.
 
 .br
 
 .br
-If PWM is currently active on the gpio it will be switched
+If PWM is currently active on the GPIO it will be switched
 off and then back on at the new frequency.
 
 .br
@@ -689,7 +689,7 @@ off and then back on at the new frequency.
 
 .IP "\fBint get_PWM_frequency(unsigned user_gpio)\fP"
 .IP "" 4
-Get the frequency of PWM being used on the gpio.
+Get the frequency of PWM being used on the GPIO.
 
 .br
 
@@ -704,30 +704,30 @@ user_gpio: 0-31.
 .br
 
 .br
-For normal PWM the frequency will be that defined for the gpio by
+For normal PWM the frequency will be that defined for the GPIO by
 \fBset_PWM_frequency\fP.
 
 .br
 
 .br
-If a hardware clock is active on the gpio the reported frequency
+If a hardware clock is active on the GPIO the reported frequency
 will be that set by \fBhardware_clock\fP.
 
 .br
 
 .br
-If hardware PWM is active on the gpio the reported frequency
+If hardware PWM is active on the GPIO the reported frequency
 will be that set by \fBhardware_PWM\fP.
 
 .br
 
 .br
-Returns the frequency (in hertz) used for the gpio if OK,
+Returns the frequency (in hertz) used for the GPIO if OK,
 otherwise PI_BAD_USER_GPIO.
 
 .IP "\fBint set_servo_pulsewidth(unsigned user_gpio, unsigned pulsewidth)\fP"
 .IP "" 4
-Start (500-2500) or stop (0) servo pulses on the gpio.
+Start (500-2500) or stop (0) servo pulses on the GPIO.
 
 .br
 
@@ -803,7 +803,7 @@ the servo pulsewidth.
 .br
 
 .br
-E.g. If you want to update a servo connected to gpio 25 at 400Hz
+E.g. If you want to update a servo connected to GPIO 25 at 400Hz
 
 .br
 
@@ -826,7 +826,7 @@ e.g. set_PWM_dutycycle(25, 1500) will set a 1500 us pulse.
 
 .IP "\fBint get_servo_pulsewidth(unsigned user_gpio)\fP"
 .IP "" 4
-Return the servo pulsewidth in use on a gpio.
+Return the servo pulsewidth in use on a GPIO.
 
 .br
 
@@ -856,7 +856,7 @@ otherwise PI_NO_HANDLE.
 .br
 
 .br
-A notification is a method for being notified of gpio state
+A notification is a method for being notified of GPIO state
 changes via a pipe.
 
 .br
@@ -886,7 +886,7 @@ Start notifications on a previously opened handle.
 .EX
 handle: 0-31 (as returned by \fBnotify_open\fP)
 .br
-  bits: a mask indicating the gpios to be notified.
+  bits: a mask indicating the GPIO to be notified.
 .br
 
 .EE
@@ -899,7 +899,7 @@ Returns 0 if OK, otherwise PI_BAD_HANDLE.
 .br
 
 .br
-The notification sends state changes for each gpio whose
+The notification sends state changes for each GPIO whose
 corresponding bit in bits is set.
 
 .br
@@ -975,7 +975,7 @@ Returns 0 if OK, otherwise PI_BAD_HANDLE.
 
 .IP "\fBint set_watchdog(unsigned user_gpio, unsigned timeout)\fP"
 .IP "" 4
-Sets a watchdog for a gpio.
+Sets a watchdog for a GPIO.
 
 .br
 
@@ -1003,7 +1003,7 @@ The watchdog is nominally in milliseconds.
 .br
 
 .br
-Only one watchdog may be registered per gpio.
+Only one watchdog may be registered per GPIO.
 
 .br
 
@@ -1013,24 +1013,24 @@ The watchdog may be cancelled by setting timeout to 0.
 .br
 
 .br
-If no level change has been detected for the gpio for timeout
-milliseconds any notification for the gpio has a report written
+If no level change has been detected for the GPIO for timeout
+milliseconds any notification for the GPIO has a report written
 to the fifo with the flags set to indicate a watchdog timeout.
 
 .br
 
 .br
 The \fBcallback\fP and \fBcallback_ex\fP functions interpret the flags
-and will call registered callbacks for the gpio with level TIMEOUT.
+and will call registered callbacks for the GPIO with level TIMEOUT.
 
 .IP "\fBint set_glitch_filter(unsigned user_gpio, unsigned steady)\fP"
 .IP "" 4
-Sets a glitch filter on a gpio.
+Sets a glitch filter on a GPIO.
 
 .br
 
 .br
-Level changes on the gpio are not reported unless the level
+Level changes on the GPIO are not reported unless the level
 has been stable for at least \fBsteady\fP microseconds.  The
 level is then reported.  Level changes of less than \fBsteady\fP
 microseconds are ignored.
@@ -1060,14 +1060,14 @@ after it was first detected.
 
 .IP "\fBint set_noise_filter(unsigned user_gpio, unsigned steady, unsigned active)\fP"
 .IP "" 4
-Sets a noise filter on a gpio.
+Sets a noise filter on a GPIO.
 
 .br
 
 .br
-Level changes on the gpio are ignored until a level which has
+Level changes on the GPIO are ignored until a level which has
 been stable for \fBsteady\fP microseconds is detected.  Level changes
-on the gpio are then reported for \fBactive\fP microseconds after
+on the GPIO are then reported for \fBactive\fP microseconds after
 which the process repeats.
 
 .br
@@ -1098,34 +1098,34 @@ such reports.
 
 .IP "\fBuint32_t read_bank_1(void)\fP"
 .IP "" 4
-Read the levels of the bank 1 gpios (gpios 0-31).
+Read the levels of the bank 1 GPIO (GPIO 0-31).
 
 .br
 
 .br
 The returned 32 bit integer has a bit set if the corresponding
-gpio is logic 1.  Gpio n has bit value (1<<n).
+GPIO is logic 1.  GPIO n has bit value (1<<n).
 
 .IP "\fBuint32_t read_bank_2(void)\fP"
 .IP "" 4
-Read the levels of the bank 2 gpios (gpios 32-53).
+Read the levels of the bank 2 GPIO (GPIO 32-53).
 
 .br
 
 .br
 The returned 32 bit integer has a bit set if the corresponding
-gpio is logic 1.  Gpio n has bit value (1<<(n-32)).
+GPIO is logic 1.  GPIO n has bit value (1<<(n-32)).
 
 .IP "\fBint clear_bank_1(uint32_t bits)\fP"
 .IP "" 4
-Clears gpios 0-31 if the corresponding bit in bits is set.
+Clears GPIO 0-31 if the corresponding bit in bits is set.
 
 .br
 
 .br
 
 .EX
-bits: a bit mask with 1 set if the corresponding gpio is
+bits: a bit mask with 1 set if the corresponding GPIO is
 .br
       to be cleared.
 .br
@@ -1141,18 +1141,18 @@ Returns 0 if OK, otherwise PI_SOME_PERMITTED.
 
 .br
 A status of PI_SOME_PERMITTED indicates that the user is not
-allowed to write to one or more of the gpios.
+allowed to write to one or more of the GPIO.
 
 .IP "\fBint clear_bank_2(uint32_t bits)\fP"
 .IP "" 4
-Clears gpios 32-53 if the corresponding bit (0-21) in bits is set.
+Clears GPIO 32-53 if the corresponding bit (0-21) in bits is set.
 
 .br
 
 .br
 
 .EX
-bits: a bit mask with 1 set if the corresponding gpio is
+bits: a bit mask with 1 set if the corresponding GPIO is
 .br
       to be cleared.
 .br
@@ -1168,18 +1168,18 @@ Returns 0 if OK, otherwise PI_SOME_PERMITTED.
 
 .br
 A status of PI_SOME_PERMITTED indicates that the user is not
-allowed to write to one or more of the gpios.
+allowed to write to one or more of the GPIO.
 
 .IP "\fBint set_bank_1(uint32_t bits)\fP"
 .IP "" 4
-Sets gpios 0-31 if the corresponding bit in bits is set.
+Sets GPIO 0-31 if the corresponding bit in bits is set.
 
 .br
 
 .br
 
 .EX
-bits: a bit mask with 1 set if the corresponding gpio is
+bits: a bit mask with 1 set if the corresponding GPIO is
 .br
       to be set.
 .br
@@ -1195,18 +1195,18 @@ Returns 0 if OK, otherwise PI_SOME_PERMITTED.
 
 .br
 A status of PI_SOME_PERMITTED indicates that the user is not
-allowed to write to one or more of the gpios.
+allowed to write to one or more of the GPIO.
 
 .IP "\fBint set_bank_2(uint32_t bits)\fP"
 .IP "" 4
-Sets gpios 32-53 if the corresponding bit (0-21) in bits is set.
+Sets GPIO 32-53 if the corresponding bit (0-21) in bits is set.
 
 .br
 
 .br
 
 .EX
-bits: a bit mask with 1 set if the corresponding gpio is
+bits: a bit mask with 1 set if the corresponding GPIO is
 .br
       to be set.
 .br
@@ -1222,11 +1222,11 @@ Returns 0 if OK, otherwise PI_SOME_PERMITTED.
 
 .br
 A status of PI_SOME_PERMITTED indicates that the user is not
-allowed to write to one or more of the gpios.
+allowed to write to one or more of the GPIO.
 
 .IP "\fBint hardware_clock(unsigned gpio, unsigned clkfreq)\fP"
 .IP "" 4
-Starts a hardware clock on a gpio at the specified frequency.
+Starts a hardware clock on a GPIO at the specified frequency.
 Frequencies above 30MHz are unlikely to work.
 
 .br
@@ -1250,13 +1250,13 @@ PI_NOT_HCLK_GPIO, PI_BAD_HCLK_FREQ,or PI_BAD_HCLK_PASS.
 .br
 
 .br
-The same clock is available on multiple gpios.  The latest
-frequency setting will be used by all gpios which share a clock.
+The same clock is available on multiple GPIO.  The latest
+frequency setting will be used by all GPIO which share a clock.
 
 .br
 
 .br
-The gpio must be one of the following.
+The GPIO must be one of the following.
 
 .br
 
@@ -1265,13 +1265,13 @@ The gpio must be one of the following.
 .EX
 4   clock 0  All models
 .br
-5   clock 1  A+/B+/Pi2 and compute module only (reserved for system use)
+5   clock 1  All models but A and B (reserved for system use)
 .br
-6   clock 2  A+/B+/Pi2 and compute module only
+6   clock 2  All models but A and B
 .br
-20  clock 0  A+/B+/Pi2 and compute module only
+20  clock 0  All models but A and B
 .br
-21  clock 1  All models but Rev.2 B (reserved for system use)
+21  clock 1  All models but A and Rev.2 B (reserved for system use)
 .br
 
 .br
@@ -1293,11 +1293,11 @@ The gpio must be one of the following.
 .br
 Access to clock 1 is protected by a password as its use will likely
 crash the Pi.  The password is given by or'ing 0x5A000000 with the
-gpio number.
+GPIO number.
 
 .IP "\fBint hardware_PWM(unsigned gpio, unsigned PWMfreq, uint32_t PWMduty)\fP"
 .IP "" 4
-Starts hardware PWM on a gpio at the specified frequency and dutycycle.
+Starts hardware PWM on a GPIO at the specified frequency and dutycycle.
 Frequencies above 30MHz are unlikely to work.
 
 .br
@@ -1337,27 +1337,27 @@ or PI_HPWM_ILLEGAL.
 .br
 
 .br
-The same PWM channel is available on multiple gpios.  The latest
-frequency and dutycycle setting will be used by all gpios which
+The same PWM channel is available on multiple GPIO.  The latest
+frequency and dutycycle setting will be used by all GPIO which
 share a PWM channel.
 
 .br
 
 .br
-The gpio must be one of the following.
+The GPIO must be one of the following.
 
 .br
 
 .br
 
 .EX
-12  PWM channel 0  A+/B+/Pi2 and compute module only
+12  PWM channel 0  All models but A and B
 .br
-13  PWM channel 1  A+/B+/Pi2 and compute module only
+13  PWM channel 1  All models but A and B
 .br
 18  PWM channel 0  All models
 .br
-19  PWM channel 1  A+/B+/Pi2 and compute module only
+19  PWM channel 1  All models but A and B
 .br
 
 .br
@@ -1412,7 +1412,7 @@ hexadecimal number the function returns 0.
 .br
 
 .br
-The revision number can be used to determine the assignment of gpios
+The revision number can be used to determine the assignment of GPIO
 to pins (see \fBgpio\fP).
 
 .br
@@ -1492,7 +1492,7 @@ The pulses are interleaved in time order within the existing waveform
 
 .br
 Merging allows the waveform to be built in parts, that is the settings
-for gpio#1 can be added, and then gpio#2 etc.
+for GPIO#1 can be added, and then GPIO#2 etc.
 
 .br
 
@@ -1655,9 +1655,9 @@ The fields specify
 .br
 
 .br
-1) the gpios to be switched on at the start of the pulse.
+1) the GPIO to be switched on at the start of the pulse.
 .br
-2) the gpios to be switched off at the start of the pulse.
+2) the GPIO to be switched off at the start of the pulse.
 .br
 3) the delay in microseconds before the next pulse.
 .br
@@ -2020,7 +2020,7 @@ control blocks.
 
 .IP "\fBint gpio_trigger(unsigned user_gpio, unsigned pulseLen, unsigned level)\fP"
 .IP "" 4
-This function sends a trigger pulse to a gpio.  The gpio is set to
+This function sends a trigger pulse to a GPIO.  The GPIO is set to
 level for pulseLen microseconds and then reset to not level.
 
 .br
@@ -2184,7 +2184,7 @@ The function returns 0 if OK, otherwise PI_BAD_SCRIPT_ID.
 
 .IP "\fBint bb_serial_read_open(unsigned user_gpio, unsigned baud, unsigned data_bits)\fP"
 .IP "" 4
-This function opens a gpio for bit bang reading of serial data.
+This function opens a GPIO for bit bang reading of serial data.
 
 .br
 
@@ -2260,7 +2260,7 @@ For \fBdata_bits\fP 17-32 there will be four bytes per character.
 
 .IP "\fBint bb_serial_read_close(unsigned user_gpio)\fP"
 .IP "" 4
-This function closes a gpio for bit bang reading of serial data.
+This function closes a GPIO for bit bang reading of serial data.
 
 .br
 
@@ -3036,7 +3036,7 @@ End
 
 .IP "\fBint bb_i2c_open(unsigned SDA, unsigned SCL, unsigned baud)\fP"
 .IP "" 4
-This function selects a pair of gpios for bit banging I2C at a
+This function selects a pair of GPIO for bit banging I2C at a
 specified baud rate.
 
 .br
@@ -3054,7 +3054,7 @@ o repeated starts
 .br
 o clock stretching
 .br
-o I2C on any pair of spare gpios
+o I2C on any pair of spare GPIO
 
 .br
 
@@ -3084,12 +3084,12 @@ NOTE:
 .br
 
 .br
-The gpios used for SDA and SCL must have pull-ups to 3V3 connected.  As
+The GPIO used for SDA and SCL must have pull-ups to 3V3 connected.  As
 a guide the hardware pull-ups on pins 3 and 5 are 1k8 in value.
 
 .IP "\fBint bb_i2c_close(unsigned SDA)\fP"
 .IP "" 4
-This function stops bit banging I2C on a pair of gpios previously
+This function stops bit banging I2C on a pair of GPIO previously
 opened with \fBbb_i2c_open\fP.
 
 .br
@@ -3097,7 +3097,7 @@ opened with \fBbb_i2c_open\fP.
 .br
 
 .EX
-SDA: 0-31, the SDA gpio used in a prior call to \fBbb_i2c_open\fP
+SDA: 0-31, the SDA GPIO used in a prior call to \fBbb_i2c_open\fP
 .br
 
 .EE
@@ -3255,16 +3255,17 @@ active low chip select.
 .br
 
 .br
-An auxiliary SPI device is available on the A+/B+/Pi2 and may be
-selected by setting the A bit in the flags.  The auxiliary
-device has 3 chip selects and a selectable word size in bits.
+An auxiliary SPI device is available on all models but the
+A and B and may be selected by setting the A bit in the
+flags.  The auxiliary device has 3 chip selects and a
+selectable word size in bits.
 
 .br
 
 .br
 
 .EX
-spi_channel: 0-1 (0-2 for A+/B+/Pi2 auxiliary device).
+spi_channel: 0-1 (0-2 for the auxiliary SPI device).
 .br
        baud: 32K-125M (values above 30M are unlikely to work).
 .br
@@ -3332,13 +3333,12 @@ px is 0 if CEx is active low (default) and 1 for active high.
 .br
 
 .br
-ux is 0 if the CEx gpio is reserved for SPI (default) and 1 otherwise.
+ux is 0 if the CEx GPIO is reserved for SPI (default) and 1 otherwise.
 
 .br
 
 .br
-A is 0 for the standard SPI device, 1 for the auxiliary SPI.  The
-auxiliary device is only present on the A+/B+/Pi2.
+A is 0 for the standard SPI device, 1 for the auxiliary SPI.
 
 .br
 
@@ -3738,8 +3738,8 @@ pigif_duplicate_callback, or pigif_bad_callback.
 .br
 
 .br
-The callback is called with the gpio, edge, and tick, whenever the
-gpio has the identified edge.
+The callback is called with the GPIO, edge, and tick, whenever the
+GPIO has the identified edge.
 
 .IP "\fBint callback_ex(unsigned user_gpio, unsigned edge, CBFuncEx_t f, void *userdata)\fP"
 .IP "" 4
@@ -3770,8 +3770,8 @@ pigif_duplicate_callback, or pigif_bad_callback.
 .br
 
 .br
-The callback is called with the gpio, edge, tick, and user, whenever
-the gpio has the identified edge.
+The callback is called with the GPIO, edge, tick, and user, whenever
+the GPIO has the identified edge.
 
 .br
 
@@ -3798,7 +3798,7 @@ The function returns 0 if OK, otherwise pigif_callback_not_found.
 
 .IP "\fBint wait_for_edge(unsigned user_gpio, unsigned edge, double timeout)\fP"
 .IP "" 4
-This function waits for edge on the gpio for up to timeout
+This function waits for edge on the GPIO for up to timeout
 seconds.
 
 .br
@@ -3900,7 +3900,7 @@ A value of 0 or 1.
 .br
 
 .IP "\fBbits\fP" 0
-A value used to select gpios.  If bit n of bits is set then gpio n is
+A value used to select GPIO.  If bit n of bits is set then GPIO n is
 selected.
 
 .br
@@ -4040,7 +4040,7 @@ The number may vary between 0 and range (default 255) where
 .br
 
 .IP "\fBedge\fP" 0
-Used to identify a gpio level transition of interest.  A rising edge is
+Used to identify a GPIO level transition of interest.  A rising edge is
 a level change from 0 to 1.  A falling edge is a level change from 1 to 0.
 
 .br
@@ -4077,9 +4077,9 @@ A function.
 .br
 
 .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
+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
 by its dutycycle.
 
 .br
@@ -4091,12 +4091,12 @@ by its dutycycle.
 .br
 
 .IP "\fBgpio\fP" 0
-A Broadcom numbered gpio, in the range 0-53.
+A Broadcom numbered GPIO, in the range 0-53.
 
 .br
 
 .br
-There  are 54 General Purpose Input Outputs (gpios) named gpio0 through
+There  are 54 General Purpose Input Outputs (GPIO) named gpio0 through
 gpio53.
 
 .br
@@ -4108,9 +4108,9 @@ gpio31.  Bank 2 consists of gpio32 through gpio53.
 .br
 
 .br
-All the gpios which are safe for the user to read and write are in
-bank 1.  Not all gpios in bank 1 are safe though.  Type 1 boards
-have 17  safe gpios.  Type 2 boards have 21.  Type 3 boards have 26.
+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
+have 17  safe GPIO.  Type 2 boards have 21.  Type 3 boards have 26.
 
 .br
 
@@ -4120,7 +4120,7 @@ See \fBget_hardware_revision\fP.
 .br
 
 .br
-The user gpios are marked with an X in the following table.
+The user GPIO are marked with an X in the following table.
 
 .br
 
@@ -4251,7 +4251,7 @@ A flag used to set normal or inverted bit bang serial data level logic.
 .br
 
 .IP "\fBlevel\fP" 0
-The level of a gpio.  Low or High.
+The level of a GPIO.  Low or High.
 
 .br
 
@@ -4280,7 +4280,7 @@ PI_HIGH 1
 .br
 
 .br
-There is one exception.  If a watchdog expires on a gpio the level will be
+There is one exception.  If a watchdog expires on a GPIO the level will be
 reported as PI_TIMEOUT.  See \fBset_watchdog\fP.
 
 .br
@@ -4298,7 +4298,7 @@ PI_TIMEOUT 2
 .br
 
 .IP "\fBmode\fP: 0-7" 0
-The operational mode of a gpio, normally INPUT or OUTPUT.
+The operational mode of a GPIO, normally INPUT or OUTPUT.
 
 .br
 
@@ -4409,7 +4409,7 @@ A thread identifier.
 .br
 
 .IP "\fBpud\fP: 0-2" 0
-The setting of the pull up/down resistor for a gpio, which may be off,
+The setting of the pull up/down resistor for a GPIO, which may be off,
 pull-up, or pull-down.
 
 .EX
@@ -4533,7 +4533,7 @@ A pointer to a buffer to receive data.
 .br
 
 .IP "\fBSCL\fP" 0
-The user gpio to use for the clock when bit banging I2C.
+The user GPIO to use for the clock when bit banging I2C.
 
 .br
 
@@ -4554,7 +4554,7 @@ An id of a stored script as returned by \fBstore_script\fP.
 .br
 
 .IP "\fBSDA\fP" 0
-The user gpio to use for data when bit banging I2C.
+The user GPIO to use for data when bit banging I2C.
 
 .br
 
@@ -4651,7 +4651,7 @@ thread.
 .br
 
 .IP "\fBtimeout\fP" 0
-A gpio watchdog timeout in milliseconds.
+A GPIO watchdog timeout in milliseconds.
 
 .EX
 PI_MIN_WDOG_TIMEOUT 0
@@ -4687,7 +4687,7 @@ A whole number >= 0.
 .br
 
 .IP "\fBuser_gpio\fP" 0
-0-31, a Broadcom numbered gpio.
+0-31, a Broadcom numbered GPIO.
 
 .br
 
index 0d2fbdc9eebd3daba6dcf1da0d5efbafcf586409..6d4f7f34f7d4023b0a1e20c7a59deab1cec60bb9 100644 (file)
@@ -30,7 +30,7 @@ For more information, please refer to <http://unlicense.org/>
 
 #include "pigpio.h"
 
-#define PIGPIOD_IF_VERSION 21
+#define PIGPIOD_IF_VERSION 22
 
 /*TEXT
 
@@ -38,27 +38,27 @@ THIS LIBRARY IS DEPRECATED.  NEW CODE SHOULD BE WRITTEN TO
 USE THE MORE VERSATILE pigpiod_if2 LIBRARY.
 
 pigpiod_if is a C library for the Raspberry which allows control
-of the gpios via the socket interface to the pigpio daemon. 
+of the GPIO via the socket interface to the pigpio daemon. 
 
 *Features*
 
-o PWM on any of gpios 0-31
+o PWM on any of GPIO 0-31
 
-o servo pulses on any of gpios 0-31
+o servo pulses on any of GPIO 0-31
 
-o callbacks when any of gpios 0-31 change state
+o callbacks when any of GPIO 0-31 change state
 
 o callbacks at timed intervals
 
-o reading/writing all of the gpios in a bank as one operation
+o reading/writing all of the GPIO in a bank as one operation
 
-o individually setting gpio modes, reading and writing
+o individually setting GPIO modes, reading and writing
 
-o notifications when any of gpios 0-31 change state
+o notifications when any of GPIO 0-31 change state
 
 o the construction of output waveforms with microsecond timing
 
-o rudimentary permission control over gpios
+o rudimentary permission control over GPIO
 
 o a simple interface to start and stop new threads
 
@@ -66,9 +66,9 @@ o I2C, SPI, and serial link wrappers
 
 o creating and running scripts on the pigpio daemon
 
-*gpios*
+*GPIO*
 
-ALL gpios are identified by their Broadcom number.
+ALL GPIO are identified by their Broadcom number.
 
 *Notes*
 
@@ -109,68 +109,68 @@ pigpio_stop                Disconnects from the pigpio daemon
 
 BEGINNER
 
-set_mode                   Set a gpio mode
-get_mode                   Get a gpio mode
+set_mode                   Set a GPIO mode
+get_mode                   Get a GPIO mode
 
-set_pull_up_down           Set/clear gpio pull up/down resistor
+set_pull_up_down           Set/clear GPIO pull up/down resistor
 
-gpio_read                  Read a gpio
-gpio_write                 Write a gpio
+gpio_read                  Read a GPIO
+gpio_write                 Write a GPIO
 
-set_PWM_dutycycle          Start/stop PWM pulses on a gpio
-get_PWM_dutycycle          Get the PWM dutycycle in use on a gpio
+set_PWM_dutycycle          Start/stop PWM pulses on a GPIO
+get_PWM_dutycycle          Get the PWM dutycycle in use on a GPIO
 
-set_servo_pulsewidth       Start/stop servo pulses on a gpio
-get_servo_pulsewidth       Get the servo pulsewidth in use on a gpio
+set_servo_pulsewidth       Start/stop servo pulses on a GPIO
+get_servo_pulsewidth       Get the servo pulsewidth in use on a GPIO
 
-callback                   Create gpio level change callback
-callback_ex                Create gpio level change callback
+callback                   Create GPIO level change callback
+callback_ex                Create GPIO level change callback
 callback_cancel            Cancel a callback
-wait_for_edge              Wait for gpio level change
+wait_for_edge              Wait for GPIO level change
 
 INTERMEDIATE
 
-gpio_trigger               Send a trigger pulse to a gpio.
+gpio_trigger               Send a trigger pulse to a GPIO.
 
-set_watchdog               Set a watchdog on a gpio.
+set_watchdog               Set a watchdog on a GPIO.
 
-set_PWM_range              Configure PWM range for a gpio
-get_PWM_range              Get configured PWM range for a gpio
+set_PWM_range              Configure PWM range for a GPIO
+get_PWM_range              Get configured PWM range for a GPIO
 
-set_PWM_frequency          Configure PWM frequency for a gpio
-get_PWM_frequency          Get configured PWM frequency for a gpio
+set_PWM_frequency          Configure PWM frequency for a GPIO
+get_PWM_frequency          Get configured PWM frequency for a GPIO
 
-read_bank_1                Read all gpios in bank 1
-read_bank_2                Read all gpios in bank 2
+read_bank_1                Read all GPIO in bank 1
+read_bank_2                Read all GPIO in bank 2
 
-clear_bank_1               Clear selected gpios in bank 1
-clear_bank_2               Clear selected gpios in bank 2
+clear_bank_1               Clear selected GPIO in bank 1
+clear_bank_2               Clear selected GPIO in bank 2
 
-set_bank_1                 Set selected gpios in bank 1
-set_bank_2                 Set selected gpios in bank 2
+set_bank_1                 Set selected GPIO in bank 1
+set_bank_2                 Set selected GPIO in bank 2
 
 start_thread               Start a new thread
 stop_thread                Stop a previously started thread
 
 ADVANCED
 
-get_PWM_real_range         Get underlying PWM range for a gpio
+get_PWM_real_range         Get underlying PWM range for a GPIO
 
 notify_open                Request a notification handle
-notify_begin               Start notifications for selected gpios
+notify_begin               Start notifications for selected GPIO
 notify_pause               Pause notifications
 notify_close               Close a notification
 
-bb_serial_read_open        Opens a gpio for bit bang serial reads
-bb_serial_read             Reads bit bang serial data from a gpio
-bb_serial_read_close       Closes a gpio for bit bang serial reads
+bb_serial_read_open        Opens a GPIO for bit bang serial reads
+bb_serial_read             Reads bit bang serial data from a GPIO
+bb_serial_read_close       Closes a GPIO for bit bang serial reads
 bb_serial_invert           Invert serial logic (1 invert, 0 normal)
 
-hardware_clock             Start hardware clock on supported gpios
-hardware_PWM               Start hardware PWM on supported gpios
+hardware_clock             Start hardware clock on supported GPIO
+hardware_PWM               Start hardware PWM on supported GPIO
 
-set_glitch_filter         Set a glitch filter on a gpio
-set_noise_filter          Set a noise filter on a gpio
+set_glitch_filter         Set a glitch filter on a GPIO
+set_noise_filter          Set a noise filter on a GPIO
 
 SCRIPTS
 
@@ -236,8 +236,8 @@ i2c_write_device           Writes the raw I2C device
 
 i2c_zip                    Performs multiple I2C transactions
 
-bb_i2c_open                Opens gpios for bit banging I2C
-bb_i2c_close               Closes gpios for bit banging I2C
+bb_i2c_open                Opens GPIO for bit banging I2C
+bb_i2c_close               Closes GPIO for bit banging I2C
 bb_i2c_zip                 Performs multiple bit banged I2C transactions
 
 SPI
@@ -385,7 +385,7 @@ D*/
 /*F*/
 int set_mode(unsigned gpio, unsigned mode);
 /*D
-Set the gpio mode.
+Set the GPIO mode.
 
 . .
 gpio: 0-53.
@@ -400,19 +400,19 @@ D*/
 /*F*/
 int get_mode(unsigned gpio);
 /*D
-Get the gpio mode.
+Get the GPIO mode.
 
 . .
 gpio: 0-53.
 . .
 
-Returns the gpio mode if OK, otherwise PI_BAD_GPIO.
+Returns the GPIO mode if OK, otherwise PI_BAD_GPIO.
 D*/
 
 /*F*/
 int set_pull_up_down(unsigned gpio, unsigned pud);
 /*D
-Set or clear the gpio pull-up/down resistor.
+Set or clear the GPIO pull-up/down resistor.
 
 . .
 gpio: 0-53.
@@ -426,19 +426,19 @@ D*/
 /*F*/
 int gpio_read(unsigned gpio);
 /*D
-Read the gpio level.
+Read the GPIO level.
 
 . .
 gpio:0-53.
 . .
 
-Returns the gpio level if OK, otherwise PI_BAD_GPIO.
+Returns the GPIO level if OK, otherwise PI_BAD_GPIO.
 D*/
 
 /*F*/
 int gpio_write(unsigned gpio, unsigned level);
 /*D
-Write the gpio level.
+Write the GPIO level.
 
 . .
  gpio: 0-53.
@@ -450,13 +450,13 @@ or PI_NOT_PERMITTED.
 
 Notes
 
-If PWM or servo pulses are active on the gpio they are switched off.
+If PWM or servo pulses are active on the GPIO they are switched off.
 D*/
 
 /*F*/
 int set_PWM_dutycycle(unsigned user_gpio, unsigned dutycycle);
 /*D
-Start (non-zero dutycycle) or stop (0) PWM pulses on the gpio.
+Start (non-zero dutycycle) or stop (0) PWM pulses on the GPIO.
 
 . .
 user_gpio: 0-31.
@@ -474,7 +474,7 @@ D*/
 /*F*/
 int get_PWM_dutycycle(unsigned user_gpio);
 /*D
-Return the PWM dutycycle in use on a gpio.
+Return the PWM dutycycle in use on a GPIO.
 
 . .
 user_gpio: 0-31.
@@ -483,19 +483,19 @@ user_gpio: 0-31.
 Returns 0 if OK, otherwise PI_BAD_USER_GPIO or PI_NOT_PWM_GPIO.
 
 For normal PWM the dutycycle will be out of the defined range
-for the gpio (see [*get_PWM_range*]).
+for the GPIO (see [*get_PWM_range*]).
 
-If a hardware clock is active on the gpio the reported dutycycle
+If a hardware clock is active on the GPIO the reported dutycycle
 will be 500000 (500k) out of 1000000 (1M).
 
-If hardware PWM is active on the gpio the reported dutycycle
+If hardware PWM is active on the GPIO the reported dutycycle
 will be out of a 1000000 (1M).
 D*/
 
 /*F*/
 int set_PWM_range(unsigned user_gpio, unsigned range);
 /*D
-Set the range of PWM values to be used on the gpio.
+Set the range of PWM values to be used on the GPIO.
 
 . .
 user_gpio: 0-31.
@@ -507,11 +507,11 @@ or PI_NOT_PERMITTED.
 
 Notes
 
-If PWM is currently active on the gpio its dutycycle will be
+If PWM is currently active on the GPIO its dutycycle will be
 scaled to reflect the new range.
 
 The real range, the number of steps between fully off and fully on
-for each of the 18 available gpio frequencies is
+for each of the 18 available GPIO frequencies is
 
 . .
   25(#1),    50(#2),   100(#3),   125(#4),    200(#5),    250(#6),
@@ -525,35 +525,35 @@ D*/
 /*F*/
 int get_PWM_range(unsigned user_gpio);
 /*D
-Get the range of PWM values being used on the gpio.
+Get the range of PWM values being used on the GPIO.
 
 . .
 user_gpio: 0-31.
 . .
 
-Returns the dutycycle range used for the gpio if OK,
+Returns the dutycycle range used for the GPIO if OK,
 otherwise PI_BAD_USER_GPIO.
 
-If a hardware clock or hardware PWM is active on the gpio the
+If a hardware clock or hardware PWM is active on the GPIO the
 reported range will be 1000000 (1M).
 D*/
 
 /*F*/
 int get_PWM_real_range(unsigned user_gpio);
 /*D
-Get the real underlying range of PWM values being used on the gpio.
+Get the real underlying range of PWM values being used on the GPIO.
 
 . .
 user_gpio: 0-31.
 . .
 
-Returns the real range used for the gpio if OK,
+Returns the real range used for the GPIO if OK,
 otherwise PI_BAD_USER_GPIO.
 
-If a hardware clock is active on the gpio the reported
+If a hardware clock is active on the GPIO the reported
 real range will be 1000000 (1M).
 
-If hardware PWM is active on the gpio the reported real range
+If hardware PWM is active on the GPIO the reported real range
 will be approximately 250M divided by the set PWM frequency.
 
 D*/
@@ -561,7 +561,7 @@ D*/
 /*F*/
 int set_PWM_frequency(unsigned user_gpio, unsigned frequency);
 /*D
-Set the frequency (in Hz) of the PWM to be used on the gpio.
+Set the frequency (in Hz) of the PWM to be used on the GPIO.
 
 . .
 user_gpio: 0-31.
@@ -575,10 +575,10 @@ 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.
 
-Each gpio can be independently set to one of 18 different
+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
+If PWM is currently active on the GPIO it will be switched
 off and then back on at the new frequency.
 
 . .
@@ -605,29 +605,29 @@ D*/
 /*F*/
 int get_PWM_frequency(unsigned user_gpio);
 /*D
-Get the frequency of PWM being used on the gpio.
+Get the frequency of PWM being used on the GPIO.
 
 . .
 user_gpio: 0-31.
 . .
 
-For normal PWM the frequency will be that defined for the gpio by
+For normal PWM the frequency will be that defined for the GPIO by
 [*set_PWM_frequency*].
 
-If a hardware clock is active on the gpio the reported frequency
+If a hardware clock is active on the GPIO the reported frequency
 will be that set by [*hardware_clock*].
 
-If hardware PWM is active on the gpio the reported frequency
+If hardware PWM is active on the GPIO the reported frequency
 will be that set by [*hardware_PWM*].
 
-Returns the frequency (in hertz) used for the gpio if OK,
+Returns the frequency (in hertz) used for the GPIO if OK,
 otherwise PI_BAD_USER_GPIO.
 D*/
 
 /*F*/
 int set_servo_pulsewidth(unsigned user_gpio, unsigned pulsewidth);
 /*D
-Start (500-2500) or stop (0) servo pulses on the gpio.
+Start (500-2500) or stop (0) servo pulses on the GPIO.
 
 . .
  user_gpio: 0-31.
@@ -662,7 +662,7 @@ Then set the PWM range using [*set_PWM_range*] to 1E6/Hz.
 Doing this allows you to use units of microseconds when setting
 the servo pulsewidth.
 
-E.g. If you want to update a servo connected to gpio 25 at 400Hz
+E.g. If you want to update a servo connected to GPIO 25 at 400Hz
 
 . .
 set_PWM_frequency(25, 400);
@@ -676,7 +676,7 @@ D*/
 /*F*/
 int get_servo_pulsewidth(unsigned user_gpio);
 /*D
-Return the servo pulsewidth in use on a gpio.
+Return the servo pulsewidth in use on a GPIO.
 
 . .
 user_gpio: 0-31.
@@ -693,7 +693,7 @@ Get a free notification handle.
 Returns a handle greater than or equal to zero if OK,
 otherwise PI_NO_HANDLE.
 
-A notification is a method for being notified of gpio state
+A notification is a method for being notified of GPIO state
 changes via a pipe.
 
 Pipes are only accessible from the local machine so this function
@@ -714,12 +714,12 @@ Start notifications on a previously opened handle.
 
 . .
 handle: 0-31 (as returned by [*notify_open*])
-  bits: a mask indicating the gpios to be notified.
+  bits: a mask indicating the GPIO to be notified.
 . .
 
 Returns 0 if OK, otherwise PI_BAD_HANDLE.
 
-The notification sends state changes for each gpio whose
+The notification sends state changes for each GPIO whose
 corresponding bit in bits is set.
 
 Notes
@@ -765,7 +765,7 @@ D*/
 /*F*/
 int set_watchdog(unsigned user_gpio, unsigned timeout);
 /*D
-Sets a watchdog for a gpio.
+Sets a watchdog for a GPIO.
 
 . .
 user_gpio: 0-31.
@@ -777,24 +777,24 @@ or PI_BAD_WDOG_TIMEOUT.
 
 The watchdog is nominally in milliseconds.
 
-Only one watchdog may be registered per gpio.
+Only one watchdog may be registered per GPIO.
 
 The watchdog may be cancelled by setting timeout to 0.
 
-If no level change has been detected for the gpio for timeout
-milliseconds any notification for the gpio has a report written
+If no level change has been detected for the GPIO for timeout
+milliseconds any notification for the GPIO has a report written
 to the fifo with the flags set to indicate a watchdog timeout.
 
 The [*callback*] and [*callback_ex*] functions interpret the flags
-and will call registered callbacks for the gpio with level TIMEOUT.
+and will call registered callbacks for the GPIO with level TIMEOUT.
 D*/
 
 /*F*/
 int set_glitch_filter(unsigned user_gpio, unsigned steady);
 /*D
-Sets a glitch filter on a gpio.
+Sets a glitch filter on a GPIO.
 
-Level changes on the gpio are not reported unless the level
+Level changes on the GPIO are not reported unless the level
 has been stable for at least [*steady*] microseconds.  The
 level is then reported.  Level changes of less than [*steady*]
 microseconds are ignored.
@@ -813,11 +813,11 @@ D*/
 /*F*/
 int set_noise_filter(unsigned user_gpio, unsigned steady, unsigned active);
 /*D
-Sets a noise filter on a gpio.
+Sets a noise filter on a GPIO.
 
-Level changes on the gpio are ignored until a level which has
+Level changes on the GPIO are ignored until a level which has
 been stable for [*steady*] microseconds is detected.  Level changes
-on the gpio are then reported for [*active*] microseconds after
+on the GPIO are then reported for [*active*] microseconds after
 which the process repeats.
 
 . .
@@ -836,90 +836,90 @@ D*/
 /*F*/
 uint32_t read_bank_1(void);
 /*D
-Read the levels of the bank 1 gpios (gpios 0-31).
+Read the levels of the bank 1 GPIO (GPIO 0-31).
 
 The returned 32 bit integer has a bit set if the corresponding
-gpio is logic 1.  Gpio n has bit value (1<<n).
+GPIO is logic 1.  GPIO n has bit value (1<<n).
 D*/
 
 /*F*/
 uint32_t read_bank_2(void);
 /*D
-Read the levels of the bank 2 gpios (gpios 32-53).
+Read the levels of the bank 2 GPIO (GPIO 32-53).
 
 The returned 32 bit integer has a bit set if the corresponding
-gpio is logic 1.  Gpio n has bit value (1<<(n-32)).
+GPIO is logic 1.  GPIO n has bit value (1<<(n-32)).
 D*/
 
 /*F*/
 int clear_bank_1(uint32_t bits);
 /*D
-Clears gpios 0-31 if the corresponding bit in bits is set.
+Clears GPIO 0-31 if the corresponding bit in bits is set.
 
 . .
-bits: a bit mask with 1 set if the corresponding gpio is
+bits: a bit mask with 1 set if the corresponding GPIO is
       to be cleared.
 . .
 
 Returns 0 if OK, otherwise PI_SOME_PERMITTED.
 
 A status of PI_SOME_PERMITTED indicates that the user is not
-allowed to write to one or more of the gpios.
+allowed to write to one or more of the GPIO.
 D*/
 
 /*F*/
 int clear_bank_2(uint32_t bits);
 /*D
-Clears gpios 32-53 if the corresponding bit (0-21) in bits is set.
+Clears GPIO 32-53 if the corresponding bit (0-21) in bits is set.
 
 . .
-bits: a bit mask with 1 set if the corresponding gpio is
+bits: a bit mask with 1 set if the corresponding GPIO is
       to be cleared.
 . .
 
 Returns 0 if OK, otherwise PI_SOME_PERMITTED.
 
 A status of PI_SOME_PERMITTED indicates that the user is not
-allowed to write to one or more of the gpios.
+allowed to write to one or more of the GPIO.
 D*/
 
 /*F*/
 int set_bank_1(uint32_t bits);
 /*D
-Sets gpios 0-31 if the corresponding bit in bits is set.
+Sets GPIO 0-31 if the corresponding bit in bits is set.
 
 . .
-bits: a bit mask with 1 set if the corresponding gpio is
+bits: a bit mask with 1 set if the corresponding GPIO is
       to be set.
 . .
 
 Returns 0 if OK, otherwise PI_SOME_PERMITTED.
 
 A status of PI_SOME_PERMITTED indicates that the user is not
-allowed to write to one or more of the gpios.
+allowed to write to one or more of the GPIO.
 D*/
 
 /*F*/
 int set_bank_2(uint32_t bits);
 /*D
-Sets gpios 32-53 if the corresponding bit (0-21) in bits is set.
+Sets GPIO 32-53 if the corresponding bit (0-21) in bits is set.
 
 . .
-bits: a bit mask with 1 set if the corresponding gpio is
+bits: a bit mask with 1 set if the corresponding GPIO is
       to be set.
 . .
 
 Returns 0 if OK, otherwise PI_SOME_PERMITTED.
 
 A status of PI_SOME_PERMITTED indicates that the user is not
-allowed to write to one or more of the gpios.
+allowed to write to one or more of the GPIO.
 D*/
 
 
 /*F*/
 int hardware_clock(unsigned gpio, unsigned clkfreq);
 /*D
-Starts a hardware clock on a gpio at the specified frequency.
+Starts a hardware clock on a GPIO at the specified frequency.
 Frequencies above 30MHz are unlikely to work.
 
 . .
@@ -930,17 +930,17 @@ frequency: 0 (off) or 4689-250000000 (250M)
 Returns 0 if OK, otherwise PI_NOT_PERMITTED, PI_BAD_GPIO,
 PI_NOT_HCLK_GPIO, PI_BAD_HCLK_FREQ,or PI_BAD_HCLK_PASS.
 
-The same clock is available on multiple gpios.  The latest
-frequency setting will be used by all gpios which share a clock.
+The same clock is available on multiple GPIO.  The latest
+frequency setting will be used by all GPIO which share a clock.
 
-The gpio must be one of the following.
+The GPIO must be one of the following.
 
 . .
 4   clock 0  All models
-5   clock 1  A+/B+/Pi2 and compute module only (reserved for system use)
-6   clock 2  A+/B+/Pi2 and compute module only
-20  clock 0  A+/B+/Pi2 and compute module only
-21  clock 1  All models but Rev.2 B (reserved for system use)
+5   clock 1  All models but A and B (reserved for system use)
+6   clock 2  All models but A and B
+20  clock 0  All models but A and B
+21  clock 1  All models but A and Rev.2 B (reserved for system use)
 
 32  clock 0  Compute module only
 34  clock 0  Compute module only
@@ -951,14 +951,14 @@ The gpio must be one of the following.
 
 Access to clock 1 is protected by a password as its use will likely
 crash the Pi.  The password is given by or'ing 0x5A000000 with the
-gpio number.
+GPIO number.
 D*/
 
 
 /*F*/
 int hardware_PWM(unsigned gpio, unsigned PWMfreq, uint32_t PWMduty);
 /*D
-Starts hardware PWM on a gpio at the specified frequency and dutycycle.
+Starts hardware PWM on a GPIO at the specified frequency and dutycycle.
 Frequencies above 30MHz are unlikely to work.
 
 NOTE: Any waveform started by [*wave_send_once*], [*wave_send_repeat*],
@@ -978,17 +978,17 @@ Returns 0 if OK, otherwise PI_NOT_PERMITTED, PI_BAD_GPIO,
 PI_NOT_HPWM_GPIO, PI_BAD_HPWM_DUTY, PI_BAD_HPWM_FREQ,
 or PI_HPWM_ILLEGAL.
 
-The same PWM channel is available on multiple gpios.  The latest
-frequency and dutycycle setting will be used by all gpios which
+The same PWM channel is available on multiple GPIO.  The latest
+frequency and dutycycle setting will be used by all GPIO which
 share a PWM channel.
 
-The gpio must be one of the following.
+The GPIO must be one of the following.
 
 . .
-12  PWM channel 0  A+/B+/Pi2 and compute module only
-13  PWM channel 1  A+/B+/Pi2 and compute module only
+12  PWM channel 0  All models but A and B
+13  PWM channel 1  All models but A and B
 18  PWM channel 0  All models
-19  PWM channel 1  A+/B+/Pi2 and compute module only
+19  PWM channel 1  All models but A and B
 
 40  PWM channel 0  Compute module only
 41  PWM channel 1  Compute module only
@@ -1022,7 +1022,7 @@ of /proc/cpuinfo.
 If the hardware revision can not be found or is not a valid
 hexadecimal number the function returns 0.
 
-The revision number can be used to determine the assignment of gpios
+The revision number can be used to determine the assignment of GPIO
 to pins (see [*gpio*]).
 
 There are at least three types of board.
@@ -1077,7 +1077,7 @@ The pulses are interleaved in time order within the existing waveform
 (if any).
 
 Merging allows the waveform to be built in parts, that is the settings
-for gpio#1 can be added, and then gpio#2 etc.
+for GPIO#1 can be added, and then GPIO#2 etc.
 
 If the added waveform is intended to start after or within the existing
 waveform then the first pulse should consist solely of a delay.
@@ -1164,8 +1164,8 @@ typedef struct
 
 The fields specify
 
-1) the gpios to be switched on at the start of the pulse. 
-2) the gpios to be switched off at the start of the pulse. 
+1) the GPIO to be switched on at the start of the pulse. 
+2) the GPIO to be switched off at the start of the pulse. 
 3) the delay in microseconds before the next pulse. 
 
 Any or all the fields can be zero.  It doesn't make any sense to
@@ -1403,7 +1403,7 @@ D*/
 /*F*/
 int gpio_trigger(unsigned user_gpio, unsigned pulseLen, unsigned level);
 /*D
-This function sends a trigger pulse to a gpio.  The gpio is set to
+This function sends a trigger pulse to a GPIO.  The GPIO is set to
 level for pulseLen microseconds and then reset to not level.
 
 . .
@@ -1501,7 +1501,7 @@ D*/
 /*F*/
 int bb_serial_read_open(unsigned user_gpio, unsigned baud, unsigned data_bits);
 /*D
-This function opens a gpio for bit bang reading of serial data.
+This function opens a GPIO for bit bang reading of serial data.
 
 . .
 user_gpio: 0-31.
@@ -1545,7 +1545,7 @@ D*/
 /*F*/
 int bb_serial_read_close(unsigned user_gpio);
 /*D
-This function closes a gpio for bit bang reading of serial data.
+This function closes a GPIO for bit bang reading of serial data.
 
 . .
 user_gpio: 0-31, previously opened with [*bb_serial_read_open*].
@@ -1990,7 +1990,7 @@ D*/
 /*F*/
 int bb_i2c_open(unsigned SDA, unsigned SCL, unsigned baud);
 /*D
-This function selects a pair of gpios for bit banging I2C at a
+This function selects a pair of GPIO for bit banging I2C at a
 specified baud rate.
 
 Bit banging I2C allows for certain operations which are not possible
@@ -1999,7 +1999,7 @@ with the standard I2C driver.
 o baud rates as low as 50 
 o repeated starts 
 o clock stretching 
-o I2C on any pair of spare gpios
+o I2C on any pair of spare GPIO
 
 . .
  SDA: 0-31
@@ -2012,18 +2012,18 @@ PI_GPIO_IN_USE.
 
 NOTE:
 
-The gpios used for SDA and SCL must have pull-ups to 3V3 connected.  As
+The GPIO used for SDA and SCL must have pull-ups to 3V3 connected.  As
 a guide the hardware pull-ups on pins 3 and 5 are 1k8 in value.
 D*/
 
 /*F*/
 int bb_i2c_close(unsigned SDA);
 /*D
-This function stops bit banging I2C on a pair of gpios previously
+This function stops bit banging I2C on a pair of GPIO previously
 opened with [*bb_i2c_open*].
 
 . .
-SDA: 0-31, the SDA gpio used in a prior call to [*bb_i2c_open*]
+SDA: 0-31, the SDA GPIO used in a prior call to [*bb_i2c_open*]
 . .
 
 Returns 0 if OK, otherwise PI_BAD_USER_GPIO, or PI_NOT_I2C_GPIO.
@@ -2108,12 +2108,13 @@ Data will be transferred at baud bits per second.  The flags may
 be used to modify the default behaviour of 4-wire operation, mode 0,
 active low chip select.
 
-An auxiliary SPI device is available on the A+/B+/Pi2 and may be
-selected by setting the A bit in the flags.  The auxiliary
-device has 3 chip selects and a selectable word size in bits.
+An auxiliary SPI device is available on all models but the
+A and B and may be selected by setting the A bit in the
+flags.  The auxiliary device has 3 chip selects and a
+selectable word size in bits.
 
 . .
-spi_channel: 0-1 (0-2 for A+/B+/Pi2 auxiliary device).
+spi_channel: 0-1 (0-2 for the auxiliary SPI device).
        baud: 32K-125M (values above 30M are unlikely to work).
   spi_flags: see below.
 . .
@@ -2142,10 +2143,9 @@ Mode POL PHA
 
 px is 0 if CEx is active low (default) and 1 for active high.
 
-ux is 0 if the CEx gpio is reserved for SPI (default) and 1 otherwise.
+ux is 0 if the CEx GPIO is reserved for SPI (default) and 1 otherwise.
 
-A is 0 for the standard SPI device, 1 for the auxiliary SPI.  The
-auxiliary device is only present on the A+/B+/Pi2.
+A is 0 for the standard SPI device, 1 for the auxiliary SPI.
 
 W is 0 if the device is not 3-wire, 1 if the device is 3-wire.  Standard
 SPI device only.
@@ -2392,8 +2392,8 @@ user_gpio: 0-31.
 The function returns a callback id if OK, otherwise pigif_bad_malloc,
 pigif_duplicate_callback, or pigif_bad_callback.
 
-The callback is called with the gpio, edge, and tick, whenever the
-gpio has the identified edge.
+The callback is called with the GPIO, edge, and tick, whenever the
+GPIO has the identified edge.
 D*/
 
 /*F*/
@@ -2412,8 +2412,8 @@ user_gpio: 0-31.
 The function returns a callback id if OK, otherwise pigif_bad_malloc,
 pigif_duplicate_callback, or pigif_bad_callback.
 
-The callback is called with the gpio, edge, tick, and user, whenever
-the gpio has the identified edge.
+The callback is called with the GPIO, edge, tick, and user, whenever
+the GPIO has the identified edge.
 
 D*/
 
@@ -2432,7 +2432,7 @@ D*/
 /*F*/
 int wait_for_edge(unsigned user_gpio, unsigned edge, double timeout);
 /*D
-This function waits for edge on the gpio for up to timeout
+This function waits for edge on the GPIO for up to timeout
 seconds.
 
 . .
@@ -2483,7 +2483,7 @@ bit::
 A value of 0 or 1.
 
 bits::
-A value used to select gpios.  If bit n of bits is set then gpio n is
+A value used to select GPIO.  If bit n of bits is set then GPIO n is
 selected.
 
 A convenient way to set bit n is to or in (1<<n).
@@ -2544,7 +2544,7 @@ The number may vary between 0 and range (default 255) where
 0 is off and range is fully on.
 
 edge::
-Used to identify a gpio level transition of interest.  A rising edge is
+Used to identify a GPIO level transition of interest.  A rising edge is
 a level change from 0 to 1.  A falling edge is a level change from 1 to 0.
 
 . .
@@ -2561,28 +2561,28 @@ f::
 A function.
 
 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
+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
 by its dutycycle.
 
 
 gpio::
-A Broadcom numbered gpio, in the range 0-53.
+A Broadcom numbered GPIO, in the range 0-53.
 
-There  are 54 General Purpose Input Outputs (gpios) named gpio0 through
+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.
 
-All the gpios which are safe for the user to read and write are in
-bank 1.  Not all gpios in bank 1 are safe though.  Type 1 boards
-have 17  safe gpios.  Type 2 boards have 21.  Type 3 boards have 26.
+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
+have 17  safe GPIO.  Type 2 boards have 21.  Type 3 boards have 26.
 
 See [*get_hardware_revision*].
 
-The user gpios are marked with an X in the following table.
+The user GPIO are marked with an X in the following table.
 
 . .
           0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
@@ -2640,7 +2640,7 @@ invert::
 A flag used to set normal or inverted bit bang serial data level logic.
 
 level::
-The level of a gpio.  Low or High.
+The level of a GPIO.  Low or High.
 
 . .
 PI_OFF 0
@@ -2653,7 +2653,7 @@ PI_LOW 0
 PI_HIGH 1
 . .
 
-There is one exception.  If a watchdog expires on a gpio the level will be
+There is one exception.  If a watchdog expires on a GPIO the level will be
 reported as PI_TIMEOUT.  See [*set_watchdog*].
 
 . .
@@ -2661,7 +2661,7 @@ PI_TIMEOUT 2
 . .
 
 mode::0-7
-The operational mode of a gpio, normally INPUT or OUTPUT.
+The operational mode of a GPIO, normally INPUT or OUTPUT.
 
 . .
 PI_INPUT 0
@@ -2712,7 +2712,7 @@ pthread_t::
 A thread identifier.
 
 pud::0-2
-The setting of the pull up/down resistor for a gpio, which may be off,
+The setting of the pull up/down resistor for a GPIO, which may be off,
 pull-up, or pull-down.
 . .
 PI_PUD_OFF 0
@@ -2766,7 +2766,7 @@ The maximum number of bytes a user customised function should return.
 A pointer to a buffer to receive data.
 
 SCL::
-The user gpio to use for the clock when bit banging I2C.
+The user GPIO to use for the clock when bit banging I2C.
 
 *script::
 A pointer to the text of a script.
@@ -2775,7 +2775,7 @@ script_id::
 An id of a stored script as returned by [*store_script*].
 
 SDA::
-The user gpio to use for data when bit banging I2C.
+The user GPIO to use for data when bit banging I2C.
 
 seconds::
 The number of seconds.
@@ -2818,7 +2818,7 @@ A function of type gpioThreadFunc_t used as the main function of a
 thread.
 
 timeout::
-A gpio watchdog timeout in milliseconds.
+A GPIO watchdog timeout in milliseconds.
 . .
 PI_MIN_WDOG_TIMEOUT 0
 PI_MAX_WDOG_TIMEOUT 60000
@@ -2834,7 +2834,7 @@ unsigned::
 A whole number >= 0.
 
 user_gpio::
-0-31, a Broadcom numbered gpio.
+0-31, a Broadcom numbered GPIO.
 
 See [*gpio*].
 
index 44fe60e9091e0abd1f1e9bc7b3fec3691d514cae..df2afe7e58b7ba1cd5eb05fe305ae6c5af515d1a 100644 (file)
@@ -21,7 +21,7 @@ gcc -Wall -pthread -o prog prog.c -lpigpiod_if2 -lrt
 
 .br
 pigpiod_if2 is a C library for the Raspberry which allows control
-of the gpios via the socket interface to the pigpio daemon.
+of the GPIO via the socket interface to the pigpio daemon.
 .br
 
 .br
@@ -31,17 +31,17 @@ of the gpios via the socket interface to the pigpio daemon.
 .br
 
 .br
-o PWM on any of gpios 0-31
+o PWM on any of GPIO 0-31
 
 .br
 
 .br
-o servo pulses on any of gpios 0-31
+o servo pulses on any of GPIO 0-31
 
 .br
 
 .br
-o callbacks when any of gpios 0-31 change state
+o callbacks when any of GPIO 0-31 change state
 
 .br
 
@@ -51,17 +51,17 @@ o callbacks at timed intervals
 .br
 
 .br
-o reading/writing all of the gpios in a bank as one operation
+o reading/writing all of the GPIO in a bank as one operation
 
 .br
 
 .br
-o individually setting gpio modes, reading and writing
+o individually setting GPIO modes, reading and writing
 
 .br
 
 .br
-o notifications when any of gpios 0-31 change state
+o notifications when any of GPIO 0-31 change state
 
 .br
 
@@ -71,7 +71,7 @@ o the construction of output waveforms with microsecond timing
 .br
 
 .br
-o rudimentary permission control over gpios
+o rudimentary permission control over GPIO
 
 .br
 
@@ -91,11 +91,11 @@ o creating and running scripts on the pigpio daemon
 .br
 
 .br
-.SS gpios
+.SS GPIO
 .br
 
 .br
-ALL gpios are identified by their Broadcom number.
+ALL GPIO are identified by their Broadcom number.
 
 .br
 
@@ -319,7 +319,7 @@ pi: 0- (as returned by \fBpigpio_start\fP).
 
 .IP "\fBint set_mode(int pi, unsigned gpio, unsigned mode)\fP"
 .IP "" 4
-Set the gpio mode.
+Set the GPIO mode.
 
 .br
 
@@ -345,7 +345,7 @@ or PI_NOT_PERMITTED.
 
 .IP "\fBint get_mode(int pi, unsigned gpio)\fP"
 .IP "" 4
-Get the gpio mode.
+Get the GPIO mode.
 
 .br
 
@@ -362,11 +362,11 @@ gpio: 0-53.
 .br
 
 .br
-Returns the gpio mode if OK, otherwise PI_BAD_GPIO.
+Returns the GPIO mode if OK, otherwise PI_BAD_GPIO.
 
 .IP "\fBint set_pull_up_down(int pi, unsigned gpio, unsigned pud)\fP"
 .IP "" 4
-Set or clear the gpio pull-up/down resistor.
+Set or clear the GPIO pull-up/down resistor.
 
 .br
 
@@ -390,7 +390,7 @@ or PI_NOT_PERMITTED.
 
 .IP "\fBint gpio_read(int pi, unsigned gpio)\fP"
 .IP "" 4
-Read the gpio level.
+Read the GPIO level.
 
 .br
 
@@ -407,11 +407,11 @@ gpio:0-53.
 .br
 
 .br
-Returns the gpio level if OK, otherwise PI_BAD_GPIO.
+Returns the GPIO level if OK, otherwise PI_BAD_GPIO.
 
 .IP "\fBint gpio_write(int pi, unsigned gpio, unsigned level)\fP"
 .IP "" 4
-Write the gpio level.
+Write the GPIO level.
 
 .br
 
@@ -441,11 +441,11 @@ Notes
 .br
 
 .br
-If PWM or servo pulses are active on the gpio they are switched off.
+If PWM or servo pulses are active on the GPIO they are switched off.
 
 .IP "\fBint set_PWM_dutycycle(int pi, unsigned user_gpio, unsigned dutycycle)\fP"
 .IP "" 4
-Start (non-zero dutycycle) or stop (0) PWM pulses on the gpio.
+Start (non-zero dutycycle) or stop (0) PWM pulses on the GPIO.
 
 .br
 
@@ -476,7 +476,7 @@ default range of 255.
 
 .IP "\fBint get_PWM_dutycycle(int pi, unsigned user_gpio)\fP"
 .IP "" 4
-Return the PWM dutycycle in use on a gpio.
+Return the PWM dutycycle in use on a GPIO.
 
 .br
 
@@ -499,23 +499,23 @@ Returns 0 if OK, otherwise PI_BAD_USER_GPIO or PI_NOT_PWM_GPIO.
 
 .br
 For normal PWM the dutycycle will be out of the defined range
-for the gpio (see \fBget_PWM_range\fP).
+for the GPIO (see \fBget_PWM_range\fP).
 
 .br
 
 .br
-If a hardware clock is active on the gpio the reported dutycycle
+If a hardware clock is active on the GPIO the reported dutycycle
 will be 500000 (500k) out of 1000000 (1M).
 
 .br
 
 .br
-If hardware PWM is active on the gpio the reported dutycycle
+If hardware PWM is active on the GPIO the reported dutycycle
 will be out of a 1000000 (1M).
 
 .IP "\fBint set_PWM_range(int pi, unsigned user_gpio, unsigned range)\fP"
 .IP "" 4
-Set the range of PWM values to be used on the gpio.
+Set the range of PWM values to be used on the GPIO.
 
 .br
 
@@ -545,14 +545,14 @@ Notes
 .br
 
 .br
-If PWM is currently active on the gpio its dutycycle will be
+If PWM is currently active on the GPIO its dutycycle will be
 scaled to reflect the new range.
 
 .br
 
 .br
 The real range, the number of steps between fully off and fully on
-for each of the 18 available gpio frequencies is
+for each of the 18 available GPIO frequencies is
 
 .br
 
@@ -575,7 +575,7 @@ The real value set by set_PWM_range is (dutycycle * real range) / range.
 
 .IP "\fBint get_PWM_range(int pi, unsigned user_gpio)\fP"
 .IP "" 4
-Get the range of PWM values being used on the gpio.
+Get the range of PWM values being used on the GPIO.
 
 .br
 
@@ -592,18 +592,18 @@ user_gpio: 0-31.
 .br
 
 .br
-Returns the dutycycle range used for the gpio if OK,
+Returns the dutycycle range used for the GPIO if OK,
 otherwise PI_BAD_USER_GPIO.
 
 .br
 
 .br
-If a hardware clock or hardware PWM is active on the gpio the
+If a hardware clock or hardware PWM is active on the GPIO the
 reported range will be 1000000 (1M).
 
 .IP "\fBint get_PWM_real_range(int pi, unsigned user_gpio)\fP"
 .IP "" 4
-Get the real underlying range of PWM values being used on the gpio.
+Get the real underlying range of PWM values being used on the GPIO.
 
 .br
 
@@ -620,19 +620,19 @@ user_gpio: 0-31.
 .br
 
 .br
-Returns the real range used for the gpio if OK,
+Returns the real range used for the GPIO if OK,
 otherwise PI_BAD_USER_GPIO.
 
 .br
 
 .br
-If a hardware clock is active on the gpio the reported
+If a hardware clock is active on the GPIO the reported
 real range will be 1000000 (1M).
 
 .br
 
 .br
-If hardware PWM is active on the gpio the reported real range
+If hardware PWM is active on the GPIO the reported real range
 will be approximately 250M divided by the set PWM frequency.
 
 .br
@@ -641,7 +641,7 @@ will be approximately 250M divided by the set PWM frequency.
 
 .IP "\fBint set_PWM_frequency(int pi, unsigned user_gpio, unsigned frequency)\fP"
 .IP "" 4
-Set the frequency (in Hz) of the PWM to be used on the gpio.
+Set the frequency (in Hz) of the PWM to be used on the GPIO.
 
 .br
 
@@ -673,13 +673,13 @@ sample rate is set when the C pigpio library is started.
 .br
 
 .br
-Each gpio can be independently set to one of 18 different
+Each GPIO can be independently set to one of 18 different
 PWM frequencies.
 
 .br
 
 .br
-If PWM is currently active on the gpio it will be switched
+If PWM is currently active on the GPIO it will be switched
 off and then back on at the new frequency.
 
 .br
@@ -726,7 +726,7 @@ off and then back on at the new frequency.
 
 .IP "\fBint get_PWM_frequency(int pi, unsigned user_gpio)\fP"
 .IP "" 4
-Get the frequency of PWM being used on the gpio.
+Get the frequency of PWM being used on the GPIO.
 
 .br
 
@@ -743,30 +743,30 @@ user_gpio: 0-31.
 .br
 
 .br
-For normal PWM the frequency will be that defined for the gpio by
+For normal PWM the frequency will be that defined for the GPIO by
 \fBset_PWM_frequency\fP.
 
 .br
 
 .br
-If a hardware clock is active on the gpio the reported frequency
+If a hardware clock is active on the GPIO the reported frequency
 will be that set by \fBhardware_clock\fP.
 
 .br
 
 .br
-If hardware PWM is active on the gpio the reported frequency
+If hardware PWM is active on the GPIO the reported frequency
 will be that set by \fBhardware_PWM\fP.
 
 .br
 
 .br
-Returns the frequency (in hertz) used for the gpio if OK,
+Returns the frequency (in hertz) used for the GPIO if OK,
 otherwise PI_BAD_USER_GPIO.
 
 .IP "\fBint set_servo_pulsewidth(int pi, unsigned user_gpio, unsigned pulsewidth)\fP"
 .IP "" 4
-Start (500-2500) or stop (0) servo pulses on the gpio.
+Start (500-2500) or stop (0) servo pulses on the GPIO.
 
 .br
 
@@ -844,7 +844,7 @@ the servo pulsewidth.
 .br
 
 .br
-E.g. If you want to update a servo connected to gpio 25 at 400Hz
+E.g. If you want to update a servo connected to GPIO 25 at 400Hz
 
 .br
 
@@ -867,7 +867,7 @@ e.g. set_PWM_dutycycle(25, 1500) will set a 1500 us pulse.
 
 .IP "\fBint get_servo_pulsewidth(int pi, unsigned user_gpio)\fP"
 .IP "" 4
-Return the servo pulsewidth in use on a gpio.
+Return the servo pulsewidth in use on a GPIO.
 
 .br
 
@@ -909,7 +909,7 @@ otherwise PI_NO_HANDLE.
 .br
 
 .br
-A notification is a method for being notified of gpio state
+A notification is a method for being notified of GPIO state
 changes via a pipe.
 
 .br
@@ -941,7 +941,7 @@ Start notifications on a previously opened handle.
 .br
 handle: 0-31 (as returned by \fBnotify_open\fP)
 .br
-  bits: a mask indicating the gpios to be notified.
+  bits: a mask indicating the GPIO to be notified.
 .br
 
 .EE
@@ -954,7 +954,7 @@ Returns 0 if OK, otherwise PI_BAD_HANDLE.
 .br
 
 .br
-The notification sends state changes for each gpio whose
+The notification sends state changes for each GPIO whose
 corresponding bit in bits is set.
 
 .br
@@ -1034,7 +1034,7 @@ Returns 0 if OK, otherwise PI_BAD_HANDLE.
 
 .IP "\fBint set_watchdog(int pi, unsigned user_gpio, unsigned timeout)\fP"
 .IP "" 4
-Sets a watchdog for a gpio.
+Sets a watchdog for a GPIO.
 
 .br
 
@@ -1064,7 +1064,7 @@ The watchdog is nominally in milliseconds.
 .br
 
 .br
-Only one watchdog may be registered per gpio.
+Only one watchdog may be registered per GPIO.
 
 .br
 
@@ -1074,24 +1074,24 @@ The watchdog may be cancelled by setting timeout to 0.
 .br
 
 .br
-If no level change has been detected for the gpio for timeout
-milliseconds any notification for the gpio has a report written
+If no level change has been detected for the GPIO for timeout
+milliseconds any notification for the GPIO has a report written
 to the fifo with the flags set to indicate a watchdog timeout.
 
 .br
 
 .br
 The \fBcallback\fP and \fBcallback_ex\fP functions interpret the flags
-and will call registered callbacks for the gpio with level TIMEOUT.
+and will call registered callbacks for the GPIO with level TIMEOUT.
 
 .IP "\fBint set_glitch_filter(int pi, unsigned user_gpio, unsigned steady)\fP"
 .IP "" 4
-Sets a glitch filter on a gpio.
+Sets a glitch filter on a GPIO.
 
 .br
 
 .br
-Level changes on the gpio are not reported unless the level
+Level changes on the GPIO are not reported unless the level
 has been stable for at least \fBsteady\fP microseconds.  The
 level is then reported.  Level changes of less than
 \fBsteady\fP microseconds are ignored.
@@ -1123,14 +1123,14 @@ after it was first detected.
 
 .IP "\fBint set_noise_filter(int pi, unsigned user_gpio, unsigned steady, unsigned active)\fP"
 .IP "" 4
-Sets a noise filter on a gpio.
+Sets a noise filter on a GPIO.
 
 .br
 
 .br
-Level changes on the gpio are ignored until a level which has
+Level changes on the GPIO are ignored until a level which has
 been stable for \fBsteady\fP microseconds is detected.  Level changes
-on the gpio are then reported for \fBactive\fP microseconds after
+on the GPIO are then reported for \fBactive\fP microseconds after
 which the process repeats.
 
 .br
@@ -1163,7 +1163,7 @@ such reports.
 
 .IP "\fBuint32_t read_bank_1(int pi)\fP"
 .IP "" 4
-Read the levels of the bank 1 gpios (gpios 0-31).
+Read the levels of the bank 1 GPIO (GPIO 0-31).
 
 .br
 
@@ -1179,11 +1179,11 @@ pi: 0- (as returned by \fBpigpio_start\fP).
 
 .br
 The returned 32 bit integer has a bit set if the corresponding
-gpio is logic 1.  Gpio n has bit value (1<<n).
+GPIO is logic 1.  GPIO n has bit value (1<<n).
 
 .IP "\fBuint32_t read_bank_2(int pi)\fP"
 .IP "" 4
-Read the levels of the bank 2 gpios (gpios 32-53).
+Read the levels of the bank 2 GPIO (GPIO 32-53).
 
 .br
 
@@ -1199,11 +1199,11 @@ pi: 0- (as returned by \fBpigpio_start\fP).
 
 .br
 The returned 32 bit integer has a bit set if the corresponding
-gpio is logic 1.  Gpio n has bit value (1<<(n-32)).
+GPIO is logic 1.  GPIO n has bit value (1<<(n-32)).
 
 .IP "\fBint clear_bank_1(int pi, uint32_t bits)\fP"
 .IP "" 4
-Clears gpios 0-31 if the corresponding bit in bits is set.
+Clears GPIO 0-31 if the corresponding bit in bits is set.
 
 .br
 
@@ -1212,7 +1212,7 @@ Clears gpios 0-31 if the corresponding bit in bits is set.
 .EX
   pi: 0- (as returned by \fBpigpio_start\fP).
 .br
-bits: a bit mask with 1 set if the corresponding gpio is
+bits: a bit mask with 1 set if the corresponding GPIO is
 .br
       to be cleared.
 .br
@@ -1228,11 +1228,11 @@ Returns 0 if OK, otherwise PI_SOME_PERMITTED.
 
 .br
 A status of PI_SOME_PERMITTED indicates that the user is not
-allowed to write to one or more of the gpios.
+allowed to write to one or more of the GPIO.
 
 .IP "\fBint clear_bank_2(int pi, uint32_t bits)\fP"
 .IP "" 4
-Clears gpios 32-53 if the corresponding bit (0-21) in bits is set.
+Clears GPIO 32-53 if the corresponding bit (0-21) in bits is set.
 
 .br
 
@@ -1241,7 +1241,7 @@ Clears gpios 32-53 if the corresponding bit (0-21) in bits is set.
 .EX
   pi: 0- (as returned by \fBpigpio_start\fP).
 .br
-bits: a bit mask with 1 set if the corresponding gpio is
+bits: a bit mask with 1 set if the corresponding GPIO is
 .br
       to be cleared.
 .br
@@ -1257,11 +1257,11 @@ Returns 0 if OK, otherwise PI_SOME_PERMITTED.
 
 .br
 A status of PI_SOME_PERMITTED indicates that the user is not
-allowed to write to one or more of the gpios.
+allowed to write to one or more of the GPIO.
 
 .IP "\fBint set_bank_1(int pi, uint32_t bits)\fP"
 .IP "" 4
-Sets gpios 0-31 if the corresponding bit in bits is set.
+Sets GPIO 0-31 if the corresponding bit in bits is set.
 
 .br
 
@@ -1270,7 +1270,7 @@ Sets gpios 0-31 if the corresponding bit in bits is set.
 .EX
   pi: 0- (as returned by \fBpigpio_start\fP).
 .br
-bits: a bit mask with 1 set if the corresponding gpio is
+bits: a bit mask with 1 set if the corresponding GPIO is
 .br
       to be set.
 .br
@@ -1286,11 +1286,11 @@ Returns 0 if OK, otherwise PI_SOME_PERMITTED.
 
 .br
 A status of PI_SOME_PERMITTED indicates that the user is not
-allowed to write to one or more of the gpios.
+allowed to write to one or more of the GPIO.
 
 .IP "\fBint set_bank_2(int pi, uint32_t bits)\fP"
 .IP "" 4
-Sets gpios 32-53 if the corresponding bit (0-21) in bits is set.
+Sets GPIO 32-53 if the corresponding bit (0-21) in bits is set.
 
 .br
 
@@ -1299,7 +1299,7 @@ Sets gpios 32-53 if the corresponding bit (0-21) in bits is set.
 .EX
   pi: 0- (as returned by \fBpigpio_start\fP).
 .br
-bits: a bit mask with 1 set if the corresponding gpio is
+bits: a bit mask with 1 set if the corresponding GPIO is
 .br
       to be set.
 .br
@@ -1315,11 +1315,11 @@ Returns 0 if OK, otherwise PI_SOME_PERMITTED.
 
 .br
 A status of PI_SOME_PERMITTED indicates that the user is not
-allowed to write to one or more of the gpios.
+allowed to write to one or more of the GPIO.
 
 .IP "\fBint hardware_clock(int pi, unsigned gpio, unsigned clkfreq)\fP"
 .IP "" 4
-Starts a hardware clock on a gpio at the specified frequency.
+Starts a hardware clock on a GPIO at the specified frequency.
 Frequencies above 30MHz are unlikely to work.
 
 .br
@@ -1345,13 +1345,13 @@ PI_NOT_HCLK_GPIO, PI_BAD_HCLK_FREQ,or PI_BAD_HCLK_PASS.
 .br
 
 .br
-The same clock is available on multiple gpios.  The latest
-frequency setting will be used by all gpios which share a clock.
+The same clock is available on multiple GPIO.  The latest
+frequency setting will be used by all GPIO which share a clock.
 
 .br
 
 .br
-The gpio must be one of the following.
+The GPIO must be one of the following.
 
 .br
 
@@ -1360,13 +1360,13 @@ The gpio must be one of the following.
 .EX
 4   clock 0  All models
 .br
-5   clock 1  A+/B+/Pi2/Zero and compute module only (reserved for system use)
+5   clock 1  All models but A and B (reserved for system use)
 .br
-6   clock 2  A+/B+/Pi2/Zero and compute module only
+6   clock 2  All models but A and B
 .br
-20  clock 0  A+/B+/Pi2/Zero and compute module only
+20  clock 0  All models but A and B
 .br
-21  clock 1  All models but Rev.2 B (reserved for system use)
+21  clock 1  All models but A and Rev.2 B (reserved for system use)
 .br
 
 .br
@@ -1388,11 +1388,11 @@ The gpio must be one of the following.
 .br
 Access to clock 1 is protected by a password as its use will likely
 crash the Pi.  The password is given by or'ing 0x5A000000 with the
-gpio number.
+GPIO number.
 
 .IP "\fBint hardware_PWM(int pi, unsigned gpio, unsigned PWMfreq, uint32_t PWMduty)\fP"
 .IP "" 4
-Starts hardware PWM on a gpio at the specified frequency and dutycycle.
+Starts hardware PWM on a GPIO at the specified frequency and dutycycle.
 Frequencies above 30MHz are unlikely to work.
 
 .br
@@ -1434,27 +1434,27 @@ or PI_HPWM_ILLEGAL.
 .br
 
 .br
-The same PWM channel is available on multiple gpios.  The latest
-frequency and dutycycle setting will be used by all gpios which
+The same PWM channel is available on multiple GPIO.  The latest
+frequency and dutycycle setting will be used by all GPIO which
 share a PWM channel.
 
 .br
 
 .br
-The gpio must be one of the following.
+The GPIO must be one of the following.
 
 .br
 
 .br
 
 .EX
-12  PWM channel 0  A+/B+/Pi2/Zero and compute module only
+12  PWM channel 0  All models but A and B
 .br
-13  PWM channel 1  A+/B+/Pi2/Zero and compute module only
+13  PWM channel 1  All models but A and B
 .br
 18  PWM channel 0  All models
 .br
-19  PWM channel 1  A+/B+/Pi2/Zero and compute module only
+19  PWM channel 1  All models but A and B
 .br
 
 .br
@@ -1548,7 +1548,7 @@ hexadecimal number the function returns 0.
 .br
 
 .br
-The revision number can be used to determine the assignment of gpios
+The revision number can be used to determine the assignment of GPIO
 to pins (see \fBgpio\fP).
 
 .br
@@ -1660,7 +1660,7 @@ The pulses are interleaved in time order within the existing waveform
 
 .br
 Merging allows the waveform to be built in parts, that is the settings
-for gpio#1 can be added, and then gpio#2 etc.
+for GPIO#1 can be added, and then GPIO#2 etc.
 
 .br
 
@@ -1835,9 +1835,9 @@ The fields specify
 .br
 
 .br
-1) the gpios to be switched on at the start of the pulse.
+1) the GPIO to be switched on at the start of the pulse.
 .br
-2) the gpios to be switched off at the start of the pulse.
+2) the GPIO to be switched off at the start of the pulse.
 .br
 3) the delay in microseconds before the next pulse.
 .br
@@ -2199,6 +2199,33 @@ int main(int argc, char *argv[])
 
 .EE
 
+.IP "\fBint wave_tx_at(int pi)\fP"
+.IP "" 4
+This function returns the id of the waveform currently being
+transmitted.
+
+.br
+
+.br
+
+.EX
+pi: 0- (as returned by \fBpigpio_start\fP).
+.br
+
+.EE
+
+.br
+
+.br
+Returns the waveform id or one of the following special values:
+
+.br
+
+.br
+PI_WAVE_NOT_FOUND (9998) - transmitted wave not found.
+.br
+PI_NO_TX_WAVE (9999) - no wave being transmitted.
+
 .IP "\fBint wave_tx_busy(int pi)\fP"
 .IP "" 4
 This function checks to see if a waveform is currently being
@@ -2379,7 +2406,7 @@ pi: 0- (as returned by \fBpigpio_start\fP).
 
 .IP "\fBint gpio_trigger(int pi, unsigned user_gpio, unsigned pulseLen, unsigned level)\fP"
 .IP "" 4
-This function sends a trigger pulse to a gpio.  The gpio is set to
+This function sends a trigger pulse to a GPIO.  The GPIO is set to
 level for pulseLen microseconds and then reset to not level.
 
 .br
@@ -2555,7 +2582,7 @@ The function returns 0 if OK, otherwise PI_BAD_SCRIPT_ID.
 
 .IP "\fBint bb_serial_read_open(int pi, unsigned user_gpio, unsigned baud, unsigned data_bits)\fP"
 .IP "" 4
-This function opens a gpio for bit bang reading of serial data.
+This function opens a GPIO for bit bang reading of serial data.
 
 .br
 
@@ -2635,7 +2662,7 @@ For \fBdata_bits\fP 17-32 there will be four bytes per character.
 
 .IP "\fBint bb_serial_read_close(int pi, unsigned user_gpio)\fP"
 .IP "" 4
-This function closes a gpio for bit bang reading of serial data.
+This function closes a GPIO for bit bang reading of serial data.
 
 .br
 
@@ -3475,7 +3502,7 @@ End
 
 .IP "\fBint bb_i2c_open(int pi, unsigned SDA, unsigned SCL, unsigned baud)\fP"
 .IP "" 4
-This function selects a pair of gpios for bit banging I2C at a
+This function selects a pair of GPIO for bit banging I2C at a
 specified baud rate.
 
 .br
@@ -3493,7 +3520,7 @@ o repeated starts
 .br
 o clock stretching
 .br
-o I2C on any pair of spare gpios
+o I2C on any pair of spare GPIO
 
 .br
 
@@ -3525,12 +3552,12 @@ NOTE:
 .br
 
 .br
-The gpios used for SDA and SCL must have pull-ups to 3V3 connected.  As
+The GPIO used for SDA and SCL must have pull-ups to 3V3 connected.  As
 a guide the hardware pull-ups on pins 3 and 5 are 1k8 in value.
 
 .IP "\fBint bb_i2c_close(int pi, unsigned SDA)\fP"
 .IP "" 4
-This function stops bit banging I2C on a pair of gpios previously
+This function stops bit banging I2C on a pair of GPIO previously
 opened with \fBbb_i2c_open\fP.
 
 .br
@@ -3540,7 +3567,7 @@ opened with \fBbb_i2c_open\fP.
 .EX
  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
+SDA: 0-31, the SDA GPIO used in a prior call to \fBbb_i2c_open\fP
 .br
 
 .EE
@@ -3700,9 +3727,10 @@ active low chip select.
 .br
 
 .br
-An auxiliary SPI device is available on the A+/B+/Pi2/Zero and may be
-selected by setting the A bit in the flags.  The auxiliary
-device has 3 chip selects and a selectable word size in bits.
+An auxiliary SPI device is available on all models but the
+A and B and may be selected by setting the A bit in the
+flags.  The auxiliary device has 3 chip selects and a
+selectable word size in bits.
 
 .br
 
@@ -3711,7 +3739,7 @@ device has 3 chip selects and a selectable word size in bits.
 .EX
          pi: 0- (as returned by \fBpigpio_start\fP).
 .br
-spi_channel: 0-1 (0-2 for A+/B+/Pi2/Zero auxiliary device).
+spi_channel: 0-1 (0-2 for the auxiliary device).
 .br
        baud: 32K-125M (values above 30M are unlikely to work).
 .br
@@ -3779,13 +3807,12 @@ px is 0 if CEx is active low (default) and 1 for active high.
 .br
 
 .br
-ux is 0 if the CEx gpio is reserved for SPI (default) and 1 otherwise.
+ux is 0 if the CEx GPIO is reserved for SPI (default) and 1 otherwise.
 
 .br
 
 .br
-A is 0 for the standard SPI device, 1 for the auxiliary SPI.  The
-auxiliary device is only present on the A+/B+/Pi2/Zero.
+A is 0 for the standard SPI device, 1 for the auxiliary SPI.
 
 .br
 
@@ -3822,6 +3849,28 @@ sets 8 bits per word.  Auxiliary SPI device only.
 
 .br
 
+.br
+The \fBspi_read\fP, \fBspi_write\fP, and \fBspi_xfer\fP functions
+transfer data packed into 1, 2, or 4 bytes according to
+the word size in bits.
+
+.br
+
+.br
+For bits 1-8 there will be one byte per character.
+.br
+For bits 9-16 there will be two bytes per character.
+.br
+For bits 17-32 there will be four bytes per character.
+
+.br
+
+.br
+E.g. to transfer 32 12-bit words buf should contain 64 bytes
+and count should be 64.
+
+.br
+
 .br
 The other bits in flags should be set to zero.
 
@@ -4213,8 +4262,8 @@ pigif_duplicate_callback, or pigif_bad_callback.
 .br
 
 .br
-The callback is called with the gpio, edge, and tick, whenever the
-gpio has the identified edge.
+The callback is called with the GPIO, edge, and tick, whenever the
+GPIO has the identified edge.
 
 .IP "\fBint callback_ex(int pi, unsigned user_gpio, unsigned edge, CBFuncEx_t f, void *userdata)\fP"
 .IP "" 4
@@ -4247,8 +4296,8 @@ pigif_duplicate_callback, or pigif_bad_callback.
 .br
 
 .br
-The callback is called with the gpio, edge, tick, and user, whenever
-the gpio has the identified edge.
+The callback is called with the GPIO, edge, tick, and user, whenever
+the GPIO has the identified edge.
 
 .IP "\fBint callback_cancel(unsigned callback_id)\fP"
 .IP "" 4
@@ -4271,7 +4320,7 @@ The function returns 0 if OK, otherwise pigif_callback_not_found.
 
 .IP "\fBint wait_for_edge(int pi, unsigned user_gpio, unsigned edge, double timeout)\fP"
 .IP "" 4
-This function waits for edge on the gpio for up to timeout
+This function waits for edge on the GPIO for up to timeout
 seconds.
 
 .br
@@ -4383,7 +4432,7 @@ A value of 0 or 1.
 .br
 
 .IP "\fBbits\fP" 0
-A value used to select gpios.  If bit n of bits is set then gpio n is
+A value used to select GPIO.  If bit n of bits is set then GPIO n is
 selected.
 
 .br
@@ -4523,7 +4572,7 @@ The number may vary between 0 and range (default 255) where
 .br
 
 .IP "\fBedge\fP" 0
-Used to identify a gpio level transition of interest.  A rising edge is
+Used to identify a GPIO level transition of interest.  A rising edge is
 a level change from 0 to 1.  A falling edge is a level change from 1 to 0.
 
 .br
@@ -4560,9 +4609,9 @@ A function.
 .br
 
 .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
+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
 by its dutycycle.
 
 .br
@@ -4574,12 +4623,12 @@ by its dutycycle.
 .br
 
 .IP "\fBgpio\fP" 0
-A Broadcom numbered gpio, in the range 0-53.
+A Broadcom numbered GPIO, in the range 0-53.
 
 .br
 
 .br
-There  are 54 General Purpose Input Outputs (gpios) named gpio0 through
+There  are 54 General Purpose Input Outputs (GPIO) named gpio0 through
 gpio53.
 
 .br
@@ -4591,9 +4640,9 @@ gpio31.  Bank 2 consists of gpio32 through gpio53.
 .br
 
 .br
-All the gpios which are safe for the user to read and write are in
-bank 1.  Not all gpios in bank 1 are safe though.  Type 1 boards
-have 17  safe gpios.  Type 2 boards have 21.  Type 3 boards have 26.
+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
+have 17  safe GPIO.  Type 2 boards have 21.  Type 3 boards have 26.
 
 .br
 
@@ -4603,7 +4652,7 @@ See \fBget_hardware_revision\fP.
 .br
 
 .br
-The user gpios are marked with an X in the following table.
+The user GPIO are marked with an X in the following table.
 
 .br
 
@@ -4734,7 +4783,7 @@ A flag used to set normal or inverted bit bang serial data level logic.
 .br
 
 .IP "\fBlevel\fP" 0
-The level of a gpio.  Low or High.
+The level of a GPIO.  Low or High.
 
 .br
 
@@ -4763,7 +4812,7 @@ PI_HIGH 1
 .br
 
 .br
-There is one exception.  If a watchdog expires on a gpio the level will be
+There is one exception.  If a watchdog expires on a GPIO the level will be
 reported as PI_TIMEOUT.  See \fBset_watchdog\fP.
 
 .br
@@ -4781,7 +4830,7 @@ PI_TIMEOUT 2
 .br
 
 .IP "\fBmode\fP" 0
-1. The operational mode of a gpio, normally INPUT or OUTPUT.
+1. The operational mode of a GPIO, normally INPUT or OUTPUT.
 
 .br
 
@@ -4921,7 +4970,7 @@ A thread identifier.
 .br
 
 .IP "\fBpud\fP: 0-2" 0
-The setting of the pull up/down resistor for a gpio, which may be off,
+The setting of the pull up/down resistor for a GPIO, which may be off,
 pull-up, or pull-down.
 
 .EX
@@ -5045,7 +5094,7 @@ A pointer to a buffer to receive data.
 .br
 
 .IP "\fBSCL\fP" 0
-The user gpio to use for the clock when bit banging I2C.
+The user GPIO to use for the clock when bit banging I2C.
 
 .br
 
@@ -5066,7 +5115,7 @@ An id of a stored script as returned by \fBstore_script\fP.
 .br
 
 .IP "\fBSDA\fP" 0
-The user gpio to use for data when bit banging I2C.
+The user GPIO to use for data when bit banging I2C.
 
 .br
 
@@ -5163,7 +5212,7 @@ thread.
 .br
 
 .IP "\fBtimeout\fP" 0
-A gpio watchdog timeout in milliseconds.
+A GPIO watchdog timeout in milliseconds.
 
 .EX
 PI_MIN_WDOG_TIMEOUT 0
@@ -5199,7 +5248,7 @@ A whole number >= 0.
 .br
 
 .IP "\fBuser_gpio\fP" 0
-0-31, a Broadcom numbered gpio.
+0-31, a Broadcom numbered GPIO.
 
 .br
 
index e5971f269ec99e29d0af15f77a475f2b755c5d5e..e478ddd675bebb4a1f0563fc4f5ec17636f4d87e 100644 (file)
@@ -25,7 +25,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 For more information, please refer to <http://unlicense.org/>
 */
 
-/* PIGPIOD_IF2_VERSION 3 */
+/* PIGPIOD_IF2_VERSION 5 */
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -874,6 +874,9 @@ int wave_chain(int pi, char *buf, unsigned bufSize)
       (pi, PI_CMD_WVCHA, 0, 0, bufSize, 1, ext, 1);
 }
 
+int wave_tx_at(int pi)
+   {return pigpio_command(pi, PI_CMD_WVTAT, 0, 0, 1);}
+
 int wave_tx_busy(int pi)
    {return pigpio_command(pi, PI_CMD_WVBSY, 0, 0, 1);}
 
index 51846c4cb3d3b412c82753b31b6b0cd1de899840..f4be0f58c8e417820b131067ae675dafe0b20493 100644 (file)
@@ -30,32 +30,32 @@ For more information, please refer to <http://unlicense.org/>
 
 #include "pigpio.h"
 
-#define PIGPIOD_IF2_VERSION 3
+#define PIGPIOD_IF2_VERSION 5
 
 /*TEXT
 
 pigpiod_if2 is a C library for the Raspberry which allows control
-of the gpios via the socket interface to the pigpio daemon. 
+of the GPIO via the socket interface to the pigpio daemon. 
 
 *Features*
 
-o PWM on any of gpios 0-31
+o PWM on any of GPIO 0-31
 
-o servo pulses on any of gpios 0-31
+o servo pulses on any of GPIO 0-31
 
-o callbacks when any of gpios 0-31 change state
+o callbacks when any of GPIO 0-31 change state
 
 o callbacks at timed intervals
 
-o reading/writing all of the gpios in a bank as one operation
+o reading/writing all of the GPIO in a bank as one operation
 
-o individually setting gpio modes, reading and writing
+o individually setting GPIO modes, reading and writing
 
-o notifications when any of gpios 0-31 change state
+o notifications when any of GPIO 0-31 change state
 
 o the construction of output waveforms with microsecond timing
 
-o rudimentary permission control over gpios
+o rudimentary permission control over GPIO
 
 o a simple interface to start and stop new threads
 
@@ -63,9 +63,9 @@ o I2C, SPI, and serial link wrappers
 
 o creating and running scripts on the pigpio daemon
 
-*gpios*
+*GPIO*
 
-ALL gpios are identified by their Broadcom number.
+ALL GPIO are identified by their Broadcom number.
 
 *Notes*
 
@@ -106,68 +106,68 @@ pigpio_stop                Disconnects from a pigpio daemon
 
 BEGINNER
 
-set_mode                   Set a gpio mode
-get_mode                   Get a gpio mode
+set_mode                   Set a GPIO mode
+get_mode                   Get a GPIO mode
 
-set_pull_up_down           Set/clear gpio pull up/down resistor
+set_pull_up_down           Set/clear GPIO pull up/down resistor
 
-gpio_read                  Read a gpio
-gpio_write                 Write a gpio
+gpio_read                  Read a GPIO
+gpio_write                 Write a GPIO
 
-set_PWM_dutycycle          Start/stop PWM pulses on a gpio
-get_PWM_dutycycle          Get the PWM dutycycle in use on a gpio
+set_PWM_dutycycle          Start/stop PWM pulses on a GPIO
+get_PWM_dutycycle          Get the PWM dutycycle in use on a GPIO
 
-set_servo_pulsewidth       Start/stop servo pulses on a gpio
-get_servo_pulsewidth       Get the servo pulsewidth in use on a gpio
+set_servo_pulsewidth       Start/stop servo pulses on a GPIO
+get_servo_pulsewidth       Get the servo pulsewidth in use on a GPIO
 
-callback                   Create gpio level change callback
-callback_ex                Create gpio level change callback
+callback                   Create GPIO level change callback
+callback_ex                Create GPIO level change callback
 callback_cancel            Cancel a callback
-wait_for_edge              Wait for gpio level change
+wait_for_edge              Wait for GPIO level change
 
 INTERMEDIATE
 
-gpio_trigger               Send a trigger pulse to a gpio.
+gpio_trigger               Send a trigger pulse to a GPIO.
 
-set_watchdog               Set a watchdog on a gpio.
+set_watchdog               Set a watchdog on a GPIO.
 
-set_PWM_range              Configure PWM range for a gpio
-get_PWM_range              Get configured PWM range for a gpio
+set_PWM_range              Configure PWM range for a GPIO
+get_PWM_range              Get configured PWM range for a GPIO
 
-set_PWM_frequency          Configure PWM frequency for a gpio
-get_PWM_frequency          Get configured PWM frequency for a gpio
+set_PWM_frequency          Configure PWM frequency for a GPIO
+get_PWM_frequency          Get configured PWM frequency for a GPIO
 
-read_bank_1                Read all gpios in bank 1
-read_bank_2                Read all gpios in bank 2
+read_bank_1                Read all GPIO in bank 1
+read_bank_2                Read all GPIO in bank 2
 
-clear_bank_1               Clear selected gpios in bank 1
-clear_bank_2               Clear selected gpios in bank 2
+clear_bank_1               Clear selected GPIO in bank 1
+clear_bank_2               Clear selected GPIO in bank 2
 
-set_bank_1                 Set selected gpios in bank 1
-set_bank_2                 Set selected gpios in bank 2
+set_bank_1                 Set selected GPIO in bank 1
+set_bank_2                 Set selected GPIO in bank 2
 
 start_thread               Start a new thread
 stop_thread                Stop a previously started thread
 
 ADVANCED
 
-get_PWM_real_range         Get underlying PWM range for a gpio
+get_PWM_real_range         Get underlying PWM range for a GPIO
 
 notify_open                Request a notification handle
-notify_begin               Start notifications for selected gpios
+notify_begin               Start notifications for selected GPIO
 notify_pause               Pause notifications
 notify_close               Close a notification
 
-bb_serial_read_open        Opens a gpio for bit bang serial reads
-bb_serial_read             Reads bit bang serial data from a gpio
-bb_serial_read_close       Closes a gpio for bit bang serial reads
+bb_serial_read_open        Opens a GPIO for bit bang serial reads
+bb_serial_read             Reads bit bang serial data from a GPIO
+bb_serial_read_close       Closes a GPIO for bit bang serial reads
 bb_serial_invert           Invert serial logic (1 invert, 0 normal)
 
-hardware_clock             Start hardware clock on supported gpios
-hardware_PWM               Start hardware PWM on supported gpios
+hardware_clock             Start hardware clock on supported GPIO
+hardware_PWM               Start hardware PWM on supported GPIO
 
-set_glitch_filter         Set a glitch filter on a gpio
-set_noise_filter          Set a noise filter on a gpio
+set_glitch_filter         Set a glitch filter on a GPIO
+set_noise_filter          Set a noise filter on a GPIO
 
 SCRIPTS
 
@@ -194,6 +194,7 @@ wave_send_using_mode       Transmits a waveform in the chosen mode
 
 wave_chain                 Transmits a chain of waveforms
 
+wave_tx_at                 Returns the current transmitting waveform
 wave_tx_busy               Checks to see if the waveform has ended
 wave_tx_stop               Aborts the current waveform
 
@@ -234,8 +235,8 @@ i2c_write_device           Writes the raw I2C device
 
 i2c_zip                    Performs multiple I2C transactions
 
-bb_i2c_open                Opens gpios for bit banging I2C
-bb_i2c_close               Closes gpios for bit banging I2C
+bb_i2c_open                Opens GPIO for bit banging I2C
+bb_i2c_close               Closes GPIO for bit banging I2C
 bb_i2c_zip                 Performs multiple bit banged I2C transactions
 
 SPI
@@ -393,7 +394,7 @@ D*/
 /*F*/
 int set_mode(int pi, unsigned gpio, unsigned mode);
 /*D
-Set the gpio mode.
+Set the GPIO mode.
 
 . .
   pi: 0- (as returned by [*pigpio_start*]).
@@ -409,20 +410,20 @@ D*/
 /*F*/
 int get_mode(int pi, unsigned gpio);
 /*D
-Get the gpio mode.
+Get the GPIO mode.
 
 . .
   pi: 0- (as returned by [*pigpio_start*]).
 gpio: 0-53.
 . .
 
-Returns the gpio mode if OK, otherwise PI_BAD_GPIO.
+Returns the GPIO mode if OK, otherwise PI_BAD_GPIO.
 D*/
 
 /*F*/
 int set_pull_up_down(int pi, unsigned gpio, unsigned pud);
 /*D
-Set or clear the gpio pull-up/down resistor.
+Set or clear the GPIO pull-up/down resistor.
 
 . .
   pi: 0- (as returned by [*pigpio_start*]).
@@ -437,20 +438,20 @@ D*/
 /*F*/
 int gpio_read(int pi, unsigned gpio);
 /*D
-Read the gpio level.
+Read the GPIO level.
 
 . .
   pi: 0- (as returned by [*pigpio_start*]).
 gpio:0-53.
 . .
 
-Returns the gpio level if OK, otherwise PI_BAD_GPIO.
+Returns the GPIO level if OK, otherwise PI_BAD_GPIO.
 D*/
 
 /*F*/
 int gpio_write(int pi, unsigned gpio, unsigned level);
 /*D
-Write the gpio level.
+Write the GPIO level.
 
 . .
    pi: 0- (as returned by [*pigpio_start*]).
@@ -463,13 +464,13 @@ or PI_NOT_PERMITTED.
 
 Notes
 
-If PWM or servo pulses are active on the gpio they are switched off.
+If PWM or servo pulses are active on the GPIO they are switched off.
 D*/
 
 /*F*/
 int set_PWM_dutycycle(int pi, unsigned user_gpio, unsigned dutycycle);
 /*D
-Start (non-zero dutycycle) or stop (0) PWM pulses on the gpio.
+Start (non-zero dutycycle) or stop (0) PWM pulses on the GPIO.
 
 . .
        pi: 0- (as returned by [*pigpio_start*]).
@@ -488,7 +489,7 @@ D*/
 /*F*/
 int get_PWM_dutycycle(int pi, unsigned user_gpio);
 /*D
-Return the PWM dutycycle in use on a gpio.
+Return the PWM dutycycle in use on a GPIO.
 
 . .
        pi: 0- (as returned by [*pigpio_start*]).
@@ -498,19 +499,19 @@ user_gpio: 0-31.
 Returns 0 if OK, otherwise PI_BAD_USER_GPIO or PI_NOT_PWM_GPIO.
 
 For normal PWM the dutycycle will be out of the defined range
-for the gpio (see [*get_PWM_range*]).
+for the GPIO (see [*get_PWM_range*]).
 
-If a hardware clock is active on the gpio the reported dutycycle
+If a hardware clock is active on the GPIO the reported dutycycle
 will be 500000 (500k) out of 1000000 (1M).
 
-If hardware PWM is active on the gpio the reported dutycycle
+If hardware PWM is active on the GPIO the reported dutycycle
 will be out of a 1000000 (1M).
 D*/
 
 /*F*/
 int set_PWM_range(int pi, unsigned user_gpio, unsigned range);
 /*D
-Set the range of PWM values to be used on the gpio.
+Set the range of PWM values to be used on the GPIO.
 
 . .
        pi: 0- (as returned by [*pigpio_start*]).
@@ -523,11 +524,11 @@ or PI_NOT_PERMITTED.
 
 Notes
 
-If PWM is currently active on the gpio its dutycycle will be
+If PWM is currently active on the GPIO its dutycycle will be
 scaled to reflect the new range.
 
 The real range, the number of steps between fully off and fully on
-for each of the 18 available gpio frequencies is
+for each of the 18 available GPIO frequencies is
 
 . .
   25(#1),    50(#2),   100(#3),   125(#4),    200(#5),    250(#6),
@@ -541,37 +542,37 @@ D*/
 /*F*/
 int get_PWM_range(int pi, unsigned user_gpio);
 /*D
-Get the range of PWM values being used on the gpio.
+Get the range of PWM values being used on the GPIO.
 
 . .
        pi: 0- (as returned by [*pigpio_start*]).
 user_gpio: 0-31.
 . .
 
-Returns the dutycycle range used for the gpio if OK,
+Returns the dutycycle range used for the GPIO if OK,
 otherwise PI_BAD_USER_GPIO.
 
-If a hardware clock or hardware PWM is active on the gpio the
+If a hardware clock or hardware PWM is active on the GPIO the
 reported range will be 1000000 (1M).
 D*/
 
 /*F*/
 int get_PWM_real_range(int pi, unsigned user_gpio);
 /*D
-Get the real underlying range of PWM values being used on the gpio.
+Get the real underlying range of PWM values being used on the GPIO.
 
 . .
        pi: 0- (as returned by [*pigpio_start*]).
 user_gpio: 0-31.
 . .
 
-Returns the real range used for the gpio if OK,
+Returns the real range used for the GPIO if OK,
 otherwise PI_BAD_USER_GPIO.
 
-If a hardware clock is active on the gpio the reported
+If a hardware clock is active on the GPIO the reported
 real range will be 1000000 (1M).
 
-If hardware PWM is active on the gpio the reported real range
+If hardware PWM is active on the GPIO the reported real range
 will be approximately 250M divided by the set PWM frequency.
 
 D*/
@@ -579,7 +580,7 @@ D*/
 /*F*/
 int set_PWM_frequency(int pi, unsigned user_gpio, unsigned frequency);
 /*D
-Set the frequency (in Hz) of the PWM to be used on the gpio.
+Set the frequency (in Hz) of the PWM to be used on the GPIO.
 
 . .
        pi: 0- (as returned by [*pigpio_start*]).
@@ -594,10 +595,10 @@ 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.
 
-Each gpio can be independently set to one of 18 different
+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
+If PWM is currently active on the GPIO it will be switched
 off and then back on at the new frequency.
 
 . .
@@ -624,30 +625,30 @@ D*/
 /*F*/
 int get_PWM_frequency(int pi, unsigned user_gpio);
 /*D
-Get the frequency of PWM being used on the gpio.
+Get the frequency of PWM being used on the GPIO.
 
 . .
        pi: 0- (as returned by [*pigpio_start*]).
 user_gpio: 0-31.
 . .
 
-For normal PWM the frequency will be that defined for the gpio by
+For normal PWM the frequency will be that defined for the GPIO by
 [*set_PWM_frequency*].
 
-If a hardware clock is active on the gpio the reported frequency
+If a hardware clock is active on the GPIO the reported frequency
 will be that set by [*hardware_clock*].
 
-If hardware PWM is active on the gpio the reported frequency
+If hardware PWM is active on the GPIO the reported frequency
 will be that set by [*hardware_PWM*].
 
-Returns the frequency (in hertz) used for the gpio if OK,
+Returns the frequency (in hertz) used for the GPIO if OK,
 otherwise PI_BAD_USER_GPIO.
 D*/
 
 /*F*/
 int set_servo_pulsewidth(int pi, unsigned user_gpio, unsigned pulsewidth);
 /*D
-Start (500-2500) or stop (0) servo pulses on the gpio.
+Start (500-2500) or stop (0) servo pulses on the GPIO.
 
 . .
         pi: 0- (as returned by [*pigpio_start*]).
@@ -683,7 +684,7 @@ Then set the PWM range using [*set_PWM_range*] to 1E6/Hz.
 Doing this allows you to use units of microseconds when setting
 the servo pulsewidth.
 
-E.g. If you want to update a servo connected to gpio 25 at 400Hz
+E.g. If you want to update a servo connected to GPIO 25 at 400Hz
 
 . .
 set_PWM_frequency(25, 400);
@@ -697,7 +698,7 @@ D*/
 /*F*/
 int get_servo_pulsewidth(int pi, unsigned user_gpio);
 /*D
-Return the servo pulsewidth in use on a gpio.
+Return the servo pulsewidth in use on a GPIO.
 
 . .
        pi: 0- (as returned by [*pigpio_start*]).
@@ -719,7 +720,7 @@ pi: 0- (as returned by [*pigpio_start*]).
 Returns a handle greater than or equal to zero if OK,
 otherwise PI_NO_HANDLE.
 
-A notification is a method for being notified of gpio state
+A notification is a method for being notified of GPIO state
 changes via a pipe.
 
 Pipes are only accessible from the local machine so this function
@@ -741,12 +742,12 @@ Start notifications on a previously opened handle.
 . .
     pi: 0- (as returned by [*pigpio_start*]).
 handle: 0-31 (as returned by [*notify_open*])
-  bits: a mask indicating the gpios to be notified.
+  bits: a mask indicating the GPIO to be notified.
 . .
 
 Returns 0 if OK, otherwise PI_BAD_HANDLE.
 
-The notification sends state changes for each gpio whose
+The notification sends state changes for each GPIO whose
 corresponding bit in bits is set.
 
 Notes
@@ -794,7 +795,7 @@ D*/
 /*F*/
 int set_watchdog(int pi, unsigned user_gpio, unsigned timeout);
 /*D
-Sets a watchdog for a gpio.
+Sets a watchdog for a GPIO.
 
 . .
        pi: 0- (as returned by [*pigpio_start*]).
@@ -807,24 +808,24 @@ or PI_BAD_WDOG_TIMEOUT.
 
 The watchdog is nominally in milliseconds.
 
-Only one watchdog may be registered per gpio.
+Only one watchdog may be registered per GPIO.
 
 The watchdog may be cancelled by setting timeout to 0.
 
-If no level change has been detected for the gpio for timeout
-milliseconds any notification for the gpio has a report written
+If no level change has been detected for the GPIO for timeout
+milliseconds any notification for the GPIO has a report written
 to the fifo with the flags set to indicate a watchdog timeout.
 
 The [*callback*] and [*callback_ex*] functions interpret the flags
-and will call registered callbacks for the gpio with level TIMEOUT.
+and will call registered callbacks for the GPIO with level TIMEOUT.
 D*/
 
 /*F*/
 int set_glitch_filter(int pi, unsigned user_gpio, unsigned steady);
 /*D
-Sets a glitch filter on a gpio.
+Sets a glitch filter on a GPIO.
 
-Level changes on the gpio are not reported unless the level
+Level changes on the GPIO are not reported unless the level
 has been stable for at least [*steady*] microseconds.  The
 level is then reported.  Level changes of less than
 [*steady*] microseconds are ignored.
@@ -845,11 +846,11 @@ D*/
 int set_noise_filter(
    int pi, unsigned user_gpio, unsigned steady, unsigned active);
 /*D
-Sets a noise filter on a gpio.
+Sets a noise filter on a GPIO.
 
-Level changes on the gpio are ignored until a level which has
+Level changes on the GPIO are ignored until a level which has
 been stable for [*steady*] microseconds is detected.  Level changes
-on the gpio are then reported for [*active*] microseconds after
+on the GPIO are then reported for [*active*] microseconds after
 which the process repeats.
 
 . .
@@ -869,102 +870,102 @@ D*/
 /*F*/
 uint32_t read_bank_1(int pi);
 /*D
-Read the levels of the bank 1 gpios (gpios 0-31).
+Read the levels of the bank 1 GPIO (GPIO 0-31).
 
 . .
 pi: 0- (as returned by [*pigpio_start*]).
 . .
 
 The returned 32 bit integer has a bit set if the corresponding
-gpio is logic 1.  Gpio n has bit value (1<<n).
+GPIO is logic 1.  GPIO n has bit value (1<<n).
 D*/
 
 /*F*/
 uint32_t read_bank_2(int pi);
 /*D
-Read the levels of the bank 2 gpios (gpios 32-53).
+Read the levels of the bank 2 GPIO (GPIO 32-53).
 
 . .
 pi: 0- (as returned by [*pigpio_start*]).
 . .
 
 The returned 32 bit integer has a bit set if the corresponding
-gpio is logic 1.  Gpio n has bit value (1<<(n-32)).
+GPIO is logic 1.  GPIO n has bit value (1<<(n-32)).
 D*/
 
 /*F*/
 int clear_bank_1(int pi, uint32_t bits);
 /*D
-Clears gpios 0-31 if the corresponding bit in bits is set.
+Clears GPIO 0-31 if the corresponding bit in bits is set.
 
 . .
   pi: 0- (as returned by [*pigpio_start*]).
-bits: a bit mask with 1 set if the corresponding gpio is
+bits: a bit mask with 1 set if the corresponding GPIO is
       to be cleared.
 . .
 
 Returns 0 if OK, otherwise PI_SOME_PERMITTED.
 
 A status of PI_SOME_PERMITTED indicates that the user is not
-allowed to write to one or more of the gpios.
+allowed to write to one or more of the GPIO.
 D*/
 
 /*F*/
 int clear_bank_2(int pi, uint32_t bits);
 /*D
-Clears gpios 32-53 if the corresponding bit (0-21) in bits is set.
+Clears GPIO 32-53 if the corresponding bit (0-21) in bits is set.
 
 . .
   pi: 0- (as returned by [*pigpio_start*]).
-bits: a bit mask with 1 set if the corresponding gpio is
+bits: a bit mask with 1 set if the corresponding GPIO is
       to be cleared.
 . .
 
 Returns 0 if OK, otherwise PI_SOME_PERMITTED.
 
 A status of PI_SOME_PERMITTED indicates that the user is not
-allowed to write to one or more of the gpios.
+allowed to write to one or more of the GPIO.
 D*/
 
 /*F*/
 int set_bank_1(int pi, uint32_t bits);
 /*D
-Sets gpios 0-31 if the corresponding bit in bits is set.
+Sets GPIO 0-31 if the corresponding bit in bits is set.
 
 . .
   pi: 0- (as returned by [*pigpio_start*]).
-bits: a bit mask with 1 set if the corresponding gpio is
+bits: a bit mask with 1 set if the corresponding GPIO is
       to be set.
 . .
 
 Returns 0 if OK, otherwise PI_SOME_PERMITTED.
 
 A status of PI_SOME_PERMITTED indicates that the user is not
-allowed to write to one or more of the gpios.
+allowed to write to one or more of the GPIO.
 D*/
 
 /*F*/
 int set_bank_2(int pi, uint32_t bits);
 /*D
-Sets gpios 32-53 if the corresponding bit (0-21) in bits is set.
+Sets GPIO 32-53 if the corresponding bit (0-21) in bits is set.
 
 . .
   pi: 0- (as returned by [*pigpio_start*]).
-bits: a bit mask with 1 set if the corresponding gpio is
+bits: a bit mask with 1 set if the corresponding GPIO is
       to be set.
 . .
 
 Returns 0 if OK, otherwise PI_SOME_PERMITTED.
 
 A status of PI_SOME_PERMITTED indicates that the user is not
-allowed to write to one or more of the gpios.
+allowed to write to one or more of the GPIO.
 D*/
 
 
 /*F*/
 int hardware_clock(int pi, unsigned gpio, unsigned clkfreq);
 /*D
-Starts a hardware clock on a gpio at the specified frequency.
+Starts a hardware clock on a GPIO at the specified frequency.
 Frequencies above 30MHz are unlikely to work.
 
 . .
@@ -976,17 +977,17 @@ frequency: 0 (off) or 4689-250000000 (250M)
 Returns 0 if OK, otherwise PI_NOT_PERMITTED, PI_BAD_GPIO,
 PI_NOT_HCLK_GPIO, PI_BAD_HCLK_FREQ,or PI_BAD_HCLK_PASS.
 
-The same clock is available on multiple gpios.  The latest
-frequency setting will be used by all gpios which share a clock.
+The same clock is available on multiple GPIO.  The latest
+frequency setting will be used by all GPIO which share a clock.
 
-The gpio must be one of the following.
+The GPIO must be one of the following.
 
 . .
 4   clock 0  All models
-5   clock 1  A+/B+/Pi2/Zero and compute module only (reserved for system use)
-6   clock 2  A+/B+/Pi2/Zero and compute module only
-20  clock 0  A+/B+/Pi2/Zero and compute module only
-21  clock 1  All models but Rev.2 B (reserved for system use)
+5   clock 1  All models but A and B (reserved for system use)
+6   clock 2  All models but A and B
+20  clock 0  All models but A and B
+21  clock 1  All models but A and Rev.2 B (reserved for system use)
 
 32  clock 0  Compute module only
 34  clock 0  Compute module only
@@ -997,14 +998,14 @@ The gpio must be one of the following.
 
 Access to clock 1 is protected by a password as its use will likely
 crash the Pi.  The password is given by or'ing 0x5A000000 with the
-gpio number.
+GPIO number.
 D*/
 
 
 /*F*/
 int hardware_PWM(int pi, unsigned gpio, unsigned PWMfreq, uint32_t PWMduty);
 /*D
-Starts hardware PWM on a gpio at the specified frequency and dutycycle.
+Starts hardware PWM on a GPIO at the specified frequency and dutycycle.
 Frequencies above 30MHz are unlikely to work.
 
 NOTE: Any waveform started by [*wave_send_**] or [*wave_chain*]
@@ -1025,17 +1026,17 @@ Returns 0 if OK, otherwise PI_NOT_PERMITTED, PI_BAD_GPIO,
 PI_NOT_HPWM_GPIO, PI_BAD_HPWM_DUTY, PI_BAD_HPWM_FREQ,
 or PI_HPWM_ILLEGAL.
 
-The same PWM channel is available on multiple gpios.  The latest
-frequency and dutycycle setting will be used by all gpios which
+The same PWM channel is available on multiple GPIO.  The latest
+frequency and dutycycle setting will be used by all GPIO which
 share a PWM channel.
 
-The gpio must be one of the following.
+The GPIO must be one of the following.
 
 . .
-12  PWM channel 0  A+/B+/Pi2/Zero and compute module only
-13  PWM channel 1  A+/B+/Pi2/Zero and compute module only
+12  PWM channel 0  All models but A and B
+13  PWM channel 1  All models but A and B
 18  PWM channel 0  All models
-19  PWM channel 1  A+/B+/Pi2/Zero and compute module only
+19  PWM channel 1  All models but A and B
 
 40  PWM channel 0  Compute module only
 41  PWM channel 1  Compute module only
@@ -1087,7 +1088,7 @@ of /proc/cpuinfo.
 If the hardware revision can not be found or is not a valid
 hexadecimal number the function returns 0.
 
-The revision number can be used to determine the assignment of gpios
+The revision number can be used to determine the assignment of GPIO
 to pins (see [*gpio*]).
 
 There are at least three types of board.
@@ -1155,7 +1156,7 @@ The pulses are interleaved in time order within the existing waveform
 (if any).
 
 Merging allows the waveform to be built in parts, that is the settings
-for gpio#1 can be added, and then gpio#2 etc.
+for GPIO#1 can be added, and then GPIO#2 etc.
 
 If the added waveform is intended to start after or within the existing
 waveform then the first pulse should consist solely of a delay.
@@ -1247,8 +1248,8 @@ typedef struct
 
 The fields specify
 
-1) the gpios to be switched on at the start of the pulse. 
-2) the gpios to be switched off at the start of the pulse. 
+1) the GPIO to be switched on at the start of the pulse. 
+2) the GPIO to be switched off at the start of the pulse. 
 3) the delay in microseconds before the next pulse. 
 
 Any or all the fields can be zero.  It doesn't make any sense to
@@ -1442,6 +1443,22 @@ int main(int argc, char *argv[])
 D*/
 
 
+/*F*/
+int wave_tx_at(int pi);
+/*D
+This function returns the id of the waveform currently being
+transmitted.
+
+. .
+pi: 0- (as returned by [*pigpio_start*]).
+. .
+
+Returns the waveform id or one of the following special values:
+
+PI_WAVE_NOT_FOUND (9998) - transmitted wave not found. 
+PI_NO_TX_WAVE (9999) - no wave being transmitted.
+D*/
+
 /*F*/
 int wave_tx_busy(int pi);
 /*D
@@ -1569,7 +1586,7 @@ D*/
 /*F*/
 int gpio_trigger(int pi, unsigned user_gpio, unsigned pulseLen, unsigned level);
 /*D
-This function sends a trigger pulse to a gpio.  The gpio is set to
+This function sends a trigger pulse to a GPIO.  The GPIO is set to
 level for pulseLen microseconds and then reset to not level.
 
 . .
@@ -1673,7 +1690,7 @@ D*/
 /*F*/
 int bb_serial_read_open(int pi, unsigned user_gpio, unsigned baud, unsigned data_bits);
 /*D
-This function opens a gpio for bit bang reading of serial data.
+This function opens a GPIO for bit bang reading of serial data.
 
 . .
        pi: 0- (as returned by [*pigpio_start*]).
@@ -1719,7 +1736,7 @@ D*/
 /*F*/
 int bb_serial_read_close(int pi, unsigned user_gpio);
 /*D
-This function closes a gpio for bit bang reading of serial data.
+This function closes a GPIO for bit bang reading of serial data.
 
 . .
        pi: 0- (as returned by [*pigpio_start*]).
@@ -2197,7 +2214,7 @@ D*/
 /*F*/
 int bb_i2c_open(int pi, unsigned SDA, unsigned SCL, unsigned baud);
 /*D
-This function selects a pair of gpios for bit banging I2C at a
+This function selects a pair of GPIO for bit banging I2C at a
 specified baud rate.
 
 Bit banging I2C allows for certain operations which are not possible
@@ -2206,7 +2223,7 @@ with the standard I2C driver.
 o baud rates as low as 50 
 o repeated starts 
 o clock stretching 
-o I2C on any pair of spare gpios
+o I2C on any pair of spare GPIO
 
 . .
   pi: 0- (as returned by [*pigpio_start*]).
@@ -2220,19 +2237,19 @@ PI_GPIO_IN_USE.
 
 NOTE:
 
-The gpios used for SDA and SCL must have pull-ups to 3V3 connected.  As
+The GPIO used for SDA and SCL must have pull-ups to 3V3 connected.  As
 a guide the hardware pull-ups on pins 3 and 5 are 1k8 in value.
 D*/
 
 /*F*/
 int bb_i2c_close(int pi, unsigned SDA);
 /*D
-This function stops bit banging I2C on a pair of gpios previously
+This function stops bit banging I2C on a pair of GPIO previously
 opened with [*bb_i2c_open*].
 
 . .
  pi: 0- (as returned by [*pigpio_start*]).
-SDA: 0-31, the SDA gpio used in a prior call to [*bb_i2c_open*]
+SDA: 0-31, the SDA GPIO used in a prior call to [*bb_i2c_open*]
 . .
 
 Returns 0 if OK, otherwise PI_BAD_USER_GPIO, or PI_NOT_I2C_GPIO.
@@ -2319,13 +2336,14 @@ Data will be transferred at baud bits per second.  The flags may
 be used to modify the default behaviour of 4-wire operation, mode 0,
 active low chip select.
 
-An auxiliary SPI device is available on the A+/B+/Pi2/Zero and may be
-selected by setting the A bit in the flags.  The auxiliary
-device has 3 chip selects and a selectable word size in bits.
+An auxiliary SPI device is available on all models but the
+A and B and may be selected by setting the A bit in the
+flags.  The auxiliary device has 3 chip selects and a
+selectable word size in bits.
 
 . .
          pi: 0- (as returned by [*pigpio_start*]).
-spi_channel: 0-1 (0-2 for A+/B+/Pi2/Zero auxiliary device).
+spi_channel: 0-1 (0-2 for the auxiliary device).
        baud: 32K-125M (values above 30M are unlikely to work).
   spi_flags: see below.
 . .
@@ -2354,10 +2372,9 @@ Mode POL PHA
 
 px is 0 if CEx is active low (default) and 1 for active high.
 
-ux is 0 if the CEx gpio is reserved for SPI (default) and 1 otherwise.
+ux is 0 if the CEx GPIO is reserved for SPI (default) and 1 otherwise.
 
-A is 0 for the standard SPI device, 1 for the auxiliary SPI.  The
-auxiliary device is only present on the A+/B+/Pi2/Zero.
+A is 0 for the standard SPI device, 1 for the auxiliary SPI.
 
 W is 0 if the device is not 3-wire, 1 if the device is 3-wire.  Standard
 SPI device only.
@@ -2377,6 +2394,17 @@ device only.
 bbbbbb defines the word size in bits (0-32).  The default (0)
 sets 8 bits per word.  Auxiliary SPI device only.
 
+The [*spi_read*], [*spi_write*], and [*spi_xfer*] functions
+transfer data packed into 1, 2, or 4 bytes according to
+the word size in bits.
+
+For bits 1-8 there will be one byte per character. 
+For bits 9-16 there will be two bytes per character. 
+For bits 17-32 there will be four bytes per character.
+
+E.g. to transfer 32 12-bit words buf should contain 64 bytes
+and count should be 64.
+
 The other bits in flags should be set to zero.
 D*/
 
@@ -2619,8 +2647,8 @@ user_gpio: 0-31.
 The function returns a callback id if OK, otherwise pigif_bad_malloc,
 pigif_duplicate_callback, or pigif_bad_callback.
 
-The callback is called with the gpio, edge, and tick, whenever the
-gpio has the identified edge.
+The callback is called with the GPIO, edge, and tick, whenever the
+GPIO has the identified edge.
 D*/
 
 /*F*/
@@ -2640,8 +2668,8 @@ user_gpio: 0-31.
 The function returns a callback id if OK, otherwise pigif_bad_malloc,
 pigif_duplicate_callback, or pigif_bad_callback.
 
-The callback is called with the gpio, edge, tick, and user, whenever
-the gpio has the identified edge.
+The callback is called with the GPIO, edge, tick, and user, whenever
+the GPIO has the identified edge.
 D*/
 
 /*F*/
@@ -2659,7 +2687,7 @@ D*/
 /*F*/
 int wait_for_edge(int pi, unsigned user_gpio, unsigned edge, double timeout);
 /*D
-This function waits for edge on the gpio for up to timeout
+This function waits for edge on the GPIO for up to timeout
 seconds.
 
 . .
@@ -2716,7 +2744,7 @@ bit::
 A value of 0 or 1.
 
 bits::
-A value used to select gpios.  If bit n of bits is set then gpio n is
+A value used to select GPIO.  If bit n of bits is set then GPIO n is
 selected.
 
 A convenient way to set bit n is to or in (1<<n).
@@ -2777,7 +2805,7 @@ The number may vary between 0 and range (default 255) where
 0 is off and range is fully on.
 
 edge::
-Used to identify a gpio level transition of interest.  A rising edge is
+Used to identify a GPIO level transition of interest.  A rising edge is
 a level change from 0 to 1.  A falling edge is a level change from 1 to 0.
 
 . .
@@ -2794,28 +2822,28 @@ f::
 A function.
 
 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
+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
 by its dutycycle.
 
 
 gpio::
-A Broadcom numbered gpio, in the range 0-53.
+A Broadcom numbered GPIO, in the range 0-53.
 
-There  are 54 General Purpose Input Outputs (gpios) named gpio0 through
+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.
 
-All the gpios which are safe for the user to read and write are in
-bank 1.  Not all gpios in bank 1 are safe though.  Type 1 boards
-have 17  safe gpios.  Type 2 boards have 21.  Type 3 boards have 26.
+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
+have 17  safe GPIO.  Type 2 boards have 21.  Type 3 boards have 26.
 
 See [*get_hardware_revision*].
 
-The user gpios are marked with an X in the following table.
+The user GPIO are marked with an X in the following table.
 
 . .
           0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
@@ -2873,7 +2901,7 @@ invert::
 A flag used to set normal or inverted bit bang serial data level logic.
 
 level::
-The level of a gpio.  Low or High.
+The level of a GPIO.  Low or High.
 
 . .
 PI_OFF 0
@@ -2886,7 +2914,7 @@ PI_LOW 0
 PI_HIGH 1
 . .
 
-There is one exception.  If a watchdog expires on a gpio the level will be
+There is one exception.  If a watchdog expires on a GPIO the level will be
 reported as PI_TIMEOUT.  See [*set_watchdog*].
 
 . .
@@ -2894,7 +2922,7 @@ PI_TIMEOUT 2
 . .
 
 mode::
-1. The operational mode of a gpio, normally INPUT or OUTPUT.
+1. The operational mode of a GPIO, normally INPUT or OUTPUT.
 
 . .
 PI_INPUT 0
@@ -2958,7 +2986,7 @@ pthread_t::
 A thread identifier.
 
 pud::0-2
-The setting of the pull up/down resistor for a gpio, which may be off,
+The setting of the pull up/down resistor for a GPIO, which may be off,
 pull-up, or pull-down.
 . .
 PI_PUD_OFF 0
@@ -3012,7 +3040,7 @@ The maximum number of bytes a user customised function should return.
 A pointer to a buffer to receive data.
 
 SCL::
-The user gpio to use for the clock when bit banging I2C.
+The user GPIO to use for the clock when bit banging I2C.
 
 *script::
 A pointer to the text of a script.
@@ -3021,7 +3049,7 @@ script_id::
 An id of a stored script as returned by [*store_script*].
 
 SDA::
-The user gpio to use for data when bit banging I2C.
+The user GPIO to use for data when bit banging I2C.
 
 seconds::
 The number of seconds.
@@ -3064,7 +3092,7 @@ A function of type gpioThreadFunc_t used as the main function of a
 thread.
 
 timeout::
-A gpio watchdog timeout in milliseconds.
+A GPIO watchdog timeout in milliseconds.
 . .
 PI_MIN_WDOG_TIMEOUT 0
 PI_MAX_WDOG_TIMEOUT 60000
@@ -3080,7 +3108,7 @@ unsigned::
 A whole number >= 0.
 
 user_gpio::
-0-31, a Broadcom numbered gpio.
+0-31, a Broadcom numbered GPIO.
 
 See [*gpio*].
 
diff --git a/pigs.1 b/pigs.1
index 2340e1c77a90252eb05f8e3acc562a9d7abee637..b42fd40bdffc6633bf15801df40b4c1706ef30d0 100644 (file)
--- a/pigs.1
+++ b/pigs.1
@@ -24,7 +24,7 @@ or
 
 
 .br
-The socket and pipe interfaces allow control of the gpios by passing
+The socket and pipe interfaces allow control of the GPIO by passing
 messages to the running pigpio library.
 
 .br
@@ -45,19 +45,19 @@ whereas /dev/pigpio uses the pipe interface.
 .br
 .SS Features
 .br
-o PWM on any of gpios 0-31
+o PWM on any of GPIO 0-31
 
 .br
-o servo pulses on any of gpios 0-31
+o servo pulses on any of GPIO 0-31
 
 .br
-o reading/writing all of the gpios in a bank as one operation
+o reading/writing all of the GPIO in a bank as one operation
 
 .br
-o individually setting gpio modes, reading and writing
+o individually setting GPIO modes, reading and writing
 
 .br
-o notifications when any of gpios 0-31 change state
+o notifications when any of GPIO 0-31 change state
 
 .br
 o the construction of output waveforms with microsecond timing
@@ -69,9 +69,9 @@ o I2C, SPI, and serial link wrappers
 o creating and running scripts on the pigpio daemon
 
 .br
-.SS gpios
+.SS GPIO
 .br
-ALL gpios are identified by their Broadcom number.
+ALL GPIO are identified by their Broadcom number.
 
 .br
 .SS Usage
@@ -191,10 +191,10 @@ E.g. 23 is 23 decimal, 0x100 is 256 decimal, 070 is 56 decimal.
 
 .br
 
-.IP "\fBBC1 bits\fP - Clear specified gpios in bank 1"
+.IP "\fBBC1 bits\fP - Clear specified GPIO in bank 1"
 .IP "" 4
-This command clears (sets low) the gpios specified by \fBbits\fP in bank 1.
-Bank 1 consists of gpios 0-31.
+This command clears (sets low) the GPIO specified by \fBbits\fP in bank 1.
+Bank 1 consists of GPIO 0-31.
 
 .br
 Upon success nothing is returned.  On error a negative status code
@@ -206,25 +206,25 @@ will be returned.
 .br
 
 .EX
-$ pigs bc1 0x400010 # clear gpios 4 (1<<4) and 22 (1<<22)
+$ pigs bc1 0x400010 # clear GPIO 4 (1<<4) and 22 (1<<22)
 .br
 
 .br
-$ pigs bc1 32 # clear gpio 5 (1<<5)
+$ pigs bc1 32 # clear GPIO 5 (1<<5)
 .br
 -42
 .br
-ERROR: no permission to update one or more gpios
+ERROR: no permission to update one or more GPIO
 .br
 
 .EE
 
 .br
 
-.IP "\fBBC2 bits\fP - Clear specified gpios in bank 2"
+.IP "\fBBC2 bits\fP - Clear specified GPIO in bank 2"
 .IP "" 4
-This command clears (sets low) the gpios specified by \fBbits\fP in bank 2.
-Bank 2 consists of gpios 32-53.
+This command clears (sets low) the GPIO specified by \fBbits\fP in bank 2.
+Bank 2 consists of GPIO 32-53.
 
 .br
 Upon success nothing is returned.  On error a negative status code
@@ -236,15 +236,15 @@ will be returned.
 .br
 
 .EX
-$ pigs bc2 0x8000 # clear gpio 47 (activity LED on A+/B+/Pi2)
+$ pigs bc2 0x8000 # clear GPIO 47 (activity LED on A+/B+/Pi2/Pi3)
 .br
 
 .br
-$ pigs bc2 1 # clear gpio 32 (first in bank 2)
+$ pigs bc2 1 # clear GPIO 32 (first in bank 2)
 .br
 -42
 .br
-ERROR: no permission to update one or more gpios
+ERROR: no permission to update one or more GPIO
 .br
 
 .EE
@@ -271,7 +271,7 @@ $ pigs bi2cc 5
 
 .IP "\fBBI2CO sda scl b\fP - Open bit bang I2C"
 .IP "" 4
-This command signals that gpios \fBsda\fP and \fBscl\fP are to be used
+This command signals that GPIO \fBsda\fP and \fBscl\fP are to be used
 for bit banging I2C at \fBb\fP baud.
 
 .br
@@ -285,13 +285,13 @@ o repeated starts
 .br
 o clock stretching
 .br
-o I2C on any pair of spare gpios
+o I2C on any pair of spare GPIO
 
 .br
 The baud rate may be between 50 and 500000 bits per second.
 
 .br
-The gpios used for SDA and SCL must have pull-ups to 3V3 connected.  As
+The GPIO used for SDA and SCL must have pull-ups to 3V3 connected.  As
 a guide the hardware pull-ups on pins 3 and 5 are 1k8 in value.
 
 .br
@@ -380,9 +380,9 @@ End
 
 .br
 
-.IP "\fBBR1 \fP - Read bank 1 gpios"
+.IP "\fBBR1 \fP - Read bank 1 GPIO"
 .IP "" 4
-This command read gpios 0-31 (bank 1) and returns the levels as a
+This command read GPIO 0-31 (bank 1) and returns the levels as a
 32-bit hexadecimal value.
 
 .br
@@ -400,9 +400,9 @@ $ pigs br1
 
 .br
 
-.IP "\fBBR2 \fP - Read bank 2 gpios"
+.IP "\fBBR2 \fP - Read bank 2 GPIO"
 .IP "" 4
-This command read gpios 32-53 (bank 2) and returns the levels as a
+This command read GPIO 32-53 (bank 2) and returns the levels as a
 32-bit hexadecimal value.
 
 .br
@@ -420,10 +420,10 @@ $ pigs br2
 
 .br
 
-.IP "\fBBS1 bits\fP - Set specified gpios in bank 1"
+.IP "\fBBS1 bits\fP - Set specified GPIO in bank 1"
 .IP "" 4
-This command sets (sets high) the gpios specified by \fBbits\fP in bank 1.
-Bank 1 consists of gpios 0-31.
+This command sets (sets high) the GPIO specified by \fBbits\fP in bank 1.
+Bank 1 consists of GPIO 0-31.
 
 .br
 Upon success nothing is returned.  On error a negative status code
@@ -435,25 +435,25 @@ will be returned.
 .br
 
 .EX
-$ pigs bs1 16 # set gpio 4 (1<<4)
+$ pigs bs1 16 # set GPIO 4 (1<<4)
 .br
 
 .br
-$ pigs bs1 1 # set gpio 1 (1<<0)
+$ pigs bs1 1 # set GPIO 1 (1<<0)
 .br
 -42
 .br
-ERROR: no permission to update one or more gpios
+ERROR: no permission to update one or more GPIO
 .br
 
 .EE
 
 .br
 
-.IP "\fBBS2 bits\fP - Set specified gpios in bank 2"
+.IP "\fBBS2 bits\fP - Set specified GPIO in bank 2"
 .IP "" 4
-This command sets (sets high) the gpios specified by \fBbits\fP in bank 2.
-Bank 2 consists of gpios 32-53.
+This command sets (sets high) the GPIO specified by \fBbits\fP in bank 2.
+Bank 2 consists of GPIO 32-53.
 
 .br
 Upon success nothing is returned.  On error a negative status code
@@ -465,15 +465,15 @@ will be returned.
 .br
 
 .EX
-$ pigs bs2 0x40 # set gpio 38 (enable high current mode A+/B+/Pi2)
+$ pigs bs2 0x40 # set GPIO 38 (enable high current mode A+/B+/Pi2/Pi3)
 .br
 
 .br
-$ pigs bs2 1 # set gpio 32 (first in bank 2)
+$ pigs bs2 1 # set GPIO 32 (first in bank 2)
 .br
 -42
 .br
-ERROR: no permission to update one or more gpios
+ERROR: no permission to update one or more GPIO
 .br
 
 .EE
@@ -514,11 +514,11 @@ configuration settings to \fBv\fP.
 
 .br
 
-.IP "\fBFG u stdy\fP - Set a glitch filter on a gpio"
+.IP "\fBFG u stdy\fP - Set a glitch filter on a GPIO"
 .IP "" 4
 
 .br
-Level changes on the gpio are not reported unless the level
+Level changes on the GPIO are not reported unless the level
 has been stable for at least \fBstdy\fP microseconds.  The
 level is then reported.  Level changes of less than \fBstdy\fP
 microseconds are ignored.
@@ -529,13 +529,13 @@ after it was first detected.
 
 .br
 
-.IP "\fBFN u stdy actv\fP - Set a noise filter on a gpio"
+.IP "\fBFN u stdy actv\fP - Set a noise filter on a GPIO"
 .IP "" 4
 
 .br
-Level changes on the gpio are ignored until a level which has
+Level changes on the GPIO are ignored until a level which has
 been stable for \fBstdy\fP microseconds is detected.  Level
-changes on the gpio are then reported for \fBactv\fP microseconds
+changes on the GPIO are then reported for \fBactv\fP microseconds
 after which the process repeats.
 
 .br
@@ -545,11 +545,11 @@ such reports.
 
 .br
 
-.IP "\fBGDC u\fP - Get gpio PWM dutycycle"
+.IP "\fBGDC u\fP - Get GPIO PWM dutycycle"
 .IP "" 4
 
 .br
-This command returns the PWM dutycycle in use on gpio \fBu\fP.
+This command returns the PWM dutycycle in use on GPIO \fBu\fP.
 
 .br
 Upon success the dutycycle is returned.  On error a negative
@@ -557,14 +557,14 @@ status code will be returned.
 
 .br
 For normal PWM the dutycycle will be out of the defined range
-for the gpio (see \fBPRG\fP).
+for the GPIO (see \fBPRG\fP).
 
 .br
-If a hardware clock is active on the gpio the reported
+If a hardware clock is active on the GPIO the reported
 dutycycle will be 500000 (500k) out of 1000000 (1M).
 
 .br
-If hardware PWM is active on the gpio the reported dutycycle
+If hardware PWM is active on the GPIO the reported dutycycle
 will be out of a 1000000 (1M).
 
 .br
@@ -585,18 +585,18 @@ pigs gdc 5
 .br
 -92
 .br
-ERROR: gpio is not in use for PWM
+ERROR: GPIO is not in use for PWM
 .br
 
 .EE
 
 .br
 
-.IP "\fBGPW u\fP - Get gpio servo pulsewidth"
+.IP "\fBGPW u\fP - Get GPIO servo pulsewidth"
 .IP "" 4
 
 .br
-This command returns the servo pulsewidth in use on gpio \fBu\fP.
+This command returns the servo pulsewidth in use on GPIO \fBu\fP.
 
 .br
 Upon success the servo pulsewidth is returned.  On error a negative
@@ -620,7 +620,7 @@ $ pigs gpw 9
 .br
 -93
 .br
-ERROR: gpio is not in use for servo pulses
+ERROR: GPIO is not in use for servo pulses
 .br
 
 .EE
@@ -650,7 +650,7 @@ $ pigs help
 
 .IP "\fBHC g cf\fP - Set hardware clock frequency"
 .IP "" 4
-This command sets the hardware clock associated with gpio \fBg\fP to
+This command sets the hardware clock associated with GPIO \fBg\fP to
 frequency \fBcf\fP. Frequencies above 30MHz are unlikely to work.
 
 .br
@@ -663,11 +663,11 @@ will be returned.
 .br
 
 .EX
-$ pigs hc 4 5000 # start a 5 KHz clock on gpio 4 (clock 0)
+$ pigs hc 4 5000 # start a 5 KHz clock on GPIO 4 (clock 0)
 .br
 
 .br
-$ pigs hc 5 5000000 # start a 5 MHz clcok on gpio 5 (clock 1)
+$ pigs hc 5 5000000 # start a 5 MHz clcok on GPIO 5 (clock 1)
 .br
 -99
 .br
@@ -677,20 +677,20 @@ ERROR: need password to use hardware clock 1
 .EE
 
 .br
-The same clock is available on multiple gpios.  The latest
-frequency setting will be used by all gpios which share a clock.
+The same clock is available on multiple GPIO.  The latest
+frequency setting will be used by all GPIO which share a clock.
 
 .br
-The gpio must be one of the following.
+The GPIO must be one of the following.
 
 .br
 
 .EX
 4   clock 0  All models
-5   clock 1  A+/B+/Pi2/Zero and compute module only (reserved for system use)
-6   clock 2  A+/B+/Pi2/Zero and compute module only
-20  clock 0  A+/B+/Pi2/Zero and compute module only
-21  clock 1  All models but Type 2 (reserved for system use)
+5   clock 1  All models but A and B (reserved for system use)
+6   clock 2  All models but A and B
+20  clock 0  All models but A and B
+21  clock 1  All models but A and B (Rev. 2) (reserved for system use)
 
 .EE
 
@@ -708,13 +708,13 @@ The gpio must be one of the following.
 .br
 Access to clock 1 is protected by a password as its use will
 likely crash the Pi.  The password is given by or'ing 0x5A000000
-with the gpio number.
+with the GPIO number.
 
 .br
 
 .IP "\fBHP g pf pdc\fP - Set hardware PWM frequency and dutycycle"
 .IP "" 4
-This command sets the hardware PWM associated with gpio \fBg\fP to
+This command sets the hardware PWM associated with GPIO \fBg\fP to
 frequency \fBpf\fP with dutycycle \fBpdc\fP. Frequencies above 30MHz
 are unlikely to work.
 
@@ -752,20 +752,20 @@ ERROR: hardware PWM frequency not 1-125M
 .EE
 
 .br
-The same PWM channel is available on multiple gpios.  The latest
-frequency and dutycycle setting will be used by all gpios which
+The same PWM channel is available on multiple GPIO.  The latest
+frequency and dutycycle setting will be used by all GPIO which
 share a PWM channel.
 
 .br
-The gpio must be one of the following.
+The GPIO must be one of the following.
 
 .br
 
 .EX
-12  PWM channel 0  A+/B+/Pi2/Zero and compute module only
-13  PWM channel 1  A+/B+/Pi2/Zero and compute module only
+12  PWM channel 0  All models but A and B
+13  PWM channel 1  All models but A and B
 18  PWM channel 0  All models
-19  PWM channel 1  A+/B+/Pi2/Zero and compute module only
+19  PWM channel 1  All models but A and B
 
 .EE
 
@@ -808,7 +808,7 @@ If the hardware revision can not be found or is not a valid hexadecimal
 number the command returns 0.
 
 .br
-The revision number can be used to determine the assignment of gpios
+The revision number can be used to determine the assignment of GPIO
 to pins (see \fBg\fP).
 
 .br
@@ -1392,11 +1392,11 @@ End
 
 .br
 
-.IP "\fBM/MODES g m\fP - Set gpio mode"
+.IP "\fBM/MODES g m\fP - Set GPIO mode"
 .IP "" 4
 
 .br
-This command sets gpio \fBg\fP to mode \fBm\fP, typically input (read)
+This command sets GPIO \fBg\fP to mode \fBm\fP, typically input (read)
 or output (write).
 
 .br
@@ -1404,7 +1404,7 @@ Upon success nothing is returned.  On error a negative status code
 will be returned.
 
 .br
-Each gpio can be configured to be in one of 8 different modes. The modes
+Each GPIO can be configured to be in one of 8 different modes. The modes
 are named Input, Output, ALT0, ALT1, ALT2, ALT3, ALT4, and ALT5.
 
 .br
@@ -1437,14 +1437,14 @@ $ pigs m 4 5 # ALT 5
 
 .br
 
-.IP "\fBMG/MODEG g\fP - Get gpio mode"
+.IP "\fBMG/MODEG g\fP - Get GPIO mode"
 .IP "" 4
 
 .br
-This command returns the current mode of gpio \fBg\fP.
+This command returns the current mode of GPIO \fBg\fP.
 
 .br
-Upon success the value of the gpio mode is returned.
+Upon success the value of the GPIO mode is returned.
 On error a negative status code will be returned.
 
 .br
@@ -1547,7 +1547,7 @@ Upon success nothing is returned.  On error a negative status code
 will be returned.
 
 .br
-The notification gets state changes for each gpio specified by \fBbits\fP.
+The notification gets state changes for each GPIO specified by \fBbits\fP.
 
 .br
 
@@ -1555,9 +1555,9 @@ The notification gets state changes for each gpio specified by \fBbits\fP.
 .br
 
 .EX
-$ pigs nb 0 -1 # Shorthand for gpios 0-31.
+$ pigs nb 0 -1 # Shorthand for GPIO 0-31.
 .br
-$ pigs nb 0 0xf0 # Get notifications for gpios 4-7.
+$ pigs nb 0 0xf0 # Get notifications for GPIO 4-7.
 .br
 
 .br
@@ -1611,7 +1611,7 @@ ERROR: unknown handle
 This command requests a free notification handle.
 
 .br
-A notification is a method for being notified of gpio state changes via a pipe.
+A notification is a method for being notified of GPIO state changes via a pipe.
 
 .br
 Upon success the command returns a handle greater than or equal to zero.
@@ -1668,11 +1668,11 @@ $ pigs np 0
 
 .br
 
-.IP "\fBP/PWM u v\fP - Set gpio PWM value"
+.IP "\fBP/PWM u v\fP - Set GPIO PWM value"
 .IP "" 4
 
 .br
-This command starts PWM on gpio \fBu\fP with dutycycle \fBv\fP.  The dutycycle
+This command starts PWM on GPIO \fBu\fP with dutycycle \fBv\fP.  The dutycycle
 varies from 0 (off) to range (fully on).  The range defaults to 255.
 
 .br
@@ -1692,7 +1692,7 @@ The \fBPRS\fP command may be used to change the default range of 255.
 .br
 
 .EX
-$ pigs p 4 64  # Start PWM on gpio 4 with 25% dutycycle
+$ pigs p 4 64  # Start PWM on GPIO 4 with 25% dutycycle
 .br
 $ pigs p 4 128 # 50%
 .br
@@ -1746,26 +1746,26 @@ Can't resolve tag 99
 
 .br
 
-.IP "\fBPFG u\fP - Get gpio PWM frequency"
+.IP "\fBPFG u\fP - Get GPIO PWM frequency"
 .IP "" 4
 
 .br
-This command returns the PWM frequency in Hz used for gpio \fBu\fP.
+This command returns the PWM frequency in Hz used for GPIO \fBu\fP.
 
 .br
 Upon success the PWM frequency is returned.  On error a negative
 status code will be returned.
 
 .br
-For normal PWM the frequency will be that defined for the gpio
+For normal PWM the frequency will be that defined for the GPIO
 by \fBPFS\fP.
 
 .br
-If a hardware clock is active on the gpio the reported frequency
+If a hardware clock is active on the GPIO the reported frequency
 will be that set by \fBHC\fP.
 
 .br
-If hardware PWM is active on the gpio the reported frequency
+If hardware PWM is active on the GPIO the reported frequency
 will be that set by \fBHP\fP.
 
 .br
@@ -1782,7 +1782,7 @@ $ pigs pfg 4
 .br
 $ pigs pfg 34
 .br
-ERROR: gpio not 0-31
+ERROR: GPIO not 0-31
 .br
 -2
 .br
@@ -1791,9 +1791,9 @@ ERROR: gpio not 0-31
 
 .br
 
-.IP "\fBPFS u v\fP - Set gpio PWM frequency"
+.IP "\fBPFS u v\fP - Set GPIO PWM frequency"
 .IP "" 4
-This command sets the PWM frequency \fBv\fP to be used for gpio \fBu\fP.
+This command sets the PWM frequency \fBv\fP to be used for GPIO \fBu\fP.
 
 .br
 The numerically closest frequency to \fBv\fP will be selected.
@@ -1808,10 +1808,10 @@ pigpiod daemon was started.  The sample rate is one of 1, 2, 4, 5, 8,
 or 10 microseconds (default 5).
 
 .br
-Each gpio can be independently set to one of 18 different PWM frequencies.
+Each GPIO can be independently set to one of 18 different PWM frequencies.
 
 .br
-If PWM is currently active on the gpio it will be switched off and then
+If PWM is currently active on the GPIO it will be switched off and then
 back on at the new frequency.
 
 .br
@@ -1886,18 +1886,18 @@ $ pigs pigpv
 
 .br
 
-.IP "\fBPRG u\fP - Get gpio PWM range"
+.IP "\fBPRG u\fP - Get GPIO PWM range"
 .IP "" 4
 
 .br
-This command returns the dutycycle range for gpio \fBu\fP.
+This command returns the dutycycle range for GPIO \fBu\fP.
 
 .br
 Upon success the range is returned.  On error a negative status code
 will be returned.
 
 .br
-If a hardware clock or hardware PWM is active on the gpio the reported
+If a hardware clock or hardware PWM is active on the GPIO the reported
 range will be 1000000 (1M).
 
 .br
@@ -2122,18 +2122,18 @@ ERROR: unknown script id
 
 .br
 
-.IP "\fBPRRG u\fP - Get gpio PWM real range"
+.IP "\fBPRRG u\fP - Get GPIO PWM real range"
 .IP "" 4
 
 .br
-This command returns the real underlying range used by gpio \fBu\fP.
+This command returns the real underlying range used by GPIO \fBu\fP.
 
 .br
-If a hardware clock is active on the gpio the reported
+If a hardware clock is active on the GPIO the reported
 real range will be 1000000 (1M).
 
 .br
-If hardware PWM is active on the gpio the reported real range
+If hardware PWM is active on the GPIO the reported real range
 will be approximately 250M divided by the set PWM frequency.
 
 .br
@@ -2177,20 +2177,20 @@ $ pigs prrg 17
 
 .br
 
-.IP "\fBPRS u v\fP - Set gpio PWM range"
+.IP "\fBPRS u v\fP - Set GPIO PWM range"
 .IP "" 4
 
 .br
-This command sets the dutycycle range \fBv\fP to be used for gpio \fBu\fP.
+This command sets the dutycycle range \fBv\fP to be used for GPIO \fBu\fP.
 Subsequent uses of command \fBP/PWM\fP will use a dutycycle between 0 (off)
 and \fBv\fP (fully on).
 
 .br
-Upon success the real underlying range used by the gpio is returned.
+Upon success the real underlying range used by the GPIO is returned.
 On error a negative status code will be returned.
 
 .br
-If PWM is currently active on the gpio its dutycycle will be scaled to
+If PWM is currently active on the GPIO its dutycycle will be scaled to
 reflect the new range.
 
 .br
@@ -2229,11 +2229,11 @@ $ pigs prs 18 1000
 
 .br
 
-.IP "\fBPUD g p\fP - Set gpio pull up/down"
+.IP "\fBPUD g p\fP - Set GPIO pull up/down"
 .IP "" 4
 
 .br
-This command sets the internal pull/up down for gpio \fBg\fP to mode \fBp\fP.
+This command sets the internal pull/up down for GPIO \fBg\fP to mode \fBp\fP.
 
 .br
 Upon success nothing is returned.  On error a negative status code
@@ -2248,22 +2248,22 @@ The mode may be pull-down (D), pull-up (U), or off (O).
 .br
 
 .EX
-$ pigs pud 4 d # Set pull-down on gpio 4.
+$ pigs pud 4 d # Set pull-down on GPIO 4.
 .br
-$ pigs pud 4 u # Set pull-up on gpio 4.
+$ pigs pud 4 u # Set pull-up on GPIO 4.
 .br
-$ pigs pud 4 o # No pull-up/down on gpio 4.
+$ pigs pud 4 o # No pull-up/down on GPIO 4.
 .br
 
 .EE
 
 .br
 
-.IP "\fBR/READ g\fP - Read gpio level"
+.IP "\fBR/READ g\fP - Read GPIO level"
 .IP "" 4
 
 .br
-This reads the current level of gpio \fBg\fP.
+This reads the current level of GPIO \fBg\fP.
 
 .br
 Upon success the current level is returned.  On error a negative status code
@@ -2275,13 +2275,13 @@ will be returned.
 .br
 
 .EX
-$ pigs r 17 # Get level of gpio 17.
+$ pigs r 17 # Get level of GPIO 17.
 .br
 0
 .br
 
 .br
-$ pigs r 4 # Get level of gpio 4.
+$ pigs r 4 # Get level of GPIO 4.
 .br
 1
 .br
@@ -2290,11 +2290,11 @@ $ pigs r 4 # Get level of gpio 4.
 
 .br
 
-.IP "\fBS/SERVO u v\fP - Set gpio servo pulsewidth"
+.IP "\fBS/SERVO u v\fP - Set GPIO servo pulsewidth"
 .IP "" 4
 
 .br
-This command starts servo pulses of \fBv\fP microseconds on gpio \fBu\fP.
+This command starts servo pulses of \fBv\fP microseconds on GPIO \fBu\fP.
 
 .br
 Upon success nothing is returned.  On error a negative status code
@@ -2326,10 +2326,10 @@ $ pigs SERVO 17 1500
 
 .br
 This example causes an on pulse of 1500 microseconds duration to be
-transmitted on gpio 17 at a rate of 50 times per second.
+transmitted on GPIO 17 at a rate of 50 times per second.
 
 .br
-This will command a servo connected to gpio 17 to rotate to its mid-point.
+This will command a servo connected to GPIO 17 to rotate to its mid-point.
 
 .br
 
@@ -2557,19 +2557,19 @@ $ pigs serwb 0 0xf0
 
 .br
 
-.IP "\fBSLR u num\fP - Read bit bang serial data from gpio"
+.IP "\fBSLR u num\fP - Read bit bang serial data from GPIO"
 .IP "" 4
 
 .br
 This command returns up to \fBnum\fP bytes of bit bang serial data
-read from gpio \fBu\fP.
+read from GPIO \fBu\fP.
 
 .br
 Upon success the count of returned bytes followed by the bytes themselves
 is returned.  On error a negative status code will be returned.
 
 .br
-The gpio \fBu\fP should have been initialised with the \fBSLRO\fP command.
+The GPIO \fBu\fP should have been initialised with the \fBSLRO\fP command.
 
 .br
 The bytes returned for each character depend upon the number of
@@ -2597,11 +2597,11 @@ $ pigs slr 15 20
 
 .br
 
-.IP "\fBSLRC u\fP - Close gpio for bit bang serial data"
+.IP "\fBSLRC u\fP - Close GPIO for bit bang serial data"
 .IP "" 4
 
 .br
-This command closes gpio \fBu\fP for reading bit bang serial data.
+This command closes GPIO \fBu\fP for reading bit bang serial data.
 
 .br
 Upon success nothing is returned.  On error a negative status code
@@ -2621,7 +2621,7 @@ $ pigs slrc 23
 .br
 -38
 .br
-ERROR: no serial read in progress on gpio
+ERROR: no serial read in progress on GPIO
 .br
 
 .EE
@@ -2633,7 +2633,7 @@ ERROR: no serial read in progress on gpio
 
 .br
 This command sets the logic level for reading bit bang serial data
-on gpio \fBu\fP.
+on GPIO \fBu\fP.
 
 .br
 Upon success nothing is returned.  On error a negative status code
@@ -2648,22 +2648,22 @@ The invert parameter \fBv\fP is 1 for inverted signal, 0 for normal.
 .br
 
 .EX
-$ pigs slri 17 1 # invert logic on gpio 17
+$ pigs slri 17 1 # invert logic on GPIO 17
 .br
 
 .br
-$ pigs slri 23 0 # use normal logic on gpio 23
+$ pigs slri 23 0 # use normal logic on GPIO 23
 .br
 
 .EE
 
 .br
 
-.IP "\fBSLRO u b db\fP - Open gpio for bit bang serial data"
+.IP "\fBSLRO u b db\fP - Open GPIO for bit bang serial data"
 .IP "" 4
 
 .br
-This command opens gpio \fBu\fP for reading bit bang serial data
+This command opens GPIO \fBu\fP for reading bit bang serial data
 at \fBb\fP baud and \fBdb\fP data bits.
 
 .br
@@ -2694,7 +2694,7 @@ $ pigs slro 23 19200 8
 .br
 -50
 .br
-ERROR: gpio already in use
+ERROR: GPIO already in use
 .br
 
 .EE
@@ -2749,9 +2749,10 @@ Speeds between 32kbps and 125Mbps are allowed.  Speeds above 30Mbps
 are unlikely to work.
 
 .br
-An auxiliary SPI device is available on the A+/B+/Pi2/Zero and may be
-selected by setting the A bit in the flags.  The auxiliary
-device has 3 chip selects and a selectable word size in bits.
+An auxiliary SPI device is available on all models but the
+A and B and may be selected by setting the A bit in the
+flags.  The auxiliary device has 3 chip selects and a
+selectable word size in bits.
 
 .br
 The flags consists of the least significant 22 bits.
@@ -2792,11 +2793,10 @@ Mode POL PHA
 px is 0 if CEx is active low (default) and 1 for active high.
 
 .br
-ux is 0 if the CEx gpio is reserved for SPI (default) and 1 otherwise.
+ux is 0 if the CEx GPIO is reserved for SPI (default) and 1 otherwise.
 
 .br
-A is 0 for the standard SPI device, 1 for the auxiliary SPI.  The
-auxiliary device is only present on the A+/B+/Pi2/Zero.
+A is 0 for the standard SPI device, 1 for the auxiliary SPI.
 
 .br
 W is 0 if the device is not 3-wire, 1 if the device is 3-wire.  Standard
@@ -2821,6 +2821,20 @@ device only.
 bbbbbb defines the word size in bits (0-32).  The default (0)
 sets 8 bits per word.  Auxiliary SPI device only.
 
+.br
+The \fBSPIR\fP, \fBSPIW\fP, and \fBSPIX\fP commands transfer data
+packed into 1, 2, or 4 bytes according to the word size in bits.
+
+.br
+For bits 1-8 there will be one byte per character.
+.br
+For bits 9-16 there will be two bytes per character.
+.br
+For bits 17-32 there will be four bytes per character.
+
+.br
+E.g. 32 12-bit words will be transferred in 64 bytes.
+
 .br
 The other bits in flags should be set to zero.
 
@@ -2961,14 +2975,14 @@ $ pigs t mils 1000 t
 
 .br
 This command sends a trigger pulse of \fBpl\fP microseconds at level \fBL\fP
-to gpio \fBu\fP.
+to GPIO \fBu\fP.
 
 .br
 Upon success nothing is returned.  On error a negative status code
 will be returned.
 
 .br
-The gpio is set to not level at the end of the pulse.
+The GPIO is set to not level at the end of the pulse.
 
 .br
 
@@ -2991,11 +3005,11 @@ ERROR: trigger pulse > 50 microseconds
 
 .br
 
-.IP "\fBW/WRITE g L\fP - Write gpio level"
+.IP "\fBW/WRITE g L\fP - Write GPIO level"
 .IP "" 4
 
 .br
-This command sets gpio \fBg\fP to level \fBL\fP.  The level may be 0
+This command sets GPIO \fBg\fP to level \fBL\fP.  The level may be 0
 (low, off, clear) or 1 (high, on, set).
 
 .br
@@ -3025,11 +3039,11 @@ ERROR: level not 0-1
 
 .br
 
-.IP "\fBWDOG u v\fP - Set gpio watchdog"
+.IP "\fBWDOG u v\fP - Set GPIO watchdog"
 .IP "" 4
 
 .br
-This command sets a watchdog of \fBv\fP milliseconds on gpio \fBu\fP.
+This command sets a watchdog of \fBv\fP milliseconds on GPIO \fBu\fP.
 
 .br
 Upon success nothing is returned.  On error a negative status code
@@ -3039,16 +3053,16 @@ will be returned.
 The watchdog is nominally in milliseconds.
 
 .br
-One watchdog may be registered per gpio.
+One watchdog may be registered per GPIO.
 
 .br
 The watchdog may be cancelled by setting timeout to 0.
 
 .br
-If no level change has been detected for the gpio for timeout milliseconds:-
+If no level change has been detected for the GPIO for timeout milliseconds:-
 
 .br
-any notification for the gpio has a report written to the fifo with
+any notification for the GPIO has a report written to the fifo with
 the flags set to indicate a watchdog timeout.
 
 .br
@@ -3072,7 +3086,7 @@ $ pigs wdog 23 9000
 
 .br
 This example causes a report to be written to any notification pipes
-listening on gpio 23 whenever gpio 23 changes state or approximately
+listening on GPIO 23 whenever GPIO 23 changes state or approximately
 every 9000 ms.
 
 .br
@@ -3081,7 +3095,7 @@ every 9000 ms.
 .IP "" 4
 
 .br
-This command adds 1 one or more triplets \fBtrips\fP of gpios on, gpios off,
+This command adds 1 one or more triplets \fBtrips\fP of GPIO on, GPIO off,
 delay to the existing waveform (if any).
 
 .br
@@ -3119,7 +3133,7 @@ $ pigs wvag 0 0 10000 0x10 0x80 1000 0x80 0x10 9000
 
 .br
 This command adds a waveform representing serial data \fBbvs\fP to
-gpio \fBu\fP at \fBb\fP baud to the existing waveform (if any).
+GPIO \fBu\fP at \fBb\fP baud to the existing waveform (if any).
 The serial data starts \fBo\fP microseconds from the start of the
 waveform.
 
@@ -3169,6 +3183,37 @@ $ pigs wvas 7 38400 8 2 0 0x41 0x42
 
 .br
 
+.IP "\fBWVTAT \fP - Returns the current transmitting waveform"
+.IP "" 4
+
+.br
+This command returns the id of the waveform currently
+being transmitted.
+
+.br
+Returns the waveform id or one of the following special
+values:
+
+.br
+9998 - transmitted wave not found
+.br
+9999 - no wave being transmitted
+
+.br
+
+\fBExample\fP
+.br
+
+.EX
+$ pigs wvtat
+.br
+9999
+.br
+
+.EE
+
+.br
+
 .IP "\fBWVBSY \fP - Check if waveform is being transmitted"
 .IP "" 4
 
@@ -3421,9 +3466,9 @@ A waveform comprises of one or more pulses.
 A pulse specifies
 
 .br
-1) the gpios to be switched on at the start of the pulse.
+1) the GPIO to be switched on at the start of the pulse.
 .br
-2) the gpios to be switched off at the start of the pulse.
+2) the GPIO to be switched off at the start of the pulse.
 .br
 3) the delay in microseconds before the next pulse.
 
@@ -3806,12 +3851,12 @@ The command expects 0 or 1.
 .br
 
 .IP "\fBbits\fP - a bit mask" 0
-A mask is used to select one or more gpios.  A gpio is selected
-if bit (1<<gpio) is set in the mask.
+A mask is used to select one or more GPIO.  A GPIO is selected
+if bit (1<<GPIO) is set in the mask.
 
 .br
-E.g. a mask of 6 (binary 110) select gpios 1 and 2, a mask of
-0x103 (binary 100000011) selects gpios 0, 1, and 8.
+E.g. a mask of 6 (binary 110) select GPIO 1 and 2, a mask of
+0x103 (binary 100000011) selects GPIO 0, 1, and 8.
 
 .br
 
@@ -3857,26 +3902,26 @@ The command expects the name of a tty serial device, e.g.
 
 .br
 
-.IP "\fBg\fP - gpio (0-53)" 0
-The command expects a gpio.
+.IP "\fBg\fP - GPIO (0-53)" 0
+The command expects a GPIO.
 
 .br
-There are 54 General Purpose Input Outputs (gpios) named gpio0 through gpio53.
+There are 54 General Purpose Input Outputs (GPIO) named gpio0 through gpio53.
 
 .br
 They are split into two banks.  Bank 1 consists of gpio0 through gpio31.
 Bank 2 consists of gpio32 through gpio53.
 
 .br
-All the gpios which are safe for the user to read and write are in bank 1.
-Not all gpios in bank 1 are safe though. Type 1 boards have 17 safe gpios.
+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 have 17 safe GPIO.
 Type 2 boards have 21. Type 3 boards have 26.
 
 .br
 See \fBHWVER\fP.
 
 .br
-The user gpios are marked with an X in the following table.
+The user GPIO are marked with an X in the following table.
 
 .br
 
@@ -3894,7 +3939,7 @@ Type 3    X  X  X  X  X  X  X  X  X  X  X  X  -  -  -  -
 .EE
 
 .br
-You are not prevented from writing to unsafe gpios.  The consequences
+You are not prevented from writing to unsafe GPIO.  The consequences
 of doing so range from no effect, to a crash, or corrupted data.
 
 .br
@@ -3924,7 +3969,7 @@ The command expects an I2C flags value.  No flags are currently defined.
 .br
 
 .IP "\fBL\fP - level (0-1)" 0
-The command expects a gpio level.
+The command expects a GPIO level.
 
 .br
 
@@ -3932,7 +3977,7 @@ The command expects a gpio level.
 The command expects a mode character.
 
 .br
-Each gpio can be configured to be in one of 8 different modes. The modes
+Each GPIO can be configured to be in one of 8 different modes. The modes
 are named Input, Output, ALT0, ALT1, ALT2, ALT3, ALT4, and ALT5.
 
 .br
@@ -3974,7 +4019,7 @@ Serial data is stored offset microseconds from the start of the waveform.
 The command expects a PUD character.
 
 .br
-Each gpio can be configured to use or not use an internal pull up or
+Each GPIO can be configured to use or not use an internal pull up or
 pull down resistor.  This is useful to provide a default state for inputs.
 
 .br
@@ -4029,14 +4074,14 @@ The command expects the number of stop (half) bits per serial character.
 
 .br
 
-.IP "\fBscl\fP - user gpio (0-31)" 0
-The command expects the number of the gpio to be used for SCL
+.IP "\fBscl\fP - user GPIO (0-31)" 0
+The command expects the number of the GPIO to be used for SCL
 when bit banging I2C.
 
 .br
 
-.IP "\fBsda\fP - user gpio (0-31)" 0
-The command expects the number of the gpio to be used for SDA
+.IP "\fBsda\fP - user GPIO (0-31)" 0
+The command expects the number of the GPIO to be used for SDA
 when bit banging I2C.
 
 .br
@@ -4071,7 +4116,7 @@ The command expects a text string.
 .br
 
 .IP "\fBtrips\fP - triplets" 0
-The command expects 1 or more triplets of gpios on, gpios off, delay.
+The command expects 1 or more triplets of GPIO on, GPIO off, delay.
 
 .br
 E.g. 0x400000 0 100000 0 0x400000 900000 defines two pulses as follows
@@ -4079,25 +4124,25 @@ E.g. 0x400000 0 100000 0 0x400000 900000 defines two pulses as follows
 .br
 
 .EX
-     gpios on          gpios off          delay
-0x400000 (gpio 22)           0 (None) 100000 (1/10th s)
-          0 (None) 0x400000 (gpio 22) 900000 (9/10th s)
+     GPIO on           GPIO off           delay
+0x400000 (GPIO 22)           0 (None) 100000 (1/10th s)
+          0 (None) 0x400000 (GPIO 22) 900000 (9/10th s)
 
 .EE
 
 .br
 
-.IP "\fBu\fP - user gpio (0-31)" 0
-The command expects the number of a user gpio.
+.IP "\fBu\fP - user GPIO (0-31)" 0
+The command expects the number of a user GPIO.
 
 .br
-A number of commands are restricted to gpios in bank 1,
+A number of commands are restricted to GPIO in bank 1,
 in particular the PWM commands, the servo command,
 the watchdog command, and the notification command.
 
 .br
 It is your responsibility to ensure that the PWM and servo commands
-are only used on safe gpios.
+are only used on safe GPIO.
 
 .br
 See \fBg\fP
@@ -4165,7 +4210,7 @@ the pigpio daemon server/client model.
 .br
 .SS Example
 .br
-A trivial example might be useful.  Suppose you want to toggle a gpio
+A trivial example might be useful.  Suppose you want to toggle a GPIO
 on and off as fast as possible.
 
 .br
@@ -4293,9 +4338,9 @@ proc introduces a script.  Everything after proc is part of the script.
 .br
 tag 999 names the current position in the script.
 .br
-w 22 1 writes 1 to gpio 22.
+w 22 1 writes 1 to GPIO 22.
 .br
-w 22 0 writes 0 to gpio 22.
+w 22 0 writes 0 to GPIO 22.
 .br
 dcr p0 decrements parameter 0.
 .br
@@ -4389,7 +4434,7 @@ STA y   Store accumulator in register                 y=A
 SUB x   Subtract x from accumulator                   A-=x; F=A
 SYS str Run external script (/opt/pigpio/cgi/str)     system(str); F=A
 TAG L   Label the current script position             N/A
-WAIT x  Wait for a gpio in x to change state          A=wait(x); F=A
+WAIT x  Wait for a GPIO in x to change state          A=wait(x); F=A
 X y1 y2 Exchange contents of registers y1 and y2      t=*y1;*y1=*y2;*y2=t
 XA y    Exchange contents of accumulator and register t=A;A=*y;*y=t
 XOR x   Xor x with accumulator                        A^=x; F=A
@@ -4404,11 +4449,11 @@ y may be a parameter (p0-p9), or a variable (v0-v149).  If p or v isn't
 specified y is assumed to be a variable.
 
 .br
-The WAIT command parameter is a bit-mask with 1 set for gpios of interest.
+The WAIT command parameter is a bit-mask with 1 set for GPIO of interest.
 
 .br
 The SYS script receives two unsigned parameters: the accumulator A and
-the current gpio levels.
+the current GPIO levels.
 
 .br
 
index 7bb9ccc60ea87864ad1affe0ef8128a3dec80f67..e7ae279bdaa089247ce8e12e5052526f23f4e1d5 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@
 from distutils.core import setup
 
 setup(name='pigpio',
-      version='1.27',
+      version='1.29',
       author='joan',
       author_email='joan@abyz.co.uk',
       maintainer='joan',
diff --git a/x_pigs b/x_pigs
index accaabb4c7d18f7586f80dfbb2c6080658afb44c..adaa1eb70c7dee460f4adcc9a03ee5431cd6d3a3 100755 (executable)
--- a/x_pigs
+++ b/x_pigs
@@ -49,7 +49,7 @@ s=$(pigs bs2 0)
 if [[ $s = "" ]]; then echo "BS2 ok"; else echo "BS2 fail ($s)"; fi
 
 s=$(pigs h)
-if [[ ${#s} = 4544 ]]; then echo "HELP ok"; else echo "HELP fail (${#s})"; fi
+if [[ ${#s} = 4593 ]]; then echo "HELP ok"; else echo "HELP fail (${#s})"; fi
 
 s=$(pigs hwver)
 if [[ $s -ne 0 ]]; then echo "HWVER ok"; else echo "HWVER fail ($s)"; fi
diff --git a/x_pipe b/x_pipe
index 4b66a5feffe337584e3494f92ea3b7918921508d..4b39afc8af6e69a5d5bc72f9eadf76b5b7141c26 100755 (executable)
--- a/x_pipe
+++ b/x_pipe
@@ -57,7 +57,7 @@ if [[ $s = 0 ]]; then echo "BS2 ok"; else echo "BS2 fail ($s)"; fi
 echo "h" >/dev/pigpio
 read -t 1 s </dev/pigout
 read -t 1 s </dev/pigout
-if [[ $s = "BC1 bits         Clear gpios in bank 1" ]]
+if [[ $s = "BC1 bits         Clear GPIO in bank 1" ]]
 then echo "HELP-a ok"
 else echo "HELP-a fail ($s)"
 fi
@@ -65,7 +65,7 @@ read -t 1 -N 9000 </dev/pigout # dump rest of help
 echo "help" >/dev/pigpio
 read -t 1 s </dev/pigout
 read -t 1 s </dev/pigout
-if [[ $s = "BC1 bits         Clear gpios in bank 1" ]]
+if [[ $s = "BC1 bits         Clear GPIO in bank 1" ]]
 then echo "HELP-b ok"
 else echo "HELP-b fail ($s)"
 fi