1 /****************************************************************************** 2 * 3 * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by 4 * Analog Devices, Inc.), 5 * Copyright (C) 2023-2024 Analog Devices, Inc. 6 * 7 * Licensed under the Apache License, Version 2.0 (the "License"); 8 * you may not use this file except in compliance with the License. 9 * You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, software 14 * distributed under the License is distributed on an "AS IS" BASIS, 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 * See the License for the specific language governing permissions and 17 * limitations under the License. 18 * 19 ******************************************************************************/ 20 21 #ifndef LIBRARIES_PERIPHDRIVERS_SOURCE_OWM_OWM_REVA_H_ 22 #define LIBRARIES_PERIPHDRIVERS_SOURCE_OWM_OWM_REVA_H_ 23 24 /* **** Includes **** */ 25 #include "owm.h" 26 #include "mxc_device.h" 27 #include "mxc_assert.h" 28 #include "owm_reva_regs.h" 29 #include "owm_regs.h" 30 31 /* **** Definitions **** */ 32 33 /* **** Globals **** */ 34 35 /* **** Functions **** */ 36 37 /* ************************************************************************* */ 38 int MXC_OWM_RevA_Init(mxc_owm_reva_regs_t *owm, const mxc_owm_cfg_t *cfg); 39 void MXC_OWM_RevA_Shutdown(mxc_owm_reva_regs_t *owm); 40 int MXC_OWM_RevA_Reset(mxc_owm_reva_regs_t *owm); 41 int MXC_OWM_RevA_TouchByte(mxc_owm_reva_regs_t *owm, uint8_t data); 42 int MXC_OWM_RevA_WriteByte(uint8_t data); 43 int MXC_OWM_RevA_ReadByte(void); 44 int MXC_OWM_RevA_TouchBit(mxc_owm_reva_regs_t *owm, uint8_t bit); 45 int MXC_OWM_RevA_WriteBit(uint8_t bit); 46 int MXC_OWM_RevA_ReadBit(void); 47 int MXC_OWM_RevA_Write(mxc_owm_reva_regs_t *owm, uint8_t *data, int len); 48 int MXC_OWM_RevA_Read(mxc_owm_reva_regs_t *owm, uint8_t *data, int len); 49 int MXC_OWM_RevA_ReadROM(uint8_t *ROMCode); 50 int MXC_OWM_RevA_MatchROM(uint8_t *ROMCode); 51 int MXC_OWM_RevA_ODMatchROM(mxc_owm_reva_regs_t *owm, uint8_t *ROMCode); 52 int MXC_OWM_RevA_SkipROM(void); 53 int MXC_OWM_RevA_ODSkipROM(mxc_owm_reva_regs_t *owm); 54 int MXC_OWM_RevA_Resume(void); 55 int MXC_OWM_RevA_SearchROM(mxc_owm_reva_regs_t *owm, int newSearch, uint8_t *ROMCode); 56 void MXC_OWM_RevA_ClearFlags(mxc_owm_reva_regs_t *owm, uint32_t mask); 57 unsigned MXC_OWM_RevA_GetFlags(mxc_owm_reva_regs_t *owm); 58 void MXC_OWM_RevA_SetExtPullup(mxc_owm_reva_regs_t *owm, int enable); 59 void MXC_OWM_RevA_SetOverdrive(mxc_owm_reva_regs_t *owm, int enable); 60 void MXC_OWM_RevA_EnableInt(mxc_owm_reva_regs_t *owm, int flags); 61 void MXC_OWM_RevA_DisableInt(mxc_owm_reva_regs_t *owm, int flags); 62 int MXC_OWM_RevA_SetForcePresenceDetect(mxc_owm_reva_regs_t *owm, int enable); 63 int MXC_OWM_RevA_SetInternalPullup(mxc_owm_reva_regs_t *owm, int enable); 64 int MXC_OWM_RevA_SetExternalPullup(mxc_owm_reva_regs_t *owm, mxc_owm_ext_pu_t ext_pu_mode); 65 int MXC_OWM_RevA_SystemClockUpdated(mxc_owm_reva_regs_t *owm); 66 int MXC_OWM_RevA_SetSearchROMAccelerator(mxc_owm_reva_regs_t *owm, int enable); 67 int MXC_OWM_RevA_BitBang_Init(mxc_owm_reva_regs_t *owm, int initialState); 68 int MXC_OWM_RevA_BitBang_Read(mxc_owm_reva_regs_t *owm); 69 int MXC_OWM_RevA_BitBang_Write(mxc_owm_reva_regs_t *owm, int state); 70 int MXC_OWM_RevA_BitBang_Disable(mxc_owm_reva_regs_t *owm); 71 72 #endif // LIBRARIES_PERIPHDRIVERS_SOURCE_OWM_OWM_REVA_H_ 73