EasyManuals Logo

Espressif ESP32-S2 User Manual

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
Page #399 background imageLoading...
Page #399 background image
Chapter 2. API Reference
SPI_SLAVE_BIT_LSBFIRST
Transmit and receive LSB first.
Type Definitions
typedef struct spi_slave_transaction_t spi_slave_transaction_t
typedef void (*slave_transaction_cb_t)(spi_slave_transaction_t *trans)
2.2.18 SPI Slave Half Duplex
Introduction
The half duplex (HD) mode is a special mode provided by ESP SPI Slave peripheral. Under this mode, the hardware
provides more services than the full duplex (FD) mode (the mode for general purpose SPI transactions, see SPI Slave
Driver). These services reduce the CPU load and the response time of SPI Slave, but the communication format is
determined by the hardware. The communication format is always half duplex, so comes the name of Half Duplex
Mode.
There are several different types of transactions, determined by the command phase of the transaction. Each trans-
action may consist of the following phases: command, address, dummy, data. The command phase is mandatory,
while the other fields may be determined by the command field. During the command, address, dummy phases, the
bus is always controlled by the master, while the direction of the data phase depends on the command. The data
phase can be either an in phase, for the master to write data to the slave; or an out phase, for the master to read data
from the slave.
About the details of how master should communicate with the SPI Slave, see ESP SPI Slave HD (Half Duplex) Mode
Protocol.
By these different transactions, the slave provide these services to the master:
A DMA channel for the master to write a great amount of data to the slave.
A DMA channel for the master to read a great amount of data from the slave.
Several general purpose registers, shard between the master and the slave.
Several general purpose interrupts, for the master to interrupt the SW of slave.
Terminology
Transaction
Channel
Sending
Receiving
Data Descriptor
Driver Feature
Transaction read/write by master in segments
Queues for data to send and received
Driver usage
Slave initialization Call spi_slave_hd_init() to initialize the SPI bus as well as the peripheral and the
driver. The SPI slave will exclusively use the SPI peripheral, pins of the bus before its deinitialized. Most config-
urations of the slave should be done as soon as the slave is being initialized.
The spi_bus_config_t specifies how the bus should be initialized, while
spi_slave_hd_slot_config_t specifies how the SPI Slave driver should work.
Espressif Systems 388
Submit Document Feedback
Release v4.4

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Espressif ESP32-S2 and is the answer not in the manual?

Espressif ESP32-S2 Specifications

General IconGeneral
BrandEspressif
ModelESP32-S2
CategorySingle board computers
LanguageEnglish