Skip to content

Conversation

smlng
Copy link
Member

@smlng smlng commented Jun 29, 2018

Contribution description

captain obvious to the rescue, i.e. see title

Issues/PRs references

#6577

@smlng smlng added Area: drivers Area: Device drivers TF: I2C Marks issues and PRs related to the work of the I²C rework task force labels Jun 29, 2018
@smlng smlng requested a review from aabadie June 29, 2018 19:42
Copy link
Member

@dylad dylad left a comment

Choose a reason for hiding this comment

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

How does this driver even works ? I don't see any call to i2c_acquire/i2c_release.
Any clue captain ?

@smlng
Copy link
Member Author

smlng commented Jun 29, 2018

mhm only adapted the existing calls, it works on master with the old API even without the acquire. And if only one I2c device is present it should be fine without acquire and release. However, you're right it will get tricky if multiple i2c devs are present. Should I fix this?

@dylad
Copy link
Member

dylad commented Jun 29, 2018

I would love to test this device on master. I don't think this driver works for all MCUs (like SAM0 based). Shame I don't own this one...

Should I fix this?

Hum, I think it's safe to fix it. So yes please go ahead :)

@smlng
Copy link
Member Author

smlng commented Jul 4, 2018

@dylad added acquire and release calls. Could be improved but would need more restructuring, but wanted to keep it simple (for now) to get the I2C rework done.

Copy link
Member

@dylad dylad left a comment

Choose a reason for hiding this comment

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

Untested ACK.
It would be great to have someone test it or maybe @smlng you can share some outputs if you find some times

smlng added 2 commits July 4, 2018 20:16
    add missing i2c_acquire and i2c_release calls to properly guard
    i2c read and write operations.
@smlng
Copy link
Member Author

smlng commented Jul 4, 2018

Here some output from the test app:

2018-07-04 20:15:25,526 - INFO # 
2018-07-04 20:15:25,529 - INFO # ##########################
2018-07-04 20:15:26,487 - INFO # 
2018-07-04 20:15:26,489 - INFO # Dev: Button A	Type: SENSE_BTN
2018-07-04 20:15:26,491 - INFO # Data:	          0
2018-07-04 20:15:26,491 - INFO # 
2018-07-04 20:15:26,494 - INFO # Dev: Button B	Type: SENSE_BTN
2018-07-04 20:15:26,496 - INFO # Data:	          0
2018-07-04 20:15:26,497 - INFO # 
2018-07-04 20:15:26,501 - INFO # Dev: Magnetometer (bmx055)	Type: SENSE_MAG
2018-07-04 20:15:26,503 - INFO # Data:	[0]    179Gs
2018-07-04 20:15:26,505 - INFO # 	[1]    -86Gs
2018-07-04 20:15:26,506 - INFO # 	[2]    -29Gs
2018-07-04 20:15:26,507 - INFO # 
2018-07-04 20:15:26,511 - INFO # Dev: Accelerometer (bmx055)	Type: SENSE_ACCEL
2018-07-04 20:15:26,513 - INFO # Data:	[0]  -1292 mg
2018-07-04 20:15:26,515 - INFO # 	[1]  -1333 mg
2018-07-04 20:15:26,517 - INFO # 	[2]    374 mg
2018-07-04 20:15:26,518 - INFO # 
2018-07-04 20:15:26,522 - INFO # Dev: Gyroscope (bmx055)	Type: SENSE_GYRO
2018-07-04 20:15:26,524 - INFO # Data:	[0]   -178dps
2018-07-04 20:15:26,525 - INFO # 	[1]     42dps
2018-07-04 20:15:26,527 - INFO # 	[2]    -96dps
2018-07-04 20:15:26,527 - INFO # 
2018-07-04 20:15:26,529 - INFO # ##########################
2018-07-04 20:15:27,487 - INFO # 
2018-07-04 20:15:27,490 - INFO # Dev: Button A	Type: SENSE_BTN
2018-07-04 20:15:27,491 - INFO # Data:	          0
2018-07-04 20:15:27,491 - INFO # 
2018-07-04 20:15:27,494 - INFO # Dev: Button B	Type: SENSE_BTN
2018-07-04 20:15:27,496 - INFO # Data:	          0
2018-07-04 20:15:27,497 - INFO # 
2018-07-04 20:15:27,501 - INFO # Dev: Magnetometer (bmx055)	Type: SENSE_MAG
2018-07-04 20:15:27,503 - INFO # Data:	[0]    133Gs
2018-07-04 20:15:27,504 - INFO # 	[1]    -60Gs
2018-07-04 20:15:27,506 - INFO # 	[2]   -124Gs
2018-07-04 20:15:27,507 - INFO # 
2018-07-04 20:15:27,511 - INFO # Dev: Accelerometer (bmx055)	Type: SENSE_ACCEL
2018-07-04 20:15:27,513 - INFO # Data:	[0]    -47 mg
2018-07-04 20:15:27,515 - INFO # 	[1]   -111 mg
2018-07-04 20:15:27,517 - INFO # 	[2]   1034 mg
2018-07-04 20:15:27,518 - INFO # 
2018-07-04 20:15:27,521 - INFO # Dev: Gyroscope (bmx055)	Type: SENSE_GYRO
2018-07-04 20:15:27,524 - INFO # Data:	[0]      3dps
2018-07-04 20:15:27,525 - INFO # 	[1]     -1dps
2018-07-04 20:15:27,527 - INFO # 	[2]      3dps
2018-07-04 20:15:27,527 - INFO # 
2018-07-04 20:15:27,529 - INFO # ##########################
2018-07-04 20:15:27,793 - INFO # Exiting Pyterm

@dylad dylad merged commit cd0d723 into RIOT-OS:new_i2c_if Jul 4, 2018
basilfx pushed a commit to basilfx/RIOT that referenced this pull request Jul 10, 2018
drivers/bmx055: adapt to new i2c api
dylad added a commit to dylad/RIOT that referenced this pull request Jul 10, 2018
drivers/bmx055: adapt to new i2c api
dylad added a commit that referenced this pull request Jul 11, 2018
drivers/bmx055: adapt to new i2c api
@smlng smlng deleted the pr/bmx055/i2c branch June 25, 2019 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: drivers Area: Device drivers TF: I2C Marks issues and PRs related to the work of the I²C rework task force
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants