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

SPI: transfer functions ignore byte order #109

Open
mtavenrath opened this issue Apr 30, 2016 · 1 comment
Open

SPI: transfer functions ignore byte order #109

mtavenrath opened this issue Apr 30, 2016 · 1 comment
Labels

Comments

@mtavenrath
Copy link

The functions SPIClass:tranfer32 and SPIClass::transfer both initialize regvalue to mySettings._user_regvalue which is SPU_USER(SPI_NO). My assumption is that this value has to be initialized to READ_PERI_REG(SPI_USER(SPI_NO));

Instead, I'm wondering if it's necessary to read this value at all. Instead this value could be read on each transfer/transfer32 call.

Phaeodaria pushed a commit to mtavenrath/SmingRTOS that referenced this issue Apr 30, 2016
…nstead of using the value SPI_USER(SPI_NO) as base value for SPI_USER in SPI::transfer and SPI::transfer32
@harry-boe
Copy link
Contributor

Initialising the Register with it's current value does not make a lot of sense to me.
The idea using the Settings is really preserve the register for each individual setting in case you are using multiple SPI slaves with different settings ..

Phaeodaria pushed a commit to mtavenrath/SmingRTOS that referenced this issue May 18, 2016
…nstead of using the value SPI_USER(SPI_NO) as base value for SPI_USER in SPI::transfer and SPI::transfer32
Phaeodaria pushed a commit to mtavenrath/SmingRTOS that referenced this issue May 18, 2016
…nstead of using the value SPI_USER(SPI_NO) as base value for SPI_USER in SPI::transfer and SPI::transfer32

	modified:   sming/core/SPI.cpp
	modified:   sming/core/SPISettings.cpp
	modified:   sming/core/SPISettings.h
Phaeodaria pushed a commit to mtavenrath/SmingRTOS that referenced this issue May 18, 2016
…nstead of using the value SPI_USER(SPI_NO) as base value for SPI_USER in SPI::transfer and SPI::transfer32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants