API GUIDE / PWMA / LL

PWMA LL 接口

1. LL 接口规范

1.1 LL 通用约束

LL API 不校验:

  • instance 是否为 PWMA。
  • PWMA clock/gate 是否开启。
  • PWMA 是否正在输出 waveform。
  • 参数是否超出裸字段范围。

多字段 read-modify-write 不能与访问同一寄存器的 ISR 或其它线程并发。

1.2 AUDIO_CON helper

分组 Helper
instance ll_pwma_is_instance()
FIFO clear ll_pwma_clear_fifo()
output enable/disable_output()、is_output_enabled()
DMA request enable/disable_dma()、is_dma_enabled()
data type set/get_data_type()
endian set/get_endian()
level set/get_init_level()、set/get_idle_level()
precision set/get_precision()
format set/get_format()
prescaler set/get_prescaler()

1.3 AUDIO_UPDATE 和 AUDIO_ST helper

ll_pwma_apply_update()
ll_pwma_is_audio_working()
ll_pwma_is_dma_fifo_empty()
ll_pwma_is_first_wave()
ll_pwma_clear_first_wave()
ll_pwma_is_busy()

ll_pwma_clear_first_wave() 写 1 清除 FST_WAVE。

1.4 Interrupt mask helper

ll_pwma_mask_dma_fifo_empty_interrupt()
ll_pwma_unmask_dma_fifo_empty_interrupt()
ll_pwma_is_dma_fifo_empty_interrupt_masked()
ll_pwma_mask_first_wave_interrupt()
ll_pwma_unmask_first_wave_interrupt()
ll_pwma_is_first_wave_interrupt_masked()

1.5 Timing helper

ll_pwma_set_period_threshold()
ll_pwma_get_period_threshold()
ll_pwma_set_high_threshold()
ll_pwma_get_high_threshold()

1.6 DMA、volume 和 soft reset helper

ll_pwma_get_dma_data_addr()

ll_pwma_set_volume_down()
ll_pwma_set_volume_up()
ll_pwma_is_volume_down()
ll_pwma_set_volume_gain()
ll_pwma_get_volume_gain()

ll_pwma_trigger_soft_reset()
ll_pwma_release_soft_reset()
ll_pwma_is_soft_reset_asserted()
ll_pwma_clear_soft_reset_status()

1.7 LL 完整符号索引

ll_pwma_is_instance
ll_pwma_clear_fifo
ll_pwma_enable_output
ll_pwma_disable_output
ll_pwma_is_output_enabled
ll_pwma_enable_dma
ll_pwma_disable_dma
ll_pwma_is_dma_enabled
ll_pwma_set_data_type
ll_pwma_get_data_type
ll_pwma_set_endian
ll_pwma_get_endian
ll_pwma_set_init_level
ll_pwma_get_init_level
ll_pwma_set_idle_level
ll_pwma_get_idle_level
ll_pwma_set_precision
ll_pwma_get_precision
ll_pwma_set_format
ll_pwma_get_format
ll_pwma_set_prescaler
ll_pwma_get_prescaler
ll_pwma_apply_update
ll_pwma_is_audio_working
ll_pwma_is_dma_fifo_empty
ll_pwma_is_first_wave
ll_pwma_clear_first_wave
ll_pwma_is_busy
ll_pwma_mask_dma_fifo_empty_interrupt
ll_pwma_unmask_dma_fifo_empty_interrupt
ll_pwma_is_dma_fifo_empty_interrupt_masked
ll_pwma_mask_first_wave_interrupt
ll_pwma_unmask_first_wave_interrupt
ll_pwma_is_first_wave_interrupt_masked
ll_pwma_set_period_threshold
ll_pwma_get_period_threshold
ll_pwma_set_high_threshold
ll_pwma_get_high_threshold
ll_pwma_get_dma_data_addr
ll_pwma_set_volume_down
ll_pwma_set_volume_up
ll_pwma_is_volume_down
ll_pwma_set_volume_gain
ll_pwma_get_volume_gain
ll_pwma_trigger_soft_reset
ll_pwma_release_soft_reset
ll_pwma_is_soft_reset_asserted
ll_pwma_clear_soft_reset_status