Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pulse distance encoding #140

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
],
"conditions": [
["OS == 'linux'", {
"cflags": ["-fpermissive", "-fexceptions", "-Wmisleading-indentation"],
"cflags_cc": ["-fpermissive", "-fexceptions", "-Wmisleading-indentation"],
"sources": [
"src/bcm2835.c",
"src/sunxi.c"
"src/bcm2835.cpp",
"src/sunxi.cpp"
]
}]
]
Expand Down
35 changes: 35 additions & 0 deletions lib/rpio.js
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,41 @@ rpio.prototype.spiEnd = function()
bindcall(binding.spi_end);
}

rpio.prototype.pdeSetSeparatorDuration = function(pin, duration)
{
return bindcall2(binding.pde_set_separator_duration, pin_to_gpio(pin), duration)
}

rpio.prototype.pdeSetShortDuration = function(pin, duration)
{
return bindcall2(binding.pde_set_short_duration, pin_to_gpio(pin), duration)
}

rpio.prototype.pdeSetLongDuration = function(pin, duration)
{
return bindcall2(binding.pde_set_long_duration, pin_to_gpio(pin), duration)
}

rpio.prototype.pdeSetSeparator = function(pin, separator)
{
if (separator === undefined)
separator = rpio.prototype.HIGH

return bindcall2(binding.pde_set_separator, pin_to_gpio(pin), separator)
}

rpio.prototype.pdeWrite = function(pin, buf, len)
{
if (len === undefined)
len = buf.length;

if (len > buf.length)
throw new Error('Buffer not large enough to accommodate request');

// Does this need to interact with mockmap first?
return bindcall3(binding.pde_write, pin_to_gpio(pin), buf, len)
}

/*
* Misc functions.
*/
Expand Down
Loading