Skip to content
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

Add SPI support for MS5611 driver #34

Merged
merged 1 commit into from
May 3, 2018

Conversation

IgorAnohin
Copy link
Contributor

Hello!
I added SPI support for MS5611.

self.bus.max_speed_hz=1000000


def WriteReg(self, reg_address, data = 0x00):
Copy link
Contributor

Choose a reason for hiding this comment

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

write_register

self.bus.close()
return rx

def ReadRegs(self, reg_address, length=3):
Copy link
Contributor

Choose a reason for hiding this comment

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

read_registers


class MS5611:

class SPI_interface():
Copy link
Contributor

@staroselskii staroselskii Feb 26, 2018

Choose a reason for hiding this comment

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

SPIBus

return rx[1:len(rx)]


class I2C_interface():
Copy link
Contributor

@staroselskii staroselskii Feb 26, 2018

Choose a reason for hiding this comment

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

I2CBus

self.bus = SMBus(i2c_bus_number)
self.address = address

def WriteReg(self, reg_address, device_address = None):
Copy link
Contributor

Choose a reason for hiding this comment

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

write_register

@IgorAnohin
Copy link
Contributor Author

I think, that now names more valid

@IgorAnohin
Copy link
Contributor Author

I think, that 'device' - better name for SPI and I2C, than flag.

@staroselskii staroselskii merged commit 0d5214a into emlid:master May 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants