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 #define SPI_FUNC_NUM            1
18 #define SPI_IOMUX_PIN_NUM_MISO  7
19 #define SPI_IOMUX_PIN_NUM_MOSI  8
20 #define SPI_IOMUX_PIN_NUM_CLK   6
21 #define SPI_IOMUX_PIN_NUM_CS    11
22 #define SPI_IOMUX_PIN_NUM_WP    10
23 #define SPI_IOMUX_PIN_NUM_HD    9
24 
25 //For D2WD and PICO-D4 chip
26 #define SPI_D2WD_PIN_NUM_MISO  17
27 #define SPI_D2WD_PIN_NUM_MOSI  8
28 #define SPI_D2WD_PIN_NUM_CLK   6
29 #define SPI_D2WD_PIN_NUM_CS    16
30 #define SPI_D2WD_PIN_NUM_WP    7
31 #define SPI_D2WD_PIN_NUM_HD    11
32 
33 #define SPI2_FUNC_NUM           HSPI_FUNC_NUM
34 #define SPI2_IOMUX_PIN_NUM_MISO HSPI_IOMUX_PIN_NUM_MISO
35 #define SPI2_IOMUX_PIN_NUM_MOSI HSPI_IOMUX_PIN_NUM_MOSI
36 #define SPI2_IOMUX_PIN_NUM_CLK  HSPI_IOMUX_PIN_NUM_CLK
37 #define SPI2_IOMUX_PIN_NUM_CS   HSPI_IOMUX_PIN_NUM_CS
38 #define SPI2_IOMUX_PIN_NUM_WP   HSPI_IOMUX_PIN_NUM_WP
39 #define SPI2_IOMUX_PIN_NUM_HD   HSPI_IOMUX_PIN_NUM_HD
40 
41 #define SPI3_FUNC_NUM           VSPI_FUNC_NUM
42 #define SPI3_IOMUX_PIN_NUM_MISO VSPI_IOMUX_PIN_NUM_MISO
43 #define SPI3_IOMUX_PIN_NUM_MOSI VSPI_IOMUX_PIN_NUM_MOSI
44 #define SPI3_IOMUX_PIN_NUM_CLK  VSPI_IOMUX_PIN_NUM_CLK
45 #define SPI3_IOMUX_PIN_NUM_CS   VSPI_IOMUX_PIN_NUM_CS
46 #define SPI3_IOMUX_PIN_NUM_WP   VSPI_IOMUX_PIN_NUM_WP
47 #define SPI3_IOMUX_PIN_NUM_HD   VSPI_IOMUX_PIN_NUM_HD
48 
49 //Following Macros are deprecated. Please use the Macros above
50 #define HSPI_FUNC_NUM           1
51 #define HSPI_IOMUX_PIN_NUM_MISO 12
52 #define HSPI_IOMUX_PIN_NUM_MOSI 13
53 #define HSPI_IOMUX_PIN_NUM_CLK  14
54 #define HSPI_IOMUX_PIN_NUM_CS   15
55 #define HSPI_IOMUX_PIN_NUM_WP   2
56 #define HSPI_IOMUX_PIN_NUM_HD   4
57 
58 #define VSPI_FUNC_NUM           1
59 #define VSPI_IOMUX_PIN_NUM_MISO 19
60 #define VSPI_IOMUX_PIN_NUM_MOSI 23
61 #define VSPI_IOMUX_PIN_NUM_CLK  18
62 #define VSPI_IOMUX_PIN_NUM_CS   5
63 #define VSPI_IOMUX_PIN_NUM_WP   22
64 #define VSPI_IOMUX_PIN_NUM_HD   21
65