component/bt: clean up WIFI_CLK_EN_REG settings for Bluetooth

1. move settings of WIFI_CLK_EN_REG for bluetooth into controller init/deinit APIs
2. modify the bit mask used in phy_rf init/deinit to use WIFI-BT shared bits
This commit is contained in:
wangmengyang
2017-11-01 17:05:38 +08:00
parent da178e446d
commit bd6394db92
6 changed files with 23 additions and 3 deletions

View File

@@ -106,6 +106,10 @@ static uint32_t get_clk_en_mask(periph_module_t periph)
return DPORT_CAN_CLK_EN;
case PERIPH_EMAC_MODULE:
return DPORT_WIFI_CLK_EMAC_EN;
case PERIPH_BT_MODULE:
return DPORT_WIFI_CLK_BT_EN_M;
case PERIPH_WIFI_BT_COMMON_MODULE:
return DPORT_WIFI_CLK_WIFI_BT_COMMON_M;
default:
return 0;
}
@@ -166,6 +170,9 @@ static uint32_t get_rst_en_mask(periph_module_t periph)
return DPORT_CAN_RST;
case PERIPH_EMAC_MODULE:
return DPORT_WIFI_CLK_EMAC_EN;
case PERIPH_BT_MODULE:
case PERIPH_WIFI_BT_COMMON_MODULE:
return 0;
default:
return 0;
}
@@ -179,6 +186,8 @@ static bool is_wifi_clk_peripheral(periph_module_t periph)
case PERIPH_SDMMC_MODULE:
case PERIPH_SDIO_SLAVE_MODULE:
case PERIPH_EMAC_MODULE:
case PERIPH_BT_MODULE:
case PERIPH_WIFI_BT_COMMON_MODULE:
return true;
default:
return false;