FX3学习笔记5-状态机

1、实验环境

硬件平台:CYUSB3KIT-003 EZ-USB® FX3™ SuperSpeed Explorer Kit

sdk版本:EZ-USB FX3 SDK1.3 / SuperSpeed Explorer Kit 1.0

实验例程:cyfxuvc_an75779(cypress官网下载demo)

2、实验目的

获取状态机的执行状态,方便跟踪调试程序

3、状态机配置说明

注意:

状态机时钟可以选择internal和external,如果选择external则必须将板子的PCKL引脚与外部时钟相连,否则状态机不工作。

4、状态机启动流程

4.1状态机配置装载api

extern CyU3PReturnStatus_t
CyU3PGpifLoad (
        const CyU3PGpifConfig_t *conf           /**< Pointer to GPIF configuration structure. */
        );

4.2状态机启动api

extern CyU3PReturnStatus_t
CyU3PGpifSMStart (
        uint8_t stateIndex,             /**< State from which to start execution. This should be 0 in most cases. */
        uint8_t initialAlpha            /**< Initial alpha values to start GPIF state machine operation with. */
        );

4.3获取状态机当前状态api

extern CyU3PReturnStatus_t
CyU3PGpifGetSMState (
        uint8_t *curState_p                     /**< Return parameter to be filled with current state information. */
        );

猜你喜欢

转载自blog.csdn.net/gyb510/article/details/54946493