hi_aio_attr

Description

Defines the attributes of the AIO device.

Prototype

typedef struct {
    hi_audio_sample_rate sample_rate;    
    hi_audio_bit_width   bit_width;      
    hi_aio_mode          work_mode;      
    hi_audio_snd_mode    snd_mode;       
    hi_u32               expand_flag;    

    hi_u32               frame_num;      
    hi_u32               point_num_per_frame;    
    hi_u32               chn_cnt;        
    hi_u32               clk_share;     
    hi_aio_i2s_type      i2s_type;     
} hi_aio_attr;

Members

Member

Description

sample_rate

Audio sampling rate. This parameter is invalid in slave mode. Only the 48 kHz sampling rate is supported.

bit_width

Audio sampling precision. In slave mode, this parameter must match the AD/DA sampling precision. Only 16-bit and 24-bit are supported.

work_mode

Defines the AI and AO operating modes.

This parameter can only be set to 0 (indicating the primary mode). The system automatically sets it to 0 regardless of whether it is set to another value.

snd_mode

Audio channel mode. 0 indicates single-channel, and 1 indicates dual-channel.

expand_flag

Audio bit width extension flag.

This parameter is reserved and does not take effect. The system automatically sets it to 0 regardless of whether it is set to another value.

frame_num

Number of buffered frames. Value range: [2, 300]

point_num_per_frame

Number of sampling points in a frame The value range of AI is [480, 2048], and that of AO is [480, 4096].

chn_cnt

Number of channels supported by each I2S. A maximum of two channels are supported. In dual-channel mode, the value is fixed at 2. In single-channel mode, the value is fixed at 1.

clk_share

Whether AI device 0 multiplexes the frame sync clock and bit stream clock of AO device 0.

This parameter is reserved and does not take effect. The system automatically sets it to 1 regardless of whether it is set to another value.

i2s_type

I2S type of the device

This parameter can only be set to 0 (indicating connecting to the built-in codec). The system automatically sets it to 0 regardless of whether it is set to another value.