This commit is contained in:
joan 2016-04-25 09:58:51 +01:00
parent bbb7affbfe
commit 51cd543d97
3 changed files with 125 additions and 26 deletions

View File

@ -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
@ -177,18 +198,28 @@ Initialises the library.
.br
.br
Call before using the other library functions.
.br
.br
Returns the pigpio version number if OK, otherwise PI_INIT_FAILED.
.br
.br
The only exception is the optional \fBgpioCfg*\fP functions, see later.
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
.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

View File

@ -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"

View File

@ -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*]