Skip to content

Commit

Permalink
dac7678, tcs34725 support
Browse files Browse the repository at this point in the history
  • Loading branch information
nekuz0r committed Dec 27, 2014
1 parent 2dbc525 commit 54fcb41
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
'src/extensions/sn3218.cc',
'src/extensions/sr595.cc',
'src/extensions/pca9685.cc',
'src/extensions/dac7678.cc',

'src/devlib/devlib.cc',
'src/devlib/ds1302.cc',
Expand Down
1 change: 1 addition & 0 deletions src/devlib/tcs34725.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "tcs34725.h"

DECLARE(tcs34725ReadRGBC);
DECLARE(tcs34725ReadHSV);
DECLARE(tcs34725GetCorrelatedColorTemperature);
DECLARE(tcs34725GetIlluminance);
DECLARE(tcs34725SetInterrupt);
Expand Down
10 changes: 5 additions & 5 deletions src/extensions/dac7678.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ IMPLEMENT(dac7678Setup) {
CHECK_ARGUMENT_TYPE_INT32(1);
CHECK_ARGUMENT_TYPE_UINT32(2);

int pinBase = GET_ARGUMENT_AS_INT32(0);
int i2cAddress = GET_ARGUMENT_AS_INT32(1);
unsigned short vrefMode = GET_ARGUMENT_AS_UINT32(2);

CHECK_ARGUMENT_IN_INTS(2, vrefMode, (DAC7678_VREF_MODE_STATIC_ON,
DAC7678_VREF_MODE_STATIC_OFF,
DAC7678_VREF_MODE_FLEXIBLE_ON,
DAC7678_VREF_MODE_FLEXIBLE_ALWAYS_ON
DAC7678_VREF_MODE_FLEXIBLE_ALWAYS_ON,
DAC7678_VREF_MODE_FLEXIBLE_ALWAYS_OFF));

int pinBase = GET_ARGUMENT_AS_INT32(0);
int i2cAddress = GET_ARGUMENT_AS_INT32(1);
unsigned short vrefMode = GET_ARGUMENT_AS_UINT32(2);

int res = ::dac7678Setup(pinBase, i2cAddress, vrefMode);

SCOPE_CLOSE(INT32(res));
Expand Down

0 comments on commit 54fcb41

Please sign in to comment.