Skip to content

Commit

Permalink
reworked readme
Browse files Browse the repository at this point in the history
  • Loading branch information
IGB-Germany committed Dec 17, 2020
1 parent 788ce86 commit f53daf3
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 8 deletions.
71 changes: 63 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,59 @@
# ComDriverSpi
# ComDriverSpi
Library for a SPI wrapper
created by IGB
================================================

Created by IGB.
This library allows the user to:

Arduino Library for wrapping the SPI class in a simpler way.
Create an object to open a communication channel.
Use the object and its methods to transfer data.
All underlying activities are encapsulated.
* Create an object to open a spi communication channel with underlying complexity encapsulated
* Use the object and its methods to transfer data with automatically setting slave select pins
* Configure for different data sizes arrays, 8bit, 16bit, 32bit
* Configure the other SPI options like frequency

An example is included to get you started.

* **/examples** - Example sketches for the library (.ino). Run these from the Arduino IDE
* **/src** - Source files for the library (.cpp, .h)
* **keywords.txt** - Keywords from this library that will be highlighted in the Arduino IDE
* **library.properties** - General library properties for the Arduino package manager

Documentation
--------------
The library enables the following functions:

#### General methods for class
ComDriverSpi();
ComDriverSpi(uint8_t slaveSelectPin);
ComDriverSpi(uint8_t slaveSelectPin, uint32_t frequency);

#### Write and read to SPI bus
bool writeSpi(uint8_t data[], uint32_t sizeToWrite, transferOption_t transferOption = transferStartEnd);
bool readSpi(uint8_t data[], uint32_t sizeToRead, transferOption_t transferOption = transferStartEnd);
bool writeReadSpi(uint8_t dataWrite[], uint32_t sizeToWrite, uint8_t dataRead[], uint32_t sizeToRead, transferOption_t transferOption = transferStartEnd);

void writeSpiManual(uint8_t dataWrite[], uint32_t sizeToWrite);
void readSpiManual(uint8_t dataRead[], uint32_t sizeToRead);

void writeSpiManual8(uint8_t data);
uint8_t readSpiManual8(void);
void writeSpiManual16(uint16_t data);
uint16_t readSpiManual16(void);
void writeSpiManual32(uint32_t data);
uint32_t readSpiManual32(void);

#### Configuration
void startWriteSpiManual(void);
void endWriteSpiManual(void);
void setSlaveSelectPin(uint8_t slaveSelectPin);
uint8_t getSlaveSelectPin();
void setFrequency(uint32_t frequency);
uint32_t getFrequency();
void setDataMode(uint8_t dataMode);
uint8_t getDataMode();
void setDataOrder(uint8_t dataOrder);
uint8_t getDataOrder();
void setTransferOption(transferOption_t transferOption);
transferOption_t getTransferOption();

## Installation

Expand All @@ -16,5 +64,12 @@ OR
Download the zip file and copy the contence in to your Arduino's contributed libraries folder found in your sketchbook folder.


## License
This project is unlicensed
License Information
-------------------
This product is _**open source**_!

Please review the LICENSE.md file for license information.

If you have any questions or concerns on licensing, please contact [email protected].

Distributed as-is; no warranty is given.
Binary file not shown.

0 comments on commit f53daf3

Please sign in to comment.