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

Add HSPI support for the Moddable Two via the SDK #227

Closed
zgramana opened this issue Jul 7, 2019 · 3 comments
Closed

Add HSPI support for the Moddable Two via the SDK #227

zgramana opened this issue Jul 7, 2019 · 3 comments

Comments

@zgramana
Copy link
Contributor

zgramana commented Jul 7, 2019

Presumably VSPI is used by the TFT and touch controller, but HSPI (available on GPIO pins 32, 14, 13, 27) also works great for adding microSD storage of images, sounds, logs, etc. It's usable when programming the Two via Arduino, but would much rather stay in the Moddable SDK and use it there! 😉

@phoddie
Copy link
Collaborator

phoddie commented Jul 8, 2019

You may use any pins for SPI you like with the Moddable SDK on ESP32. The Moddable Two manifest defines the SPI pins to use here:

	"spi": {
		"miso_pin": 12,
		"mosi_pin": 13,
		"sck_pin": 14,
	},

You can change that to use other pins in your application manifest by overriding the SPI pins configuration, for example:

	"spi": {
		"mosi_pin": 23,
		"miso_pin": 19,
		"sck_pin": 18
	},

@phoddie phoddie closed this as completed Jul 8, 2019
@phoddie
Copy link
Collaborator

phoddie commented Jul 8, 2019

The information above is to configure the SPI pins. The SPI port (HSPI or VSPI) is passed as an argument to modSPIConfig when establishing a new SPI connection.

@zgramana
Copy link
Contributor Author

zgramana commented Jul 8, 2019

Thanks, that's a big help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants