1 /** 2 * @file hpb.h 3 * @brief HyperBus (HPB) function prototypes and data types. 4 */ 5 6 /****************************************************************************** 7 * 8 * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by 9 * Analog Devices, Inc.), 10 * Copyright (C) 2023-2024 Analog Devices, Inc. 11 * 12 * Licensed under the Apache License, Version 2.0 (the "License"); 13 * you may not use this file except in compliance with the License. 14 * You may obtain a copy of the License at 15 * 16 * http://www.apache.org/licenses/LICENSE-2.0 17 * 18 * Unless required by applicable law or agreed to in writing, software 19 * distributed under the License is distributed on an "AS IS" BASIS, 20 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 * See the License for the specific language governing permissions and 22 * limitations under the License. 23 * 24 ******************************************************************************/ 25 26 /* Define to prevent redundant inclusion */ 27 #ifndef LIBRARIES_PERIPHDRIVERS_SOURCE_HPB_HPB_REVA_H_ 28 #define LIBRARIES_PERIPHDRIVERS_SOURCE_HPB_HPB_REVA_H_ 29 30 /* **** Includes **** */ 31 #include "hpb_reva_regs.h" 32 #include "hpb.h" 33 #include "mxc_sys.h" 34 35 #ifdef __cplusplus 36 extern "C" { 37 #endif 38 39 /* **** Definitions **** */ 40 typedef enum { 41 MXC_HPB_REVA_DEV_HYPER_FLASH = MXC_V_HPB_REVA_MEMCTRL_DEVTYPE_HYPERFLASH, 42 MXC_HPB_REVA_DEV_XCCELA_PSRAM = MXC_V_HPB_REVA_MEMCTRL_DEVTYPE_XCCELA_PSRAM, 43 MXC_HPB_REVA_DEV_HYPER_RAM = MXC_V_HPB_REVA_MEMCTRL_DEVTYPE_HYPERRAM, 44 } mxc_hpb_reva_device_t; 45 46 /* **** Function Prototypes **** */ 47 void MXC_HPB_RevA_RegRead8(mxc_hpb_reva_regs_t *hpb, mxc_hpb_cfg_reg_val_t *cfg_reg_val, 48 uint32_t base_addr, unsigned int index); 49 void MXC_HPB_RevA_RegWrite8(mxc_hpb_reva_regs_t *hpb, mxc_hpb_cfg_reg_val_t *cfg_reg_val, 50 uint32_t base_addr, unsigned int index); 51 void MXC_HPB_RevA_RegRead16(mxc_hpb_reva_regs_t *hpb, mxc_hpb_cfg_reg_val_t *cfg_reg_val, 52 uint32_t base_addr, unsigned int index); 53 void MXC_HPB_RevA_RegWrite16(mxc_hpb_reva_regs_t *hpb, mxc_hpb_cfg_reg_val_t *cfg_reg_val, 54 uint32_t base_addr, unsigned int index); 55 int MXC_HPB_RevA_Init(mxc_hpb_reva_regs_t *hpb, mxc_hpb_mem_config_t *mem0, 56 mxc_hpb_mem_config_t *mem1); 57 uint32_t MXC_HPB_RevA_GetStatus(mxc_hpb_reva_regs_t *hpb); 58 void MXC_HPB_RevA_EnableInt(mxc_hpb_reva_regs_t *hpb, unsigned polarity); 59 unsigned MXC_HPB_RevA_GetFlag(mxc_hpb_reva_regs_t *hpb); 60 61 #ifdef __cplusplus 62 } 63 #endif 64 65 #endif // LIBRARIES_PERIPHDRIVERS_SOURCE_HPB_HPB_REVA_H_ 66