⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uem_proc_cmd.c

📁 最新MTK手机软件源码
💻 C
📖 第 1 页 / 共 5 页
字号:
            break;
    }
    return result;
}

/*****************************************************************************
*  Function 
*     l4cuem_rtc_set_time_req
*  DESCRIPTION
*     
*  PARAMETERS
*       ...  
*  RETURNS
*     void
*  GLOBALS AFFECTED
*****************************************************************************/


/*****************************************************************************
 * FUNCTION
 *  l4cuem_rtc_set_time_req
 * DESCRIPTION
 *  
 * PARAMETERS
 *  rtc_type            [IN]        
 *  rtctime             [IN]        
 *  setting_type        [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void l4cuem_rtc_set_time_req(kal_uint8 rtc_type, rtc_alarm_info_struct rtctime, kal_uint8 setting_type)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    t_rtc l_rtctime;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    kal_trace(TRACE_FUNC, FUNC_UEM_RTC_SET_TIME);

    switch (setting_type)   /* rtc_setting_type_enum */
    {
        case RTC_SETTING_TYPE_DATE:
            RTC_GetTime(&l_rtctime);
            l_rtctime.rtc_year = rtctime.data_time.rtc_year;
            l_rtctime.rtc_mon = rtctime.data_time.rtc_mon;
            l_rtctime.rtc_day = rtctime.data_time.rtc_day;
            l_rtctime.rtc_wday = rtctime.data_time.rtc_wday;
            break;

        case RTC_SETTING_TYPE_TIME:
            RTC_GetTime(&l_rtctime);
            l_rtctime.rtc_hour = rtctime.data_time.rtc_hour;
            l_rtctime.rtc_min = rtctime.data_time.rtc_min;
            l_rtctime.rtc_sec = rtctime.data_time.rtc_sec;
            break;

        case RTC_SETTING_TYPE_DATETIME:
        default:
            l_rtctime.rtc_year = rtctime.data_time.rtc_year;
            l_rtctime.rtc_mon = rtctime.data_time.rtc_mon;
            l_rtctime.rtc_day = rtctime.data_time.rtc_day;
            l_rtctime.rtc_hour = rtctime.data_time.rtc_hour;
            l_rtctime.rtc_min = rtctime.data_time.rtc_min;
            l_rtctime.rtc_wday = rtctime.data_time.rtc_wday;
            l_rtctime.rtc_sec = rtctime.data_time.rtc_sec;
            break;
    }

    switch (rtc_type)
    {
        case RTC_TIME_CLOCK_IND:
            RTC_InitTC_Time(&l_rtctime);

            RTC_Config(
                uem_rtc_alarm_format_convert(DEVICE_AL_EN_NoChange),
                uem_rtc_clock_format_convert(DEVICE_TC_EN_ChkM));
            break;
        case RTC_ALARM_IND:
            if (rtctime.alarm_index < MAX_ALARM_NUM)
            {
                RTC_SetAlarm(&l_rtctime);

                RTC_Config(
                    uem_rtc_alarm_format_convert(rtctime.alarm_format),
                    uem_rtc_clock_format_convert(DEVICE_TC_EN_NoChange));
            }
            else
            {
                kal_trace(TRACE_FUNC, WARNING_UEM_OUT_OF_RANGE);
            }
            break;
        default:
            kal_trace(TRACE_FUNC, WARNING_UEM_OUT_OF_RANGE);
            break;
    }
}

/*****************************************************************************
*   Function 
*      l4cuem_alarm_get_time_req
*   DESCRIPTION
*      The function is used to set the RTC alarm or clock time value.
*   PARAMETERS
*      rtctime   IN   
*   RETURNS
*      void
*   GLOBALS AFFECTED
*****************************************************************************/


/*****************************************************************************
 * FUNCTION
 *  l4cuem_alarm_get_time_req
 * DESCRIPTION
 *  
 * PARAMETERS
 *  rtc_alarm_id        [IN]        
 *  alarm_info          [?]         
 * RETURNS
 *  void
 *****************************************************************************/
void l4cuem_alarm_get_time_req(kal_uint8 rtc_alarm_id, rtc_alarm_info_struct *alarm_info)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    kal_trace(TRACE_FUNC, FUNC_UEM_ALARM_GET_TIME);

    ASSERT(alarm_info != NULL); /* invalid address */

    if (rtc_alarm_id < MAX_ALARM_NUM)
    {
        kal_mem_cpy(alarm_info, &(g_uem_cntx_p->rmi_data.alarm_info[rtc_alarm_id]), sizeof(rtc_alarm_info_struct));
    }
    else
    {
        /* error: out of range */
        kal_trace(TRACE_FUNC, WARNING_UEM_OUT_OF_RANGE);
    }
}

/*****************************************************************************
*   Function 
*      l4cuem_rtc_cnfg_format_req
*   DESCRIPTION
*      The function is used to set the RTC format.
*   PARAMETERS
*      rtctime   IN   
*   RETURNS
*      void
*   GLOBALS AFFECTED
*****************************************************************************/


/*****************************************************************************
 * FUNCTION
 *  l4cuem_rtc_cnfg_format_req
 * DESCRIPTION
 *  
 * PARAMETERS
 *  rtc_type            [IN]        
 *  rtc_alarm_id        [IN]        
 *  rtc_format_id       [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void l4cuem_rtc_cnfg_format_req(kal_uint8 rtc_type, kal_uint8 rtc_alarm_id, kal_uint8 rtc_format_id)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    kal_trace(TRACE_FUNC, FUNC_UEM_RTC_CNFG_FORMAT);

    switch (rtc_type)
    {
        case RTC_TIME_CLOCK_IND:
            RTC_Config(
                uem_rtc_alarm_format_convert(DEVICE_AL_EN_NoChange),
                uem_rtc_clock_format_convert(rtc_format_id));
            break;
        case RTC_ALARM_IND:
            if (rtc_alarm_id < MAX_ALARM_NUM)
            {
                RTC_Config(
                    uem_rtc_alarm_format_convert(rtc_format_id),
                    uem_rtc_clock_format_convert(DEVICE_TC_EN_NoChange));
            }
            break;
        default:
            break;
    }
}

/*****************************************************************************
*   Function 
*      l4cuem_rtc_delete_date_time_req
*   DESCRIPTION
*      The function is used to set the RTC format.
*   PARAMETERS
*      rtctime   IN   
*   RETURNS
*      void
*   GLOBALS AFFECTED
*****************************************************************************/


/*****************************************************************************
 * FUNCTION
 *  l4cuem_rtc_delete_date_time_req
 * DESCRIPTION
 *  
 * PARAMETERS
 *  rtc_type            [IN]        
 *  rtc_alarm_id        [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void l4cuem_rtc_delete_date_time_req(kal_uint8 rtc_type, kal_uint8 rtc_alarm_id)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    kal_trace(TRACE_FUNC, FUNC_UEM_RTC_DELETE_DATE_TIME);

    switch (rtc_type)
    {
        case RTC_TIME_CLOCK_IND:
            l4cuem_rtc_cnfg_format_req(rtc_type, rtc_alarm_id, DEVICE_TC_EN_None);
            break;
        case RTC_ALARM_IND:
            l4cuem_rtc_cnfg_format_req(rtc_type, rtc_alarm_id, DEVICE_AL_EN_None);
            break;
        default:
            break;
    }
}

/*****************************************************************************
*   Function 
*      l4cuem_speech_set_mode_req
*   DESCRIPTION
*      The function is used to set the speech mode on/off while there is in a call setup.
*   PARAMETERS
*      speech_mode_onoff   IN   
*   RETURNS
*      void
*   GLOBALS AFFECTED
*****************************************************************************/


/*****************************************************************************
 * FUNCTION
 *  l4cuem_speech_set_mode_req
 * DESCRIPTION
 *  
 * PARAMETERS
 *  speech_mode_onoff       [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void l4cuem_speech_set_mode_req(kal_bool speech_mode_onoff)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    kal_trace(TRACE_INFO, INFO_UEM_SPEECH_SET_MODE, speech_mode_onoff);

#ifdef __MTK_TARGET__
    if (speech_mode_onoff)
    {
        BMT_CallState(KAL_TRUE);
    }
    else
    {
        BMT_CallState(KAL_FALSE);
    }
#endif /* __MTK_TARGET__ */ 

    uem_send_msg_to_aud(MSG_ID_L4AUD_SP_SET_MODE_REQ, (kal_uint32) speech_mode_onoff);
}

/*****************************************************************************
*   Function 
*      l4cuem_call_status_ind
*   DESCRIPTION
*      The function is used to inform AUX if a calling is being set, connected or disconected.
*   PARAMETERS
*      ind_type   IN   
*   RETURNS
*      void
*   GLOBALS AFFECTED
*****************************************************************************/


/*****************************************************************************
 * FUNCTION
 *  l4cuem_call_status_req_ind
 * DESCRIPTION
 *  
 * PARAMETERS
 *  ind_type        [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void l4cuem_call_status_req_ind(kal_uint8 ind_type)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
#ifdef __MTK_TARGET__
    switch (ind_type)
    {
        case UEM_CALL_SETUP:
            g_uem_cntx_p->incall_state = UEM_CALL_SETUP;

            /* Inform BMT call state active */
            BMT_CallState(KAL_TRUE);

            /* Inform AUB call state deactive */
            uem_send_msg_to_aux(MSG_ID_AUX_CALL_SETUP_REQ_IND);

            /* Change ADC measure parameter */
            uem_send_msg_to_bmt(
                MSG_ID_BMT_ADC_MODIFY_PARAMETERS_REQ,
                (kal_uint32) (g_uem_cntx_p->adc_sche_id),
                (kal_uint32) (ADC_TALKING_EVAL_COUNT),
                (kal_uint32) (ADC_TALKING_EVAL_PERIOD));
            break;
        case UEM_CALL_CONNECT:
            g_uem_cntx_p->incall_state = UEM_CALL_CONNECT;
            uem_send_msg_to_aux(MSG_ID_AUX_CALL_CONNECT_REQ_IND);
            break;
        case UEM_CALL_DISCONNECT:
            g_uem_cntx_p->incall_state = UEM_CALL_DISCONNECT;

            /* Inform BMT call state deactive */
            BMT_CallState(KAL_FALSE);

            /* Inform AUX call state deactive */
            uem_send_msg_to_aux(MSG_ID_AUX_CALL_DISCONNECT_REQ_IND);

            /* Change ADC measure parameter */
            uem_send_msg_to_bmt(
                MSG_ID_BMT_ADC_MODIFY_PARAMETERS_REQ,
                (kal_uint32) (g_uem_cntx_p->adc_sche_id),
                (kal_uint32) (ADC_IDLE_EVAL_COUNT),
                (kal_uint32) (ADC_IDLE_EVAL_PERIOD));
            break;
        default:
            break;
    }
#endif /* __MTK_TARGET__ */ 
}

/*****************************************************************************
*   Function 
*      l4cuem_set_mute_req
*   DESCRIPTION
*      The function is used to turn on/off the microphone.
*   PARAMETERS
*      mute_onoff   IN   
*   RETURNS
*      void
*   GLOBALS AFFECTED
*****************************************************************************/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -