Closed LouDou closed 2 weeks ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue should not be closed yet please.
spi_bus_initialize はGFXが実行しているのでDACの方には不要ではないでしょうか
@lovyan03 if I let this library call spi_bus_initialize
then the DAC doesn't work. I need to have better control over initialising and using the bus myself for both the DAC and the display.
I still haven't got to the bottom of what is going on here. There is a lot of complex code in lgfx's src/lgfx/v1/platforms/esp32/common.cpp
interface, and it assumes in _spi_dev_handle
that it owns the SPI bus and that only one device is ever on that bus. I therefore cannot let lgfx manage the bus and the transactions because it is unaware that other devices are on the bus.
This is a shame, I really like the lgfx library for graphics, I just wish it could play nicely with other devices.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
not stale
検証しやすいように、ビルド可能な もっとシンプルなコードを提供してもらえませんか?
You can see the difference in code between Shared SPI bus and otherwise in ESP-IDF v5.x
ESP_LOGI(TAG, "Initializing SPI BUS");
spi_bus_config_t bus_cfg = {
.mosi_io_num = SD_MOSI,
.miso_io_num = SD_MISO,
.sclk_io_num = SD_SCLK,
.quadwp_io_num = -1,
.quadhd_io_num = -1,
.max_transfer_sz = 4092,
};
esp_err_t ret = spi_bus_initialize(SDSPI_HOST_ID, &bus_cfg, SDSPI_DEFAULT_DMA);
if (ret != ESP_OK) {
ESP_LOGE(TAG, "Failed to initialize bus.");
return ESP_FAIL;
}
Exclusive => https://github.com/sukesh-ak/ESP32-TUX/blob/master/main/helpers/helper_storage.hpp
Shared => https://github.com/sukesh-ak/ESP32-TUX/blob/master/main/helpers/helper_storage_shared.hpp
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically closed because it has not had recent activity. Thank you for your contributions.
not stale.
Carefully written Issues are more likely to be given priority. 丁寧に記述された報告は優先して対応される可能性が高くなります。
Environment ( 実行環境 )
Problem Description ( 問題の内容 )
I am sharing the SPI bus between one ST7735s and two AD5238 DAC devices. I have both the display and DACs working independently. However, as soon as I send anything to the display, the DAC stops working. The DAC is configured using the esp-idf
spi_bus_add_device
API and also sets up the bus usingspi_bus_initialize
.Note that the display uses SPI mode 0 and the DACs require SPI mode 2.
Expected Behavior ( 期待される動作 )
Both the DAC and display can be used at the same time on the same SPI bus.
Actual Behavior ( 実際の動作 )
DAC stops working after the display has been updated.
Steps to reproduce ( 再現のための前提条件 )
Code to reproduce this issue ( 再現させるためのコード )
DAC interface:
SPI and display interface
main
DAC is being updated periodically in a timer task using
psc::dac::writeDacOutput(...)
.Then as soon as
psc::tft::displayConfig(...)
is called, the DAC no longer updates.