基于QCC30XX51XX ANC多功能音频开发板方案已经上架,为了方便客户EVB的使用数字I2S输出功能,所以编制这份文档和说明,希望对大家有所帮助。
1. EVB底板数字I2S转模拟音频输出原理图:
I2S转模拟输出音频选用PCM5102芯片,电源使用3.3V,所以J48选择VDD_3V3;对于QCC5124的Sink工程,默认I2S输出PIO口为PIO15-PIO18,最后通过3.5mm的J6输出。
2. 在实物中选择VDD_3V3和PIO15-PIO18;
3. 在MDE中使能enable wired;
4. 在MDE->fw_cfg_filesystem->common->subsys3_config;使能PcmPioConfig=[10 11 ff 12 13],编译完成后下载烧录QCC5124;
5. 在config中设置 Plug-in Type: configuration set->Audio-I2S:
6. 在config中设置configuration set->audio->ouput->channel allcation:硬件类型Hardware Type选择I2S,配置完成后重启开机测试即可。
/*******************************************************************************
Copyright (c) 2016 Qualcomm Technologies International, Ltd.
FILE NAME
sink_ba_broadcaster.c
DESCRIPTION
This is an internal submodule for broadcast audio. This module implements
Broadcaster functionalities of broadcast audio. It provides interface to other
sub modules to access(set/get) broadcaster behaviours.
Major functionalities handled in this module are
1.Broadcaster Association
2.Security key/random number generation for association
3.Handle Broadcaster configuration
4.Handles all messages form broadcaster
5.Broadcaster connection
NOTES
This module interfaces need to be exposed to sink_ba or sink_ba_pluging modules
only. It is restricted to access these interfaces from any other modules
*/
#include "sink_ba_broadcaster.h"
#include "sink_debug.h"
#ifdef ENABLE_BROADCAST_AUDIO
#include "sink_ba_broadcaster_encryption.h"
#include "sink_ba_broadcaster_scm.h"
#include "sink_ba_broadcaster_packetiser.h"
#include "sink_ba.h"
#include "sink_main_task.h"
#include "sink_gatt_server_ba.h"
#include "sink_ble.h"
#include "sink_configmanager.h"
#include "sink_broadcast_audio_config_def.h"
#include <broadcast_context.h>
#include <broadcast_cmd.h>
#include <broadcast.h>
#include <afh_channel_map.h>
#include <a2dp.h>
#include <vm.h>
#include <vmtypes.h>
#include <panic.h>
#include <stdlib.h>
/* Debugging defines */
#ifdef DEBUG_BA_BROADCASTER
#define DEBUG_BROADCASTER(x) DEBUG(x)
#else
#define DEBUG_BROADCASTER(x)
#endif
#ifdef AFH_LOGGING
#define AFH_LOGGING_DEBUG(x) DEBUG(x)
#else
#define AFH_LOGGING_DEBUG(x)
#endif
/*! Offset to apply to the instant for an AFH update to be applied on broadcaster
* and receiver, in BT slots when using sync train method; 1 second. */
#define AFH_UPDATE_INSTANT_OFFSET (3200)
/*---------------------CSB Defines--------------------------*/
/* Time in slots before we'll receive a supervision timeout
* for failure to transmit a CSB packet. */
#define CSB_SUPERVISION_TIMEOUT 0x2000
/* Permitted packets to use for CSB. */
#define CSB_PACKET_TYPE 8
/*---------------------SYNC TRAIN related Defines ----------*/
/* Default sync train timeout of 30s (in BT slots) */
#define SYNC_TRAIN_TIMEOUT (0xBB80)
/* Don't timeout the sync train, broadcast library will
* automatically restart it for us, and always keep it running */
#define SYNC_TRAIN_NO_TIMEOUT 0
/* Minimum interval for sync train packets. */
#define SYNC_TRAIN_INTERVAL_MIN 0xA0
/* Maximum interval for sync train packets. */
#define SYNC_TRAIN_INTERVAL_MAX 0xC0
/* Service data in the sync train, must be 0x00 */
#define SYNC_TRAIN_SERVICE_DATA_WORD 0x00
/*-----------------Data structure used for Broadcaster------*/
/* Broadcaster data, this single structure handles all
data related to broadcaster.
*/
typedef struct _brodcasterdata_t{
/* Reference to an instance of the broadcast library, configured as a broadcaster */
BROADCAST* broadcaster;
/* Parameters for configuring a broadcast stream */
broadcaster_csb_params csb_params;
/* Parameters for configuring a sync train, advertising the broadcast stream */
broadcaster_sync_params sync_params;
/* Lock during handling of adverts/connecting/disconnecting BLE link */
unsigned connecting:1;
/*! Flag indicating we have requested a local change in the
* AFH channel map, and not yet been notified it has been
* applied. */
unsig