1、TLMM gpio控制
/* Access the TLMM protocol. */
status = gBS->LocateProtocol( &gEfiTLMMProtocolGuid, NULL, (void**)&TLMMProtocol);
/* Test EFI wrapper interface. */
if(TLMMProtocol)
{
status = TLMMProtocol->ConfigGpio(
(UINT32)EFI_GPIO_CFG(pinNumber, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_2MA),
TLMM_GPIO_ENABLE);
if(!EFI_ERROR(status))
{
TLMMProtocol->GpioOut(
(UINT32)EFI_GPIO_CFG(pinNumber, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_2MA),
GPIO_HIGH_VALUE);
TLMMProtocol->GpioOut(
(UINT32)EFI_GPIO_CFG(pinNumber, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_2MA),
GPIO_LOW_VALUE);
}
2、pwm输出
gBS->LocateProtocol(&gQcomPmicPwmProtocolGuid, NULL, (void **)&PMIC_PWM_Protocol)
PMIC_PWM_Protocol->PwmConfig
PMIC_PWM_Protocol->SetPwmValue // 占空比value/2^pwm_size