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
SPI Interface is improper working.
Bitmode: MSB Bytemode: MSB (Big Endian) 32 Bit Transfer
Bitmode: LSB Bytemode: MSB (Big Endian) 24 Bit Transfer, 8 Bit empty
spi_config_t spi_config = { .interface = { .bit_tx_order = SPI_BIT_ORDER_MSB_FIRST, .byte_tx_order = SPI_BYTE_ORDER_MSB_FIRST, .cs_en = 1, .mosi_en = 1, }, .intr_enable.val = 0, .mode = SPI_MASTER_MODE, .clk_div = SPI_4MHz_DIV, }; spi_init(HSPI_HOST, &spi_config); uint32_t buf[2] = {0x12345678, 0x12345678}; spi_trans_t trans = {0}; trans.bits.mosi = 8 * 8; trans.mosi = buf; spi_trans(HSPI_HOST, &trans);
Bitorder is wrong set:
ESP8266_RTOS_SDK/components/esp8266/include/driver/spi.h
Lines 33 to 34 in d3a5f99
ESP8266_RTOS_SDK/components/esp8266/include/esp8266/spi_struct.h
Line 60 in d3a5f99
SPI bus data using SPI_BYTE_ORDER_MSB_FIRST and data 0x12345678, 0x12345678: 0x12 0x34 0x56 0x00 0x12 0x34 0x56 0x00
SPI_BYTE_ORDER_MSB_FIRST
0x12345678, 0x12345678
0x12 0x34 0x56 0x00 0x12 0x34 0x56 0x00
SPI bus data using SPI_BYTE_ORDER_LSB_FIRST and data 0x12345678, 0x12345678: 0x78 0x56 0x34 0x12 0x78 0x56 0x34 0x12
SPI_BYTE_ORDER_LSB_FIRST
0x78 0x56 0x34 0x12 0x78 0x56 0x34 0x12
SPI_BIT_ORDER_MSB_FIRST
SPI_BIT_ORDER_LSB_FIRST
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Environment
Problem Description
SPI Interface is improper working.
Expected Behavior
Bitmode: MSB
Bytemode: MSB (Big Endian) 32 Bit Transfer
Actual Behavior
Bitmode: LSB
Bytemode: MSB (Big Endian) 24 Bit Transfer, 8 Bit empty
Code to reproduce this issue
Bitorder is wrong set:
ESP8266_RTOS_SDK/components/esp8266/include/driver/spi.h
Lines 33 to 34 in d3a5f99
differs from
ESP8266_RTOS_SDK/components/esp8266/include/esp8266/spi_struct.h
Line 60 in d3a5f99
SPI bus data using
SPI_BYTE_ORDER_MSB_FIRST
and data0x12345678, 0x12345678
:0x12 0x34 0x56 0x00 0x12 0x34 0x56 0x00
SPI bus data using
SPI_BYTE_ORDER_LSB_FIRST
and data0x12345678, 0x12345678
:0x78 0x56 0x34 0x12 0x78 0x56 0x34 0x12
SPI_BIT_ORDER_MSB_FIRST
andSPI_BIT_ORDER_LSB_FIRST
are swappedThe text was updated successfully, but these errors were encountered: