V51
authorjoan <joan@abyz.co.uk>
Mon, 25 Apr 2016 08:58:51 +0000 (09:58 +0100)
committerjoan <joan@abyz.co.uk>
Mon, 25 Apr 2016 08:58:51 +0000 (09:58 +0100)
pigpio.3
pigpio.c
pigpio.h

index 7f06865130cb2547d0f87188b9275885dc73b659..516125ec49281a36b2e8953f45bd0d4f38e574a5 100644 (file)
--- a/pigpio.3
+++ b/pigpio.3
@@ -157,14 +157,35 @@ All the functions which return an int return < 0 on error.
 .br
 
 .br
-If the library is not initialised all but the \fBgpioCfg*\fP, \fBgpioVersion\fP,
-and \fBgpioHardwareRevision\fP functions will return PI_NOT_INITIALISED.
+\fBgpioInitialise\fP must be called before all other library functions
+with the following exceptions:
 
 .br
 
 .br
-If the library is initialised the \fBgpioCfg*\fP functions will
-return PI_INITIALISED.
+
+.EX
+\fBgpioCfg*\fP
+.br
+\fBgpioVersion\fP
+.br
+\fBgpioHardwareRevision\fP
+.br
+
+.EE
+
+.br
+
+.br
+If the library is not initialised all but the \fBgpioCfg*\fP,
+\fBgpioVersion\fP, and \fBgpioHardwareRevision\fP functions will
+return error PI_NOT_INITIALISED.
+
+.br
+
+.br
+If the library is initialised the \fBgpioCfg*\fP functions will return
+error PI_INITIALISED.
 
 .br
 
@@ -178,17 +199,27 @@ Initialises the library.
 .br
 
 .br
-Call before using the other library functions.
+Returns the pigpio version number if OK, otherwise PI_INIT_FAILED.
 
 .br
 
 .br
-Returns the pigpio version number if OK, otherwise PI_INIT_FAILED.
+gpioInitialise must be called before using the other library functions
+with the following exceptions:
+
+.br
 
 .br
 
+.EX
+\fBgpioCfg*\fP
+.br
+\fBgpioVersion\fP
+.br
+\fBgpioHardwareRevision\fP
 .br
-The only exception is the optional \fBgpioCfg*\fP functions, see later.
+
+.EE
 
 .br
 
@@ -5109,6 +5140,11 @@ Configures pigpio to buffer cfgMillis milliseconds of GPIO samples.
 
 .br
 
+.br
+This function is only effective if called before \fBgpioInitialise\fP.
+
+.br
+
 .br
 
 .EX
@@ -5172,6 +5208,11 @@ peripheral.
 
 .br
 
+.br
+This function is only effective if called before \fBgpioInitialise\fP.
+
+.br
+
 .br
 
 .EX
@@ -5236,6 +5277,11 @@ Configures pigpio to use the specified DMA channel.
 
 .br
 
+.br
+This function is only effective if called before \fBgpioInitialise\fP.
+
+.br
+
 .br
 
 .EX
@@ -5255,6 +5301,11 @@ Configures pigpio to use the specified DMA channels.
 
 .br
 
+.br
+This function is only effective if called before \fBgpioInitialise\fP.
+
+.br
+
 .br
 
 .EX
@@ -5298,6 +5349,11 @@ GPIO specified by the mask.
 
 .br
 
+.br
+This function is only effective if called before \fBgpioInitialise\fP.
+
+.br
+
 .br
 
 .EX
@@ -5341,6 +5397,11 @@ Configures pigpio to use the specified socket port.
 
 .br
 
+.br
+This function is only effective if called before \fBgpioInitialise\fP.
+
+.br
+
 .br
 
 .EX
@@ -5360,6 +5421,11 @@ Configures pigpio support of the fifo and socket interfaces.
 
 .br
 
+.br
+This function is only effective if called before \fBgpioInitialise\fP.
+
+.br
+
 .br
 
 .EX
@@ -5396,6 +5462,11 @@ Selects the method of DMA memory allocation.
 
 .br
 
+.br
+This function is only effective if called before \fBgpioInitialise\fP.
+
+.br
+
 .br
 
 .EX
@@ -6306,7 +6377,7 @@ typedef void (*gpioAlertFuncEx_t)
 .br
 
 .br
-One of
+These functions are only effective if called before \fBgpioInitialise\fP.
 
 .br
 
@@ -6323,8 +6394,6 @@ One of
 .br
 \fBgpioCfgInterfaces\fP
 .br
-\fBgpioCfgInternals\fP
-.br
 \fBgpioCfgSocketPort\fP
 .br
 \fBgpioCfgMemAlloc\fP
index ed384163ce1de991dbe75ce27171d5a1e8f31bef..13d7264a9cc54ee947d1e87be7fd57b1bba607db 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 50 */
+/* pigpio version 51 */
 
 /* include ------------------------------------------------------- */
 
@@ -7572,6 +7572,8 @@ int initInitialise(void)
       else if (rev <  16) gpioMask = PI_DEFAULT_UPDATE_MASK_A_B2;
       else if (rev == 17) gpioMask = PI_DEFAULT_UPDATE_MASK_COMPUTE;
       else if (rev  < 20) gpioMask = PI_DEFAULT_UPDATE_MASK_APLUS_BPLUS;
+      else if (rev == 20) gpioMask = PI_DEFAULT_UPDATE_MASK_COMPUTE;
+      else if (rev == 21) gpioMask = PI_DEFAULT_UPDATE_MASK_APLUS_BPLUS;
       else
       {
          model = (rev >> 4) & 0xFF;
@@ -11873,4 +11875,3 @@ int gpioCfgInternals(unsigned cfgWhat, unsigned cfgVal)
 
 #include "custom.cext"
 
-
index b06be965fd1c7192c67ce7367074fac61c4a3cb7..cfadacd6be9fa52a75c7e339e55e883ff5dddeeb 100644 (file)
--- a/pigpio.h
+++ b/pigpio.h
@@ -31,7 +31,7 @@ For more information, please refer to <http://unlicense.org/>
 #include <stdint.h>
 #include <pthread.h>
 
-#define PIGPIO_VERSION 50
+#define PIGPIO_VERSION 51
 
 /*TEXT
 
@@ -93,11 +93,21 @@ For examples of usage see the C programs within the pigpio archive file.
 
 All the functions which return an int return < 0 on error.
 
-If the library is not initialised all but the [*gpioCfg**], [*gpioVersion*],
-and [*gpioHardwareRevision*] functions will return PI_NOT_INITIALISED.
+[*gpioInitialise*] must be called before all other library functions
+with the following exceptions:
 
-If the library is initialised the [*gpioCfg**] functions will
-return PI_INITIALISED.
+. .
+[*gpioCfg**]
+[*gpioVersion*]
+[*gpioHardwareRevision*]
+. .
+
+If the library is not initialised all but the [*gpioCfg**],
+[*gpioVersion*], and [*gpioHardwareRevision*] functions will
+return error PI_NOT_INITIALISED.
+
+If the library is initialised the [*gpioCfg**] functions will return
+error PI_INITIALISED.
 
 TEXT*/
 
@@ -294,7 +304,6 @@ gpioCfgSocketPort          Configure socket port
 gpioCfgMemAlloc            Configure DMA memory allocation mode
 
 gpioCfgInternals           Configure miscellaneous internals (DEPRECATED)
-
 gpioCfgGetInternals        Get internal configuration settings
 gpioCfgSetInternals        Set internal configuration settings
 
@@ -770,11 +779,16 @@ int gpioInitialise(void);
 /*D
 Initialises the library.
 
-Call before using the other library functions.
-
 Returns the pigpio version number if OK, otherwise PI_INIT_FAILED.
 
-The only exception is the optional [*gpioCfg**] functions, see later.
+gpioInitialise must be called before using the other library functions
+with the following exceptions:
+
+. .
+[*gpioCfg**]
+[*gpioVersion*]
+[*gpioHardwareRevision*]
+. .
 
 ...
 if (gpioInitialise() < 0)
@@ -3618,6 +3632,8 @@ int gpioCfgBufferSize(unsigned cfgMillis);
 /*D
 Configures pigpio to buffer cfgMillis milliseconds of GPIO samples.
 
+This function is only effective if called before [*gpioInitialise*].
+
 . .
 cfgMillis: 100-10000
 . .
@@ -3653,6 +3669,8 @@ int gpioCfgClock(
 Configures pigpio to use a particular sample rate timed by a specified
 peripheral.
 
+This function is only effective if called before [*gpioInitialise*].
+
 . .
     cfgMicros: 1, 2, 4, 5, 8, 10
 cfgPeripheral: 0 (PWM), 1 (PCM)
@@ -3686,6 +3704,8 @@ int gpioCfgDMAchannel(unsigned DMAchannel); /* DEPRECATED */
 /*D
 Configures pigpio to use the specified DMA channel.
 
+This function is only effective if called before [*gpioInitialise*].
+
 . .
 DMAchannel: 0-14
 . .
@@ -3700,6 +3720,8 @@ int gpioCfgDMAchannels(
 /*D
 Configures pigpio to use the specified DMA channels.
 
+This function is only effective if called before [*gpioInitialise*].
+
 . .
   primaryChannel: 0-14
 secondaryChannel: 0-14
@@ -3727,6 +3749,8 @@ int gpioCfgPermissions(uint64_t updateMask);
 Configures pigpio to only allow updates (writes or mode changes) for the
 GPIO specified by the mask.
 
+This function is only effective if called before [*gpioInitialise*].
+
 . .
 updateMask: bit (1<<n) is set for each GPIO n which may be updated
 . .
@@ -3748,6 +3772,8 @@ int gpioCfgSocketPort(unsigned port);
 /*D
 Configures pigpio to use the specified socket port.
 
+This function is only effective if called before [*gpioInitialise*].
+
 . .
 port: 1024-32000
 . .
@@ -3761,6 +3787,8 @@ int gpioCfgInterfaces(unsigned ifFlags);
 /*D
 Configures pigpio support of the fifo and socket interfaces.
 
+This function is only effective if called before [*gpioInitialise*].
+
 . .
 ifFlags: 0-7
 . .
@@ -3782,6 +3810,8 @@ int gpioCfgMemAlloc(unsigned memAllocMode);
 /*D
 Selects the method of DMA memory allocation.
 
+This function is only effective if called before [*gpioInitialise*].
+
 . .
 memAllocMode: 0-2
 . .
@@ -4280,7 +4310,7 @@ typedef void (*gpioAlertFuncEx_t)
 
 gpioCfg*::
 
-One of
+These functions are only effective if called before [*gpioInitialise*].
 
 [*gpioCfgBufferSize*] 
 [*gpioCfgClock*] 
@@ -4288,7 +4318,6 @@ One of
 [*gpioCfgDMAchannels*] 
 [*gpioCfgPermissions*] 
 [*gpioCfgInterfaces*] 
-[*gpioCfgInternals*] 
 [*gpioCfgSocketPort*] 
 [*gpioCfgMemAlloc*]