EasyManua.ls Logo

Espressif ESP32-S2 - Page 384

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 2. API Reference
int sclk_io_num
GPIO pin for SPI Clock signal, or -1 if not used.
int quadwp_io_num
GPIO pin for WP (Write Protect) signal, or -1 if not used.
int data2_io_num
GPIO pin for spi data2 signal in quad/octal mode, or -1 if not used.
int quadhd_io_num
GPIO pin for HD (Hold) signal, or -1 if not used.
int data3_io_num
GPIO pin for spi data3 signal in quad/octal mode, or -1 if not used.
int data4_io_num
GPIO pin for spi data4 signal in octal mode, or -1 if not used.
int data5_io_num
GPIO pin for spi data5 signal in octal mode, or -1 if not used.
int data6_io_num
GPIO pin for spi data6 signal in octal mode, or -1 if not used.
int data7_io_num
GPIO pin for spi data7 signal in octal mode, or -1 if not used.
int max_transfer_sz
Maximum transfer size, in bytes. Defaults to 4092 if 0 when DMA enabled, or to
SOC_SPI_MAXIMUM_BUFFER_SIZE if DMA is disabled.
uint32_t flags
Abilities of bus to be checked by the driver. Or-ed value of SPICOMMON_BUSFLAG_* flags.
int intr_flags
Interrupt flag for the bus to set the priority, and IRAM attribute, see esp_intr_alloc.h. Note that
the EDGE, INTRDISABLED attribute are ignored by the driver. Note that if ESP_INTR_FLAG_IRAM
is set, ALL the callbacks of the driver, and their callee functions, should be put in the IRAM.
Macros
SPI_MAX_DMA_LEN
SPI_SWAP_DATA_TX(DATA, LEN)
Transform unsigned integer of length <= 32 bits to the format which can be sent by the SPI driver directly.
E.g. to send 9 bits of data, you can:
uint16_t data = SPI_SWAP_DATA_TX(0x145, 9);
Then points tx_buffer to &data.
Parameters
DATA: Data to be sent, can be uint8_t, uint16_t or uint32_t.
LEN: Length of data to be sent, since the SPI peripheral sends from the MSB, this helps to shift the
data to the MSB.
SPI_SWAP_DATA_RX(DATA, LEN)
Transform received data of length <= 32 bits to the format of an unsigned integer.
E.g. to transform the data of 15 bits placed in a 4-byte array to integer:
uint16_t data = SPI_SWAP_DATA_RX(*(uint32_t*)t->rx_data, 15);
Parameters
DATA: Data to be rearranged, can be uint8_t, uint16_t or uint32_t.
Espressif Systems 373
Submit Document Feedback
Release v4.4

Table of Contents