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

📄 bsptcled.cpp

📁 Microsoft WinCE 6.0 BSP FINAL release source code for use with the i.MX27ADS TO2 WCE600_FINAL_MX27_S
💻 CPP
📖 第 1 页 / 共 2 页
字号:
            {
                if(PmicTCLEDFunLightGetCurrentLevel(pFunCurrentPkt->bank, pFunCurrentPkt->channel, &pFunCurrentPkt->level) != PMIC_SUCCESS)
                {
                    ERRORMSG(TRUE, (TEXT("pfnPmicTCLEDFunLightGetCurrentLevel failed\r\n")));
                    rc = FALSE;
                }
            }
            break;
        case TCLED_IOCTL_FUN_SETCYCLETIME:
            if (pInBuf != NULL)
                pFunCycleTimePkt = (PFUN_CYCLETIME_PKT)pInBuf;
            else
                rc = FALSE;

            if (rc == TRUE)
            {
                if(PmicTCLEDFunLightSetCycleTime(pFunCycleTimePkt->bank, pFunCycleTimePkt->ct) != PMIC_SUCCESS)
                {
                    ERRORMSG(TRUE, (TEXT("pfnPmicTCLEDFunLightSetCycleTime failed\r\n")));
                    rc = FALSE;
                }
            }
            break;
        case TCLED_IOCTL_FUN_GETCYCLETIME:
            if (pOutBuf != NULL)
                pFunCycleTimePkt = (PFUN_CYCLETIME_PKT)pOutBuf;
            else
                rc = FALSE;

            if (rc == TRUE)
            {
                if(PmicTCLEDFunLightGetCycleTime(pFunCycleTimePkt->bank, &pFunCycleTimePkt->ct) != PMIC_SUCCESS)
                {
                    ERRORMSG(TRUE, (TEXT("pfnPmicTCLEDFunLightGetCycleTime failed\r\n")));
                    rc = FALSE;
                }
            }
            break;
        case TCLED_IOCTL_FUN_SETDUTYCYCLE:
            if (pInBuf != NULL)
                pFunDutyCyclePkt = (PFUN_DUTYCYCLE_PKT)pInBuf;
            else
                rc = FALSE;

            if (rc == TRUE)
            {
                if(PmicTCLEDFunLightSetDutyCycle(pFunDutyCyclePkt->bank, pFunDutyCyclePkt->channel, pFunDutyCyclePkt->dc) != PMIC_SUCCESS)
                {
                    ERRORMSG(TRUE, (TEXT("pfnPmicTCLEDFunLightSetDutyCycle failed\r\n")));
                    rc = FALSE;
                }
            }
            break;
        case TCLED_IOCTL_FUN_GETDUTYCYCLE:
            if (pOutBuf != NULL)
                pFunDutyCyclePkt = (PFUN_DUTYCYCLE_PKT)pOutBuf;
            else
                rc = FALSE;

            if (rc == TRUE)
            {
                if(PmicTCLEDFunLightGetDutyCycle(pFunDutyCyclePkt->bank, pFunDutyCyclePkt->channel, &pFunDutyCyclePkt->dc) != PMIC_SUCCESS)
                {
                    ERRORMSG(TRUE, (TEXT("pfnPmicTCLEDFunLightGetDutyCycle failed\r\n")));
                    rc = FALSE;
                }
            }
            break;
        case TCLED_IOCTL_FUN_SETBLENDEDRAMPS:
            if (pInBuf != NULL)
                pFunPatternPkt = (PFUN_PATTERN_PKT)pInBuf;
            else
                rc = FALSE;

            if (rc == TRUE)
            {
                if(PmicTCLEDFunLightBlendedRamps(pFunPatternPkt->bank, TC_OFF) != PMIC_SUCCESS)
                {
                    ERRORMSG(TRUE, (TEXT("pfnPmicTCLEDFunLightBlendedRamps failed\r\n")));
                    rc = FALSE;
                }
                if(PmicTCLEDFunLightBlendedRamps(pFunPatternPkt->bank, pFunPatternPkt->speed) != PMIC_SUCCESS)
                {
                    ERRORMSG(TRUE, (TEXT("pfnPmicTCLEDFunLightBlendedRamps failed\r\n")));
                    rc = FALSE;
                }
            }
            break;
        case TCLED_IOCTL_FUN_SETSAWRAMPS:
            if (pInBuf != NULL)
                pFunPatternPkt = (PFUN_PATTERN_PKT)pInBuf;
            else
                rc = FALSE;

            if (rc == TRUE)
            {
                if(PmicTCLEDFunLightSawRamps(pFunPatternPkt->bank, TC_OFF) != PMIC_SUCCESS)
                {
                    ERRORMSG(TRUE, (TEXT("pfnPmicTCLEDFunLightSawRamps failed\r\n")));
                    rc = FALSE;
                }
                if(PmicTCLEDFunLightSawRamps(pFunPatternPkt->bank, pFunPatternPkt->speed) != PMIC_SUCCESS)
                {
                    ERRORMSG(TRUE, (TEXT("pfnPmicTCLEDFunLightSawRamps failed\r\n")));
                    rc = FALSE;
                }
            }
            break;
        case TCLED_IOCTL_FUN_SETBLENDEDBOWTIE:
            if (pInBuf != NULL)
                pFunPatternPkt = (PFUN_PATTERN_PKT)pInBuf;
            else
                rc = FALSE;

            if (rc == TRUE)
            {
                if(PmicTCLEDFunLightBlendedBowtie(pFunPatternPkt->bank, TC_OFF) != PMIC_SUCCESS)
                {
                    ERRORMSG(TRUE, (TEXT("pfnPmicTCLEDFunLightBlendedBowtie failed\r\n")));
                    rc = FALSE;
                }
                if(PmicTCLEDFunLightBlendedBowtie(pFunPatternPkt->bank, pFunPatternPkt->speed) != PMIC_SUCCESS)
                {
                    ERRORMSG(TRUE, (TEXT("pfnPmicTCLEDFunLightBlendedBowtie failed\r\n")));
                    rc = FALSE;
                }
            }
            break;
        case TCLED_IOCTL_FUN_STROBE:
            if (pInBuf != NULL)
                pFunStrobePkt = (PFUN_STROBE_PKT)pInBuf;
            else
                rc = FALSE;

            if (rc == TRUE)
            {
                if(PmicTCLEDFunLightStrobe(pFunStrobePkt->channel, TC_STROBE_OFF) != PMIC_SUCCESS)
                {
                    ERRORMSG(TRUE, (TEXT("pfnPmicTCLEDFunLightStrobe failed\r\n")));
                    rc = FALSE;
                }
                if(PmicTCLEDFunLightStrobe(pFunStrobePkt->channel, pFunStrobePkt->speed) != PMIC_SUCCESS)
                {
                    ERRORMSG(TRUE, (TEXT("pfnPmicTCLEDFunLightStrobe failed\r\n")));
                    rc = FALSE;
                }
                
            }
            break;
        case TCLED_IOCTL_FUN_RAMPUP:
            if (pInBuf != NULL)
                pFunSpeedPkt = (PFUN_SPEED_PKT )pInBuf;
            else
                rc = FALSE;

            if (rc == TRUE)
            {
                if(PmicTCLEDFunLightRampOff(pFunSpeedPkt->bank, pFunSpeedPkt->channel) != PMIC_SUCCESS)
                {
                    ERRORMSG(TRUE, (TEXT("pfnPmicTCLEDFunLightRampOff failed\r\n")));
                    rc = FALSE;
                }
                if(PmicTCLEDFunLightRampUp(pFunSpeedPkt->bank, pFunSpeedPkt->channel) != PMIC_SUCCESS)
                {
                    ERRORMSG(TRUE, (TEXT("pfnPmicTCLEDFunLightRampUp failed\r\n")));
                    rc = FALSE;
                }
            }
            break;
        case TCLED_IOCTL_FUN_RAMPDOWN:
            if (pInBuf != NULL)
                pFunSpeedPkt = (PFUN_SPEED_PKT )pInBuf;
            else
                rc = FALSE;

            if (rc == TRUE)
            {
                if(PmicTCLEDFunLightRampOff(pFunSpeedPkt->bank, pFunSpeedPkt->channel) != PMIC_SUCCESS)
                {
                    ERRORMSG(TRUE, (TEXT("pfnPmicTCLEDFunLightRampOff failed\r\n")));
                    rc = FALSE;
                }
                if(PmicTCLEDFunLightRampDown(pFunSpeedPkt->bank, pFunSpeedPkt->channel) != PMIC_SUCCESS)
                {
                    ERRORMSG(TRUE, (TEXT("pfnPmicTCLEDFunLightRampDown failed\r\n")));
                    rc = FALSE;
                }
            }
            break;
        case TCLED_IOCTL_FUN_RAMPOFF:
            if (pInBuf != NULL)
                pFunSpeedPkt = (PFUN_SPEED_PKT )pInBuf;
            else
                rc = FALSE;

            if (rc == TRUE)
            {
                if(PmicTCLEDFunLightRampOff(pFunSpeedPkt->bank, pFunSpeedPkt->channel) != PMIC_SUCCESS)
                {
                    ERRORMSG(TRUE, (TEXT("pfnPmicTCLEDFunLightRampOff failed\r\n")));
                    rc = FALSE;
                }
            }
            break;
        case TCLED_IOCTL_FUN_TRIODEON:
            if (pInBuf != NULL)
                pFunSpeedPkt = (PFUN_SPEED_PKT )pInBuf;
            else
                rc = FALSE;

            if (rc == TRUE)
            {
                if(PmicTCLEDFunLightTriodeOn(pFunSpeedPkt->bank, pFunSpeedPkt->channel) != PMIC_SUCCESS)
                {
                    ERRORMSG(TRUE, (TEXT("pfnPmicTCLEDFunLightTriodeOn failed\r\n")));
                    rc = FALSE;
                }
            }
            break;
        case TCLED_IOCTL_FUN_TRIODEOFF:
            if (pInBuf != NULL)
                pFunSpeedPkt = (PFUN_SPEED_PKT )pInBuf;
            else
                rc = FALSE;

            if (rc == TRUE)
            {
                if(PmicTCLEDFunLightTriodeOff(pFunSpeedPkt->bank, pFunSpeedPkt->channel) != PMIC_SUCCESS)
                {
                    ERRORMSG(TRUE, (TEXT("pfnPmicTCLEDFunLightTriodeOff failed\r\n")));
                    rc = FALSE;
                }
            }
            break;
        case TCLED_IOCTL_FUN_CHASINGLIGHTSPATTERN:
            if (pInBuf != NULL)
                pFunPatternPkt = (PFUN_PATTERN_PKT )pInBuf;
            else
                rc = FALSE;

            if (rc == TRUE)
            {
                if(PmicTCLEDFunLightChasingLightsPattern(pFunPatternPkt->bank, pFunPatternPkt->pattern, TC_OFF) != PMIC_SUCCESS)
                {
                    ERRORMSG(TRUE, (TEXT("pfnPmicTCLEDFunLightChasingLightsPattern failed\r\n")));
                    rc = FALSE;
                }
                if(PmicTCLEDFunLightChasingLightsPattern(pFunPatternPkt->bank, pFunPatternPkt->pattern, pFunPatternPkt->speed) != PMIC_SUCCESS)
                {
                    ERRORMSG(TRUE, (TEXT("pfnPmicTCLEDFunLightChasingLightsPattern failed\r\n")));
                    rc = FALSE;
                }
            }
            break;
        case TCLED_IOCTL_FUN_ENABLEEDGESLOW:
            if(PmicTCLEDEnableEdgeSlow() != PMIC_SUCCESS)
            {
                ERRORMSG(TRUE, (TEXT("pfnPmicTCLEDEnableEdgeSlow failed\r\n")));
                rc = FALSE;
            }
            break;
        case TCLED_IOCTL_FUN_DISABLEEDGESLOW:
            if(PmicTCLEDDisableEdgeSlow() != PMIC_SUCCESS)
            {
                ERRORMSG(TRUE, (TEXT("pfnPmicTCLEDDisableEdgeSlow failed\r\n")));
                rc = FALSE;
            }
            break;
        case TCLED_IOCTL_FUN_ENABLEHALFCURRENT:
            if(PmicTCLEDEnableHalfCurrent() != PMIC_SUCCESS)
            {
                ERRORMSG(TRUE, (TEXT("pfnPmicTCLEDEnableHalfCurrent failed\r\n")));
                rc = FALSE;
            }
            break;
        case TCLED_IOCTL_FUN_DISABLEHALFCURRENT:
            if(PmicTCLEDDisableHalfCurrent() != PMIC_SUCCESS)
            {
                ERRORMSG(TRUE, (TEXT("pfnPmicTCLEDDisableHalfCurrent failed\r\n")));
                rc = FALSE;
            }
            break;

    }

    DEBUGMSG(BSP_TCLED_DEBUG, (TEXT("-BSPTcledIOControl \r\n")));

    return rc;
}

⌨️ 快捷键说明

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