Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: WiringPi/WiringPi-Node
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.1.1
Choose a base ref
...
head repository: WiringPi/WiringPi-Node
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 20 commits
  • 9 files changed
  • 5 contributors

Commits on Sep 21, 2016

  1. fixing pinModeAlt mode

    pinModeAlt mode should be in FSEL_INPT, FSEL_OUTP, FSEL_ALT0, FSEL_ALT1, FSEL_ALT2, FSEL_ALT3, FSEL_ALT4, FSEL_ALT5 not in WPI_MODE_PINS, WPI_MODE_PHYS, WPI_MODE_GPIO.
    NoHomey authored Sep 21, 2016
    Copy the full SHA
    24b0908 View commit details
  2. exporting missing WPI_MODE_ constants

    exporting WPI_MODE_GPIO_SYS, WPI_MODE_PIFACE & WPI_MODE_UNINITIALISED
    NoHomey authored Sep 21, 2016
    Copy the full SHA
    6647908 View commit details

Commits on Sep 22, 2016

  1. Merge pull request #48 from NoHomey/patch-2

    Fixing #47 Un-exported WPI_MODE_ constants
    nekuz0r authored Sep 22, 2016
    Copy the full SHA
    e60dc3f View commit details
  2. Merge pull request #46 from NoHomey/patch-1

    Fixing #45 pinModeAlt mode is checked in wrong ints
    nekuz0r authored Sep 22, 2016
    Copy the full SHA
    5bea401 View commit details

Commits on Sep 29, 2016

  1. Loading in sn3218

    NoHomey authored Sep 29, 2016
    Copy the full SHA
    6f4383d View commit details
  2. Merge pull request #49 from NoHomey/patch-3

    Fixes #42 sn3218 extension not available
    nekuz0r authored Sep 29, 2016
    Copy the full SHA
    6931958 View commit details
  3. Copy the full SHA
    4e19523 View commit details
  4. Merge pull request #50 from NoHomey/close-opened-fd

    Fixes #43 How to release a wiringPiI2CSetup() file descriptor
    nekuz0r authored Sep 29, 2016
    Copy the full SHA
    bf14d46 View commit details

Commits on Oct 6, 2016

  1. Copy the full SHA
    9819704 View commit details
  2. Merge pull request #53 from NoHomey/2.2.0

    Closes #52 Release new sem. version
    nekuz0r authored Oct 6, 2016
    Copy the full SHA
    baea7af View commit details
  3. 2.2.0

    nekuz0r committed Oct 6, 2016
    Copy the full SHA
    2f70411 View commit details

Commits on Oct 9, 2016

  1. Copy the full SHA
    467ccae View commit details

Commits on Oct 16, 2016

  1. Fixing typo: red -> reg

    NoHomey authored Oct 16, 2016
    Copy the full SHA
    3332f8a View commit details
  2. Merge pull request #54 from The-Alchemist/patch-1

    Fix hyperlink because of typo
    nekuz0r authored Oct 16, 2016
    Copy the full SHA
    63c92bf View commit details
  3. Merge pull request #56 from NoHomey/patch-4

    #57 [DOCUMENTATION] wiringPiI2CReadReg16 second argument should be reg instead of red
    nekuz0r authored Oct 16, 2016
    Copy the full SHA
    97f7fe1 View commit details

Commits on Nov 11, 2016

  1. Update contributor list

    eugeneware committed Nov 11, 2016
    Copy the full SHA
    a430622 View commit details
  2. Copy the full SHA
    5e44a38 View commit details

Commits on Nov 17, 2016

  1. Merge pull request #1 from WiringPi/master

    Update with source
    taoyuan authored Nov 17, 2016
    Copy the full SHA
    e3ed95f View commit details
  2. Copy the full SHA
    d1feb0f View commit details
  3. Merge pull request #64 from taoyuan/master

    Fixed twitter account for "taoyuan"
    eugeneware authored Nov 17, 2016
    Copy the full SHA
    f98bbcd View commit details
Showing with 92 additions and 14 deletions.
  1. +11 −1 CHANGELOG.md
  2. +13 −3 DOCUMENTATION.md
  3. +7 −2 README.md
  4. +2 −2 install.sh
  5. +2 −2 package.json
  6. +1 −0 src/extensions/extensions.cc
  7. +9 −3 src/wiringPi.cc
  8. +24 −1 src/wiringPiI2C.cc
  9. +23 −0 src/wiringPiSPI.cc
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# CHANGELOG

## v2.1.1 *[not released yet]*
## v2.2.0 *[Oct 6 2016]*
* **Fix:** pinModeAlt mode argument is cheked in (FSEL_INPT, FSEL_OUTP, FSEL_ALT0, FSEL_ALT1, FSEL_ALT2, FSEL_ALT3, FSEL_ALT4, FSEL_ALT5) `NoHomey`
* **Fix:** sn3218Setup is a function `NoHomey`
* **Update:** documentation `NoHomey`
* **Add:** export of WPI_MODE_GPIO_SYS constant `NoHomey`
* **Add:** export of WPI_MODE_GPIO_PIFACE constant `NoHomey`
* **Add:** export of WPI_MODE_GPIO_UNINITIALISED constant `NoHomey`
* **Add:** wiringPiI2CClose `NoHomey`
* **Add:** wiringPiSPIClose `NoHomey`

## v2.1.1 *[Jan 5 2016]*
* **Fix:** added scope for dispatchInterrupt `taoyuan`

## v2.1.0 *[Aug 1 2015]*
16 changes: 13 additions & 3 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@
* [sr595](#sr595)
* [DevLib](#devlib)
* [ds1302](#ds1302)
* [GetBoard](#getboard)
* [GertBoard](#gertboard)
* [LCD](#lcd)
* [LCD 128x64](#lcd-128x64)
* [piFace](#piface)
@@ -487,13 +487,18 @@ The ID is the I2C number of the device and you can use the i2cdetect program to

wiringPiI2CSetup() will work out which revision Raspberry Pi you have and open the appropriate device in /dev.

The return value is the standard Linux filehandle, or -1 if any error – in which case, you can consult errno as usual.
The return value is the Linux file-descriptor for the device, or -1 if any error – in which case, you can consult errno as usual.

### wiringPiI2CSetupInterface(device, devId)
<span class="api-info"><code> >= 2.0.0 </code></span>

Undocumented access to set the interface explicitly - might be used for the Pi's 2nd I2C interface...

### wiringPiI2CClose(fd)
<span class="apt-info"><code> >= 2.2.0 </code></span>

Closes the device identified by the file descriptor given.

### wiringPiI2CRead(fd)
<span class="api-info"><code> >= 2.0.0 </code></span>

@@ -506,7 +511,7 @@ Some devices present data when you read them without having to do any register t

This read an 8-bit value from the device register indicated.

### wiringPiI2CReadReg16(fd, red)
### wiringPiI2CReadReg16(fd, reg)
<span class="api-info"><code> >= 2.0.0 </code></span>

This read an 16-bit value from the device register indicated.
@@ -562,6 +567,11 @@ If an error has happened, you may use the standard errno global variable to see
### wiringPiSPISetupMode(channel, speed, mode)
<span class="apt-info"><code> >= 2.1.0 </code></span>

### wiringPiSPIClose(fd)
<span class="apt-info"><code> >= 2.2.0 </code></span>

Closes the device identified by the file descriptor given.

---

## Serial
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -15,15 +15,15 @@ var wpi = require('wiring-pi');
```
## Documentation

See the [DOCUMENTATION.md](https://github.com/eugeneware/wiring-pi/blob/master/DOCUMENTATION.md) file for more detailed documentation.
See the [DOCUMENTATION.md](https://github.com/WiringPi/WiringPi-Node/blob/master/DOCUMENTATION.md) file for more detailed documentation.

## Contributing

wiring-pi is an [**OPEN Open Source Project**](http://openopensource.org/). This means that:

> Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project.
See the [CONTRIBUTING.md](https://github.com/eugeneware/wiring-pi/blob/master/CONTRIBUTING.md) file for more details.
See the [CONTRIBUTING.md](https://github.com/WiringPi/WiringPi-Node/blob/master/CONTRIBUTING.md) file for more details.

### Contributors

@@ -34,3 +34,8 @@ Contributor | GitHub profile | Twitter profile |
Igor Soarez (Creator) | [Soarez](https://github.com/Soarez) | [@igorsoarez](https://twitter.com/igorsoarez)
Leandre Gohy | [nekuz0r](https://github.com/nekuz0r) | [@LeandreGohy](http://twitter.com/LeandreGohy)
Eugene Ware | [eugeneware](https://github.com/eugeneware) | [@eugeneware](http://twitter.com/eugeneware)
Ivo Stratev | [NoHomey](https://github.com/NoHomey) |
Chris Continanza | [csquared](https://github.com/csquared) | [@csquared](https://twitter.com/em_csquared/)
Tao Yuan | [taoyuan](https://github.com/taoyuan) | [@taoyvan](https://twitter.com/taoyvan)
Tom Janson | [tjanson](https://github.com/tjanson) |
Vincent Terraillon | [LouTerrailloune](https://github.com/LouTerrailloune) | [@pure74vincent](https://twitter.com/pure74vincent)
4 changes: 2 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ check_make_ok() {
fi
echo "Please check install.log and fix any problems. If you're still stuck,"
echo "then please open a new issue then post all the output and as many details as you can to"
echo " https://github.com/eugeneware/wiring-pi/issues"
echo " https://github.com/WiringPi/WiringPi-Node/issues"
echo "================================================================================"
echo ""
if [ $2 == 1 ]; then
@@ -29,7 +29,7 @@ check_git_clone() {
echo "FATAL: Cloning libWiringPi failed."
echo "Please check install.log and fix any problems. If you're still stuck,"
echo "then please open a new issue then post all the output and as many details as you can to"
echo " https://github.com/eugeneware/wiring-pi/issues"
echo " https://github.com/WiringPi/WiringPi-Node/issues"
echo "================================================================================"
echo ""
exit 1
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wiring-pi",
"version": "2.1.1",
"version": "2.2.1",
"description": "Bindings to wiringPi",
"main": "lib/exports.js",
"scripts": {
@@ -9,7 +9,7 @@
},
"repository": {
"type": "git",
"url": "git@github.com:eugeneware/wiring-pi.git"
"url": "git@github.com:WiringPi/WiringPi-Node.git"
},
"keywords": [
"wiringPi",
1 change: 1 addition & 0 deletions src/extensions/extensions.cc
Original file line number Diff line number Diff line change
@@ -35,6 +35,7 @@ IMPLEMENT_EXPORT_INIT(extensions) {
INIT(mcp23017);
INIT(pcf8574);
INIT(pcf8591);
INIT(sn3218);
INIT(sr595);
INIT(pca9685);
}
12 changes: 9 additions & 3 deletions src/wiringPi.cc
Original file line number Diff line number Diff line change
@@ -156,7 +156,7 @@ IMPLEMENT(wiringPiSetupPhys) {

// Func : void pinModeAlt(int pin, int mode)
// Description : This is an un-documented special to let you set any pin to any mode.
// Modes are WPI_MODE_PINS, WPI_MODE_PHYS, WPI_MODE_GPIO.
// Modes are FSEL_INPT, FSEL_OUTP, FSEL_ALT0, FSEL_ALT1, FSEL_ALT2, FSEL_ALT3, FSEL_ALT4, FSEL_ALT5.

IMPLEMENT(pinModeAlt) {
SCOPE_OPEN();
@@ -172,7 +172,7 @@ IMPLEMENT(pinModeAlt) {
int pin = GET_ARGUMENT_AS_INT32(0);
int mode = GET_ARGUMENT_AS_INT32(1);

CHECK_ARGUMENT_IN_INTS(1, mode, (WPI_MODE_PINS, WPI_MODE_PHYS, WPI_MODE_GPIO));
CHECK_ARGUMENT_IN_INTS(1, mode, (FSEL_INPT, FSEL_OUTP, FSEL_ALT0, FSEL_ALT1, FSEL_ALT2, FSEL_ALT3, FSEL_ALT4, FSEL_ALT5));

::pinModeAlt(pin, mode);

@@ -710,10 +710,14 @@ IMPLEMENT_EXPORT_INIT(wiringPi) {
EXPORT_FUNCTION(pwmSetClock);
EXPORT_FUNCTION(gpioClockSet);

// pinModeAlt
// WPI_MODEs
EXPORT_CONSTANT_INT(WPI_MODE_PINS);
EXPORT_CONSTANT_INT(WPI_MODE_PHYS);
EXPORT_CONSTANT_INT(WPI_MODE_GPIO);
EXPORT_CONSTANT_INT(WPI_MODE_GPIO_SYS);
EXPORT_CONSTANT_INT(WPI_MODE_PIFACE);
EXPORT_CONSTANT_INT(WPI_MODE_UNINITIALISED);


// pinMode
EXPORT_CONSTANT_INT(INPUT);
@@ -736,6 +740,7 @@ IMPLEMENT_EXPORT_INIT(wiringPi) {
EXPORT_CONSTANT_INT(PWM_MODE_BAL);
EXPORT_CONSTANT_INT(PWM_MODE_MS);

// piBoardId
EXPORT_CONSTANT_INT(PI_MODEL_UNKNOWN);
EXPORT_CONSTANT_INT(PI_MODEL_A);
EXPORT_CONSTANT_INT(PI_MODEL_B);
@@ -760,6 +765,7 @@ IMPLEMENT_EXPORT_INIT(wiringPi) {
EXPORT_CONSTANT_STRING_ARRAY(PI_REVISION_NAMES, piRevisionNames, 5);
EXPORT_CONSTANT_STRING_ARRAY(PI_MAKER_NAMES, piMakerNames, 5);

// pinModeAlt
EXPORT_CONSTANT_INT(FSEL_INPT);
EXPORT_CONSTANT_INT(FSEL_OUTP);
EXPORT_CONSTANT_INT(FSEL_ALT0);
25 changes: 24 additions & 1 deletion src/wiringPiI2C.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "wiringPiI2C.h"
#include <wiringPiI2C.h>
#include <unistd.h>

DECLARE(wiringPiI2CRead);
DECLARE(wiringPiI2CReadReg8);
@@ -9,6 +10,7 @@ DECLARE(wiringPiI2CWriteReg8);
DECLARE(wiringPiI2CWriteReg16);
DECLARE(wiringPiI2CSetupInterface);
DECLARE(wiringPiI2CSetup);
DECLARE(wiringPiI2CClose);

// Func : int wiringPiI2CRead (int fd);
// Simple device read. Some devices present data when you read them without having to do any register transactions.
@@ -188,6 +190,26 @@ IMPLEMENT(wiringPiI2CSetup) {
SCOPE_CLOSE(INT32(res));
}

// Func : void wiringPiI2CClose(const int fd)
// Description : This closes opened I2C file descriptor
// fd is file descriptor returned either from wiringPiI2CSetup or wiringPiI2CSetupInterface

IMPLEMENT(wiringPiI2CClose) {
SCOPE_OPEN();

SET_ARGUMENT_NAME(0, fd);

CHECK_ARGUMENTS_LENGTH_EQUAL(1);

CHECK_ARGUMENT_TYPE_INT32(0);

int fd = GET_ARGUMENT_AS_INT32(0);

::close(fd);

SCOPE_CLOSE(UNDEFINED());
}

IMPLEMENT_EXPORT_INIT(wiringPiI2C) {
EXPORT_FUNCTION(wiringPiI2CRead);
EXPORT_FUNCTION(wiringPiI2CReadReg8);
@@ -197,4 +219,5 @@ IMPLEMENT_EXPORT_INIT(wiringPiI2C) {
EXPORT_FUNCTION(wiringPiI2CWriteReg16);
EXPORT_FUNCTION(wiringPiI2CSetupInterface);
EXPORT_FUNCTION(wiringPiI2CSetup);
}
EXPORT_FUNCTION(wiringPiI2CClose);
}
23 changes: 23 additions & 0 deletions src/wiringPiSPI.cc
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#include "wiringPiSPI.h"
#include <wiringPiSPI.h>
#include <unistd.h>

DECLARE(wiringPiSPIGetFd);
DECLARE(wiringPiSPIDataRW);
DECLARE(wiringPiSPISetup);
DECLARE(wiringPiSPISetupMode);
DECLARE(wiringPiSPIClose);

// Func : int wiringPiSPIGetFd(int channel)

@@ -98,9 +100,30 @@ IMPLEMENT(wiringPiSPISetupMode) {
SCOPE_CLOSE(INT32(res));
}

// Func : void wiringPiSPIClose(const int fd)
// Description : This closes opened SPI file descriptor
// fd is file descriptor returned either from wiringPiSPISetup or wiringPiSPISetupMode

IMPLEMENT(wiringPiSPIClose) {
SCOPE_OPEN();

SET_ARGUMENT_NAME(0, fd);

CHECK_ARGUMENTS_LENGTH_EQUAL(1);

CHECK_ARGUMENT_TYPE_INT32(0);

int fd = GET_ARGUMENT_AS_INT32(0);

::close(fd);

SCOPE_CLOSE(UNDEFINED());
}

IMPLEMENT_EXPORT_INIT(wiringPiSPI) {
EXPORT_FUNCTION(wiringPiSPIGetFd);
EXPORT_FUNCTION(wiringPiSPIDataRW);
EXPORT_FUNCTION(wiringPiSPISetup);
EXPORT_FUNCTION(wiringPiSPISetupMode);
EXPORT_FUNCTION(wiringPiSPIClose);
}