1 // Copyright 2015-2018 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 #ifndef _DRIVER_PERIPH_CTRL_H_ 16 #define _DRIVER_PERIPH_CTRL_H_ 17 18 #include "soc/periph_defs.h" 19 20 #ifdef __cplusplus 21 extern "C" { 22 #endif 23 24 /** 25 * @brief enable peripheral module 26 * 27 * @param[in] periph : Peripheral module name 28 * 29 * Clock for the module will be ungated, and reset de-asserted. 30 * 31 * @note If periph_module_enable is called a number of times, 32 * periph_module_disable has to be called the same number of times 33 * in order to put the peripheral into disabled state. 34 * 35 * @return NULL 36 * 37 */ 38 void periph_module_enable(periph_module_t periph); 39 40 /** 41 * @brief disable peripheral module 42 * 43 * @param[in] periph : Peripheral module name 44 * 45 * Clock for the module will be gated, reset asserted. 46 * 47 * @note If periph_module_enable is called a number of times, 48 * periph_module_disable has to be called the same number of times 49 * in order to put the peripheral into disabled state. 50 * 51 * @return NULL 52 * 53 */ 54 void periph_module_disable(periph_module_t periph); 55 56 /** 57 * @brief reset peripheral module 58 * 59 * @param[in] periph : Peripheral module name 60 * 61 * Reset will asserted then de-assrted for the peripheral. 62 * 63 * Calling this function does not enable or disable the clock for the module. 64 * 65 * @return NULL 66 * 67 */ 68 void periph_module_reset(periph_module_t periph); 69 70 /** 71 * @brief enable wifi bt common module 72 * 73 * @note If wifi_bt_common_module_enable is called a number of times, 74 * wifi_bt_common_module_disable has to be called the same number of times 75 * in order to put the peripheral into disabled state. 76 * 77 * @return NULL 78 * 79 */ 80 void wifi_bt_common_module_enable(void); 81 82 /** 83 * @brief disable wifi bt common module 84 * 85 * @note If wifi_bt_common_module_enable is called a number of times, 86 * wifi_bt_common_module_disable has to be called the same number of times 87 * in order to put the peripheral into disabled state. 88 * 89 * @return NULL 90 * 91 */ 92 void wifi_bt_common_module_disable(void); 93 94 /** 95 * @brief enable wifi module 96 * 97 * @note Enable wifi module only. 98 * 99 * @return NULL 100 * 101 */ 102 void wifi_module_enable(void); 103 104 /** 105 * @brief disable wifi module 106 * 107 * @note Disable wifi module only. 108 * 109 * @return NULL 110 * 111 */ 112 void wifi_module_disable(void); 113 #ifdef __cplusplus 114 } 115 #endif 116 117 #endif /* _DRIVER_PERIPH_CTRL_H_ */ 118