sdio_slave_periph.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright 2015-2020 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. #include <stdint.h>
  15. #include "soc/sdio_slave_periph.h"
  16. #include "soc/gpio_periph.h"
  17. // I/O slot of sdio slave:
  18. // 0: GPIO 6, 11, 7, 8, 9, 10,
  19. // 1: GPIO 14, 15, 2, 4, 12, 13 for CLK, CMD, D0, D1, D2, D3 respectively.
  20. // only one peripheral for SDIO and only one slot can work at the same time.
  21. // currently slot 0 is occupied by SPI for flash
  22. const sdio_slave_slot_info_t sdio_slave_slot_info[2] = {
  23. {
  24. .clk_gpio = SDIO_SLAVE_SLOT0_IOMUX_PIN_NUM_CLK,
  25. .cmd_gpio = SDIO_SLAVE_SLOT0_IOMUX_PIN_NUM_CMD,
  26. .d0_gpio = SDIO_SLAVE_SLOT0_IOMUX_PIN_NUM_D0,
  27. .d1_gpio = SDIO_SLAVE_SLOT0_IOMUX_PIN_NUM_D1,
  28. .d2_gpio = SDIO_SLAVE_SLOT0_IOMUX_PIN_NUM_D2,
  29. .d3_gpio = SDIO_SLAVE_SLOT0_IOMUX_PIN_NUM_D3,
  30. .func = SDIO_SLAVE_SLOT0_FUNC,
  31. }, {
  32. .clk_gpio = SDIO_SLAVE_SLOT1_IOMUX_PIN_NUM_CLK,
  33. .cmd_gpio = SDIO_SLAVE_SLOT1_IOMUX_PIN_NUM_CMD,
  34. .d0_gpio = SDIO_SLAVE_SLOT1_IOMUX_PIN_NUM_D0,
  35. .d1_gpio = SDIO_SLAVE_SLOT1_IOMUX_PIN_NUM_D1,
  36. .d2_gpio = SDIO_SLAVE_SLOT1_IOMUX_PIN_NUM_D2,
  37. .d3_gpio = SDIO_SLAVE_SLOT1_IOMUX_PIN_NUM_D3,
  38. .func = SDIO_SLAVE_SLOT1_FUNC,
  39. },
  40. };