Browse Source

try to solve issue without success

pull/1626/head
lumapu 9 months ago
parent
commit
ede4fba997
  1. 2
      src/hm/nrfHal.h
  2. 2
      src/hms/cmtHal.h
  3. 8
      src/plugins/Display/epdHal.h

2
src/hm/nrfHal.h

@ -55,6 +55,7 @@ class nrfHal: public RF24_hal, public SpiPatcherHandle {
gpio_set_level(mPinClk, 0);
gpio_reset_pin(mPinCs);
request_spi();
spi_device_interface_config_t devcfg = {
.command_bits = 0,
.address_bits = 0,
@ -72,6 +73,7 @@ class nrfHal: public RF24_hal, public SpiPatcherHandle {
.post_cb = nullptr
};
ESP_ERROR_CHECK(spi_bus_add_device(mHostDevice, &devcfg, &spi));
release_spi();
gpio_reset_pin(mPinEn);
gpio_set_direction(mPinEn, GPIO_MODE_OUTPUT);

2
src/hms/cmtHal.h

@ -50,6 +50,7 @@ class cmtHal : public SpiPatcherHandle {
gpio_set_level(mPinClk, 0);
gpio_reset_pin(mPinCs);
request_spi();
spi_device_interface_config_t devcfg_reg = {
.command_bits = 1,
.address_bits = 7,
@ -67,6 +68,7 @@ class cmtHal : public SpiPatcherHandle {
.post_cb = nullptr
};
ESP_ERROR_CHECK(spi_bus_add_device(mHostDevice, &devcfg_reg, &spi_reg));
release_spi();
gpio_reset_pin(mPinFcs);
spi_device_interface_config_t devcfg_fifo = {

8
src/plugins/Display/epdHal.h

@ -51,6 +51,7 @@ class epdHal: public GxEPD2_HalInterface, public SpiPatcherHandle {
gpio_set_level(mPinClk, 0);
gpio_reset_pin(mPinCs);
request_spi();
spi_device_interface_config_t devcfg = {
.command_bits = 0,
.address_bits = 0,
@ -68,6 +69,7 @@ class epdHal: public GxEPD2_HalInterface, public SpiPatcherHandle {
.post_cb = nullptr
};
ESP_ERROR_CHECK(spi_bus_add_device(mHostDevice, &devcfg, &spi));
release_spi();
if(GPIO_NUM_NC != mPinRst) {
gpio_reset_pin(mPinRst);
@ -152,14 +154,12 @@ class epdHal: public GxEPD2_HalInterface, public SpiPatcherHandle {
}
request_spi();
size_t spiLen = static_cast<size_t>(n + fill_with_zeroes) << 3;
spi_transaction_t t = {
.flags = SPI_TRANS_CS_KEEP_ACTIVE,
.cmd = 0,
.addr = 0,
.length = spiLen,
.rxlength = spiLen,
.length = 1u,
.rxlength = 1u,
.user = NULL,
.tx_buffer = data,
.rx_buffer = data

Loading…
Cancel
Save