1 /***************************************************************************//** 2 * \file cyhal_pdmpcm_impl.h 3 * 4 * Description: 5 * Provides a high level interface for interacting with the Infineon PDM/PCM converted. 6 * 7 ******************************************************************************** 8 * \copyright 9 * Copyright 2019-2021 Cypress Semiconductor Corporation (an Infineon company) or 10 * an affiliate of Cypress Semiconductor Corporation 11 * 12 * SPDX-License-Identifier: Apache-2.0 13 * 14 * Licensed under the Apache License, Version 2.0 (the "License"); 15 * you may not use this file except in compliance with the License. 16 * You may obtain a copy of the License at 17 * 18 * http://www.apache.org/licenses/LICENSE-2.0 19 * 20 * Unless required by applicable law or agreed to in writing, software 21 * distributed under the License is distributed on an "AS IS" BASIS, 22 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 * See the License for the specific language governing permissions and 24 * limitations under the License. 25 *******************************************************************************/ 26 27 #pragma once 28 29 #include "cyhal_hw_resources.h" 30 31 #if (CYHAL_DRIVER_AVAILABLE_PDMPCM) 32 33 #if defined(__cplusplus) 34 extern "C" { 35 #endif /* __cplusplus */ 36 37 #if defined(CY_IP_MXAUDIOSS_INSTANCES) 38 /** The PGA gain in units of 0.5 dB (-12 dB) */ 39 #define CYHAL_PDM_PCM_MIN_GAIN -24 40 /** The PGA gain in units of 0.5 dB (10.5 dB) */ 41 #define CYHAL_PDM_PCM_MAX_GAIN 21 42 #elif defined(CY_IP_MXTDM) 43 /** The PGA gain in units of 0.5 dB (-103.5) */ 44 #define CYHAL_PDM_PCM_MIN_GAIN -207 45 /** The PGA gain in units of 0.5 dB (82.5) */ 46 #define CYHAL_PDM_PCM_MAX_GAIN 165 47 #endif 48 /** The rate of which PCM data is generated. This value is halved for mono channel. */ 49 #define CYHAL_PDM_PCM_MAX_SAMPLE_RATE 48000 50 #if defined(__cplusplus) 51 } 52 #endif /* __cplusplus */ 53 54 #endif /* CYHAL_DRIVER_AVAILABLE_PDMPCM */ 55