SmartSnippets DA1459x SDK
Data Structures | Macros | Enumerations | Functions

Definition of API for the PDM Low Level Driver. More...

#include "sdk_defs.h"
#include "hw_src.h"

Go to the source code of this file.

Data Structures

struct  hw_pdm_config_t
 PDM interface mode configuration. More...
 

Macros

#define HW_PDM_CRG_REG_FIELD_MASK(reg, field)   REG_MSK(CRG_AUD, PDM_##reg##_REG, field)
 Get the mask of a field of a PDM register of CRG. More...
 
#define HW_PDM_CRG_REG_FIELD_POS(reg, field)   REG_POS(CRG_AUD, PDM_##reg##_REG, field)
 Get the bit position of a field of a PDM register of CRG. More...
 
#define HW_PDM_CRG_REG_GETF(reg, field)   REG_GETF(CRG_AUD, PDM_##reg##_REG, field)
 Get the value of a field of a PDM register. More...
 
#define HW_PDM_CRG_REG_SETF(reg, field, val)   REG_SETF(CRG_AUD, PDM_##reg##_REG, field, val)
 Set the value of a field of a PDM register. More...
 
#define HW_PDM_CRG_REG_SET_BIT(reg, field)   REG_SET_BIT(CRG_AUD, PDM_##reg##_REG, field)
 Set a bit of a PDM register. More...
 
#define HW_PDM_CRG_REG_CLR_BIT(reg, field)   REG_CLR_BIT(CRG_AUD, PDM_##reg##_REG, field)
 Clear a bit of a PDM register. More...
 
#define HW_PDM_SRC_REG_GETF(id, reg, field)   HW_SRC_REG_GETF(id, SRC1, reg##_REG, field)
 Get the value of a field of a PDM register. More...
 
#define HW_PDM_SRC_REG_SETF(id, reg, field, val)   HW_SRC_REG_SETF(id, SRC1, reg##_REG, field, val)
 Set the value of a field of a PDM register. More...
 
#define HW_PDM_SRC_REG_SET_BIT(id, reg, field)   HW_SRC_REG_SET_BIT(id, SRC1, reg##_REG, field)
 Set a bit of a PDM register. More...
 
#define HW_PDM_SRC_REG_CLR_BIT(id, reg, field)   HW_SRC_REG_CLR_BIT(id, SRC1, reg##_REG, field)
 Clear a bit of a PDM register. More...
 

Enumerations

enum  HW_PDM_DATA_DIRECTION
 PDM data direction. More...
 
enum  HW_PDM_MODE { HW_PDM_SLAVE_MODE = 0, HW_PDM_MASTER_MODE }
 PDM Master/Slave mode. More...
 
enum  HW_PDM_DI_DELAY { HW_PDM_DI_NO_DELAY = 0, HW_PDM_DI_4_NS_DELAY, HW_PDM_DI_8_NS_DELAY, HW_PDM_DI_12_NS_DELAY }
 PDM input delay. More...
 
enum  HW_PDM_DO_DELAY { HW_PDM_DO_NO_DELAY = 0, HW_PDM_DO_8_NS_DELAY, HW_PDM_DO_12_NS_DELAY, HW_PDM_DO_16_NS_DELAY }
 PDM output delay. More...
 
enum  HW_PDM_CHANNEL_CONFIG { HW_PDM_CHANNEL_NONE = 0, HW_PDM_CHANNEL_R, HW_PDM_CHANNEL_L, HW_PDM_CHANNEL_LR }
 PDM output channel configuration. More...
 
enum  HW_PDM_MUX_OUT { HW_PDM_MUX_OUT_SRC1, HW_PDM_MUX_OUT_SRC2 }
 PDM output multiplexer. More...
 

Functions

__STATIC_INLINE HW_PDM_DI_DELAY hw_pdm_get_input_delay (HW_SRC_ID id)
 Get input delay in PDM interface. More...
 
__STATIC_INLINE HW_PDM_DO_DELAY hw_pdm_get_output_delay (HW_SRC_ID id)
 Get output delay in PDM interface. More...
 
__STATIC_INLINE HW_PDM_CHANNEL_CONFIG hw_pdm_get_output_channel_config (HW_SRC_ID id)
 Get PDM output channel configuration. More...
 
__STATIC_INLINE HW_PDM_MODE hw_pdm_get_mode (void)
 Get PDM Master/Slave mode. More...
 
__STATIC_INLINE bool hw_pdm_get_status (void)
 Get PDM status. Supported only for Master mode. More...
 
__STATIC_INLINE uint8_t hw_pdm_get_clk_div (void)
 Get PDM clock divider. More...
 
__STATIC_INLINE bool hw_pdm_get_in_channel_swap (HW_SRC_ID id)
 Get the status of swap of the channels on the PDM input source. More...
 
__STATIC_INLINE bool hw_pdm_get_out_channel_swap (HW_SRC_ID id)
 Get the status of swap of the channels on the PDM output source. More...
 
__STATIC_INLINE void hw_pdm_enable (void)
 Enable PDM block system clock source used only for Master mode. More...
 
__STATIC_INLINE void hw_pdm_disable (void)
 Disable PDM block system clock source. More...
 
__STATIC_INLINE void hw_pdm_set_input_delay (HW_SRC_ID id, HW_PDM_DI_DELAY delay)
 Set input delay in PDM interface. More...
 
__STATIC_INLINE void hw_pdm_set_output_delay (HW_SRC_ID id, HW_PDM_DO_DELAY delay)
 Set output delay in PDM interface. More...
 
__STATIC_INLINE void hw_pdm_set_output_channel_config (HW_SRC_ID id, HW_PDM_CHANNEL_CONFIG channel_conf)
 Set PDM output channel configuration applicable only for SRC1, APU. More...
 
__STATIC_INLINE void hw_pdm_set_mode (HW_PDM_MODE mode)
 Set PDM Master/Slave mode. More...
 
__STATIC_INLINE void hw_pdm_set_in_channel_swap (HW_SRC_ID id, bool swap)
 Swap left and right channel on the PDM input source. More...
 
__STATIC_INLINE void hw_pdm_set_out_channel_swap (HW_SRC_ID id, bool swap)
 Swap left and right channel on the PDM output source. More...
 
__STATIC_INLINE void hw_pdm_set_pdm_output_mux (HW_PDM_MUX_OUT output)
 Set output for the PDM_MUX_OUT multiplexer. More...
 
__STATIC_INLINE HW_PDM_MUX_OUT hw_pdm_get_pdm_output_mux (void)
 Get output for the PDM_MUX_OUT multiplexer. More...
 
uint32_t hw_pdm_clk_init (uint32_t frequency)
 Initialize PDM clock. More...
 
void hw_pdm_init (HW_SRC_ID id, hw_pdm_config_t *config)
 Initialize PDM interface. More...
 

Detailed Description

Definition of API for the PDM Low Level Driver.

Copyright (C) 2019-2023 Renesas Electronics Corporation and/or its affiliates. All rights reserved. Confidential Information.

This software ("Software") is supplied by Renesas Electronics Corporation and/or its affiliates ("Renesas"). Renesas grants you a personal, non-exclusive, non-transferable, revocable, non-sub-licensable right and license to use the Software, solely if used in or together with Renesas products. You may make copies of this Software, provided this copyright notice and disclaimer ("Notice") is included in all such copies. Renesas reserves the right to change or discontinue the Software at any time without notice.

THE SOFTWARE IS PROVIDED "AS IS". RENESAS DISCLAIMS ALL WARRANTIES OF ANY KIND, WHETHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. TO THE MAXIMUM EXTENT PERMITTED UNDER LAW, IN NO EVENT SHALL RENESAS BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE, EVEN IF RENESAS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. USE OF THIS SOFTWARE MAY BE SUBJECT TO TERMS AND CONDITIONS CONTAINED IN AN ADDITIONAL AGREEMENT BETWEEN YOU AND RENESAS. IN CASE OF CONFLICT BETWEEN THE TERMS OF THIS NOTICE AND ANY SUCH ADDITIONAL LICENSE AGREEMENT, THE TERMS OF THE AGREEMENT SHALL TAKE PRECEDENCE. BY CONTINUING TO USE THIS SOFTWARE, YOU AGREE TO THE TERMS OF THIS NOTICE.IF YOU DO NOT AGREE TO THESE TERMS, YOU ARE NOT PERMITTED TO USE THIS SOFTWARE.