|
mraa
0.7.1
Low Level Skeleton Library for Communication on GNU/Linux platforms
|
This file defines the SPI interface for libmraa
Public Member Functions | |
| Spi (int bus) | |
| ~Spi () | |
| mraa_result_t | mode (Spi_Mode mode) |
| mraa_result_t | frequency (int hz) |
| int | writeByte (uint8_t data) |
| uint16_t | write_word (uint16_t data) |
| uint8_t * | write (uint8_t *txBuf, int length) |
| uint16_t * | write_word (uint16_t *txBuf, int length) |
| mraa_result_t | transfer (uint8_t *txBuf, uint8_t *rxBuf, int length) |
| mraa_result_t | transfer_word (uint16_t *txBuf, uint16_t *rxBuf, int length) |
| mraa_result_t | lsbmode (bool lsb) |
| mraa_result_t | bitPerWord (unsigned int bits) |
|
inline |
Initialise SPI object using the board mapping to set muxes
| bus | to use, as listed in the platform definition, normally 0 |

|
inline |
Closes spi bus

|
inline |
Set the SPI device mode. see spidev0-3
| mode | the mode. See Linux spidev doc |

|
inline |
Set the SPI device operating clock frequency
| hz | the frequency to set in hz |

|
inline |
Write single byte to the SPI device
| data | the byte to send |

|
inline |
Write single byte to the SPI device
| data | the byte to send |

|
inline |
Write buffer of bytes to SPI device The pointer return has to be free'd by the caller. It will return a NULL pointer in cases of error
| txBuf | buffer to send |
| length | size of buffer to send |

|
inline |
Write buffer of bytes to SPI device The pointer return has to be free'd by the caller. It will return a NULL pointer in cases of error
| txBuf | buffer to send |
| length | size of buffer (in bytes) to send |

|
inline |
Transfer data to and from SPI device Receive pointer may be null if return data is not needed.
| txBuf | buffer to send |
| rxBuf | buffer to optionally receive data from spi device |
| length | size of buffer to send |

|
inline |
Transfer data to and from SPI device Receive pointer may be null if return data is not needed.
| txBuf | buffer to send |
| rxBuf | buffer to optionally receive data from spi device |
| length | size of buffer to send |

|
inline |
Change the SPI lsb mode
| lsb | Use least significant bit transmission - 0 for msbi |

|
inline |
Set bits per mode on transaction, default is 8
| bits | bits per word |

1.8.9.1