1 /* 2 * Copyright (c) 2022 Winner Microelectronics Co., Ltd. All rights reserved. 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 16 #ifndef __WM_PSRAM_H__ 17 #define __WM_PSRAM_H__ 18 19 #define PSRAM_ADDR_START 0x30000000 20 #define PSRAM_SIZE_BYTE 0x00800000 21 22 typedef enum { 23 PSRAM_SPI = 0, 24 PSRAM_QPI, 25 } psram_mode_t; 26 /** 27 * @defgroup Driver_APIs Driver APIs 28 * @brief Driver APIs 29 */ 30 31 /** 32 * @addtogroup Driver_APIs 33 * @{ 34 */ 35 36 /** 37 * @defgroup PSRAM_Driver_APIs PSRAM Driver APIs 38 * @brief PSRAM driver APIs 39 */ 40 41 /** 42 * @addtogroup PSRAM_Driver_APIs 43 * @{ 44 */ 45 46 /** 47 * @brief This function is used to init the psram . 48 * 49 * @param[in] mode is work mode, PSRAM_SPI or PSRAM_QPI 50 * 51 * @retval none 52 * 53 * @note None 54 */ 55 void psram_init(psram_mode_t mode); 56 57 /** 58 * @brief This function is used to Copy block of memory in dma mode . 59 * 60 * @param[in] src Pointer to the source of data to be copied 61 * @param[in] dst Pointer to the destination array where the content is to be copied 62 * @param[in] num Number of bytes to copy 63 * 64 * @retval num Number of bytes that's been copied 65 * 66 * @note None 67 */ 68 int memcpy_dma(unsigned char *dst, unsigned char *src, int num); 69 /** 70 * @} 71 */ 72 73 /** 74 * @} 75 */ 76 #endif 77 78