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

Pin assignments SPIS nrf52 #44938

Closed
lachlansmith opened this issue Apr 19, 2022 · 1 comment
Closed

Pin assignments SPIS nrf52 #44938

lachlansmith opened this issue Apr 19, 2022 · 1 comment
Labels
Enhancement Changes/Updates/Additions to existing features

Comments

@lachlansmith
Copy link

lachlansmith commented Apr 19, 2022

Is your enhancement proposal related to a problem? Please describe.
A clear and concise description of what the problem is.

I'd like to use SPIS on the Particle Argon but I can't figure out the csn-pin to use. I believe boards > arm > particle_argon > dts > mesh_feather_spi_spi1.dtsi references the nrf52 pin assignments. This leads me to believe I need to look at nordic, however I'm struggling to see the relation between the dtsi file and nordic's documentation.

Could someone who knows something help with understanding the mapping of gpio1 15 -> 47, gpio1 14 -> 46, gpio1 13 -> 45 and my problem which is gpio0 31 -> ?, and how they got there?

&spi1 {
	compatible = "nordic,nrf-spis";
	status = "okay";
	sck-pin = <47>;
	mosi-pin = <45>;
	miso-pin = <46>;
        // cs-gpios = < &gpio0 31 GPIO_ACTIVE_LOW>;
	csn-pin = <?>;
	def-char = <0x00>;

	bt-hci@0 {
		compatible = "zephyr,bt-hci-spi-slave";
		reg = <0>;
		irq-gpios = <&gpio0 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;
	};
};

Describe the solution you'd like
A clear and concise description of what you want to happen.

Documentation/mesh_feather_spis_spi1.dtsi example

@lachlansmith lachlansmith added the Enhancement Changes/Updates/Additions to existing features label Apr 19, 2022
@lachlansmith
Copy link
Author

lachlansmith commented Apr 19, 2022

I'm unsure if this is correct but it seems like a pretty good guess. Since a GPIO bus goes from [0 ... 31] and gpio1 is the "next" bus the mapping is gpio1 14 = 31 + 14 + 1 (indexing 0) = 46. So the pins are referencing the GPIO number plus whatever bus they are on. Hate when things seem obvious after the fact. I can't find documentation on this so I assume this is just a known convention I haven't come across before.

Thus, gpio0 31 = 31 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Changes/Updates/Additions to existing features
Projects
None yet
Development

No branches or pull requests

1 participant