#include <avr/io.h>
#include "iohelp.h"
Go to the source code of this file.
|
void | sspiInit (uint8_t sck, uint8_t mosi, uint8_t miso) |
|
void | sspiOutMSB (uint8_t sck, uint8_t mosi, uint16_t data, uint8_t bits) |
|
uint16_t | sspiInMSB (uint8_t sck, uint8_t miso, uint8_t bits) |
|
uint16_t | sspiInOutMSB (uint8_t sck, uint8_t mosi, uint8_t miso, uint16_t data, uint8_t bits) |
|
void | sspiOutLSB (uint8_t sck, uint8_t mosi, uint16_t data, uint8_t bits) |
|
uint16_t | sspiInLSB (uint8_t sck, uint8_t miso, uint8_t bits) |
|
uint16_t | sspiInOutLSB (uint8_t sck, uint8_t mosi, uint8_t miso, uint16_t data, uint8_t bits) |
|
void sspiInit |
( |
uint8_t |
sck, |
|
|
uint8_t |
mosi, |
|
|
uint8_t |
miso |
|
) |
| |
Initialise pins for software SPI
It is not necessary to call this in order to use software SPI, it is simply a convenience function to do the necessary setup. You can initialise the pins directly if needed.
- Parameters
-
sck | the pin to use for the SCK output |
mosi | the pin to use for the MOSI output |
miso | the pin to use for the MISO input |
Definition at line 22 of file softspi.c.
uint16_t sspiInLSB |
( |
uint8_t |
sck, |
|
|
uint8_t |
miso, |
|
|
uint8_t |
bits |
|
) |
| |
Transfer data from a slave (LSB first)
- Parameters
-
sck | the pin to use for the SCK output |
miso | the pin to use for the MISO input |
bits | the number of bits to transfer |
- Returns
- a 16 bit value containing the data in the lowest bits.
Definition at line 156 of file softspi.c.
uint16_t sspiInMSB |
( |
uint8_t |
sck, |
|
|
uint8_t |
miso, |
|
|
uint8_t |
bits |
|
) |
| |
Transfer data from a slave (MSB first)
- Parameters
-
sck | the pin to use for the SCK output |
miso | the pin to use for the MISO input |
bits | the number of bits to transfer |
- Returns
- a 16 bit value containing the data in the lowest bits.
Definition at line 68 of file softspi.c.
uint16_t sspiInOutLSB |
( |
uint8_t |
sck, |
|
|
uint8_t |
mosi, |
|
|
uint8_t |
miso, |
|
|
uint16_t |
data, |
|
|
uint8_t |
bits |
|
) |
| |
Transfer data to and from a slave (LSB first)
- Parameters
-
sck | the pin to use for the SCK output |
mosi | the pin to use for the MOSI output |
miso | the pin to use for the MISO input |
data | the data to transfer out |
bits | the number of bits to transfer |
- Returns
- a 16 bit value containing the read data in the lowest bits.
Definition at line 184 of file softspi.c.
uint16_t sspiInOutMSB |
( |
uint8_t |
sck, |
|
|
uint8_t |
mosi, |
|
|
uint8_t |
miso, |
|
|
uint16_t |
data, |
|
|
uint8_t |
bits |
|
) |
| |
Transfer data to and from a slave (MSB first)
- Parameters
-
sck | the pin to use for the SCK output |
mosi | the pin to use for the MOSI output |
miso | the pin to use for the MISO input |
data | the data to transfer out |
bits | the number of bits to transfer |
- Returns
- a 16 bit value containing the read data in the lowest bits.
Definition at line 95 of file softspi.c.
void sspiOutLSB |
( |
uint8_t |
sck, |
|
|
uint8_t |
mosi, |
|
|
uint16_t |
data, |
|
|
uint8_t |
bits |
|
) |
| |
Transfer data to a slave (LSB first)
- Parameters
-
sck | the pin to use for the SCK output |
mosi | the pin to use for the MOSI output |
data | the data to transfer |
bits | the number of bits to transfer |
Definition at line 129 of file softspi.c.
void sspiOutMSB |
( |
uint8_t |
sck, |
|
|
uint8_t |
mosi, |
|
|
uint16_t |
data, |
|
|
uint8_t |
bits |
|
) |
| |
Transfer data to a slave (MSB first)
- Parameters
-
sck | the pin to use for the SCK output |
mosi | the pin to use for the MOSI output |
data | the data to transfer |
bits | the number of bits to transfer |
Definition at line 40 of file softspi.c.