📄 uem_utility.c
字号:
case BMT_OVERCHARGECURRENT:
bs = PMIC_OVERCHARGECURRENT;
break;
/* Charge current is too low. */
case BMT_LOWCHARGECURRENT:
bs = PMIC_LOWCHARGECURRENT;
break;
/* Charge is completed. */
case BMT_CHARGE_COMPLETE:
bs = PMIC_CHARGE_COMPLETE;
break;
/* Invalid battery */
case BMT_INVALID_BAT:
bs = PMIC_INVALID_BATTERY;
break;
/* Invalid charger */
case BMT_INVALID_CHARGER:
bs = PMIC_INVALID_CHARGER;
break;
/* Charging timeout, battery is bad */
case BMT_CHARGE_TIMEOUT:
bs = PMIC_CHARGING_TIMEOUT;
break;
case BMT_CHARGE_BAD_CONTACT:
bs = PMIC_CHARGE_BAD_CONTACT;
break;
case BMT_BATTERY_BAD_CONTACT:
bs = PMIC_BATTERY_BAD_CONTACT;
break;
#ifdef __USB_ENABLE__
case BMT_USB_CHARGER_IN:
bs = PMIC_USB_CHARGER_IN;
break;
case BMT_USB_CHARGER_OUT:
bs = PMIC_USB_CHARGER_OUT;
break;
case BMT_USB_NO_CHARGING_IN:
bs = PMIC_USB_NO_CHARGER_IN;
break;
case BMT_USB_NO_CHARGING_OUT:
bs = PMIC_USB_NO_CHARGER_OUT;
break;
#endif /* __USB_ENABLE__ */
default:
bs = PMIC_VBAT_STATUS;
break;
}
return bs;
}
/*****************************************************************************
* Function
* uem_set_poweron_mode
* DESCRIPTION
* Rtc clock format convert
* PARAMETERS
* is_key_power IN
* RETURNS
* void
* GLOBALS AFFECTED
*****************************************************************************/
/*****************************************************************************
* FUNCTION
* uem_set_poweron_mode
* DESCRIPTION
*
* PARAMETERS
* mode [IN]
* RETURNS
* void
*****************************************************************************/
void uem_set_poweron_mode(kal_uint8 mode)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
g_uem_cntx_p->power_on_mode = mode;
}
/*****************************************************************************
* Function
* uem_get_poweron_mode
* DESCRIPTION
* Speaker convert
* PARAMETERS
* void
* RETURNS
* is_key_power IN
* GLOBALS AFFECTED
*****************************************************************************/
/*****************************************************************************
* FUNCTION
* uem_get_poweron_mode
* DESCRIPTION
*
* PARAMETERS
* void
* RETURNS
*
*****************************************************************************/
kal_uint8 uem_get_poweron_mode(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
return g_uem_cntx_p->power_on_mode;
}
/*****************************************************************************
* Function
* uem_set_bat_status
* DESCRIPTION
* Speaker convert
* PARAMETERS
* bat_status IN
* bat_vol IN
* RETURNS
* void
* GLOBALS AFFECTED
*****************************************************************************/
/*****************************************************************************
* FUNCTION
* uem_set_bat_status
* DESCRIPTION
*
* PARAMETERS
* bmt_status [IN]
* RETURNS
* void
*****************************************************************************/
void uem_set_bat_status(uem_bmt_struct bmt_status)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
g_uem_cntx_p->bmt_status.status = bmt_status.status;
g_uem_cntx_p->bmt_status.volt = bmt_status.volt;
g_uem_cntx_p->bmt_status.adc = bmt_status.adc;
}
/*****************************************************************************
* Function
* uem_get_bat_status
* DESCRIPTION
* Speaker convert
* PARAMETERS
* bat_status IN
* bat_vol IN
* RETURNS
* void
* GLOBALS AFFECTED
*****************************************************************************/
/*****************************************************************************
* FUNCTION
* uem_get_bat_status
* DESCRIPTION
*
* PARAMETERS
* bmt_status [?]
* RETURNS
* void
*****************************************************************************/
void uem_get_bat_status(uem_bmt_struct *bmt_status)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
ASSERT(bmt_status);
bmt_status->status = g_uem_cntx_p->bmt_status.status;
bmt_status->volt = g_uem_cntx_p->bmt_status.volt;
bmt_status->adc = g_uem_cntx_p->bmt_status.adc;
}
/*****************************************************************************
* Function
* uem_vbat_level_convert
* DESCRIPTION
* vbat convert to user level
* PARAMETERS
* bat_status IN
* bat_vol IN
* RETURNS
* void
* GLOBALS AFFECTED
*****************************************************************************/
/*****************************************************************************
* FUNCTION
* uem_vbat_level_convert
* DESCRIPTION
*
* PARAMETERS
* vbat [IN]
* RETURNS
*
*****************************************************************************/
kal_uint8 uem_vbat_level_convert(kal_int32 vbat)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
return custom_cfg_vbat_level_convert(vbat);
}
/*****************************************************************************
* Function
* uem_set_silent_mode
* DESCRIPTION
* Silent mode
* PARAMETERS
* silent_mode IN
* RETURNS
* void
* GLOBALS AFFECTED
*****************************************************************************/
/*****************************************************************************
* FUNCTION
* uem_set_silent_mode
* DESCRIPTION
*
* PARAMETERS
* silent_mode [IN]
* RETURNS
* void
*****************************************************************************/
void uem_set_silent_mode(kal_bool silent_mode)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
g_uem_cntx_p->rmi_data.silent_mode = silent_mode;
}
/*****************************************************************************
* Function
* uem_get_silent_mode
* DESCRIPTION
* Silent mode
* PARAMETERS
* silent_mode IN
* RETURNS
* void
* GLOBALS AFFECTED
*****************************************************************************/
/*****************************************************************************
* FUNCTION
* uem_get_silent_mode
* DESCRIPTION
*
* PARAMETERS
* void
* RETURNS
*
*****************************************************************************/
kal_uint8 uem_get_silent_mode(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
return g_uem_cntx_p->rmi_data.silent_mode;
}
/*****************************************************************************
* Function
* uem_set_alert_mode
* DESCRIPTION
* Alert mode
* PARAMETERS
* alert_mode IN
* RETURNS
* void
* GLOBALS AFFECTED
*****************************************************************************/
/*****************************************************************************
* FUNCTION
* uem_set_alert_mode
* DESCRIPTION
*
* PARAMETERS
* alert_mode [IN]
* RETURNS
* void
*****************************************************************************/
void uem_set_alert_mode(kal_uint8 alert_mode)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
g_uem_cntx_p->rmi_data.alert_mode = alert_mode;
}
/*****************************************************************************
* Function
* uem_get_alert_mode
* DESCRIPTION
* Alert mode
* PARAMETERS
* silent_mode IN
* RETURNS
* void
* GLOBALS AFFECTED
*****************************************************************************/
/*****************************************************************************
* FUNCTION
* uem_get_alert_mode
* DESCRIPTION
*
* PARAMETERS
* void
* RETURNS
*
*****************************************************************************/
kal_uint8 uem_get_alert_mode(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
return g_uem_cntx_p->rmi_data.alert_mode;
}
/*****************************************************************************
* Function
* uem_set_greeting_text
* DESCRIPTION
* Greeting Text
* PARAMETERS
* mode IN
* greeting_text IN
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -