Closed sfs325 closed 8 years ago
Well, this can be a bit involved, but you basically need to align the existing SPI functionality with the Arduino API.
This is generally done by creating a kind of wrapper for the existing SPI driver. As an example, in the spi.begin() function of the wrapper, you could do something like the following:
void spiclass::begin(){
SPI spi(p5, p6, p7); // mosi, miso, sclk
}
In this case, the Arduino SPI API is used to call the mbed SPI driver, so the core RF24 library can use the same functions for both.
This would generally need to be done for SPI, GPIO, Timing functions, as well as anything relating to program memory. As I said it is a bit involved, and also requires some knowledge of both Arduino and Mbed platforms, so we would probably need some assistance etc.. in order to make this happen.
Thank you for answering. I don't have the skills to do it, but i will try to get some people on it, but it will be hard. I feel that Lpc812 is quite more interesting for remote resnsors than attiny85.
Just one more question, how can I define that my compiler has to use my new template
You can probably just use a #define for detection like ATTiny, and specify the RF24_arch_config file to load.
For example, with Arduino, the detection is done solely in the RF24_config.h file.
#if defined ARDUINO
If the MBED platform has a similar #define, you can use that, or if there is a microcontroller specific #define you can use that, else something would have to be manually defined somewhere.
#elif defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) || defined(__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__)
#define RF24_TINY
#include "arch/ATTiny/RF24_arch_config.h"
Well I have tried in every way porting it but I couldn't get it, I don't have the skill, so I decided to use attiny85. What was my surprise? Attiny is totally useless, I just wanted to attach just an ds18b20 temperature sensor, but the RF24Mesh firmware is 81%, adding OneWire library exceeds the maximum of 8Kb in 2Kb making it totally useless.
I haven't found anyone for porting to mbed, so want to ask you gently for it. Main advantages of Mbed? Scalable hardware, plenty of different models with different capabilities of MCUs, form ARM cortex M0+ to M4. And a nice feature, Mbed official RTOS. It could be quite useful for developing an interest stack.
I'm planning in using it in LPC812 for sensors, so take a look and if you have enough time, and you want.... give it a try because it could be a nice improvement.
@Pidjey If you are still dealing with this you could possibly rewrite the ds18b20 library as bare minimum as possible.
Hi, I not so good with prgraming and I would like porting it to mbed. I have seen the portability template http://tmrh20.github.io/RF24/Portability.html but I have no idea how to achive it. For example this is the spi template:
And this is the mbed spi library:
What should I do with them
After this, how can should how should I say to the library that theese are my config files and my compiler should use them