-
Notifications
You must be signed in to change notification settings - Fork 923
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Machine API #9
Comments
Here it is: Feel free to comment on it. |
The wiki needs to be updated based on the I2C interface that we ended up using. Also, I would like to startup the conversation about a proposed SPI interface.
|
What does the "mode" field mean? And can MSBFirst be merged into it? (This depends somewhat on how the hardware implements SPI mode). Other than that, this interface looks good. |
Mode refers to the standard SPI modes: http://www.rosseeld.be/DRO/PIC/SPI_Timing.htm The bit order (MSB first or LSB first) is implemented differently depending on the target, so it seemed like a good idea to keep separate. |
This is my WIP branch with the nrf5x SPI support: https://github.com/hybridgroup/tinygo/tree/feature/nrf-spi |
FYI: I have made the wiki editable by everyone. |
Thanks for doing that. I recently updated both the I2C and SPI interface details on the wiki. |
May I make couple nitices | suggestion? 1: the Pin interface lack of external IRQ (config, assignment callback ... ) |
func init() {
machine.BUTTON1.Configure(...)
machine.BUTTON1.SetInterrupt(machine.PinChange, machine.PriorityHigh, func(pin machine.Pin) {
machine.LED1.High(machine.BUTTON1.Get())
})
}
|
Good plans. |
Notes about possible interactions of interrupts:
|
Just side question: |
This issue has really been replaced with the wiki, and specific Prs like that around interrupts #782 I propose that we close it now. |
Sounds good. Closing.
I think the most sensible approach is to just run ISRs as they arrive: not running them immediately (in interrupt context) will often cause too much delays and you'll often want to respond to interrupts ASAP. |
Maybe it is a good idea to actually design an API for the "machine" module, similar to the (mostly) cross-platform MicroPython hardware API.
The text was updated successfully, but these errors were encountered: