Part 1
요약·해설
TCPC Devicetree와 policy-engine의 Source ready 흐름을 설명합니다.
Power Source
5 V · 9 V · 15 V
RDO · 100 mA
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
3A94562A4FC103461E414DCA824AAC4EA6D7D194CCB0F294403164CF1DFE3617
.. zephyr:code-sample:: usb-c-source
:name: Basic USB-C Source
:relevant-api: _usbc_device_api
Implement a USB-C Power Delivery application in the form of a USB-C Source.
Overview
********
This example demonstrates how to create a USB-C Power Delivery application
using the USB-C subsystem. The application implements a USB-C Source device.
After a USB-C Sink device is plugged into the USB-C Source device, it
negotiates with the Source device to provide 5V at 100mA, 9V at 100mA,
or 15V at 100mA and the Requested Data Object (RDO) provided by the Source
is displayed.
.. _usb-c-source-sample-requirements:
Requirements
************
The TCPC device used by the sample is specified in the devicetree
node that's compatible with ``usb-c-connector``.
The sample has been tested on ``stm32g081b_eval``.
An overlay file is provided.
Building and Running
********************
Build and flash as follows, changing ``stm32g081b_eval`` for your board:
.. zephyr-app-commands::
:zephyr-app: samples/subsys/usb_c/source
:board: stm32g081b_eval
:goals: build flash
:compact:
Connect a sink device and see console output:
Sample Output
=============
.. code-block:: console
PRL_TX_SUSPEND
PRL_HR_SUSPEND
PE_SUSPEND
UnattachedWait.SRC
Unattached.SRC
AttachWait.SRC
Attached.SRC
PE_SRC_Startup
PRL_INIT
PRL_HR_Wait_for_Request
PRL_Tx_PHY_Layer_Reset
PRL_Tx_Wait_for_Message_Request
PE_SRC_Send_Capabilities
PRL_Tx_Wait_for_PHY_response
PRL_Tx_Wait_for_Message_Request
PE_SRC_Discover
PE_SRC_Send_Capabilities
PRL_Tx_Wait_for_PHY_response
RECV 1042/1
[0]1300280a
PRL_Tx_Wait_for_Message_Request
PE_SRC_Negotiate_Capability
PE_SRC_Transition_Supply
PRL_Tx_Wait_for_PHY_response
RECV 0441/0
PRL_Tx_Wait_for_Message_Request
PE_SRC_Ready
PRL_Tx_Wait_for_PHY_response
RECV 0641/0
PRL_Tx_Wait_for_Message_Request
REQUEST RDO: 1300280a
Object Position: 1
Giveback: 0
Capability Mismatch: 0
USB Comm Capable: 1
No USB Suspend: 1
Unchunk Ext MSG Support: 0
Operating Current: 100 mA
Min Operating Current: 100 mA
Part 3
한국어 전문 번역
개요
USB-C subsystem을 사용해 USB-C Power Delivery application을 만드는 example입니다. Application은 USB-C Source device를 구현합니다.
USB-C Sink를 Source에 연결하면 5 V 100 mA, 9 V 100 mA 또는 15 V 100 mA 가운데 하나를 공급하도록 협상하고 Source가 받은 Requested Data Object(RDO)를 표시합니다.
요구 사항
Sample이 사용하는 TCPC device는 Devicetree에서 usb-c-connector compatible node로 지정합니다. stm32g081b_eval에서 시험됐으며 해당 board용 overlay file이 제공됩니다.
빌드 및 실행
다음과 같이 build하고 flash합니다. 다른 board에서는 stm32g081b_eval을 대상 board 이름으로 바꿉니다.
west build -b stm32g081b_eval samples/subsys/usb_c/source
west flash
Sink device를 연결하고 console output을 확인합니다.
샘플 출력
Output은 Source protocol과 policy engine을 suspend 상태에서 깨운 뒤 Unattached.SRC, attach, startup, capability 전송, RDO 수신, supply 전환을 거쳐 PE_SRC_Ready에 도달하는 흐름을 보여 줍니다. 마지막에는 object position 1, operating/minimum current 100 mA와 USB communication flag를 포함한 RDO field가 해석됩니다.
PRL_TX_SUSPEND
PRL_HR_SUSPEND
PE_SUSPEND
UnattachedWait.SRC
Unattached.SRC
AttachWait.SRC
Attached.SRC
PE_SRC_Startup
PRL_INIT
PRL_HR_Wait_for_Request
PRL_Tx_PHY_Layer_Reset
PRL_Tx_Wait_for_Message_Request
PE_SRC_Send_Capabilities
PRL_Tx_Wait_for_PHY_response
PRL_Tx_Wait_for_Message_Request
PE_SRC_Discover
PE_SRC_Send_Capabilities
PRL_Tx_Wait_for_PHY_response
RECV 1042/1
[0]1300280a
PRL_Tx_Wait_for_Message_Request
PE_SRC_Negotiate_Capability
PE_SRC_Transition_Supply
PRL_Tx_Wait_for_PHY_response
RECV 0441/0
PRL_Tx_Wait_for_Message_Request
PE_SRC_Ready
PRL_Tx_Wait_for_PHY_response
RECV 0641/0
PRL_Tx_Wait_for_Message_Request
REQUEST RDO: 1300280a
Object Position: 1
Giveback: 0
Capability Mismatch: 0
USB Comm Capable: 1
No USB Suspend: 1
Unchunk Ext MSG Support: 0
Operating Current: 100 mA
Min Operating Current: 100 mA
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.