Bumped the version to 2.40 - correctly this time, I hope.

Added fixed for a few minor things. pin driver for rht03/dht type
sensors. Network stuff is experimental - for now.
This commit is contained in:
Gordon Henderson
2017-02-27 19:51:32 +00:00
parent e687f3f2c6
commit 70fa99a127
28 changed files with 2069 additions and 87 deletions

View File

@@ -37,7 +37,7 @@ INCLUDE = -I$(DESTDIR)$(PREFIX)/include
CFLAGS = $(DEBUG) -Wall -Wextra $(INCLUDE) -Winline -pipe
LDFLAGS = -L$(DESTDIR)$(PREFIX)/lib
LIBS = -lwiringPi -lwiringPiDev -lpthread -lrt -lm
LIBS = -lwiringPi -lwiringPiDev -lpthread -lrt -lm -lcrypt
# May not need to alter anything below this line
###############################################################################

View File

@@ -9,15 +9,15 @@ gpio \- Command-line access to Raspberry Pi's GPIO
.PP
.B gpio
.B [ \-g | \-1 ]
.B mode/read/write/aread/awrite/wb/pwm/clock ...
.B mode/read/write/aread/awrite/wb/pwm/clock/toggle/blink ...
.PP
.B gpio
.B [ \-x extension:params ]
.B mode/read/write/aread/awrite/pwm/pwmTone ...
.B mode/read/write/aread/awrite/pwm/toggle/blink ...
.PP
.B gpio
.B [ \-p ]
.B read/write/toggle/wb
.B read/write/toggle/blink
.B ...
.PP
.B gpio
@@ -118,11 +118,23 @@ respective logic levels.
Write the given value (0 or 1) to the pin. You need to set the pin
to output mode first.
.TP
.B toggle <pin>
Changes the state of a GPIO pin; 0 to 1, or 1 to 0.
Note unlike the blink command, the pin must be in output mode first.
.TP
.B blink <pin>
Blinks the given pin on/off. Press Control-C to exit.
Note: This command explicitly sets the pin to output mode.
.TP
.B aread <pin>
Read the analog value of the given pin. This needs to be uses in
Read the analog value of the given pin. This needs to be used in
conjunction with a -x flag to add in an extension that handles analog
inputs. respective logic levels.
inputs.
e.g. gpio -x mcp3002:200:0 aread 200
@@ -132,7 +144,7 @@ will read the first analog input on an mcp3002 SPI ADC chip.
.B awrite <pin> <value>
Write the analog value to the given pin. This needs to be used in
conjunction with a -x flag to add in an extension that handles analog
inputs. respective logic levels.
inputs.
e.g. gpio -x mcp4802:200:0 awrite 200 128
@@ -234,7 +246,7 @@ absolutely sure you know what you're doing.
high | low
Change the USB current limiter to high (1.2 amps) or low (the default, 600mA)
This is only applicable to the model B+
This is only applicable to the Model B+ and the Model B, v2.
.TP
.B pwm-bal/pwm-ms
@@ -253,7 +265,6 @@ them. Optionally it will set the I2C baudrate to that supplied in Kb/sec
Note: On recent kernels with the device tree enabled you should use the
raspi-config program to load/unload the I2C device at boot time.
(or disable the device tree to continue to use this method)
.TP
.B load spi
@@ -268,7 +279,6 @@ e.g. 8192 bytes then reboot.
Note: On recent kernels with the device tree enabled you should use the
raspi-config program to load/unload the SPI device at boot time.
(or disable the device tree to continue to use this method)
.TP
.B gbr

View File

@@ -1443,6 +1443,16 @@ int main (int argc, char *argv [])
wpMode = WPI_MODE_PIFACE ;
}
// Check for -z argument so we don't actually initialise wiringPi
else if (strcasecmp (argv [1], "-z") == 0)
{
for (i = 2 ; i < argc ; ++i)
argv [i - 1] = argv [i] ;
--argc ;
wpMode = WPI_MODE_UNINITIALISED ;
}
// Default to wiringPi mode
else
@@ -1460,12 +1470,15 @@ int main (int argc, char *argv [])
{
if (argc < 3)
{
fprintf (stderr, "%s: -x missing extension specification.\n", argv [0]) ;
fprintf (stderr, "%s: -x missing extension command.\n", argv [0]) ;
exit (EXIT_FAILURE) ;
}
if (!loadWPiExtension (argv [0], argv [2], TRUE)) // Prints its own error messages
if (!loadWPiExtension (argv [0], argv [2], TRUE))
{
fprintf (stderr, "%s: Extension load failed: %s\n", argv [0], strerror (errno)) ;
exit (EXIT_FAILURE) ;
}
// Shift args down by 2