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

PCM interface. More...

Files

file  hw_pcm.h
 Definition of API for the PCM interface Low Level Driver.
 

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

PCM interface.

Macro Definition Documentation

◆ HW_PCM_CRG_REG_CLR_BIT

#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.

Parameters
[in]regis the register to access
[in]fieldis the register field to write

◆ HW_PCM_CRG_REG_GETF

#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.

Parameters
[in]regis the register to access
[in]fieldis the register field to read
Returns
the value of the register field

◆ HW_PCM_CRG_REG_SET_BIT

#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.

Parameters
[in]regis the register to access
[in]fieldis the register field to write

◆ HW_PCM_CRG_REG_SETF

#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.

Parameters
[in]regis the register to access
[in]fieldis the register field to write
[in]valis the value to write

◆ HW_PCM_SRC_REG_CLR_BIT

#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.

Parameters
[in]regis the register to access
[in]fieldis the register field to write

◆ HW_PCM_SRC_REG_GETF

#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.

Parameters
[in]regis the register to access
[in]fieldis the register field to read
Returns
the value of the register field

◆ HW_PCM_SRC_REG_SET_BIT

#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.

Parameters
[in]regis the register to access
[in]fieldis the register field to write

◆ HW_PCM_SRC_REG_SETF

#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.

Parameters
[in]regis the register to access
[in]fieldis the register field to write
[in]valis the value to write

Typedef Documentation

◆ hw_pcm_interrupt_cb_t

typedef void(* hw_pcm_interrupt_cb_t) (void)

Application-defined callback type for the PCM interrupt.

Note
The application defined callback should be declared as __RETAINED_CODE.

Enumeration Type Documentation

◆ HW_PCM_CLK_GENERATION

PCM clock generation.

Enumerator
HW_PCM_CLK_GEN_FRACTIONAL 

fractional option. Dividing the system clock by an integer and a fractional part

HW_PCM_CLK_GEN_INTEGER_ONLY 

integer only option. Approximate the sample rate by adding more clock pulses than required bits. These extra pulses are ignored

◆ HW_PCM_CLK_POLARITY

PCM clock polarity.

Enumerator
HW_PCM_CLK_POLARITY_NORMAL 

normal clock polarity

HW_PCM_CLK_POLARITY_INVERTED 

inverted clock polarity

◆ HW_PCM_CLOCK

PCM system clock source.

Enumerator
HW_PCM_CLK_DIVN 

PCM clk to be used is DIVN

HW_PCM_CLK_DIV1 

PCM clk to be used is DIV1

◆ HW_PCM_CYCLE_PER_BIT

PCM clock cycles per bit.

Enumerator
HW_PCM_ONE_CYCLE_PER_BIT 

one clock cycle per data bit

HW_PCM_TWO_CYCLE_PER_BIT 

two clock cycles per data bit

◆ HW_PCM_DO_OUTPUT_MODE

PCM DO output mode.

Enumerator
HW_PCM_DO_OUTPUT_PUSH_PULL 

PCM DO push pull

HW_PCM_DO_OUTPUT_OPEN_DRAIN 

PCM DO open drain

◆ HW_PCM_ERROR_CODE

PCM error code.

Enumerator
HW_PCM_ERROR_NO_ERROR 

No error during pcm init

HW_PCM_ERROR_INVALID_SAMPLE_RATE 

Error related with not supported sampling rate

HW_PCM_ERROR_INVALID_BIT_DEPTH 

Error related with not supported bits per samples

HW_PCM_ERROR_INVALID_CHANNELS 

Error related with not supported number of channels

HW_PCM_ERROR_INVALID_CHANNEL_DELAYS 

Error related with not supported number of channel delays

HW_PCM_ERROR_INVALID_SLOTS 

Error related with not supported number of slots

HW_PCM_ERROR_INVALID_FSC_DIV 

Error related with not supported calculated fsc divider

HW_PCM_ERROR_NA_DIV 

Error related with not supported case of pcm divisors

◆ HW_PCM_FSC_DELAY

PCM FSC delay.

Enumerator
HW_PCM_FSC_STARTS_1_CYCLE_BEFORE_MSB_BIT 

PCM FSC starts one cycle before MSB bit

HW_PCM_FSC_STARTS_SYNCH_TO_MSB_BIT 

PCM FSC starts at the same time as MSB bit

◆ HW_PCM_FSC_EDGE

PCM FSC edge.

Enumerator
HW_PCM_FSC_EDGE_RISING 

shift channels 1-8 after PCM_FSC edge

HW_PCM_FSC_EDGE_RISING_AND_FALLING 

shift channels 1-4 after PCM_FSC edge and channels 5-8 after opposite PCM_FSC edge

◆ HW_PCM_FSC_POLARITY

PCM FSC polarity.

Enumerator
HW_PCM_FSC_POLARITY_NORMAL 

normal FSC polarity

HW_PCM_FSC_POLARITY_INVERTED 

inverted FSC polarity

◆ HW_PCM_INPUT

PCM input register.

Enumerator
HW_PCM_INPUT_REG_1 

PCM input 1

HW_PCM_INPUT_REG_2 

PCM input 2

◆ HW_PCM_INPUT_MUX

PCM input multiplexer.

Enumerator
HW_PCM_INPUT_MUX_OFF 

PCM input is off

HW_PCM_INPUT_MUX_SRC1_OUT 

PCM input set to SRC1_OUT_REG

HW_PCM_INPUT_MUX_SRC_OUT 

deprecated name for SRC1_OUT_REG

HW_PCM_INPUT_MUX_PCM_OUT_REG 

PCM input set to PCM_OUT_REG

HW_PCM_INPUT_MUX_SRC2_OUT 

PCM input set to SRC2_OUT_REG

◆ HW_PCM_MODE

PCM master/slave mode.

Enumerator
HW_PCM_MODE_SLAVE 

PCM interface in slave mode

HW_PCM_MODE_MASTER 

PCM interface in master mode

◆ HW_PCM_OUTPUT

PCM output register.

Enumerator
HW_PCM_OUTPUT_REG_1 

PCM output 1

HW_PCM_OUTPUT_REG_2 

PCM output 2

Function Documentation

◆ hw_pcm_clk_is_enabled()

__STATIC_INLINE bool hw_pcm_clk_is_enabled ( void  )

Get the status of the PCM interface clock source.

Returns
Return values
falseif PCM interface clock source is disabled,
trueotherwise

◆ hw_pcm_get_channel_delay()

__STATIC_INLINE uint8_t hw_pcm_get_channel_delay ( )

Get PCM channel delay.

Returns
channel delay in multiples of 8 bits

◆ hw_pcm_get_clk_per_bit()

__STATIC_INLINE bool hw_pcm_get_clk_per_bit ( void  )

Get PCM clock cycles per data bit.

Returns
cycles The number of clock cycles per data bit:
Return values
HW_PCM_ONE_CYCLE_PER_BIT= One clock cycle per data bit
HW_PCM_TWO_CYCLE_PER_BIT= Two clock cycles per data bit

◆ hw_pcm_get_clk_polarity()

__STATIC_INLINE bool hw_pcm_get_clk_polarity ( void  )

Get PCM clock polarity.

Returns
Polarity of PCM_CLK
Return values
HW_PCM_CLK_POLARITY_NORMALor
HW_PCM_CLK_POLARITY_INVERTED

◆ hw_pcm_get_fsc_delay()

__STATIC_INLINE bool hw_pcm_get_fsc_delay ( void  )

Get PCM FSC delay.

Returns
Start position of FSC is programmable. If delay is HW_PCM_FSC_STARTS_1_CYCLE_BEFORE_MSB_BIT then FSC starts one clock cycle before first bit of channel 0. If delay is HW_PCM_FSC_STARTS_SYNCH_TO_MSB_BIT then FSC starts synchronously to the first bit of channel 0.

◆ hw_pcm_get_fsc_div()

__STATIC_INLINE uint16_t hw_pcm_get_fsc_div ( void  )

Get PCM FSC divider.

Returns
The FSC divider. Values must be in the range of 8..0x1000. If PCM_CLK_BIT=1, divider must always be even.

◆ hw_pcm_get_fsc_edge()

__STATIC_INLINE bool hw_pcm_get_fsc_edge ( void  )

Get PCM FSC edge.

Returns
The FSC edge
Return values
HW_PCM_FSC_EDGE_RISINGor
HW_PCM_FSC_EDGE_RISING_AND_FALLING

◆ hw_pcm_get_fsc_length()

__STATIC_INLINE uint8_t hw_pcm_get_fsc_length ( void  )

Get PCM FSC length.

Returns
The FSC length in multiples of 8. if 0 then FSC length is equal to 1 data bit.

◆ hw_pcm_get_fsc_polarity()

__STATIC_INLINE bool hw_pcm_get_fsc_polarity ( void  )

Get PCM FSC polarity.

Returns
The polarity of FSC
Return values
HW_PCM_FSC_POLARITY_NORMALor
HW_PCM_FSC_POLARITY_INVERTED

◆ hw_pcm_get_mode()

__STATIC_INLINE HW_PCM_MODE hw_pcm_get_mode ( void  )

Get PCM master/slave mode.

Returns
PCM mode
Return values
masteror
slave

◆ hw_pcm_get_output_mode()

__STATIC_INLINE HW_PCM_DO_OUTPUT_MODE hw_pcm_get_output_mode ( void  )

Get PCM DO output mode.

Returns
output mode can be
Return values
HW_PCM_DO_OUTPUT_PUSH_PULLor
HW_PCM_DO_OUTPUT_OPEN_DRAIN

◆ hw_pcm_get_pcm_input_mux()

__STATIC_INLINE HW_PCM_INPUT_MUX hw_pcm_get_pcm_input_mux ( void  )

Get input for the PCM1_MUX_IN multiplexer.

Returns
The input for PCM is HW_PCM_INPUT_MUX enum value

◆ hw_pcm_init()

void hw_pcm_init ( hw_pcm_config_t config)

Set initialization of PCM interface.

call hw_pcm_enable() once PCM interface initialization is done

Parameters
[in]configconfiguration of PCM interface in specific mode (generic PCM, I2S, TDM, IOM)

◆ hw_pcm_init_clk()

HW_PCM_ERROR_CODE hw_pcm_init_clk ( hw_pcm_clk_cfg_t pcm_clk)

Initialize PCM clock registers.

Parameters
[in,out]pcm_clkPCM clock configuration
Note
The value of pcm_clk->fsc_div is calculated by the function; it should be used to configure PCM_FSC_DIV.
Returns
the error code
Return values
HW_PCM_ERROR_NO_ERRORon success, else
error
See also
HW_PCM_ERROR_CODE

◆ hw_pcm_input_read()

__STATIC_INLINE uint32_t hw_pcm_input_read ( HW_PCM_INPUT  input)

Read PCM input (RX) register.

Parameters
[in]inputThe input register, HW_PCM_INPUT_REG_1 or HW_PCM_INPUT_REG_2
Returns
read data read from register

◆ hw_pcm_is_enabled()

__STATIC_INLINE bool hw_pcm_is_enabled ( void  )

Get the status of the PCM interface.

Returns
Return values
falseif PCM interface is disabled,
trueotherwise

◆ hw_pcm_output_write()

__STATIC_INLINE void hw_pcm_output_write ( HW_PCM_OUTPUT  output,
const uint32_t  data 
)

Write PCM output (TX) register.

Parameters
[in]outputThe output register,
Return values
HW_PCM_OUTPUT_REG_1or
HW_PCM_OUTPUT_REG_2
Parameters
[in]datadata to write to output register

◆ hw_pcm_register_interrupt()

void hw_pcm_register_interrupt ( hw_pcm_interrupt_cb_t  cb)

Register PCM interrupt handler.

A callback function is registered to be called when an interrupt is generated. Interrupt is automatically enabled after calling this function. If no callback is specified, interrupt will be automatically cleared by the driver.

Parameters
[in]cbCallback defined by the application.

◆ hw_pcm_set_channel_delay()

__STATIC_INLINE void hw_pcm_set_channel_delay ( uint8_t  delay)

Set PCM channel delay.

Parameters
[in]delaychannel delay is the multiples (N) of 8 bits
  • Values must be in the range of 0..3.

◆ hw_pcm_set_clk_per_bit()

__STATIC_INLINE void hw_pcm_set_clk_per_bit ( HW_PCM_CYCLE_PER_BIT  cycles)

Set PCM clock cycles per data bit.

Parameters
[in]cyclesThe number of clock cycles per data bit:
Return values
HW_PCM_ONE_CYCLE_PER_BIT= One clock cycle per data bit
HW_PCM_TWO_CYCLE_PER_BIT= Two clock cycles per data bit

◆ hw_pcm_set_clk_polarity()

__STATIC_INLINE void hw_pcm_set_clk_polarity ( HW_PCM_CLK_POLARITY  pol)

Set PCM clock polarity.

Parameters
[in]polPolarity of PCM_CLK,
Return values
HW_PCM_CLK_POLARITY_NORMALor
HW_PCM_CLK_POLARITY_INVERTED

◆ hw_pcm_set_fsc_delay()

__STATIC_INLINE void hw_pcm_set_fsc_delay ( HW_PCM_FSC_DELAY  delay)

Set PCM FSC delay.

Parameters
[in]delayStart position of FSC is programmable. If delay is HW_PCM_FSC_STARTS_1_CYCLE_BEFORE_MSB_BIT then FSC starts one clock cycle before first bit of channel 0. If delay is HW_PCM_FSC_STARTS_SYNCH_TO_MSB_BIT then FSC starts synchronously to the first bit of channel 0.

◆ hw_pcm_set_fsc_div()

__STATIC_INLINE void hw_pcm_set_fsc_div ( uint16_t  div)

Set PCM FSC divider.

Parameters
[in]divThe FSC divider. Values must be in the range of 8..0x1000. If PCM_CLK_BIT=1, divider must always be even.

◆ hw_pcm_set_fsc_edge()

__STATIC_INLINE void hw_pcm_set_fsc_edge ( HW_PCM_FSC_EDGE  edge)

Set PCM FSC edge.

Parameters
[in]edgeThe FSC edge, HW_PCM_FSC_EDGE_RISING or HW_PCM_FSC_EDGE_RISING_AND_FALLING

◆ hw_pcm_set_fsc_length()

__STATIC_INLINE void hw_pcm_set_fsc_length ( uint8_t  length)

Set PCM FSC length.

Parameters
[in]lengthThe FSC length is the multiples (N) of 8. Values must be in the range of 0..8. if 0 then FSC length is equal to 1 data bit.

◆ hw_pcm_set_fsc_polarity()

__STATIC_INLINE void hw_pcm_set_fsc_polarity ( HW_PCM_FSC_POLARITY  pol)

Set PCM FSC polarity.

Parameters
[in]polThe polarity of FSC,
Return values
HW_PCM_FSC_POLARITY_NORMALor
HW_PCM_FSC_POLARITY_INVERTED

◆ hw_pcm_set_mode()

__STATIC_INLINE void hw_pcm_set_mode ( HW_PCM_MODE  mode)

Set PCM master/slave mode.

Parameters
[in]modePCM mode
Return values
masteror
slave

◆ hw_pcm_set_output_mode()

__STATIC_INLINE void hw_pcm_set_output_mode ( HW_PCM_DO_OUTPUT_MODE  mode)

Set PCM DO output mode.

Parameters
[in]modeoutput mode can be
Return values
HW_PCM_DO_OUTPUT_PUSH_PULLor
HW_PCM_DO_OUTPUT_OPEN_DRAIN

◆ hw_pcm_set_pcm_input_mux()

__STATIC_INLINE void hw_pcm_set_pcm_input_mux ( HW_PCM_INPUT_MUX  input)

Set input for the PCM1_MUX_IN multiplexer.

Parameters
[in]inputThe input for PCM is HW_PCM_INPUT_MUX enum value

◆ hw_pcm_unregister_interrupt()

void hw_pcm_unregister_interrupt ( void  )

Unregister interrupt PCM handler.

Interrupt is automatically disabled after calling this function.