We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Adafruit CircuitPython 8.0.0-beta.6
import displayio import board import busio displayio.release_displays() FREQ = 80_000_000 spi = board.SPI() spi.try_lock() spi.configure(baudrate=FREQ) spi.unlock()
The frequency returned will always be what the baudrate parameter was, even if the bus could not be set to that frequency.
baudrate
spi.frequency always returns the value it was set to, even if that value was not achieved.
spi.frequency
From set_spi_config in /ports/espressif/common-hal/busio/SPI.c
set_spi_config
... esp_err_t result = spi_bus_add_device(self->host_id, &device_config, &spi_handle[self->host_id]); if (result != ESP_OK) { mp_raise_RuntimeError(translate("SPI configuration failed")); } self->baudrate = baudrate; ...
Instead of setting the baudrate calling spi_device_get_actual_freq function could be used to calculate the actual frequency the bus was set to.
spi_device_get_actual_freq
No response
The text was updated successfully, but these errors were encountered:
dhalbert
Successfully merging a pull request may close this issue.
CircuitPython version
Code/REPL
Behavior
The frequency returned will always be what the
baudrate
parameter was, even if the bus could not be set to that frequency.Description
spi.frequency
always returns the value it was set to, even if that value was not achieved.From
set_spi_config
in /ports/espressif/common-hal/busio/SPI.cInstead of setting the baudrate calling
spi_device_get_actual_freq
function could be used to calculate the actual frequency the bus was set to.Additional information
No response
The text was updated successfully, but these errors were encountered: