Code Monkey home page Code Monkey logo

Comments (5)

RandomInsano avatar RandomInsano commented on August 15, 2024 1

Yeah, I think that’s alright. It’s a difference of opinion and what matters is that it exists and is usable by people. :)

from eeprom24x-rs.

RandomInsano avatar RandomInsano commented on August 15, 2024

Yeah, I think this makes sense. To be honest, I’m not sure I would define special structure for this and maybe just pass in the memory size.

Argument for: I don’t need to have an array of every size defined and usually the page size is in the part number.

Argument against: guarantees sizes are followed properly?

from eeprom24x-rs.

eldruin avatar eldruin commented on August 15, 2024

I see that it would be comfortable for this driver not to have to deal with the page size but if the user passes a too big page size, data will be overwritten. Given an EEPROM IC, I would say that is one of the worst things that can happen.
As a user, I would like the driver to prevent me from doing something potentially bad for myself (there might be use cases for this behavior, but in such an unusual case, I expect an advanced user not to be surprised that he would need to talk to the IC directly to do it).

As you said, the page size is something that is immutable for an IC and I would simply expect a driver to abstract me from such a parameter .

from eeprom24x-rs.

eldruin avatar eldruin commented on August 15, 2024

I added support for many other ICs and got rid of the duplicated code via macros.
I published this in release 0.2.0.
However, I will leave this issue open, as I would like to offer a generic API where the user can specify the page size since the device names are not quite consistent. I will probably do this after #5

from eeprom24x-rs.

eldruin avatar eldruin commented on August 15, 2024

All this has been fixed in https://github.com/eldruin/eeprom24x-rs/releases/tag/v0.3.0

from eeprom24x-rs.

Related Issues (9)

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.