Comments (8)
Juste pour info, j'avais fait une autre Lib qui supportait I2C et SPI en même temps. Cela peut servir d'inspiration : https://github.com/sosandroid/AnalogDevice_AD5161
from fram_mb85rc_i2c.
Hi, at this time no plan to support SPI.
However, I can support you if you try to do it
from fram_mb85rc_i2c.
Hi,
Thanks a lot for the answer. I'm currently making a version for SPI chips, with less functionality and forked from the I2C version - here. At this time it's ok, but I will tell you if I need help ;)
Thanks a lot.
from fram_mb85rc_i2c.
Hello sosandroid,
I'm currently working on the SPI version of those chip. The lib works well, but I would like to simplify it and change the Overloading syntax into a Template. By doing that I, and maybe you too, have only have one write/read function whatever the value you want to write byte, half word, long. The idea is to have a something like this :
// Inside the .h
template <typename T>
void _readT(T *value) { *value = SPI.tranfer(0); } // maybe that can works too with Wire.transmission
class FRAM_MB85RS_SPI
{
public:
boolean read (uint32_t address, T *value);
// ....
private:
//...
}
// Inside the .cpp
boolean FRAM_MB85RS_SPI::read(uint32_t address, T *value)
{
if (address >= _maxaddress)
return false;
#ifdef SER_OUT
Serial.print("Read address : ");
Serial.println(address, BIN);
#endif
_csASSERT();
SPI.transfer(FRAM_READ);
_setMemAddr(& address);
_readT<uint8_t>(*value);
_csRELEASE();
return true;
}
The point is that I'm a bit lost and I don't have a clue how can I insert a template inside the class.
If you are interested and if you know how to do, maybe you could help me to achieve that ?
The example above doesn't compile and create error on build.
Thanks in advance for your answer
from fram_mb85rc_i2c.
Hi,
I never worked with templates.
I quick search lead me to issues using Templates with the Arduino Builder such as this one : arduino/arduino-builder#182 (comment)
from fram_mb85rc_i2c.
This SPI lib I made works well, I would just like to minimize the size of the lib in memory by creating something more versatile without adding too much lines of code. Template seems the solution, but hard to figure it out.
from fram_mb85rc_i2c.
Hello,
Here the link for the library I created for the SPI FRAM version and based on your work for the I2C FRAM.
Even if I changed a lot of stuff, removed the ERROR management, which wasn't needed for my own use, functions, etc. the architecture remain the same.
I hope it could be useful for the community.
On GitHub - FRAM_MB85RS_SPI
On GitHub.io page - FRAM_MB85RS_SPI
Thanks for your work!
from fram_mb85rc_i2c.
Just added a crosslink on top of the Readme file to point out this SPI version.
Thank for the sharing
from fram_mb85rc_i2c.
Related Issues (20)
- always reading from memory address 0b000XXXXXXXX on <64kb device HOT 8
- wrong comment HOT 1
- problem reading\writing FM24C04
- 1MB device not recognized HOT 2
- FM24V10 not recognized HOT 6
- Test FM24C04B-G HOT 3
- Possible typo HOT 3
- add an example for working with 1Mbit Devices ? HOT 1
- FM24V05-G HOT 7
- FM24C64-G not recognized HOT 3
- Typo in example code "FRAM_I2C_simple_write_read" HOT 2
- Is this quicker for writing arrays? HOT 4
- Cypress FM24C04B multiple issues HOT 15
- Build Error on Example HOT 6
- Storing a String or DateTime type in FRAM HOT 1
- Emulation of Arduino EEPROM library HOT 1
- Problem with TimerOne HOT 3
- How to use Wire1 HOT 2
- Which is the recommended stable release or commit? HOT 1
- FM24C04B problem HOT 6
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 fram_mb85rc_i2c.