1 // Copyright (C) 2022 Beken Corporation 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 #pragma once 16 17 //#include <driver/qspi_types.h> 18 19 #ifdef __cplusplus 20 extern "C" { 21 #endif 22 23 /* @brief Overview about this API header 24 * 25 */ 26 27 /** 28 * @brief psram API 29 * @defgroup bk_api_psram PSRAM API group 30 * @{ 31 */ 32 33 /** 34 * @brief Init the PSRAM driver 35 * 36 * This API init the resoure common to PSRAM: 37 * - Init PSRAM driver control register 38 * - Configure PSRAM Clock and voltage selection 39 * 40 * This API should be called before any other use PSRAM. 41 * 42 * @return 43 * - BK_OK: succeed 44 * - others: other errors. 45 */ 46 bk_err_t bk_psram_driver_init(void); 47 48 /** 49 * @brief Deinit the PSRAM driver 50 * 51 * This API free the resoure common to PSRAM: 52 * - Init PSRAM driver control register 53 * - power down PSRAM voltage 54 * 55 * 56 * @return 57 * - BK_OK: succeed 58 * - others: other errors. 59 */ 60 bk_err_t bk_psram_driver_deinit(void); 61 62 /** 63 * @brief Init the PSRAM HW 64 * 65 * This API init the resoure common to all PSRAM: 66 * - Configure the clock control register 67 * - Select a frequency multiple 68 * - Flash clock select 69 * - Enable the clock 70 * 71 * This API should be called before any other PSRAM APIs. 72 * 73 * @return 74 * - BK_OK: succeed 75 * - others: other errors. 76 */ 77 bk_err_t bk_psram_init(void); 78 79 /** 80 * @brief Deinit the PSRAM HW 81 * 82 * This API free the resoure common to PSRAM: 83 * - Init PSRAM HW control register 84 * - power down PSRAM voltage 85 * 86 * 87 * @return 88 * - BK_OK: succeed 89 * - others: other errors. 90 */ 91 bk_err_t bk_psram_deinit(void); 92 93 /** 94 * @} 95 */ 96 #ifdef __cplusplus 97 } 98 #endif 99 100