Lines Matching refs:temp

28     uint32_t temp;  in PF1550_SetChargerAttibute()  local
34 temp = (attribute->fastChargeCurrent_mA > 1000U) ? 1000U : attribute->fastChargeCurrent_mA; in PF1550_SetChargerAttibute()
35 temp = (attribute->fastChargeCurrent_mA < 100U) ? 100U : temp; in PF1550_SetChargerAttibute()
36 temp = (temp - 100U) / 50U; in PF1550_SetChargerAttibute()
37 (void)PF1550_ModifyReg(handle, PF1550_CHG_CURR_CNFG, 0x1FU, (uint8_t)temp); in PF1550_SetChargerAttibute()
40temp = (attribute->fastChargeVoltage_uV > 4440000U) ? 4440000U : attribute->fastChargeVoltage_uV; in PF1550_SetChargerAttibute()
41 temp = (attribute->fastChargeVoltage_uV < 3500000U) ? 3500000U : temp; in PF1550_SetChargerAttibute()
42 temp = (temp - 3340000U) / 20000U; in PF1550_SetChargerAttibute()
43 (void)PF1550_ModifyReg(handle, PF1550_BATT_REG, 0x3FU, (uint8_t)temp); in PF1550_SetChargerAttibute()
49 temp = (attribute->fastChargeTime_hr > 14U) ? 14U : attribute->fastChargeTime_hr; in PF1550_SetChargerAttibute()
50 temp = temp >> 1U; in PF1550_SetChargerAttibute()
51 (void)PF1550_ModifyReg(handle, PF1550_CHG_TMR, 0x03U, (uint8_t)temp); in PF1550_SetChargerAttibute()
54 temp = (attribute->endOfChargeTime_min > 70U) ? 70U : attribute->endOfChargeTime_min; in PF1550_SetChargerAttibute()
55 temp = (temp / 10U) << 3U; in PF1550_SetChargerAttibute()
56 (void)PF1550_ModifyReg(handle, PF1550_CHG_TMR, 0x38U, (uint8_t)temp); in PF1550_SetChargerAttibute()
61 temp = 4U << 4U; in PF1550_SetChargerAttibute()
65 temp = 3U << 4U; in PF1550_SetChargerAttibute()
69 temp = 2U << 4U; in PF1550_SetChargerAttibute()
73 temp = 1U << 4U; in PF1550_SetChargerAttibute()
77 temp = 0U; in PF1550_SetChargerAttibute()
79 (void)PF1550_ModifyReg(handle, PF1550_CHG_EOC_CNFG, 0x70U, (uint8_t)temp); in PF1550_SetChargerAttibute()
84 temp = 3U; in PF1550_SetChargerAttibute()
88temp = (attribute->restartVoltageThreshold_uV > 200000U) ? 200000U : attribute->restartVoltageThre… in PF1550_SetChargerAttibute()
89 temp = (attribute->restartVoltageThreshold_uV < 100000U) ? 100000U : temp; in PF1550_SetChargerAttibute()
90 temp = (temp - 100000U) / 50000U; in PF1550_SetChargerAttibute()
92 (void)PF1550_ModifyReg(handle, PF1550_CHG_EOC_CNFG, 0x03U, (uint8_t)temp); in PF1550_SetChargerAttibute()
95temp = (attribute->miniSystemVoltage_uV > 4300000U) ? 4300000U : attribute->miniSystemVoltage_uV; in PF1550_SetChargerAttibute()
96 if (temp <= 3500000U) in PF1550_SetChargerAttibute()
98 temp = 0x0U; in PF1550_SetChargerAttibute()
100 else if (temp <= 3700000U) in PF1550_SetChargerAttibute()
102 temp = 0x1U << 6U; in PF1550_SetChargerAttibute()
106 temp = 0x2U << 6U; in PF1550_SetChargerAttibute()
108 (void)PF1550_ModifyReg(handle, PF1550_BATT_REG, 0xC0U, (uint8_t)temp); in PF1550_SetChargerAttibute()
117 uint8_t temp = 0U; in PF1550_GetChargerStatus() local
122 (void)PF1550_ReadReg(handle, PF1550_VBUS_SNS, &temp); in PF1550_GetChargerStatus()
123 status |= temp; in PF1550_GetChargerStatus()
124 (void)PF1550_ReadReg(handle, PF1550_CHG_SNS, &temp); in PF1550_GetChargerStatus()
125 status |= (uint32_t)temp << 8U; in PF1550_GetChargerStatus()
126 (void)PF1550_ReadReg(handle, PF1550_BATT_SNS, &temp); in PF1550_GetChargerStatus()
127 status |= (uint32_t)temp << 16U; in PF1550_GetChargerStatus()
163 uint32_t temp; in PF1550_SetBatFETAttibute() local
171 temp = 0x0U; in PF1550_SetBatFETAttibute()
175 temp = 0x3U; in PF1550_SetBatFETAttibute()
179 temp = 0x2U; in PF1550_SetBatFETAttibute()
183 temp = 0x1U; in PF1550_SetBatFETAttibute()
185 temp = temp << 4U; in PF1550_SetBatFETAttibute()
186 (void)PF1550_ModifyReg(handle, PF1550_BATFET_CNFG, 0x30U, (uint8_t)temp); in PF1550_SetBatFETAttibute()
190 temp = 0U; in PF1550_SetBatFETAttibute()
191 temp |= attribute->overcurrentProtectEnable ? 0x0U : 0x8U; in PF1550_SetBatFETAttibute()
192 temp |= attribute->overcurrentProtectEnableNoVbus ? 0x80U : 0x0U; in PF1550_SetBatFETAttibute()
193 (void)PF1550_ModifyReg(handle, PF1550_BATFET_CNFG, 0x88U, (uint8_t)temp); in PF1550_SetBatFETAttibute()
200 temp = 0U; in PF1550_SetBatFETAttibute()
201 temp |= attribute->overvoltageFaultProtectEnable ? 0x1U : 0x0U; in PF1550_SetBatFETAttibute()
202 temp |= attribute->watchDogFaultProtectEnable ? 0x2U : 0x0U; in PF1550_SetBatFETAttibute()
203 temp |= attribute->thermalFaultProtectEnable ? 0x4U : 0x0U; in PF1550_SetBatFETAttibute()
204 temp |= attribute->thermalShutdownProtectEnable ? 0x8U : 0x0U; in PF1550_SetBatFETAttibute()
205 temp |= attribute->timerFaultProtectEnable ? 0x10U : 0x0U; in PF1550_SetBatFETAttibute()
206 (void)PF1550_ModifyReg(handle, PF1550_FAULT_BATFET_CNFG, 0x1FU, (uint8_t)temp); in PF1550_SetBatFETAttibute()
211 uint32_t temp; in PF1550_SetPowerPathAttibute() local
219 temp = 20U; in PF1550_SetPowerPathAttibute()
223 temp = 19U; in PF1550_SetPowerPathAttibute()
227 temp = (attribute->vbusCurrentLimit_mA + 900U) / 100U; in PF1550_SetPowerPathAttibute()
231 temp = (attribute->vbusCurrentLimit_mA + 350U) / 50U; in PF1550_SetPowerPathAttibute()
235 temp = (attribute->vbusCurrentLimit_mA - 10U) / 5U; in PF1550_SetPowerPathAttibute()
239 temp = 0U; in PF1550_SetPowerPathAttibute()
241 temp = temp << 3U; in PF1550_SetPowerPathAttibute()
242 (void)PF1550_ModifyReg(handle, PF1550_VBUS_INLIM_CNFG, 0xF8U, (uint8_t)temp); in PF1550_SetPowerPathAttibute()
245 temp = (attribute->vbusDpmVoltage_uV < 3900000U) ? 3900000U : attribute->vbusDpmVoltage_uV; in PF1550_SetPowerPathAttibute()
246 temp = (attribute->vbusDpmVoltage_uV > 4600000U) ? 4600000U : temp; in PF1550_SetPowerPathAttibute()
247 temp = (temp - 3900000U) / 100000U; in PF1550_SetPowerPathAttibute()
248 (void)PF1550_ModifyReg(handle, PF1550_VBUS_LIN_DPM, 0x07U, (uint8_t)temp); in PF1550_SetPowerPathAttibute()
253 temp = 0U; in PF1550_SetPowerPathAttibute()
257 temp = 1U; in PF1550_SetPowerPathAttibute()
259 temp = temp << 5U; in PF1550_SetPowerPathAttibute()
260 (void)PF1550_ModifyReg(handle, PF1550_VBUS_LIN_DPM, 0x20U, (uint8_t)temp); in PF1550_SetPowerPathAttibute()
265 temp = 1U; in PF1550_SetPowerPathAttibute()
269 temp = 2U; in PF1550_SetPowerPathAttibute()
273 temp = 3U; in PF1550_SetPowerPathAttibute()
275 (void)PF1550_ModifyReg(handle, PF1550_DBNC_DELAY_TIME, 0x03U, (uint8_t)temp); in PF1550_SetPowerPathAttibute()
280 temp = 1U; in PF1550_SetPowerPathAttibute()
284 temp = 2U; in PF1550_SetPowerPathAttibute()
288 temp = 3U; in PF1550_SetPowerPathAttibute()
290 (void)PF1550_ModifyReg(handle, PF1550_VBUS2SYS_CNFG, 0x03U, (uint8_t)temp); in PF1550_SetPowerPathAttibute()
295 temp = 0U; in PF1550_SetPowerPathAttibute()
299 temp = 1U << 2U; in PF1550_SetPowerPathAttibute()
301 (void)PF1550_ModifyReg(handle, PF1550_VBUS2SYS_CNFG, 0x04U, (uint8_t)temp); in PF1550_SetPowerPathAttibute()
306 temp = 0U; in PF1550_SetPowerPathAttibute()
310 temp = 1U << 1U; in PF1550_SetPowerPathAttibute()
312 (void)PF1550_ModifyReg(handle, PF1550_USB_PHY_LDO_CNFG, 0x02U, (uint8_t)temp); in PF1550_SetPowerPathAttibute()
317 temp = 0U; in PF1550_SetPowerPathAttibute()
321 temp = 1U; in PF1550_SetPowerPathAttibute()
325 temp = 2U; in PF1550_SetPowerPathAttibute()
329 temp = 3U; in PF1550_SetPowerPathAttibute()
331 temp = temp << 4U; in PF1550_SetPowerPathAttibute()
332 (void)PF1550_ModifyReg(handle, PF1550_DBNC_DELAY_TIME, 0x30U, (uint8_t)temp); in PF1550_SetPowerPathAttibute()
336 temp = attribute->usbPhyDischargerEnbale ? 0x1U : 0x0U; in PF1550_SetPowerPathAttibute()
337 temp |= attribute->usbPhyLdoEnable ? 0x4U : 0x0U; in PF1550_SetPowerPathAttibute()
338 (void)PF1550_ModifyReg(handle, PF1550_USB_PHY_LDO_CNFG, 0x05U, (uint8_t)temp); in PF1550_SetPowerPathAttibute()
343 uint32_t temp; in PF1550_SetThermalAttibute() local
354 temp = 0U; in PF1550_SetThermalAttibute()
358 temp = 1U; in PF1550_SetThermalAttibute()
362 temp = 2U; in PF1550_SetThermalAttibute()
364 temp = temp << 2U; in PF1550_SetThermalAttibute()
365 (void)PF1550_ModifyReg(handle, PF1550_THM_REG_CNFG, 0x0CU, (uint8_t)temp); in PF1550_SetThermalAttibute()
368 temp = (attribute->thermalColdThreshold_C <= -10) ? (1U << 4U) : 0U; in PF1550_SetThermalAttibute()
369 (void)PF1550_ModifyReg(handle, PF1550_THM_REG_CNFG, 0x10U, (uint8_t)temp); in PF1550_SetThermalAttibute()
372 temp = (attribute->thermalCoolThreshold_C <= 10) ? (1U << 1U) : 0U; in PF1550_SetThermalAttibute()
373 (void)PF1550_ModifyReg(handle, PF1550_THM_ADJ_SETTING, 0x02U, (uint8_t)temp); in PF1550_SetThermalAttibute()
376 temp = (attribute->thermalWarmThreshold_C < 50) ? 0U : 1U; in PF1550_SetThermalAttibute()
377 (void)PF1550_ModifyReg(handle, PF1550_THM_ADJ_SETTING, 0x01U, (uint8_t)temp); in PF1550_SetThermalAttibute()
380 temp = (attribute->thermalHotThreshold_C < 60) ? (1U << 5U) : 0U; in PF1550_SetThermalAttibute()
381 (void)PF1550_ModifyReg(handle, PF1550_THM_REG_CNFG, 0x20U, (uint8_t)temp); in PF1550_SetThermalAttibute()
386 temp = 3U; in PF1550_SetThermalAttibute()
390 temp = 2U; in PF1550_SetThermalAttibute()
394 temp = 1U; in PF1550_SetThermalAttibute()
398 temp = 0U; in PF1550_SetThermalAttibute()
400 temp = temp << 2U; in PF1550_SetThermalAttibute()
401 (void)PF1550_ModifyReg(handle, PF1550_THM_ADJ_SETTING, 0x0CU, (uint8_t)temp); in PF1550_SetThermalAttibute()
406 temp = 3U; in PF1550_SetThermalAttibute()
410 temp = 2U; in PF1550_SetThermalAttibute()
414 temp = 1U; in PF1550_SetThermalAttibute()
418 temp = 0U; in PF1550_SetThermalAttibute()
420 temp = temp << 4U; in PF1550_SetThermalAttibute()
421 (void)PF1550_ModifyReg(handle, PF1550_THM_ADJ_SETTING, 0x30U, (uint8_t)temp); in PF1550_SetThermalAttibute()
424 temp = attribute->thermalFoldbackEnable ? (1U << 7U) : 0U; in PF1550_SetThermalAttibute()
425 (void)PF1550_ModifyReg(handle, PF1550_THM_REG_CNFG, 0x80U, (uint8_t)temp); in PF1550_SetThermalAttibute()
437 uint32_t temp; in PF1550_SetLedAttibute() local
443 temp = (attribute->mode == kPF1550_LedMode_1) ? (1U << 4U) : 0x0U; in PF1550_SetLedAttibute()
444 (void)PF1550_ModifyReg(handle, PF1550_LED_CNFG, 0x10U, (uint8_t)temp); in PF1550_SetLedAttibute()
447 temp = (attribute->pwmDuty_pct > 100U) ? 100U : attribute->pwmDuty_pct; in PF1550_SetLedAttibute()
448 temp = (temp * 32U) / 100U; in PF1550_SetLedAttibute()
449 (void)PF1550_ModifyReg(handle, PF1550_LED_PWM, 0x3FU, (uint8_t)temp); in PF1550_SetLedAttibute()
454 temp = 0U; in PF1550_SetLedAttibute()
458 temp = 1U; in PF1550_SetLedAttibute()
462 temp = 2U; in PF1550_SetLedAttibute()
466 temp = 3U; in PF1550_SetLedAttibute()
468 (void)PF1550_ModifyReg(handle, PF1550_LED_CNFG, 0x03U, (uint8_t)temp); in PF1550_SetLedAttibute()
471 temp = attribute->rampEnable ? 0x40U : 0x0U; in PF1550_SetLedAttibute()
472 (void)PF1550_ModifyReg(handle, PF1550_LED_PWM, 0x40U, (uint8_t)temp); in PF1550_SetLedAttibute()
475 temp = attribute->swCtrlEnable ? 0x20U : 0x0U; in PF1550_SetLedAttibute()
476 (void)PF1550_ModifyReg(handle, PF1550_LED_CNFG, 0x20U, (uint8_t)temp); in PF1550_SetLedAttibute()