-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
power: ades1754 : Add support for ADES1754 #2429
Conversation
cppcheck complain is valid, @RaduSabau1, please have a look. |
81e9dbe
to
a3b737b
Compare
V2:
|
a3b737b
to
2d52665
Compare
V3:
|
2d52665
to
0a5eaab
Compare
V3:
|
0a5eaab
to
c8dad97
Compare
V4:
|
00a30da
to
8167de5
Compare
drivers/power/ades1754/ades1754.h
Outdated
|
||
struct ades1754_init_param { | ||
struct no_os_uart_init_param *uart_param; | ||
|
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.
remove all these blank lines
drivers/power/ades1754/ades1754.h
Outdated
|
||
struct ades1754_desc { | ||
struct no_os_uart_desc *uart_desc; | ||
|
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.
remove blank lines
drivers/power/ades1754/ades1754.c
Outdated
case 0: | ||
tx_data[i + 9] = ades1754_manchester(no_os_field_get(ADES1754_LOWER_NIBBLE_MASK, | ||
ADES1754_FILL_BYTE_C2), true); | ||
|
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.
remove blank lines for all cases
drivers/power/ades1754/ades1754.c
Outdated
for (i = 3; i < 3 + 2 * desc->no_dev; i += 4) { | ||
data[j] = no_os_field_prep(ADES1754_MSB_MASK, | ||
no_os_bit_swap_constant_8(crc[i + 1])) | no_os_bit_swap_constant_8(crc[i]); | ||
|
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.
this one also seems unnecessary
drivers/power/ades1754/ades1754.c
Outdated
mask = NO_OS_GENMASK(15, 2); | ||
reg = ADES1754_OVTHCLR_REG; | ||
reg2 = ADES1754_OVTHSET_REG; | ||
|
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.
remove blank lines
|
||
ret = ades1754_init(&ades1754_desc, &ades1754_ip); | ||
if (ret) | ||
return ret; |
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.
perhaps provide one or two more API calls after the init to set something, whatever you want
projects/ades1754/README.rst
Outdated
The initialization data used in the examples is taken out from: | ||
`Project Common Data Path <https://github.com/analogdevicesinc/no-OS/tree/main/projects/ades1754/src/common>`_ | ||
|
||
The macros used for Common Data structures are defined in pkatform specific files found at: |
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.
pkatform
@@ -0,0 +1,104 @@ | |||
/***************************************************************************//** | |||
* @file def_uart_example.c |
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.
i don't really like the default
name, you probably need better names for the examples
projects/ades1754/README.rst
Outdated
|
||
EXAMPLE ?= def_uart_example | ||
|
||
SPI UART Example |
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.
really, this example name should be more telling, SPI UART
doesnt make sense to me, but SPI UART bridge
does
projects/ades1754/README.rst
Outdated
The macros used for Common Data structures are defined in pkatform specific files found at: | ||
`Project Platform Configuration Path <https://github.com/analogdevicesinc/no-OS/tree/main/projects/ades1754/src/platform>`_ | ||
|
||
DEF UART Example |
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.
And this example name tells me nothing about what this example is about
Add initial header and source files for ADES1754 driver. Signed-off-by: Radu Sabau <[email protected]>
Add initial README.rst documentation file for ADES1754 driver. Signed-off-by: Radu Sabau <[email protected]>
Add initial header and source files for ADES1754 project, alongside Makefiles. Signed-off-by: Radu Sabau <[email protected]>
Add README.rst documentation file for ADES1754 project. Signed-off-by: Radu Sabau <[email protected]>
8167de5
to
71c67f4
Compare
V5:
|
Pull Request Description
The ADES1754/ADES1755/ADES1756 are flexible
data-acquisition systems for the management of high-
voltage and low-voltage battery modules. The systems
can measure 14 cell voltages and a combination of six
temperatures or system voltage measurements with fully
redundant measurement engines in 162μs, or perform
all inputs solely with the ADC measurement engine in
99μs. Fourteen internal balancing switches rated
for >300mA for cell-balancing current support extensive
built-in diagnostics. Up to 32 devices can be daisy-
chained to manage 448 cells and monitor 192
temperatures.
This PR includes examples that use other device drivers, therefore it needs to be merged after #2428
PR Type
PR Checklist