1 /*
2  * Copyright 2021-2022 NXP
3  * All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 #include "wifi_bt_config.h"
9 #include "pin_mux.h"
10 #include "fsl_gpio.h"
11 
12 /*******************************************************************************
13  * Definitions
14  ******************************************************************************/
15 #ifdef WIFI_BT_USE_M2_INTERFACE
16 #warning "M.2 interface is not supported on this board"
17 #endif
18 
19 /*******************************************************************************
20  * Prototypes
21  ******************************************************************************/
22 
23 /*******************************************************************************
24  * Variables
25  ******************************************************************************/
26 
27 /*******************************************************************************
28  * Code
29  ******************************************************************************/
30 
BOARD_WIFI_BT_Enable(bool enable)31 void BOARD_WIFI_BT_Enable(bool enable)
32 {
33     if (enable)
34     {
35         /* Enable module */
36         /* Enable power supply for SD */
37         GPIO_PinWrite(BOARD_SDMMC_SD_POWER_RESET_GPIO_BASE, BOARD_SDMMC_SD_POWER_RESET_GPIO_PIN, 1);
38     }
39     else
40     {
41         /* Disable module */
42         /* Disable power supply for SD */
43         GPIO_PinWrite(BOARD_SDMMC_SD_POWER_RESET_GPIO_BASE, BOARD_SDMMC_SD_POWER_RESET_GPIO_PIN, 0);
44     }
45     vTaskDelay(pdMS_TO_TICKS(100));
46 }
47 
BOARD_WIFI_BT_Config(void * card,sdio_int_t cardInt)48 void BOARD_WIFI_BT_Config(void *card, sdio_int_t cardInt)
49 {
50     BOARD_SDIO_Config(card, NULL, BOARD_SDMMC_SDIO_HOST_IRQ_PRIORITY, cardInt);
51     BOARD_WIFI_BT_Enable(false);
52 }
53