DRV_SPDIF

[English]

DRV_SPDIF API Status

API

drv_spdif_init()

drv_spdif_deinit()

drv_spdif_config()

drv_spdif_enable()

drv_spdif_disable()

drv_spdif_register_isr_cbk()

drv_spdif_get_rx_samplerate()

drv_spdif_get_fifo_cnt()

drv_spdif_get_fifo_address()

drv_spdif_set_aempty_threshold()

drv_spdif_set_afull_threshold()

DRV_SPDIF Pin and GPIO Map

SPDIF Pin

Number

SPDIF_TX

12

SPDIF_RX

17

DRV_SPDIF API Reference

Header File

Functions

int32_t drv_spdif_init(void)

init a spdif device.

初始化设备,在使用spdif功能前需要调用它获取device instance

返回值:
  • 0 – success [BK_RET_OK]

  • other – fail

返回:

result

int32_t drv_spdif_deinit(void)

deinit a spdif device.

反初始化spdif设备,对drv_spdif_init()进行反向操作

返回值:
  • 0 – success [BK_RET_OK]

  • other – fail

返回:

result

int32_t drv_spdif_config(spdif_config_t *p_config)

config spdif parameter.

对spdif设备参数的配置

参数:

p_config[in] 参数结构体指针

返回值:
  • 0 – success [BK_RET_OK]

  • other – fail

返回:

result

int32_t drv_spdif_enable(void)

enable spdif tramsfer

返回值:
  • 0 – success [BK_RET_OK]

  • other – fail

返回:

result

int32_t drv_spdif_disable(void)

disable spdif tramsfer

返回值:
  • 0 – success [BK_RET_OK]

  • other – fail

返回:

result

int32_t drv_spdif_register_isr_cbk(pfunc_drv_spdif_cb_t pfn_cb, void *pv_arg)

register spdif isr callback function

返回值:
  • 0 – success [BK_RET_OK]

  • other – fail

返回:

result

spdif_samplerate_e drv_spdif_get_rx_samplerate(void)

get spdif rx samplerate

返回值:
  • 0 – success [BK_RET_OK]

  • other – fail

返回:

result

uint32_t drv_spdif_get_fifo_cnt(void)

get the amount of data in spdif fifo

返回:

amount

uint32_t drv_spdif_get_fifo_address(void)

get spdif fifo address

返回:

address

int32_t drv_spdif_set_aempty_threshold(uint16_t threshold)

set spdif fifo almost empty report threshold

参数:

threshold[in] 门限值

返回值:
  • 0 – success [BK_RET_OK]

  • other – fail

返回:

result

int32_t drv_spdif_set_afull_threshold(uint16_t threshold)

set spdif fifo almost full report threshold

参数:

threshold[in] 门限值

返回值:
  • 0 – success [BK_RET_OK]

  • other – fail

返回:

result

Structures

struct spdif_config_t

Type Definitions

typedef void (*pfunc_drv_spdif_cb_t)(spdif_status_e status, void *pv_arg)

Enumerations

enum spdif_mode_e

Values:

enumerator SPDIF_RX
enumerator SPDIF_TX
enum spdif_chan_mode_e

Values:

enumerator SPDIF_STEREO
enumerator SPDIF_MONO
enum spdif_samplerate_e

Values:

enumerator SPDIF_44_1K
enumerator SPDIF_48K
enumerator SPDIF_96K
enumerator SPDIF_192K
enum spdif_status_e

Values:

enumerator SPDIF_UNDERR
enumerator SPDIF_OVRERR
enumerator SPDIF_SYNCERR
enumerator SPDIF_PARITYERR