-
Notifications
You must be signed in to change notification settings - Fork 516
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
Initial approach to a Firmata SPI implementation #341
base: main
Are you sure you want to change the base?
Conversation
|
||
bool SPIFirmata::handlePinMode(uint8_t pin, int mode) | ||
{ | ||
// There is no reason for a user to manually set the SPI pin modes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
utility/SPIFirmata.cpp
Outdated
pinMode(mCsPin, OUTPUT); | ||
|
||
if (argv[10] != END_SYSEX) { | ||
mCsActiveState = argv[10]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to ensure that argv[10] is a valid value (0 or 1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fallback to default (SPI_CS_ACTIVE_LOW) if invalid
fe2a5a8
to
7bdefb4
Compare
This is an initial approach to Firmata SPI support. Consider this a prototype for now. The draft proposal that this implementation is based on is available here: https://github.com/firmata/protocol/blob/master/proposals/spi-proposal.md.
SPI is a difficult protocol to implement in a generic way. The idea with this prototype implementation is to get it out there and have people start testing with various SPI devices to see where it falls short.
A prototype Firmata client implementation is also being explored for firmata.js: https://github.com/firmata/firmata.js/compare/spi-alpha. You can use that to test devices or use it as an example for testing in other programming environments.
Note that both the Arduino implementation and the firmata.js are still changing, but should be stable enough to checkout and test with (just be sure to checkout both at the same time as I'm pushing updates simultaneously).