Skip to content

Conversation

@igi540
Copy link
Collaborator

@igi540 igi540 commented Oct 8, 2025

Introduce initial, beta public headers aligned with esp-idf/esp-usb style:

  • Type-C core (CC-only): attach/detach/orientation & power-role control

    • File: esp-usb/type_c/include/esp_typec.h
    • Install/uninstall + library info
    • Events: ATTACHED/DETACHED/ORIENTATION/PWR_ROLE/ERROR
    • Factory: esp_typec_port_create_husb320() (HUSB320; CC-only)
    • APIs: esp_typec_set_power_role(), esp_typec_get_orientation(), esp_typec_is_attached(), esp_typec_port_destroy()
  • Power Delivery (PD-only): runtime role control and sink requests

    • File: esp-usb/type_c/include/esp_typec_pd.h
    • Install/uninstall + optional polling handler + library info
    • Events: ATTACHED/DETACHED/CONTRACT_READY/CONTRACT_LOST/PPS_ADJUSTED/ERROR
    • Factory: esp_typec_pd_port_create_fusb302() (FUSB302; PD-capable)
    • APIs: esp_typec_pd_set_power_role(), esp_typec_pd_sink_request_fixed(), esp_typec_pd_sink_request_pps(), esp_typec_pd_get_contract(), esp_typec_pd_get_orientation(), esp_typec_pd_is_attached(), esp_typec_pd_port_destroy()

Decisions:

  • Split CC-only and PD APIs to keep modules independent and build-light.
  • Reused event naming across CC and PD for consistency; separate enums to avoid coupling.
  • Only include HUSB320 (CC-only) and FUSB302 (PD-capable) factories for now; removed any HUSB311 references.
  • New files use SPDX year 2025 per repo convention.

Notes:

  • APIs are intentionally minimal; more controls (source caps, swaps, DRP policies) can be added without breaking the current surface.
  • Data-role (host/device) integration is out of scope for this step.

Description

Related

Testing


Checklist

Before submitting a Pull Request, please ensure the following:

  • 🚨 This PR does not introduce breaking changes.
  • All CI checks (GH Actions) pass.
  • Documentation is updated as needed.
  • Tests are updated or added as necessary.
  • Code is well-commented, especially in complex areas.
  • Git history is clean — commits are squashed to the minimum necessary.

@igi540 igi540 self-assigned this Oct 8, 2025
@igi540 igi540 force-pushed the feat/usb_pd_stack_init branch 6 times, most recently from 7d8cbda to d385b5d Compare October 14, 2025 18:05
Introduce initial, beta public headers aligned with esp-idf/esp-usb style:
- Type-C core (CC-only): attach/detach/orientation & power-role control
  - File: esp-usb/type_c/include/esp_typec.h
  - Install/uninstall + library info
  - Events: ATTACHED/DETACHED/ORIENTATION/PWR_ROLE/ERROR
  - Factory: esp_typec_port_create_husb320() (HUSB320; CC-only)
  - APIs: esp_typec_set_power_role(), esp_typec_get_orientation(),
          esp_typec_is_attached(), esp_typec_port_destroy()

- Power Delivery (PD-only): runtime role control and sink requests
  - File: esp-usb/type_c/include/esp_typec_pd.h
  - Install/uninstall + optional polling handler + library info
  - Events: ATTACHED/DETACHED/CONTRACT_READY/CONTRACT_LOST/PPS_ADJUSTED/ERROR
  - Factory: esp_typec_pd_port_create_fusb302() (FUSB302; PD-capable)
  - APIs: esp_typec_pd_set_power_role(),
          esp_typec_pd_sink_request_fixed(), esp_typec_pd_sink_request_pps(),
          esp_typec_pd_get_contract(), esp_typec_pd_get_orientation(),
          esp_typec_pd_is_attached(), esp_typec_pd_port_destroy()

Decisions:
- Split CC-only and PD APIs to keep modules independent and build-light.
- Reused event naming across CC and PD for consistency; separate enums to
  avoid coupling.
- Only include HUSB320 (CC-only) and FUSB302 (PD-capable) factories for now;
  removed any HUSB311 references.
- New files use SPDX year 2025 per repo convention.

Notes:
- APIs are intentionally minimal; more controls (source caps, swaps, DRP
  policies) can be added without breaking the current surface.
- Data-role (host/device) integration is out of scope for this step.
@igi540 igi540 force-pushed the feat/usb_pd_stack_init branch from d385b5d to a2521f8 Compare October 15, 2025 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants