Comments (12)
PD micro code is designed to be small to fit into low cost embedded platform.
Yeah that's why I made the method as short as possible. It's a bit annoying to use this way but it should take up a minimum amount of time and memory. I already had to split the display initialization up into several small parts so I could use it without blocking the PD loop ^^"
If you could integrate a nicer method to access the possible voltages and currents that'd be great, otherwise my solution does everything Ineeded.
from pd_micro.
I played around with it and added a method to get the information based on the way it already uses for the debug log. I'll make a pull request once I polished it up a bit.
from pd_micro.
@kaythe, do you think you could share a draft of your improvement? I haven't been able to do the same :(
I haven't had the time to work on it unfortunately, but I'll see if I can get you a rough version today
from pd_micro.
This would be great as I don't know how we can toggle between available options without an external controller.
I admit my C isn't great, but maybe a method to return an array of PD_power_info_t from the power source would be good. Would be good if it was accessible with or without logging on.
from pd_micro.
Awesome! Looking forward to seeing it!
from pd_micro.
@kaythe, do you think you could share a draft of your improvement? I haven't been able to do the same :(
from pd_micro.
@danricho it took a bit longer than expected but you should now be able to see it here: kaythe@a686b23
I want to add some error handling before I create a pull request though.
from pd_micro.
Looks great so far. And even a display output added!
I'm planning to do similar to create a "bench power supply" using either the voltage levels available or PPS if the source can do it.
I will have a tinker when I have some time at my bench.
Cheers!
from pd_micro.
hey,guys,it looks like we all think same things,I have made one OLED current measure kit using INA219 and STM32 reffernced "USB Tester OLED Backpack" on github,recently I want to add the PD function so that this kit can generate any voltage and limit current while draw the scope of voltage, the PCB is done and I am debugging the software,but I have met problem with transmit the code to C while the oringinal code is C ,the software build passed while the target voltage don't change,I an still trying to find the problems.
from pd_micro.
Hi, guys, sorry for this late reply. I did write some code on getting the list of possible voltage and current. But I haven't had time to try and verify so far.
PD micro code is designed to be small to fit into low cost embedded platform. It should be easy to just edit the PD_UFP.cpp to fit your own needs. If you need to port to other platforms, just follow how PD_UFP.cpp does, and ensure these handlers are in your PD task.
- PD_Protocol events handler
- FUSB302 events handler
- timer handler
- interrupt handler
I will work on porting it to Atmel SAMD51 with a new dev board with LCD this year
from pd_micro.
I've had success with your method also @kaythe.
My last step is to add listing PPS mode as a selectable mode aside from the set voltages available. I'm still yet to look how I will do that, how to test for it and to get the ranges available.
from pd_micro.
There is a simple way of getting the available PDOs. Just initialize to 5V Fix provile. When done all PDOs ar stored in the protocol structure
I'm ausing a wrappe class derived from PD_UFP_c
bool PD_PPS_c::get_PDO_info(uint8_t PDO, PD_power_info_t * power_info) // gets advertised voltage in mV
{ // get_PDO_info current in mA, power in 0,01W
memset(power_info,0,sizeof(PD_power_info_t));
if (PD_protocol_get_power_info(&protocol,PDO,power_info))
{ // recalculate units
power_info->min_v*=50; // 50 mV units => [min_v]= 1 mV
power_info->max_v*=50; // 50 mV units => [max_v]= 1 mV
power_info->max_i*=10; // 10 mA units => [max_i]= 1 mA
power_info->max_p*=25; // 250 mW units => [max_p]=10 mW
return true;
} // recalculate units
else
return false;
} // get_PDO_info
from pd_micro.
Related Issues (18)
- Current limit not being enforced in PPS mode HOT 1
- PPS defaults to 5V after working correctly for 60 seconds HOT 1
- Drop in replacement for TPS62175DQCR? It's sold out everywhere, restock eta July 2023.
- Support for PD 3.1 48V HOT 1
- Anywhere to buy these currently? HOT 2
- Wifi enabled with API?
- BOM
- Where to buy? HOT 3
- Does not work with power bank
- Multiple voltage output?
- avrdude: butterfly_recv(): programmer is not responding HOT 2
- PPS above 11V exits after 5 seconds of triggering HOT 2
- Add a diode between VBus and the USB-C connector? HOT 3
- Voltage present after load switch is set to off HOT 3
- How to change the Changing PPS voltage and current in run time? Need an example for it,plz! THX :) HOT 3
- Bootloader HOT 1
- Doesn't recongnize when charging cable is unplugged HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pd_micro.