-
-
Notifications
You must be signed in to change notification settings - Fork 23
Efuse Refactoring #1749
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
Open
AmirTajaddodi
wants to merge
12
commits into
master
Choose a base branch
from
amir/loadswitch_refactoring
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Efuse Refactoring #1749
Changes from 10 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
60caf6a
abstraction for efuse
AmirTajaddodi 48ec46a
more efuse changes
AmirTajaddodi ce16b5c
cleaned up code
Aditya-Dhiman4 fe845f4
fixed build issues, API is functional, efuse_ok functions may need so…
Aditya-Dhiman4 a928e00
baseline EFuse C++ Refactor
Aditya-Dhiman4 2d2cdcc
Efuse C++ refactor mostly complete, just have ok function left and te…
Aditya-Dhiman4 323442c
renamed efuses and implemented ok function
Aditya-Dhiman4 4eb6737
efuse fault handling overhaul
Aditya-Dhiman4 7f7ebcd
C++ TPS28 Efuse, added final keyword cuz its cool and optimizations h…
Aditya-Dhiman4 8a623c7
le format
Aditya-Dhiman4 2cc1887
many smol changes
Aditya-Dhiman4 a1311f3
format
Aditya-Dhiman4 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| #pragma once | ||
|
|
||
| #include <stdbool.h> | ||
| #include "io_loadswitches.h" | ||
| #include "io_efuses.h" | ||
|
|
||
| void app_efuse_broadcast(void); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| #pragma once | ||
|
|
||
| #include <stdint.h> | ||
| #include "io_loadswitches.h" | ||
| #include "io_efuses.h" | ||
|
|
||
| typedef struct | ||
| { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| #include "hw_adcs.h" | ||
| #include "hw_gpios.h" | ||
| #include "hw_i2cs.h" | ||
| #include "io_efuses.h" | ||
| #include "io_efuse/io_efuse_ST_VND5/io_efuse_ST_VND5.h" | ||
| #include "io_efuse/io_efuse_TI_TPS25/io_efuse_TI_TPS25.h" | ||
|
|
||
| static ST_VND5_Efuse f_inv_ST_VND5_Efuse = { .stby_reset_gpio = &fr_stby_inv }; | ||
| static ST_VND5_Efuse rsm_ST_VND5_Efuse = { .stby_reset_gpio = &fr_stby_inv }; | ||
| static ST_VND5_Efuse bms_ST_VND5_Efuse = { .stby_reset_gpio = &fr_stby_front }; | ||
| static ST_VND5_Efuse r_inv_ST_VND5_Efuse = { .stby_reset_gpio = &fr_stby_front }; | ||
| static ST_VND5_Efuse dam_ST_VND5_Efuse = { .stby_reset_gpio = &fr_stby_rear }; | ||
| static ST_VND5_Efuse front_ST_VND5_Efuse = { .stby_reset_gpio = &fr_stby_rear }; | ||
| static TI_TPS25_Efuse rl_pump_TI_TPS25_Efuse = { .pgood = &rl_pump_pgood }; | ||
| static ST_VND5_Efuse r_rad_fan_ST_VND5_Efuse = { .stby_reset_gpio = &fr_stby_rad }; | ||
|
|
||
| const Efuse f_inv_efuse = { .enable_gpio = &f_inv_en, | ||
| .sns_adc_channel = &inv_f_pwr_i_sns, | ||
| .st_vnd5 = &f_inv_ST_VND5_Efuse, | ||
| .efuse_functions = &ST_VND5_Efuse_functions }; | ||
|
|
||
| const Efuse rsm_efuse = { .enable_gpio = &rsm_en, | ||
| .sns_adc_channel = &rsm_i_sns, | ||
| .st_vnd5 = &f_inv_ST_VND5_Efuse, | ||
| .efuse_functions = &ST_VND5_Efuse_functions }; | ||
|
|
||
| const Efuse bms_efuse = { .enable_gpio = &bms_en, | ||
| .sns_adc_channel = &bms_i_sns, | ||
| .st_vnd5 = &bms_ST_VND5_Efuse, | ||
| .efuse_functions = &ST_VND5_Efuse_functions }; | ||
|
|
||
| const Efuse r_inv_efuse = { .enable_gpio = &r_inv_en, | ||
| .sns_adc_channel = &inv_r_pwr_i_sns, | ||
| .st_vnd5 = &r_inv_ST_VND5_Efuse, | ||
| .efuse_functions = &ST_VND5_Efuse_functions }; | ||
|
|
||
| const Efuse dam_efuse = { .enable_gpio = &dam_en, | ||
| .sns_adc_channel = &dam_i_sns, | ||
| .st_vnd5 = &dam_ST_VND5_Efuse, | ||
| .efuse_functions = &ST_VND5_Efuse_functions }; | ||
|
|
||
| const Efuse front_efuse = { .enable_gpio = &front_en, | ||
| .sns_adc_channel = &front_i_sns, | ||
| .st_vnd5 = &front_ST_VND5_Efuse, | ||
| .efuse_functions = &ST_VND5_Efuse_functions }; | ||
|
|
||
| const Efuse rl_pump_efuse = { .enable_gpio = &rl_pump_en, | ||
| .sns_adc_channel = &pump_rl_pwr_i_sns, | ||
| .ti_tps25 = &rl_pump_TI_TPS25_Efuse, | ||
| .efuse_functions = &TI_TPS25_Efuse_functions }; | ||
|
|
||
| const Efuse r_rad_fan_efuse = { .enable_gpio = &rr_rad_fan_en, | ||
| .sns_adc_channel = &r_rad_fan_i_sns, | ||
| .st_vnd5 = &r_rad_fan_ST_VND5_Efuse, | ||
| .efuse_functions = &TI_TPS25_Efuse_functions }; | ||
|
|
||
| const Efuse *const efuse_channels[NUM_EFUSE_CHANNELS] = { | ||
| [EFUSE_CHANNEL_F_INV] = &f_inv_efuse, [EFUSE_CHANNEL_RSM] = &rsm_efuse, | ||
| [EFUSE_CHANNEL_BMS] = &bms_efuse, [EFUSE_CHANNEL_R_INV] = &r_inv_efuse, | ||
| [EFUSE_CHANNEL_DAM] = &dam_efuse, [EFUSE_CHANNEL_FRONT] = &front_efuse, | ||
| [EFUSE_CHANNEL_RL_PUMP] = &rl_pump_efuse, [EFUSE_CHANNEL_R_RAD] = &r_rad_fan_efuse | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| #pragma once | ||
|
|
||
| #include "io_efuse/io_efuse.h" | ||
|
|
||
| typedef enum | ||
| { | ||
| // INV_RSM loadswitch | ||
| EFUSE_CHANNEL_F_INV = 0u, | ||
| EFUSE_CHANNEL_RSM, | ||
|
|
||
| // INV_BMS loadswitch | ||
| EFUSE_CHANNEL_BMS, | ||
| EFUSE_CHANNEL_R_INV, | ||
|
|
||
| // Front loadswitch | ||
| EFUSE_CHANNEL_DAM, | ||
| EFUSE_CHANNEL_FRONT, | ||
|
|
||
| // TI loadswitches | ||
| EFUSE_CHANNEL_RL_PUMP, | ||
|
|
||
| // Radiator Fan loadswitches | ||
| EFUSE_CHANNEL_R_RAD, | ||
|
|
||
| NUM_EFUSE_CHANNELS | ||
| } EfuseChannel; | ||
|
|
||
| extern const Efuse *const efuse_channels[NUM_EFUSE_CHANNELS]; | ||
|
|
||
| extern const Efuse f_inv_efuse; | ||
| extern const Efuse rsm_efuse; | ||
| extern const Efuse bms_efuse; | ||
| extern const Efuse r_inv_efuse; | ||
| extern const Efuse dam_efuse; | ||
| extern const Efuse front_efuse; | ||
| extern const Efuse rl_pump_efuse; | ||
| extern const Efuse r_rad_fan_efuse; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 change back
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.
Also please fix the tests