|
FluxSand 1.0
FluxSand - Interactive Digital Hourglass
|
#include <bsp_spi.hpp>
Public Member Functions | |
| SpiDevice (const std::string &device, uint32_t speed, uint8_t mode) | |
| ~SpiDevice () | |
| uint8_t | ReadRegister (Gpio *cs, uint8_t reg) |
| void | WriteRegister (Gpio *cs, uint8_t reg, uint8_t value) |
| void | ReadRegisters (Gpio *cs, uint8_t reg, uint8_t *buffer, size_t length) |
| int | Fd () const |
| uint32_t | Speed () const |
Private Attributes | |
| int | fd_ |
| uint32_t | speed_ |
SPI device interface for configuration and register operations.
Definition at line 20 of file bsp_spi.hpp.
|
inline |
Opens and configures the SPI device.
| device | SPI device file path (e.g., "/dev/spidev0.0") |
| speed | Transfer speed in Hz |
| mode | SPI mode (e.g., SPI_MODE_0) |
Definition at line 29 of file bsp_spi.hpp.
|
inline |
Closes the SPI device.
Definition at line 45 of file bsp_spi.hpp.
|
inline |
Definition at line 133 of file bsp_spi.hpp.
|
inline |
Reads a register via SPI.
| cs | GPIO chip select (active low) |
| reg | Register address (MSB set to 1 for read operation) |
Definition at line 58 of file bsp_spi.hpp.
|
inline |
Definition at line 107 of file bsp_spi.hpp.
|
inline |
Definition at line 135 of file bsp_spi.hpp.
|
inline |
Writes a value to a register via SPI.
| cs | GPIO chip select |
| reg | Register address |
| value | Value to write |
Definition at line 88 of file bsp_spi.hpp.
|
private |
Definition at line 138 of file bsp_spi.hpp.
|
private |
Definition at line 139 of file bsp_spi.hpp.