Skip to content

Conversation

@aykevl
Copy link
Member

@aykevl aykevl commented Oct 18, 2020

Instead of only allowing a limited number of speeds, use the provided
speed as an upper bound on the allowed speed. The reasoning is that
picking a higher speed than requrested will likely result in malfunction
while picking a lower speed will usually only result in slower
operation.
This behavior matches the ESP32 at least.


Tested on a SK9822 LED strip with an nrf52832.

It was inspired by code like this: https://github.com/tinygo-org/drivers/pull/208/files#diff-3ea9b9d98ece4f5cf1c374d3876eeda73d4b9fc617d1bc3431cd988af2bfeaebL41
Also, this behavior should allow more flexibility in configuring SPI peripherals: a driver or program should pick the maximum speed allowed by the driver instead of configuring a specific speed per chip (for portable code).

Instead of only allowing a limited number of speeds, use the provided
speed as an upper bound on the allowed speed. The reasoning is that
picking a higher speed than requrested will likely result in malfunction
while picking a lower speed will usually only result in slower
operation.
This behavior matches the ESP32 at least.
@deadprogram
Copy link
Member

Very good idea @aykevl thanks. Now merging.

@deadprogram deadprogram merged commit 47dc76f into dev Oct 18, 2020
@deadprogram deadprogram deleted the nrf-spi-frequency branch October 18, 2020 20:11
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

Successfully merging this pull request may close these issues.

3 participants