mirror of https://github.com/joan2937/pigpio
parent
d5f32d3301
commit
a41d63493b
11
pigpio.3
11
pigpio.3
|
@ -6936,8 +6936,11 @@ and 611 control blocks on a lite channel.
|
||||||
|
|
||||||
.IP "\fBint gpioCfgPermissions(uint64_t updateMask)\fP"
|
.IP "\fBint gpioCfgPermissions(uint64_t updateMask)\fP"
|
||||||
.IP "" 4
|
.IP "" 4
|
||||||
Configures pigpio to only allow updates (writes or mode changes) for the
|
Configures pigpio to restrict GPIO updates via the socket or pipe
|
||||||
GPIO specified by the mask.
|
interfaces to the GPIO specified by the mask. Programs directly
|
||||||
|
calling the pigpio library (i.e. linked with -lpigpio are not
|
||||||
|
affected). A GPIO update is a write to a GPIO or a GPIO mode
|
||||||
|
change or any function which would force such an action.
|
||||||
|
|
||||||
.br
|
.br
|
||||||
|
|
||||||
|
@ -6963,7 +6966,7 @@ added to the mask.
|
||||||
.br
|
.br
|
||||||
|
|
||||||
.br
|
.br
|
||||||
If the board revision is not recognised then GPIO 0-31 are allowed.
|
If the board revision is not recognised then GPIO 2-27 are allowed.
|
||||||
|
|
||||||
.br
|
.br
|
||||||
|
|
||||||
|
@ -10259,7 +10262,7 @@ A 16-bit word value.
|
||||||
.br
|
.br
|
||||||
#define PI_DEFAULT_SOCKET_ADDR_STR "127.0.0.1"
|
#define PI_DEFAULT_SOCKET_ADDR_STR "127.0.0.1"
|
||||||
.br
|
.br
|
||||||
#define PI_DEFAULT_UPDATE_MASK_UNKNOWN 0xFFFFFFFF
|
#define PI_DEFAULT_UPDATE_MASK_UNKNOWN 0x0000000FFFFFFCLL
|
||||||
.br
|
.br
|
||||||
#define PI_DEFAULT_UPDATE_MASK_B1 0x03E7CF93
|
#define PI_DEFAULT_UPDATE_MASK_B1 0x03E7CF93
|
||||||
.br
|
.br
|
||||||
|
|
6
pigpio.c
6
pigpio.c
|
@ -205,7 +205,7 @@ bit 0 READ_LAST_NOT_SET_ERROR
|
||||||
#define DO_DBG(level, format, arg...) \
|
#define DO_DBG(level, format, arg...) \
|
||||||
{ \
|
{ \
|
||||||
if ((gpioCfg.dbgLevel >= level) && \
|
if ((gpioCfg.dbgLevel >= level) && \
|
||||||
(!(gpioCfg.internals & PI_CFG_SIGHANDLER))) \
|
(!(gpioCfg.internals & PI_CFG_NOSIGHANDLER))) \
|
||||||
fprintf(stderr, "%s %s: " format "\n" , \
|
fprintf(stderr, "%s %s: " format "\n" , \
|
||||||
myTimeStamp(), __FUNCTION__ , ## arg); \
|
myTimeStamp(), __FUNCTION__ , ## arg); \
|
||||||
}
|
}
|
||||||
|
@ -8135,7 +8135,7 @@ int initInitialise(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef EMBEDDED_IN_VM
|
#ifndef EMBEDDED_IN_VM
|
||||||
if (!(gpioCfg.internals & PI_CFG_SIGHANDLER))
|
if (!(gpioCfg.internals & PI_CFG_NOSIGHANDLER))
|
||||||
sigSetHandler();
|
sigSetHandler();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -8534,7 +8534,7 @@ void gpioTerminate(void)
|
||||||
|
|
||||||
#ifndef EMBEDDED_IN_VM
|
#ifndef EMBEDDED_IN_VM
|
||||||
if ((gpioCfg.internals & PI_CFG_STATS) &&
|
if ((gpioCfg.internals & PI_CFG_STATS) &&
|
||||||
(!(gpioCfg.internals & PI_CFG_SIGHANDLER)))
|
(!(gpioCfg.internals & PI_CFG_NOSIGHANDLER)))
|
||||||
{
|
{
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"\n#####################################################\n");
|
"\n#####################################################\n");
|
||||||
|
|
15
pigpio.h
15
pigpio.h
|
@ -31,7 +31,7 @@ For more information, please refer to <http://unlicense.org/>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|
||||||
#define PIGPIO_VERSION 6507
|
#define PIGPIO_VERSION 6509
|
||||||
|
|
||||||
/*TEXT
|
/*TEXT
|
||||||
|
|
||||||
|
@ -865,7 +865,7 @@ typedef void *(gpioThreadFunc_t) (void *);
|
||||||
#define PI_CFG_ALERT_FREQ 4 /* bits 4-7 */
|
#define PI_CFG_ALERT_FREQ 4 /* bits 4-7 */
|
||||||
#define PI_CFG_RT_PRIORITY (1<<8)
|
#define PI_CFG_RT_PRIORITY (1<<8)
|
||||||
#define PI_CFG_STATS (1<<9)
|
#define PI_CFG_STATS (1<<9)
|
||||||
#define PI_CFG_SIGHANDLER (1<<10)
|
#define PI_CFG_NOSIGHANDLER (1<<10)
|
||||||
|
|
||||||
#define PI_CFG_ILLEGAL_VAL (1<<11)
|
#define PI_CFG_ILLEGAL_VAL (1<<11)
|
||||||
|
|
||||||
|
@ -4712,8 +4712,11 @@ D*/
|
||||||
/*F*/
|
/*F*/
|
||||||
int gpioCfgPermissions(uint64_t updateMask);
|
int gpioCfgPermissions(uint64_t updateMask);
|
||||||
/*D
|
/*D
|
||||||
Configures pigpio to only allow updates (writes or mode changes) for the
|
Configures pigpio to restrict GPIO updates via the socket or pipe
|
||||||
GPIO specified by the mask.
|
interfaces to the GPIO specified by the mask. Programs directly
|
||||||
|
calling the pigpio library (i.e. linked with -lpigpio are not
|
||||||
|
affected). A GPIO update is a write to a GPIO or a GPIO mode
|
||||||
|
change or any function which would force such an action.
|
||||||
|
|
||||||
This function is only effective if called before [*gpioInitialise*].
|
This function is only effective if called before [*gpioInitialise*].
|
||||||
|
|
||||||
|
@ -4724,7 +4727,7 @@ updateMask: bit (1<<n) is set for each GPIO n which may be updated
|
||||||
The default setting depends upon the Pi model. The user GPIO are
|
The default setting depends upon the Pi model. The user GPIO are
|
||||||
added to the mask.
|
added to the mask.
|
||||||
|
|
||||||
If the board revision is not recognised then GPIO 0-31 are allowed.
|
If the board revision is not recognised then GPIO 2-27 are allowed.
|
||||||
|
|
||||||
Unknown board @ PI_DEFAULT_UPDATE_MASK_UNKNOWN @ 0xFFFFFFFF
|
Unknown board @ PI_DEFAULT_UPDATE_MASK_UNKNOWN @ 0xFFFFFFFF
|
||||||
Type 1 board @ PI_DEFAULT_UPDATE_MASK_B1 @ 0x03E6CF93
|
Type 1 board @ PI_DEFAULT_UPDATE_MASK_B1 @ 0x03E6CF93
|
||||||
|
@ -6373,7 +6376,7 @@ after this command is issued.
|
||||||
#define PI_DEFAULT_SOCKET_PORT 8888
|
#define PI_DEFAULT_SOCKET_PORT 8888
|
||||||
#define PI_DEFAULT_SOCKET_PORT_STR "8888"
|
#define PI_DEFAULT_SOCKET_PORT_STR "8888"
|
||||||
#define PI_DEFAULT_SOCKET_ADDR_STR "127.0.0.1"
|
#define PI_DEFAULT_SOCKET_ADDR_STR "127.0.0.1"
|
||||||
#define PI_DEFAULT_UPDATE_MASK_UNKNOWN 0xFFFFFFFF
|
#define PI_DEFAULT_UPDATE_MASK_UNKNOWN 0x0000000FFFFFFCLL
|
||||||
#define PI_DEFAULT_UPDATE_MASK_B1 0x03E7CF93
|
#define PI_DEFAULT_UPDATE_MASK_B1 0x03E7CF93
|
||||||
#define PI_DEFAULT_UPDATE_MASK_A_B2 0xFBC7CF9C
|
#define PI_DEFAULT_UPDATE_MASK_A_B2 0xFBC7CF9C
|
||||||
#define PI_DEFAULT_UPDATE_MASK_APLUS_BPLUS 0x0080480FFFFFFCLL
|
#define PI_DEFAULT_UPDATE_MASK_APLUS_BPLUS 0x0080480FFFFFFCLL
|
||||||
|
|
21
pigpio.py
21
pigpio.py
|
@ -3,7 +3,7 @@ pigpio is a Python module for the Raspberry which talks to
|
||||||
the pigpio daemon to allow control of the general purpose
|
the pigpio daemon to allow control of the general purpose
|
||||||
input outputs (GPIO).
|
input outputs (GPIO).
|
||||||
|
|
||||||
[http://abyz.co.uk/rpi/pigpio/python.html]
|
[http://abyz.me.uk/rpi/pigpio/python.html]
|
||||||
|
|
||||||
*Features*
|
*Features*
|
||||||
|
|
||||||
|
@ -299,7 +299,7 @@ import threading
|
||||||
import os
|
import os
|
||||||
import atexit
|
import atexit
|
||||||
|
|
||||||
VERSION = "1.38"
|
VERSION = "1.39"
|
||||||
|
|
||||||
exceptions = True
|
exceptions = True
|
||||||
|
|
||||||
|
@ -1114,17 +1114,19 @@ class _callback_thread(threading.Thread):
|
||||||
|
|
||||||
lastLevel = self.lastLevel
|
lastLevel = self.lastLevel
|
||||||
|
|
||||||
|
RECV_SIZ = 4096
|
||||||
MSG_SIZ = 12
|
MSG_SIZ = 12
|
||||||
|
|
||||||
|
buf = bytes()
|
||||||
while self.go:
|
while self.go:
|
||||||
|
|
||||||
buf = self.sl.s.recv(MSG_SIZ)
|
buf += self.sl.s.recv(RECV_SIZ)
|
||||||
|
offset = 0
|
||||||
|
|
||||||
while self.go and len(buf) < MSG_SIZ:
|
while self.go and (len(buf) - offset) >= MSG_SIZ:
|
||||||
buf += self.sl.s.recv(MSG_SIZ-len(buf))
|
msgbuf = buf[offset:offset + MSG_SIZ]
|
||||||
|
offset += MSG_SIZ
|
||||||
if self.go:
|
seq, flags, tick, level = (struct.unpack('HHII', msgbuf))
|
||||||
seq, flags, tick, level = (struct.unpack('HHII', buf))
|
|
||||||
|
|
||||||
if flags == 0:
|
if flags == 0:
|
||||||
changed = level ^ lastLevel
|
changed = level ^ lastLevel
|
||||||
|
@ -1147,6 +1149,7 @@ class _callback_thread(threading.Thread):
|
||||||
for cb in self.events:
|
for cb in self.events:
|
||||||
if cb.event == event:
|
if cb.event == event:
|
||||||
cb.func(event, tick)
|
cb.func(event, tick)
|
||||||
|
buf = buf[offset:]
|
||||||
|
|
||||||
self.sl.s.close()
|
self.sl.s.close()
|
||||||
|
|
||||||
|
@ -4163,7 +4166,7 @@ class pi():
|
||||||
"""
|
"""
|
||||||
Store a script for later execution.
|
Store a script for later execution.
|
||||||
|
|
||||||
See [[http://abyz.co.uk/rpi/pigpio/pigs.html#Scripts]] for
|
See [[http://abyz.me.uk/rpi/pigpio/pigs.html#Scripts]] for
|
||||||
details.
|
details.
|
||||||
|
|
||||||
script:= the script text as a series of bytes.
|
script:= the script text as a series of bytes.
|
||||||
|
|
|
@ -78,6 +78,11 @@ Disable remote socket interface.
|
||||||
.
|
.
|
||||||
Default enabled
|
Default enabled
|
||||||
.
|
.
|
||||||
|
.IP "\fB-m\fP"
|
||||||
|
Disable alerts (sampling).
|
||||||
|
.
|
||||||
|
Default enabled
|
||||||
|
.
|
||||||
.IP "\fB-n IP address\fP"
|
.IP "\fB-n IP address\fP"
|
||||||
Allow IP address to use the socket interface.
|
Allow IP address to use the socket interface.
|
||||||
Name (e.g. paul) or dotted quad (e.g. 192.168.1.66).
|
Name (e.g. paul) or dotted quad (e.g. 192.168.1.66).
|
||||||
|
|
Loading…
Reference in New Issue