SmartSnippets DA1459x SDK
Data Structures | Macros | Typedefs | Enumerations | Functions

Definition of API for the PCM interface Low Level Driver. More...

#include "sdk_defs.h"

Go to the source code of this file.

Data Structures

struct  hw_pcm_config_generic_pcm_t
 PCM configuration in PCM mode. More...
 
struct  hw_pcm_config_i2s_mode_t
 PCM configuration in I2S mode. More...
 
struct  hw_pcm_config_tdm_mode_t
 PCM configuration in TDM mode. More...
 
struct  hw_pcm_config_iom_mode_t
 PCM configuration in IOM2 mode. More...
 
struct  hw_pcm_config_t
 PCM interface mode configuration. More...
 
struct  hw_pcm_clk_cfg_t
 PCM interface clock configuration. More...
 

Macros

#define HW_PCM_CRG_REG_GETF(reg, field)   REG_GETF(CRG_AUD, PCM_##reg##_REG, field)
 Get the value of a field of a PCM register of CRG. More...
 
#define HW_PCM_CRG_REG_SETF(reg, field, val)   REG_SETF(CRG_AUD, PCM_##reg##_REG, field, val)
 Set the value of a field of a PCM register of CRG. More...
 
#define HW_PCM_CRG_REG_SET_BIT(reg, field)   REG_SET_BIT(CRG_AUD, PCM_##reg##_REG, field)
 Set a bit of a PCM register of CRG. More...
 
#define HW_PCM_CRG_REG_CLR_BIT(reg, field)   REG_CLR_BIT(CRG_AUD, PCM_##reg##_REG, field)
 Clear a bit of a PCM register of CRG. More...
 
#define HW_PCM_SRC_REG_GETF(reg, field)   REG_GETF(PCM1, PCM1_##reg##_REG, field)
 Get the value of a field of a PCM register of SRC. More...
 
#define HW_PCM_SRC_REG_SETF(reg, field, val)   REG_SETF(PCM1, PCM1_##reg##_REG, field, val)
 Set the value of a field of a PCM register of SRC. More...
 
#define HW_PCM_SRC_REG_SET_BIT(reg, field)   REG_SET_BIT(PCM1, PCM1_##reg##_REG, field)
 Set a bit of a PCM register of SRC. More...
 
#define HW_PCM_SRC_REG_CLR_BIT(reg, field)   REG_CLR_BIT(PCM1, PCM1_##reg##_REG, field)
 Clear a bit of a PCM register of SRC. More...
 

Typedefs

typedef void(* hw_pcm_interrupt_cb_t) (void)
 Application-defined callback type for the PCM interrupt. More...
 

Enumerations

enum  HW_PCM_ERROR_CODE {
  HW_PCM_ERROR_NO_ERROR, HW_PCM_ERROR_INVALID_SAMPLE_RATE, HW_PCM_ERROR_INVALID_BIT_DEPTH, HW_PCM_ERROR_INVALID_CHANNELS,
  HW_PCM_ERROR_INVALID_CHANNEL_DELAYS, HW_PCM_ERROR_INVALID_SLOTS, HW_PCM_ERROR_INVALID_FSC_DIV, HW_PCM_ERROR_NA_DIV
}
 PCM error code. More...
 
enum  HW_PCM_MODE { HW_PCM_MODE_SLAVE, HW_PCM_MODE_MASTER }
 PCM master/slave mode. More...
 
enum  HW_PCM_CLOCK { HW_PCM_CLK_DIVN, HW_PCM_CLK_DIV1 }
 PCM system clock source. More...
 
enum  HW_PCM_CLK_GENERATION { HW_PCM_CLK_GEN_FRACTIONAL = 0, HW_PCM_CLK_GEN_INTEGER_ONLY }
 PCM clock generation. More...
 
enum  HW_PCM_CYCLE_PER_BIT { HW_PCM_ONE_CYCLE_PER_BIT = 0, HW_PCM_TWO_CYCLE_PER_BIT }
 PCM clock cycles per bit. More...
 
enum  HW_PCM_DO_OUTPUT_MODE { HW_PCM_DO_OUTPUT_PUSH_PULL = 0, HW_PCM_DO_OUTPUT_OPEN_DRAIN }
 PCM DO output mode. More...
 
enum  HW_PCM_FSC_EDGE { HW_PCM_FSC_EDGE_RISING = 0, HW_PCM_FSC_EDGE_RISING_AND_FALLING }
 PCM FSC edge. More...
 
enum  HW_PCM_FSC_DELAY { HW_PCM_FSC_STARTS_1_CYCLE_BEFORE_MSB_BIT = 0, HW_PCM_FSC_STARTS_SYNCH_TO_MSB_BIT }
 PCM FSC delay. More...
 
enum  HW_PCM_INPUT { HW_PCM_INPUT_REG_1, HW_PCM_INPUT_REG_2 }
 PCM input register. More...
 
enum  HW_PCM_OUTPUT { HW_PCM_OUTPUT_REG_1, HW_PCM_OUTPUT_REG_2 }
 PCM output register. More...
 
enum  HW_PCM_INPUT_MUX {
  HW_PCM_INPUT_MUX_OFF, HW_PCM_INPUT_MUX_SRC1_OUT, HW_PCM_INPUT_MUX_SRC_OUT = HW_PCM_INPUT_MUX_SRC1_OUT, HW_PCM_INPUT_MUX_PCM_OUT_REG,
  HW_PCM_INPUT_MUX_SRC2_OUT
}
 PCM input multiplexer. More...
 
enum  HW_PCM_CLK_POLARITY { HW_PCM_CLK_POLARITY_NORMAL = 0, HW_PCM_CLK_POLARITY_INVERTED }
 PCM clock polarity. More...
 
enum  HW_PCM_FSC_POLARITY { HW_PCM_FSC_POLARITY_NORMAL = 0, HW_PCM_FSC_POLARITY_INVERTED }
 PCM FSC polarity. More...
 
enum  HW_PCM_CONFIG_MODE
 PCM interface modes.
 

Functions

__STATIC_INLINE void hw_pcm_clk_enable (void)
 Enable the PCM interface clock source.
 
__STATIC_INLINE void hw_pcm_clk_disable (void)
 Disable the PCM interface clock source.
 
__STATIC_INLINE bool hw_pcm_clk_is_enabled (void)
 Get the status of the PCM interface clock source. More...
 
__STATIC_INLINE void hw_pcm_enable (void)
 Enable the PCM interface.
 
__STATIC_INLINE void hw_pcm_disable (void)
 Disable the PCM interface.
 
__STATIC_INLINE bool hw_pcm_is_enabled (void)
 Get the status of the PCM interface. More...
 
__STATIC_INLINE uint8_t hw_pcm_get_channel_delay ()
 Get PCM channel delay. More...
 
__STATIC_INLINE bool hw_pcm_get_fsc_edge (void)
 Get PCM FSC edge. More...
 
__STATIC_INLINE uint8_t hw_pcm_get_fsc_length (void)
 Get PCM FSC length. More...
 
__STATIC_INLINE uint16_t hw_pcm_get_fsc_div (void)
 Get PCM FSC divider. More...
 
__STATIC_INLINE bool hw_pcm_get_fsc_delay (void)
 Get PCM FSC delay. More...
 
__STATIC_INLINE bool hw_pcm_get_clk_polarity (void)
 Get PCM clock polarity. More...
 
__STATIC_INLINE bool hw_pcm_get_fsc_polarity (void)
 Get PCM FSC polarity. More...
 
__STATIC_INLINE bool hw_pcm_get_clk_per_bit (void)
 Get PCM clock cycles per data bit. More...
 
__STATIC_INLINE HW_PCM_INPUT_MUX hw_pcm_get_pcm_input_mux (void)
 Get input for the PCM1_MUX_IN multiplexer. More...
 
__STATIC_INLINE HW_PCM_DO_OUTPUT_MODE hw_pcm_get_output_mode (void)
 Get PCM DO output mode. More...
 
__STATIC_INLINE HW_PCM_MODE hw_pcm_get_mode (void)
 Get PCM master/slave mode. More...
 
__STATIC_INLINE void hw_pcm_set_mode (HW_PCM_MODE mode)
 Set PCM master/slave mode. More...
 
HW_PCM_ERROR_CODE hw_pcm_init_clk (hw_pcm_clk_cfg_t *pcm_clk)
 Initialize PCM clock registers. More...
 
void hw_pcm_init (hw_pcm_config_t *config)
 Set initialization of PCM interface. More...
 
__STATIC_INLINE void hw_pcm_set_channel_delay (uint8_t delay)
 Set PCM channel delay. More...
 
__STATIC_INLINE void hw_pcm_set_fsc_edge (HW_PCM_FSC_EDGE edge)
 Set PCM FSC edge. More...
 
__STATIC_INLINE void hw_pcm_set_fsc_length (uint8_t length)
 Set PCM FSC length. More...
 
__STATIC_INLINE void hw_pcm_set_fsc_div (uint16_t div)
 Set PCM FSC divider. More...
 
__STATIC_INLINE void hw_pcm_set_fsc_delay (HW_PCM_FSC_DELAY delay)
 Set PCM FSC delay. More...
 
__STATIC_INLINE void hw_pcm_set_clk_polarity (HW_PCM_CLK_POLARITY pol)
 Set PCM clock polarity. More...
 
__STATIC_INLINE void hw_pcm_set_pcm_input_mux (HW_PCM_INPUT_MUX input)
 Set input for the PCM1_MUX_IN multiplexer. More...
 
__STATIC_INLINE void hw_pcm_set_fsc_polarity (HW_PCM_FSC_POLARITY pol)
 Set PCM FSC polarity. More...
 
__STATIC_INLINE void hw_pcm_set_clk_per_bit (HW_PCM_CYCLE_PER_BIT cycles)
 Set PCM clock cycles per data bit. More...
 
__STATIC_INLINE void hw_pcm_set_output_mode (HW_PCM_DO_OUTPUT_MODE mode)
 Set PCM DO output mode. More...
 
__STATIC_INLINE uint32_t hw_pcm_input_read (HW_PCM_INPUT input)
 Read PCM input (RX) register. More...
 
__STATIC_INLINE void hw_pcm_output_write (HW_PCM_OUTPUT output, const uint32_t data)
 Write PCM output (TX) register. More...
 
void hw_pcm_register_interrupt (hw_pcm_interrupt_cb_t cb)
 Register PCM interrupt handler. More...
 
void hw_pcm_unregister_interrupt (void)
 Unregister interrupt PCM handler. More...
 

Detailed Description

Definition of API for the PCM interface Low Level Driver.

Copyright (C) 2020-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.