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 "fsl_gpio.h"
10 
11 /*******************************************************************************
12  * Definitions
13  ******************************************************************************/
14 #ifdef WIFI_BT_USE_M2_INTERFACE
15 #warning "M.2 interface is not supported on this board"
16 #endif
17 
18 /*******************************************************************************
19  * Prototypes
20  ******************************************************************************/
21 
22 /*******************************************************************************
23  * Variables
24  ******************************************************************************/
25 
26 /*******************************************************************************
27  * Code
28  ******************************************************************************/
29 
BOARD_WIFI_BT_Enable(bool enable)30 void BOARD_WIFI_BT_Enable(bool enable)
31 {
32     if (enable)
33     {
34         /* Enable module */
35         /* Enable power supply for SD */
36         GPIO_PinWrite(BOARD_SDMMC_SD_POWER_RESET_GPIO_BASE, BOARD_SDMMC_SD_POWER_RESET_GPIO_PIN, 1);
37     }
38     else
39     {
40         /* Disable module */
41         /* Disable power supply for SD */
42         GPIO_PinWrite(BOARD_SDMMC_SD_POWER_RESET_GPIO_BASE, BOARD_SDMMC_SD_POWER_RESET_GPIO_PIN, 0);
43     }
44     vTaskDelay(pdMS_TO_TICKS(100));
45 }
46 
BOARD_WIFI_BT_Config(void * card,sdio_int_t cardInt)47 void BOARD_WIFI_BT_Config(void *card, sdio_int_t cardInt)
48 {
49     BOARD_SDIO_Config(card, NULL, BOARD_SDMMC_SDIO_HOST_IRQ_PRIORITY, cardInt);
50     BOARD_WIFI_BT_Enable(false);
51 }
52