Optimized high speed nRF24L01+ driver class documentation  1.4.2
TMRh20 2020 - Optimized fork of the nRF24L01+ driver
spi.h
Go to the documentation of this file.
1 
13 #include <string>
14 #include <stdint.h>
15 #include <unistd.h>
16 #include <stdio.h>
17 #include <stdlib.h>
18 #include <getopt.h>
19 #include <fcntl.h>
20 #include <sys/ioctl.h>
21 #include <inttypes.h>
22 #include <linux/types.h>
23 #include <linux/spi/spidev.h>
24 
25 using namespace std;
26 
27 #ifndef DOXYGEN_FORCED
28 // exclude this line from the docs to prevent displaying in the list of classes
29 class SPI
30 #endif
31 {
32 public:
33 
37  SPI();
38 
42  void begin(int busNo);
43 
49  uint8_t transfer(uint8_t tx_);
50 
57  void transfernb(char* tbuf, char* rbuf, uint32_t len);
58 
64  void transfern(char* buf, uint32_t len);
65 
66 #ifndef DOXYGEN_FORCED
67 // exclude this line from the docs to prevent warnings docs generators
68  virtual ~ SPI();
69 #endif
70 private:
71 
73  string device;
75  uint8_t mode;
77  uint8_t bits;
79  uint32_t speed;
80  int fd;
81 
82  void init();
83 
84 };
85 
void transfernb(char *tbuf, char *rbuf, uint32_t len)
uint8_t transfer(uint8_t tx_)
void transfern(char *buf, uint32_t len)
void begin(int busNo)