SpiRam_Extended

SpiRam_Extended is an updated version of the SpiRam library. When using SpiRam I found that I was always having to manually handle the conversion from integers, longs and floats into their constituent bytes before transferring them. This was tedious and something which actually took quite allot of thought every time I wanted to do it!

All the original functionality of the SpiRam library still exists and as such the following functions are available:

void read_page(long address, char *buffer);
void write_page(long address, char *buffer);
void read_stream(long address, char *buffer, long length);
void write_stream(long address, char *buffer, long length);
void run_stream(long address, long length);
void stream_run(char data_byte,long index); //if used, MUST be part of main program

The remaining functions are new to the SpiRam_Extended library:

int read_int(long address);
int write_int(long address, int data_int);
long read_long(long address);
long write_long(long address, long data_int);
float read_float(long address);
float write_float(long address, float data_int);
void read_ints(long address,int *data_int, long length);
void write_ints(long address,int *data_int, long length);
void read_longs(long address,long *data_long, long length);
void write_longs(long address,long *data_long, long length);
void read_floats(long address,float *data_long, long length);
void write_floats(long address,float *data_long, long length);

My advice for learning to use the new functions is to take a look at the example script, SpiRam_Extended_Functions, which demonstrates the use of all of the new functionality which I have built in. The library is still new and may have some teething issues. Please report any problems you have to me on GitHub and I will try to help fix them!

Download the library by clicking here.

Advertisements

One thought on “SpiRam_Extended

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s