Jump to content

Updated SPI lm4f library TM4C123 & TM4C1294

Recommended Posts

I wanted to improve the compatibility of the SPI.h lm4f library to include functions of arduino user contributed SPI.h libraries. I found SPI2.h here: http://forum.stellarisiti.com/topic/620-two-spi-modules. This library added multi-module features but removed the 123 & 1294 compatibility. I have merged SPI2 and the core SPI libs into spiE.h and added several more function variations. 


spiE.h best features are:


1. Array transfer up to 255 bytes. This is 5x faster than single byte transfer.

2. SPI2's pinMode() and digitalWrire() functions are replaced with faster macros.

3. Support for __TM4C129XNCZAD__, __TM4C1294NCPDT__, BLIZZARD_RB1 (LM4F) boards

4. Up to 4 instances can be defined: SPI0, SPI1, SPI3, & SPI2 is instantiated by default as SPI for arduino code compatibility.

5. Multiple SlaveSelect pins can be used fir multiple devices on one data line. defaultSS, default +SS2, or SS1 + SS2, etc.


I have tested this on the 129. If you have a need for it and can try it on the other boards before I upload it to github, be my guest.


Share this post

Link to post
Share on other sites

I assume you mean as an additional library such as spiE.h, and not as an update to the core  SPI.h? After its tested you are welcome to add it as SPI.h since 90% of the code is from it.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now