-
Notifications
You must be signed in to change notification settings - Fork 40
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
Reusing FPGA pins for GPIO and other peripherals #3
Comments
I made a little experiment, and one thing now i'm not sure about is how to handle the selection signal. |
Also, is it common to be able to have for example : Should the direction of the pins set by the selected functionality ? or it should always be set by the GPIO controller ? |
For SPI, I currently have one selection signal that switches all the pins. But for some other peripherals it would be better per I/O. For example I have PWM and Servo peripherals which have a width parameters and for these it would be better to be able to switch each IO separately. I don't currently have the ability to do the multiple locations. I don't think that is really necessary. The setup I am testing with MuraxArduino has two SPI peripherals; one of GPIOA and one on GPIOB. Currently I set the direction of the pins with the GPIO controller. I think that is probably OK. |
Maybe having it consistent with Linux could be useful: |
For microcontrollers and systems like Arduino, it is common for the same pins to be used for GPIO and one or more other peripherals. For the output pins, a mux is typically used to switch the pins between use by the GPIO and the other peripherals.
It would be useful if, as part of the definition of the input/output ports of a peripheral, that a mapping onto GPIO pins could be specified along with the muxes to switch the pins,
As the GPIO peripheral uses a tri-state array, the C driving code for a peripheral would need to set the pins used by the peripheral to input or output as appropriate (using the GPIO writeEnable register), and to sets bits in a register to switch the muxes. It would be useful if a C header file were generated that gave the mapping between the peripheral pins and the GPIO pins and specified the mux register addresses and bit offsets..
The text was updated successfully, but these errors were encountered: