nodemcu-firmware icon indicating copy to clipboard operation
nodemcu-firmware copied to clipboard

ads1115.setup() performs reset of all i2c devices

Open paweljasinski opened this issue 7 years ago • 9 comments

Missing feature

The current released ads1115 module issues a i2c general reset during the setup() This reset is not specific to ads hardware. How about moving it to the i2c module.

Justification

It is likely another module using i2c implements the same reset logic.

Workarounds

The setup of ads1115 has to be called before other i2c devices are programmed.

paweljasinski avatar Jan 22 '18 22:01 paweljasinski

I'm not familiar with the ads1115 architecture, but I see that you moved the I2C reset command into a dedicated function with #2231 - is this issue here still applicable once #2231 got merged?

devsaurus avatar Jan 24 '18 21:01 devsaurus

The ads1115 specific issue is gone, but in my opinion, the reset function does not belong to ads1115 module. For example: In addiction to ads1115 I have dac on the i2c bus, and it does obey the general reset command. The reset command is not specific to ads1115. It feels natural to move the reset to i2c.

paweljasinski avatar Jan 25 '18 16:01 paweljasinski

the reset function does not belong to ads1115 module.

After reading through the I2C spec chapters for "General call address" and "Software reset" I also think that the generic bus reset should not be part of a device-specific module.

Consequently, the i2c module might benefit from a function to issue general calls. That would be more for user's convenience than driven by functional requirements, since the corresponding sequence can be generated with existing i2c functions. Something like

i2c.general_call(id, second_byte[, <more bytes>])
-- with constants for <second_byte>
-- i2c.RESET_AND_WRITE_SLA
-- i2c.WRITE_SLA

Is this a reasonable improvement of the i2c module? Any objections from others?

devsaurus avatar Feb 04 '18 11:02 devsaurus

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 21 '19 07:07 stale[bot]

Issue should be kept.

devsaurus avatar Jul 21 '19 20:07 devsaurus

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 16 '20 01:07 stale[bot]

Probably still an issue. Belatedly, I see no reason not to add general_call functionality to the i2c module.

nwf avatar Jul 18 '20 11:07 nwf

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 21 '21 00:07 stale[bot]

Still hoping to get this fixed

HHHartmann avatar Jul 21 '21 08:07 HHHartmann