From: joan Date: Mon, 25 Apr 2016 08:58:51 +0000 (+0100) Subject: V51 X-Git-Tag: archive/raspbian/1.68-2+rpi1~83 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=51cd543d97d9adddbc4ac97ce447e498a7817f4c;p=pigpio.git V51 --- diff --git a/pigpio.3 b/pigpio.3 index 7f06865..516125e 100644 --- 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 diff --git a/pigpio.c b/pigpio.c index ed38416..13d7264 100644 --- a/pigpio.c +++ b/pigpio.c @@ -25,7 +25,7 @@ OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to */ -/* 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" - diff --git a/pigpio.h b/pigpio.h index b06be96..cfadacd 100644 --- a/pigpio.h +++ b/pigpio.h @@ -31,7 +31,7 @@ For more information, please refer to #include #include -#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<