-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
draft driver for STUSB4500 #14895
base: master
Are you sure you want to change the base?
draft driver for STUSB4500 #14895
Conversation
[Experimental Bot, please feedback here] No, this PR does not fully meet the NuttX requirements. While it provides a summary and testing information, it lacks crucial details. Here's a breakdown of what's missing:
By addressing these points, the PR will be much more likely to be accepted. Remember to be clear, concise, and provide as much detail as possible. |
90c9862
to
e035f45
Compare
drivers/usbmisc/Kconfig
Outdated
default n | ||
select I2C | ||
---help--- | ||
Enable device driver for ST standalone USB PD sink controller |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enable device driver for ST standalone USB PD sink controller | |
Enable device driver for ST standalone USB PD (power delivery) sink controller that addresses sink up to 100 W (20 V; 5 A). |
drivers/usbmisc/stusb4500.c
Outdated
ret = I2C_TRANSFER(priv->i2c, msg, 2); | ||
if (ret >= 0) | ||
{ | ||
#define BUFFER_SIZE 128 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move this macro to the right section of this file (top) or to stusb4500.h, also use STUSB4500_BUFFER_SIZE to avoid name collision
uint8_t battery : 2; | ||
} bat; | ||
} | ||
USB_PD_SNK_PDO_TYPEDEF __attribute__((__packed__)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to use packed attribute from compiler.h
right now it is only possible to change the delivered power on the fly by 1. selecting PDO2 slot 2. write to POO2 3. renegotiate power by sw reset command
e035f45
to
2531052
Compare
Right now it is only possible to change the delivered power on the fly by
Note: Please adhere to Contributing Guidelines.
Summary
Create a basic driver to negotiate power delivery with walladapter using STM STUSB4500 chip.
This is a standalone driver that does not change any other code. It may be selected, or not via kconfig.
Impact
New feature. No impact to any existing user or application expected.
Testing
Tested on custom board.