Optimized High Speed NRF24L01+ Driver Class Documenation  V1.0
TMRh20 2014 - Optimized Fork of NRF24L01+ Driver
spi.h
Go to the documentation of this file.
1 
15 #include <string>
16 #include <stdint.h>
17 #include <unistd.h>
18 #include <stdio.h>
19 #include <stdlib.h>
20 #include <getopt.h>
21 #include <fcntl.h>
22 #include <sys/ioctl.h>
23 #include <inttypes.h>
24 #include <linux/types.h>
25 #include <linux/spi/spidev.h>
26 
27 using namespace std;
28 //class SPI {
29 public:
30 
34  SPI();
35 
39  void begin(int busNo);
40 
46  uint8_t transfer(uint8_t tx_);
47 
54  void transfernb(char* tbuf, char* rbuf, uint32_t len);
55 
61  void transfern(char* buf, uint32_t len);
62 
63  virtual ~SPI();
64 
65 private:
66 
68  string device;
70  uint8_t mode;
72  uint8_t bits;
74  uint32_t speed;
75  int fd;
76 
77  void init();
78 };
79 
80 
uint8_t bits
Definition: spi.h:72
uint32_t speed
Definition: spi.h:74
string device
Definition: spi.h:68
void begin(int busNo)
void transfernb(char *tbuf, char *rbuf, uint32_t len)
void transfern(char *buf, uint32_t len)
SPI()
uint8_t transfer(uint8_t tx_)
int fd
Definition: spi.h:75
uint8_t mode
Definition: spi.h:70
virtual ~SPI()