qcc3086发射,spdif输入,qact链路参考

qcc3086默认只支持模拟输入和usb audio,这里实际就是用spdif取代了模拟输入。

/*!
    \copyright  Copyright (c) 2021 - 2023 Qualcomm Technologies International, Ltd.\n
                All Rights Reserved.\n
                Qualcomm Technologies International, Ltd. Confidential and Proprietary.
    \version    %version
    \file       state_of_charge.c
    \ingroup    state_of_charge
    \brief      
*/
 
#ifndef HAVE_NO_BATTERY
 
#define DEBUG_LOG_MODULE_NAME state_of_charge
#include <logging.h>
DEBUG_LOG_DEFINE_LEVEL_VAR
 
#include <ps.h>
#include <panic.h>
#include <pio.h>
#include <vm.h>
#include <hydra_macros.h>
#include <limits.h>
#include <task_list.h>
#include <logging.h>
#include <led.h>
#ifdef INCLUDE_DFU
#include <upgrade.h>
#endif
 
#include "adk_log.h"
#include "state_of_charge_private.h"
#include "battery_monitor.h"
#include "charger_monitor.h"
#include "battery_monitor_config.h"
#include "unexpected_message.h"
 
#include <stdlib.h>
 
/* Make the type used for message IDs available in debug tools */
LOGGING_PRESERVE_MESSAGE_ENUM(soc_messages)
ASSERT_MESSAGE_GROUP_NOT_OVERFLOWED(STATE_OF_CHARGE, STATE_OF_CHARGE_MESSAGE_END)
 
typedef struct
{
 
    const soc_lookup_t* soc_config_table;
    unsigned soc_config_size;
}soc_ctx_t;
 
static soc_ctx_t soc_ctx;
 
soc_data_t app_battery_charge;
 
/*! 
    \brief Send battery state of charge update message to all registered clients.
    \param battery_region pointer to battery_region_data_t structure
*/
static void soc_ServiceClients(soc_data_t *battery_charge)
{
 
    socRegisteredClient *client = NULL;
    for (client = battery_charge->client_list; client != NULL; client = client->next)
    {
 
        uint8 percent = (uint8)battery_charge->state_of_charge;
        if (percent != client->percent)
        {
 
            MESSAGE_MAKE(msg, MESSAGE_SOC_UPDATE_T);
            msg->percent = percent;
            client->percent = percent;
            MessageSend(client->form.task, SOC_UPDATE_IND, msg);
        }
    }
}
 
/*! Add a client to the list of clients */
static bool soc_ClientAdd(soc_data_t *battery_charge, soc_registration_form_t *form)
{
 
    socRegisteredClient *new = calloc(1, sizeof(*new));
    if (new)
    {
 
        new->form = *form;
        new->next = battery_charge->client_list;
        battery_charge->client_list = new;
        return TRUE;
    }
    return FALSE;
}
 
/*! Remove a client from the list of clients */
static void soc_ClientRemove(soc_data_t *battery_charge, Task task)
{
 
    socRegisteredClient **head;
    for (head = &battery_charge->client_list; *head != NULL; head = &(*head)->next)
    {
 
        if ((*head)->form.task == task)
        {
 
            socRegisteredClient *toremove = *head
  • 22
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值