Optimized high speed nRF24L01+ driver class documentation v1.4.8
TMRh20 2020 - Optimized fork of the nRF24L01+ driver
Loading...
Searching...
No Matches
spi.h
Go to the documentation of this file.
1
12#ifndef RF24_UTILITY_TEMPLATE_SPI_H_
13#define RF24_UTILITY_TEMPLATE_SPI_H_
14
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
27using namespace std;
28
29#ifndef DOXYGEN_FORCED
30// exclude this line from the docs to prevent displaying in the list of classes
31class SPI
32#endif
33{
34
35public:
39 SPI();
40
44 void begin(int busNo);
45
51 uint8_t transfer(uint8_t tx_);
52
59 void transfernb(char* tbuf, char* rbuf, uint32_t len);
60
66 void transfern(char* buf, uint32_t len);
67
68#ifndef DOXYGEN_FORCED
69 // exclude this line from the docs to prevent warnings docs generators
70 virtual ~SPI();
71#endif
72
73private:
75 string device;
77 uint8_t mode;
79 uint8_t bits;
81 uint32_t speed;
82 int fd;
83
84 void init();
85};
86
89#endif // RF24_UTILITY_TEMPLATE_SPI_H_
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)