Coder Social home page Coder Social logo

Comments (2)

PerMalmberg avatar PerMalmberg commented on June 19, 2024

Disclaimer: I've not read the whole data sheet so I might be missing something.

Based on table 9 in the spec it seems to me combining the existing write and read functions should work. My intention with these methods was that they do the ground work to follow the i2c spec and combining them yields the desired write/read sequences needed for the specific device assuming the expect_ack, use_restart_signal and end_with_nack are correctly set.

The 16-bit register you refer to must the the command bytes, They are not an register address so they can we written with the write command.

I don't think I've used clock-stretching, but if it is handled by the underlying driver then it might work as-is. It is also an optional mode of the device so it is not a must to use.

Lastly, the delay between sending commands to the device can be easily handled by checking against a timestamp of the last command and waiting until 1ms has passed.

from smooth.

enelson1001 avatar enelson1001 commented on June 19, 2024

I plan on submitting a pull request for this sensor today or tomorrow. The PR will include a new function added to I2CMasterDevice called

read_block(uint8_t address,  core::util::FixedBufferBase<uint8_t>& data,  bool end_with_nack)

This new function does not include the i2c_master_write as the current read does but only implements the i2c_read.

This new function allowed me to read data from the SHT30.

You can close this discussion since we can discuss further in the PR. If you don't like the name of the function then the name can be changed during the PR process.

from smooth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.