1 /*
2  * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #pragma once
8 
9 #include "esp_bit_defs.h"
10 
11 /// Mask of interrupts sending to the host.
12 typedef enum {
13     SDIO_SLAVE_HOSTINT_BIT0 = BIT(0),   ///< General purpose interrupt bit 0.
14     SDIO_SLAVE_HOSTINT_BIT1 = BIT(1),
15     SDIO_SLAVE_HOSTINT_BIT2 = BIT(2),
16     SDIO_SLAVE_HOSTINT_BIT3 = BIT(3),
17     SDIO_SLAVE_HOSTINT_BIT4 = BIT(4),
18     SDIO_SLAVE_HOSTINT_BIT5 = BIT(5),
19     SDIO_SLAVE_HOSTINT_BIT6 = BIT(6),
20     SDIO_SLAVE_HOSTINT_BIT7 = BIT(7),
21     SDIO_SLAVE_HOSTINT_SEND_NEW_PACKET = BIT(23), ///< New packet available
22 } sdio_slave_hostint_t;
23 
24 
25 /// Timing of SDIO slave
26 typedef enum {
27     SDIO_SLAVE_TIMING_PSEND_PSAMPLE = 0,/**< Send at posedge, and sample at posedge. Default value for HS mode.
28                                          *   If :c:macro:`SDIO_SLAVE_FLAG_HIGH_SPEED` is specified in
29                                          *   :cpp:class:`sdio_slave_config_t`, this should be selected.
30                                          *   Normally there's no problem using this to work in DS mode.
31                                          */
32     SDIO_SLAVE_TIMING_NSEND_PSAMPLE,    /**< Send at negedge, and sample at posedge. Default value for DS mode and
33                                          *   below. If :c:macro:`SDIO_SLAVE_FLAG_DEFAULT_SPEED` is specified in
34                                          *   :cpp:class:`sdio_slave_config_t`, this should be selected.
35                                          */
36     SDIO_SLAVE_TIMING_PSEND_NSAMPLE,    ///< Send at posedge, and sample at negedge
37     SDIO_SLAVE_TIMING_NSEND_NSAMPLE,    ///< Send at negedge, and sample at negedge
38 } sdio_slave_timing_t;
39 
40 /// Configuration of SDIO slave mode
41 typedef enum {
42     SDIO_SLAVE_SEND_STREAM = 0, ///< Stream mode, all packets to send will be combined as one if possible
43     SDIO_SLAVE_SEND_PACKET = 1, ///< Packet mode, one packets will be sent one after another (only increase packet_len if last packet sent).
44 } sdio_slave_sending_mode_t;
45