]> granicus.if.org Git - esp-idf/commitdiff
Merge branch 'bugfix/spi_hd_rx' into 'master'
authorIvan Grokhotkov <ivan@espressif.com>
Mon, 28 Aug 2017 09:36:58 +0000 (17:36 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Mon, 28 Aug 2017 09:36:58 +0000 (17:36 +0800)
fix(spi_dma_rx): add check to avoid using SPI half-duplex mode DMA with both MOSI and MISO phases.

See merge request !1111

1  2 
components/driver/include/driver/spi_master.h
components/driver/spi_master.c

index c938d499face3683cbb23d4ebdcde3752ba5df34,d3b6f81dc579bb0e2b9dc2789813f71c244f6197..31028072930198f859e75ca23877d6c2674cc1e0
@@@ -71,14 -71,12 +71,14 @@@ typedef struct 
   */
  struct spi_transaction_t {
      uint32_t flags;                 ///< Bitwise OR of SPI_TRANS_* flags
 -    uint16_t command;               ///< Command data, of which the length is set in the command_bits of spi_device_interface_config_t.
 -    uint64_t addr;                  ///< Address data, of which the length is set in the address_bits of spi_device_interface_config_t.
 -                                    ///< <b>NOTE: this field is re-written to be used in a new way.</b> 
 -                                    ///< - Example: write 0x123400 and address_bits=24 to send address of 0x12, 0x34, 0x00.  
 +    uint16_t cmd;                   ///< Command data, of which the length is set in the ``command_bits`` of spi_device_interface_config_t.
 +                                    ///< <b>NOTE: this field, used to be "command" in ESP-IDF 2.1 and before, is re-written to be used in a new way in ESP-IDF 3.0.</b>
 +                                    ///< - Example: write 0x0123 and command_bits=12 to send command 0x12, 0x3_ (in previous version, you may have to write 0x3_12).
 +    uint64_t addr;                  ///< Address data, of which the length is set in the ``address_bits`` of spi_device_interface_config_t.
 +                                    ///< <b>NOTE: this field, used to be "address" in ESP-IDF 2.1 and before, is re-written to be used in a new way in ESP-IDF3.0.</b> 
 +                                    ///< - Example: write 0x123400 and address_bits=24 to send address of 0x12, 0x34, 0x00 (in previous version, you may have to write 0x12340000).  
      size_t length;                  ///< Total data length, in bits
-     size_t rxlength;                ///< Total data length received, should be not greater than ``length`` in full-duplex mode. (0 defaults this to the value of ``length``)
+     size_t rxlength;                ///< Total data length received, should be not greater than ``length`` in full-duplex mode (0 defaults this to the value of ``length``).
      void *user;                     ///< User-defined variable. Can be used to store eg transaction ID.
      union {
          const void *tx_buffer;      ///< Pointer to transmit buffer, or NULL for no MOSI phase
Simple merge