Skip to content

Conversation

@AmirTajaddodi
Copy link
Contributor

Changelist

Testing Done

Resolved Tickets

@Aditya-Dhiman4 Aditya-Dhiman4 force-pushed the amir/loadswitch_refactoring branch from db6923d to 8767da1 Compare October 14, 2025 08:25
@Lucien950 Lucien950 added Systems Shared App Level Modules Drivers Shared Hardware Abstractions throughout the boards. and removed Systems Shared App Level Modules labels Oct 22, 2025
@Aditya-Dhiman4 Aditya-Dhiman4 force-pushed the amir/loadswitch_refactoring branch from cecab5b to 8f6e10e Compare November 24, 2025 03:44
@Aditya-Dhiman4 Aditya-Dhiman4 self-assigned this Nov 24, 2025
@Aditya-Dhiman4 Aditya-Dhiman4 force-pushed the amir/loadswitch_refactoring branch from 8f6e10e to 7f7ebcd Compare November 28, 2025 08:21

// Setting faults for st_vnd5 efuse
// TODO: Verify these
if (fault_table_idx == L_L)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

case statement this

* https://octopart.com/datasheet/vnd5t100ajtr-e-stmicroelectronics-21218840
*/

#define NOMINAL_V 3.0f
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be characterized because nominal input voltage is usually 3.3

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unless data sheet said otherwise

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I saw this in the datasheet but I didnt so ill set this to 3.3

Copy link
Contributor

@Aditya-Dhiman4 Aditya-Dhiman4 Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh actually this I might have been also referring to the power manager, if you look at the removed code from the power_manager.c file we compare with 3.0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets keep at 3.3 but this needs to be characterized

}
else
{
efuse->ti_tps28->faults.raw = 0x03;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is 0x03 supposed to mean here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is not correct lol, basically if the diagnostics pin is down, the fault pin still indicates for overcurrent and thermal shut down, but I am unsure if I am supposed to check for those faults in the same way if the diagnostics is high or not. They only have a truth table for fault checking if the diagnostics pin is high.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surely if the diag pin is not high we shouldn't do any checks. Also isn't diag pin an input to the chip?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah its an input i just forgot to make a setter for it. The reason why I still want to perform checks is because the datasheet says if diagnostics are disabled the fault pin will still report overcurrent and thermal shutdown, I need to discuss this a bit more with you

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lowkey these can just be done in the efuse.hpp file they are very short functions so allocating an entire file to them seem unecessary

static constexpr uint8_t H_L = 0x02U;
static constexpr uint8_t H_H = 0x03U;

ST_VND5_Efuse::ST_VND5_Efuse(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please do this in the hpp file

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other than it being kinda short I dont fully get why we should define the functions in the header files only, like whats the advantage here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well it is a constructor function so convention-wise it should be part of the .hpp file so if you look at hw_pwminput you can see that is bundled up. I think @Lucien950 can prob give the c++ optimization answer but in my view at least the cpp function should only have the functions associated with the class, and the constructor should be in the hpp

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also please consteval the constructor

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also i think if you leave it in the hpp file it can implicitly inline the constructor vs here if it is in the cpp you cant inline nomore

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait just to be clear you want me to just move the constructor to the header or the entire file? I thought you wanted me to move it to the header?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the constructor


namespace io
{
TI_TPS25_Efuse::TI_TPS25_Efuse(const hw::Gpio &enable_gpio, const hw::Adc &sns_adc_channel, const hw::Gpio &pgood)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as before please do this in the hpp file

hw_gpio_writePin(efuse->enable_gpio, false);
}

static bool io_TI_TPS25_Efuse_pgood(const Efuse *efuse)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is an important consideration to note that when checking pgood this has to be when there is a voltage on the VCC or something like and we can just check this. Double check this with the datasheet to when we are allowed to check pgood

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please change back

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also please fix the tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Drivers Shared Hardware Abstractions throughout the boards.

Development

Successfully merging this pull request may close these issues.

4 participants