Skip to content

Add support for ACS37800 and mRo-M10104#32107

Open
lgarciaos wants to merge 3 commits intoArduPilot:masterfrom
lgarciaos:mRo-m10104
Open

Add support for ACS37800 and mRo-M10104#32107
lgarciaos wants to merge 3 commits intoArduPilot:masterfrom
lgarciaos:mRo-m10104

Conversation

@lgarciaos
Copy link
Contributor

@peterbarker let me know if I should split this into more PRs, this, along with the DSDL flag (dronecan/DSDL#76) and #32105 should get proper support for our M10104

Copy link
Contributor

@peterbarker peterbarker left a comment

Choose a reason for hiding this comment

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

Looks pretty good!

float convert_voltage(int16_t vcode);
float convert_current(int16_t icode);

volatile uint8_t _ctr;
Copy link
Contributor

Choose a reason for hiding this comment

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

unused

Suggested change
volatile uint8_t _ctr;

_ctr = 0;
WITH_SEMAPHORE(_dev->get_semaphore());
// Configure ACS for DC operation
if(!write_word(REG_ACCESS_CODE, CUSTOMER_CODE)){
Copy link
Contributor

Choose a reason for hiding this comment

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

What on Earth is this?!

Choose a reason for hiding this comment

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

Code to enable access to sensor EEPROM of the sensor apparently.
Pages 29 and 42 of the datasheet.

Comment on lines +126 to +127
uint32_t check_c_config;
read_word(REG_C_SHADOW,check_c_config);
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks pointless unless you are debugging

static const struct AP_Param::GroupInfo var_info[];

protected:
AP_HAL::OwnPtr<AP_HAL::I2CDevice> _dev;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
AP_HAL::OwnPtr<AP_HAL::I2CDevice> _dev;
AP_HAL::I2CDevice *_dev;

Copy link
Contributor

@Hwurzburg Hwurzburg left a comment

Choose a reason for hiding this comment

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

when this is merged, there will be no way to find a device that uses this for a wiki link...I think a brief readme should be added with notes on which hardware products use this...unless you do not want anything that uses this to be linked in the wiki

Copy link
Contributor

@Hwurzburg Hwurzburg left a comment

Choose a reason for hiding this comment

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

same comment as previous periph PR

Update libraries/AP_BattMonitor/AP_BattMonitor_ACS37800.cpp

Co-authored-by: Peter Barker <pb-gh@barker.dropbear.id.au>

Update libraries/AP_BattMonitor/AP_BattMonitor_ACS37800.cpp

Co-authored-by: Peter Barker <pb-gh@barker.dropbear.id.au>

AP_BattMonitor: wIP
@Hwurzburg Hwurzburg added the WikiNeeded needs wiki update label Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WikiNeeded needs wiki update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants