• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //     http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #pragma once
16 
17 #include "soc/soc.h"
18 
19 /// Mask of interrupts sending to the host.
20 typedef enum {
21     SDIO_SLAVE_HOSTINT_BIT0 = BIT(0),   ///< General purpose interrupt bit 0.
22     SDIO_SLAVE_HOSTINT_BIT1 = BIT(1),
23     SDIO_SLAVE_HOSTINT_BIT2 = BIT(2),
24     SDIO_SLAVE_HOSTINT_BIT3 = BIT(3),
25     SDIO_SLAVE_HOSTINT_BIT4 = BIT(4),
26     SDIO_SLAVE_HOSTINT_BIT5 = BIT(5),
27     SDIO_SLAVE_HOSTINT_BIT6 = BIT(6),
28     SDIO_SLAVE_HOSTINT_BIT7 = BIT(7),
29     SDIO_SLAVE_HOSTINT_SEND_NEW_PACKET = BIT(23), ///< New packet available
30 } sdio_slave_hostint_t;
31 
32 
33 /// Timing of SDIO slave
34 typedef enum {
35     SDIO_SLAVE_TIMING_PSEND_PSAMPLE = 0,/**< Send at posedge, and sample at posedge. Default value for HS mode.
36                                          *   Normally there's no problem using this to work in DS mode.
37                                          */
38     SDIO_SLAVE_TIMING_NSEND_PSAMPLE    ,///< Send at negedge, and sample at posedge. Default value for DS mode and below.
39     SDIO_SLAVE_TIMING_PSEND_NSAMPLE,    ///< Send at posedge, and sample at negedge
40     SDIO_SLAVE_TIMING_NSEND_NSAMPLE,    ///< Send at negedge, and sample at negedge
41 } sdio_slave_timing_t;
42 
43 /// Configuration of SDIO slave mode
44 typedef enum {
45     SDIO_SLAVE_SEND_STREAM = 0, ///< Stream mode, all packets to send will be combined as one if possible
46     SDIO_SLAVE_SEND_PACKET = 1, ///< Packet mode, one packets will be sent one after another (only increase packet_len if last packet sent).
47 } sdio_slave_sending_mode_t;
48