Old Code Restoration

This is code I’ve contributed to professionally and delivered to NXP. NXP have released it under the BSD 3-Clause license, so I’ve made a copy for reference:

https://github.com/nakane1chome/MCUXpresso-SDK-USBPD-Stack/tree/main

I have not included other parts of MCUXpresso, so it is unlikely to compile as-is.

About

This is a device independent USBPD Stack. It is designed to work with the Universal Serial Bus Type-C® Port Controller Interface Specification (TCPC) as the interface phy, in particular the NXP PTN5110. However the core state machine is device and phy independent.

This software was release to work with the NXP USB Type-C Shield 2 Demo Kit and the NXP LPC MCU series.

The other software from MCUXpresso is not include in this repository. This USBPD Stack is independent of the MCUXpresso middleware.

See:

NXP have released this as BSD-3-Clause software. This version is unchanged from the NXP release.

History

The code has been changed alot before release by NXP in a reusable middleware form.

The original code was designed for a 8051 based MCU running on Keil’s RTX tasker, compiled via Keil’s C compiler. It was ported to ARM Cortex M0 based LPC MCUs, but still running on the Keil RTX, which became ARM’s CMSIS RTOS. As it was designed for the 8051 the original version stored all state in global data structures. It also assumed an I2C based interface.

It was originally designed for USBPD version 1.0 and pre dates USB Type-C. It has been updated through the generations of USBPD 2.0 and 3.0 and also for the introduction of USB Type-C.

The middleware version appears to have been updated to be RTOS independent, replace global state data with a state pointer (pd_handle *) for each function and has been decoupled from the I2C interface.