You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
724 B
37 lines
724 B
#ifndef __SPI_PORT_HEADER__
|
|
#define __SPI_PORT_HEADER__
|
|
|
|
#include "../../data/transport/transportBus.h"
|
|
|
|
#include <getopt.h>
|
|
#include <fcntl.h>
|
|
#include <sys/ioctl.h>
|
|
#include <linux/types.h>
|
|
#include <linux/spi/spidev.h>
|
|
|
|
|
|
typedef enum E_SPI_MODES{
|
|
SPI_ADDR_8 = 0,
|
|
SPI_ADDR_16 = 1
|
|
} SPI_MODE;
|
|
|
|
class spiPort: public transportBus {
|
|
private:
|
|
bool m_bConnected;
|
|
bool m_bInitComplete;
|
|
CSTR m_pDevicePath;
|
|
int m_ioFID;
|
|
uint32_t m_nLineSpeed;
|
|
struct spi_ioc_transfer xfer[2];
|
|
bool HW_init( CSTR Path, uint32_t Speed );
|
|
public:
|
|
spiPort();
|
|
spiPort( CSTR DevicePath, int Speed );
|
|
virtual ~spiPort();
|
|
bool setMode( SPI_MODE val );
|
|
|
|
|
|
};
|
|
|
|
|
|
#endif
|