```mermaid
graph TD
    A[初始化] --> B[TypeC_Init]
    B --> C[状态机TypeC_RunStateMachine]
    
    C --> D{当前状态}
    D --> E[Unattached]
    D --> F[AttachWait]
    D --> G[Attached]
    D --> H[ErrorRecovery]
    
    E --> I[CC检测]
    F --> I
    G --> I
    
    I --> J{CC中断处理}
    J --> K[CC去抖]
    K --> L{去抖完成?}
    L -->|No| K
    L -->|Yes| M[更新CC状态]
    
    M --> N[状态转换]
    N --> C
    
    subgraph CC检测流程
    O[TypeC_CCDetHandleFunc] --> P[获取CC ADC值]
    P --> Q[CC电平判断]
    Q --> R[更新CC Match状态]
    end
    
    subgraph VBUS检测流程 
    S[VBUS监测] --> T[VBUS电压判断]
    T --> U[VBUS状态更新]
    end

    subgraph 去抖处理
    V[TypeC_CCDebounce] --> W[启动去抖定时器]
    W --> X[等待定时器超时]
    X --> Y[确认CC状态稳定]
    end
```