Comments (5)
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.
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.
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.
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.
All this has been fixed in https://github.com/eldruin/eeprom24x-rs/releases/tag/v0.3.0
from eeprom24x-rs.
Related Issues (9)
- Implement current address read HOT 1
- Simplify write_page() implementations using a trait associated constant HOT 1
- Repeated code HOT 2
- Check address against device capacity HOT 1
- Incorrect addressing for low memory devices HOT 2
- 0.2.0: Remove devices that incur into incorrect addressing HOT 1
- Multiple I2C devices on same bus HOT 2
- Support for 24CSx parts HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eeprom24x-rs.