diff --git a/html/_adafruit___bus_i_o___register_8h_source.html b/html/_adafruit___bus_i_o___register_8h_source.html index b69060f..9fbb40f 100644 --- a/html/_adafruit___bus_i_o___register_8h_source.html +++ b/html/_adafruit___bus_i_o___register_8h_source.html @@ -72,7 +72,7 @@ $(function() {
Adafruit_BusIO_Register::setAddressWidth
void setAddressWidth(uint16_t address_width)
Set the width of register address.
Definition: Adafruit_BusIO_Register.cpp:380
Adafruit_BusIO_Register::Adafruit_BusIO_Register
Adafruit_BusIO_Register(Adafruit_I2CDevice *i2cdevice, uint16_t reg_addr, uint8_t width=1, uint8_t byteorder=LSBFIRST, uint8_t address_width=1)
Create a register we access over an I2C Device (which defines the bus and address) ...
Definition: Adafruit_BusIO_Register.cpp:18
Adafruit_BusIO_Register::readCached
uint32_t readCached(void)
Read cached data from last time we wrote to this register.
Definition: Adafruit_BusIO_Register.cpp:211
-
Adafruit_GenericDevice
Class for communicating with a device via generic read/write functions.
Definition: Adafruit_GenericDevice.h:19
+
Adafruit_GenericDevice
Class for communicating with a device via generic read/write functions.
Definition: Adafruit_GenericDevice.h:21
Adafruit_SPIDevice
Definition: Adafruit_SPIDevice.h:94
Adafruit_BusIO_Register::read
uint32_t read(void)
Read data from the register location. This does not do any error checking!
Definition: Adafruit_BusIO_Register.cpp:188
Adafruit_BusIO_Register::width
uint8_t width(void)
The width of the register data, helpful for doing calculations.
Definition: Adafruit_BusIO_Register.cpp:360
diff --git a/html/_adafruit___generic_device_8h_source.html b/html/_adafruit___generic_device_8h_source.html index 3845e0e..cff1a11 100644 --- a/html/_adafruit___generic_device_8h_source.html +++ b/html/_adafruit___generic_device_8h_source.html @@ -62,18 +62,18 @@ $(function() {
Adafruit_GenericDevice.h
-
1 #ifndef ADAFRUIT_GENERICDEVICE_H
2 #define ADAFRUIT_GENERICDEVICE_H
3 
4 #include <Arduino.h>
5 
6 typedef bool (*busio_genericdevice_read_t)(uint8_t *buffer, size_t len);
7 typedef bool (*busio_genericdevice_write_t)(const uint8_t *buffer, size_t len);
8 typedef bool (*busio_genericdevice_readreg_t)(uint8_t *addr_buf,
9  uint8_t addrsiz, uint8_t *buf,
10  uint16_t bufsiz);
11 typedef bool (*busio_genericdevice_writereg_t)(uint8_t *addr_buf,
12  uint8_t addrsiz,
13  const uint8_t *buf,
14  uint16_t bufsiz);
15 
20 public:
22  busio_genericdevice_read_t read_func,
23  busio_genericdevice_write_t write_func,
24  busio_genericdevice_readreg_t readreg_func = nullptr,
25  busio_genericdevice_writereg_t writereg_func = nullptr);
26 
27  bool begin(void);
28 
29  bool read(uint8_t *buffer, size_t len);
30  bool write(const uint8_t *buffer, size_t len);
31  bool readRegister(uint8_t *addr_buf, uint8_t addrsiz, uint8_t *buf,
32  uint16_t bufsiz);
33  bool writeRegister(uint8_t *addr_buf, uint8_t addrsiz, const uint8_t *buf,
34  uint16_t bufsiz);
35 
36 protected:
38  busio_genericdevice_read_t _read_func;
40  busio_genericdevice_write_t _write_func;
42  busio_genericdevice_readreg_t _readreg_func;
44  busio_genericdevice_writereg_t _writereg_func;
45 
46  bool _begun;
47 };
49 
50 #endif // ADAFRUIT_GENERICDEVICE_H
bool read(uint8_t *buffer, size_t len)
Read data into a buffer.
Definition: Adafruit_GenericDevice.cpp:47
-
busio_genericdevice_read_t _read_func
Function pointer for reading raw data from the device.
Definition: Adafruit_GenericDevice.h:38
-
bool writeRegister(uint8_t *addr_buf, uint8_t addrsiz, const uint8_t *buf, uint16_t bufsiz)
Write to a register location.
Definition: Adafruit_GenericDevice.cpp:72
-
bool begin(void)
Initializes the device.
Definition: Adafruit_GenericDevice.cpp:28
-
bool _begun
Definition: Adafruit_GenericDevice.h:46
-
busio_genericdevice_readreg_t _readreg_func
Function pointer for reading a &#39;register&#39; from the device.
Definition: Adafruit_GenericDevice.h:42
-
bool readRegister(uint8_t *addr_buf, uint8_t addrsiz, uint8_t *buf, uint16_t bufsiz)
Read from a register location.
Definition: Adafruit_GenericDevice.cpp:59
-
Adafruit_GenericDevice(busio_genericdevice_read_t read_func, busio_genericdevice_write_t write_func, busio_genericdevice_readreg_t readreg_func=nullptr, busio_genericdevice_writereg_t writereg_func=nullptr)
Create a Generic device with the provided read/write functions.
Definition: Adafruit_GenericDevice.cpp:14
-
busio_genericdevice_write_t _write_func
Function pointer for writing raw data to the device.
Definition: Adafruit_GenericDevice.h:40
-
busio_genericdevice_writereg_t _writereg_func
Function pointer for writing a &#39;register&#39; to the device.
Definition: Adafruit_GenericDevice.h:44
-
Class for communicating with a device via generic read/write functions.
Definition: Adafruit_GenericDevice.h:19
-
bool write(const uint8_t *buffer, size_t len)
Write a buffer of data.
Definition: Adafruit_GenericDevice.cpp:37
+
1 #ifndef ADAFRUIT_GENERICDEVICE_H
2 #define ADAFRUIT_GENERICDEVICE_H
3 
4 #include <Arduino.h>
5 
6 typedef bool (*busio_genericdevice_read_t)(void *obj, uint8_t *buffer,
7  size_t len);
8 typedef bool (*busio_genericdevice_write_t)(void *obj, const uint8_t *buffer,
9  size_t len);
10 typedef bool (*busio_genericdevice_readreg_t)(void *obj, uint8_t *addr_buf,
11  uint8_t addrsiz, uint8_t *data,
12  uint16_t datalen);
13 typedef bool (*busio_genericdevice_writereg_t)(void *obj, uint8_t *addr_buf,
14  uint8_t addrsiz,
15  const uint8_t *data,
16  uint16_t datalen);
17 
22 public:
24  void *obj, busio_genericdevice_read_t read_func,
25  busio_genericdevice_write_t write_func,
26  busio_genericdevice_readreg_t readreg_func = nullptr,
27  busio_genericdevice_writereg_t writereg_func = nullptr);
28 
29  bool begin(void);
30 
31  bool read(uint8_t *buffer, size_t len);
32  bool write(const uint8_t *buffer, size_t len);
33  bool readRegister(uint8_t *addr_buf, uint8_t addrsiz, uint8_t *buf,
34  uint16_t bufsiz);
35  bool writeRegister(uint8_t *addr_buf, uint8_t addrsiz, const uint8_t *buf,
36  uint16_t bufsiz);
37 
38 protected:
40  busio_genericdevice_read_t _read_func;
42  busio_genericdevice_write_t _write_func;
44  busio_genericdevice_readreg_t _readreg_func;
46  busio_genericdevice_writereg_t _writereg_func;
47 
48  bool _begun;
49 
51 private:
52  void *_obj;
53 };
54 
55 #endif // ADAFRUIT_GENERICDEVICE_H
bool read(uint8_t *buffer, size_t len)
Read data into a buffer.
Definition: Adafruit_GenericDevice.cpp:51
+
busio_genericdevice_read_t _read_func
Function pointer for reading raw data from the device.
Definition: Adafruit_GenericDevice.h:40
+
bool writeRegister(uint8_t *addr_buf, uint8_t addrsiz, const uint8_t *buf, uint16_t bufsiz)
Write to a register location.
Definition: Adafruit_GenericDevice.cpp:76
+
bool begin(void)
Simple begin function (doesn&#39;t do much at this time)
Definition: Adafruit_GenericDevice.cpp:32
+
bool _begun
Definition: Adafruit_GenericDevice.h:48
+
busio_genericdevice_readreg_t _readreg_func
Function pointer for reading a &#39;register&#39; from the device.
Definition: Adafruit_GenericDevice.h:44
+
bool readRegister(uint8_t *addr_buf, uint8_t addrsiz, uint8_t *buf, uint16_t bufsiz)
Read from a register location.
Definition: Adafruit_GenericDevice.cpp:63
+
busio_genericdevice_write_t _write_func
Function pointer for writing raw data to the device.
Definition: Adafruit_GenericDevice.h:42
+
busio_genericdevice_writereg_t _writereg_func
Function pointer for writing a &#39;register&#39; to the device.
Definition: Adafruit_GenericDevice.h:46
+
Class for communicating with a device via generic read/write functions.
Definition: Adafruit_GenericDevice.h:21
+
bool write(const uint8_t *buffer, size_t len)
Write a buffer of data.
Definition: Adafruit_GenericDevice.cpp:41
+
Adafruit_GenericDevice(void *obj, busio_genericdevice_read_t read_func, busio_genericdevice_write_t write_func, busio_genericdevice_readreg_t readreg_func=nullptr, busio_genericdevice_writereg_t writereg_func=nullptr)
Create a Generic device with the provided read/write functions.
Definition: Adafruit_GenericDevice.cpp:16
-
1 #ifndef Adafruit_SPIDevice_h
2 #define Adafruit_SPIDevice_h
3 
4 #include <Arduino.h>
5 
6 #if !defined(SPI_INTERFACES_COUNT) || \
7  (defined(SPI_INTERFACES_COUNT) && (SPI_INTERFACES_COUNT > 0))
8 // HW SPI available
9 #include <SPI.h>
10 #define BUSIO_HAS_HW_SPI
11 #else
12 // SW SPI ONLY
13 enum { SPI_MODE0, SPI_MODE1, SPI_MODE2, _SPI_MODE4 };
14 typedef uint8_t SPIClass;
15 #endif
16 
17 // some modern SPI definitions don't have BitOrder enum
18 #if (defined(__AVR__) && !defined(ARDUINO_ARCH_MEGAAVR)) || \
19  defined(ESP8266) || defined(TEENSYDUINO) || defined(SPARK) || \
20  defined(ARDUINO_ARCH_SPRESENSE) || defined(MEGATINYCORE) || \
21  defined(DXCORE) || defined(ARDUINO_AVR_ATmega4809) || \
22  defined(ARDUINO_AVR_ATmega4808) || defined(ARDUINO_AVR_ATmega3209) || \
23  defined(ARDUINO_AVR_ATmega3208) || defined(ARDUINO_AVR_ATmega1609) || \
24  defined(ARDUINO_AVR_ATmega1608) || defined(ARDUINO_AVR_ATmega809) || \
25  defined(ARDUINO_AVR_ATmega808) || defined(ARDUINO_ARCH_ARC32) || \
26  defined(ARDUINO_ARCH_XMC)
27 
28 typedef enum _BitOrder {
29  SPI_BITORDER_MSBFIRST = MSBFIRST,
30  SPI_BITORDER_LSBFIRST = LSBFIRST,
31 } BusIOBitOrder;
32 
33 #elif defined(ESP32) || defined(__ASR6501__) || defined(__ASR6502__)
34 
35 // some modern SPI definitions don't have BitOrder enum and have different SPI
36 // mode defines
37 typedef enum _BitOrder {
38  SPI_BITORDER_MSBFIRST = SPI_MSBFIRST,
39  SPI_BITORDER_LSBFIRST = SPI_LSBFIRST,
40 } BusIOBitOrder;
41 
42 #else
43 // Some platforms have a BitOrder enum but its named MSBFIRST/LSBFIRST
44 #define SPI_BITORDER_MSBFIRST MSBFIRST
45 #define SPI_BITORDER_LSBFIRST LSBFIRST
46 typedef BitOrder BusIOBitOrder;
47 #endif
48 
49 #if defined(__IMXRT1062__) // Teensy 4.x
50 // *Warning* I disabled the usage of FAST_PINIO as the set/clear operations
51 // used in the cpp file are not atomic and can effect multiple IO pins
52 // and if an interrupt happens in between the time the code reads the register
53 // and writes out the updated value, that changes one or more other IO pins
54 // on that same IO port, those change will be clobbered when the updated
55 // values are written back. A fast version can be implemented that uses the
56 // ports set and clear registers which are atomic.
57 // typedef volatile uint32_t BusIO_PortReg;
58 // typedef uint32_t BusIO_PortMask;
59 //#define BUSIO_USE_FAST_PINIO
60 
61 #elif defined(__MBED__) || defined(__ZEPHYR__)
62 // Boards based on RTOS cores like mbed or Zephyr are not going to expose the
63 // low level registers needed for fast pin manipulation
64 #undef BUSIO_USE_FAST_PINIO
65 
66 #elif defined(ARDUINO_ARCH_XMC)
67 #undef BUSIO_USE_FAST_PINIO
68 
69 #elif defined(__AVR__) || defined(TEENSYDUINO)
70 typedef volatile uint8_t BusIO_PortReg;
71 typedef uint8_t BusIO_PortMask;
72 #define BUSIO_USE_FAST_PINIO
73 
74 #elif defined(ESP8266) || defined(ESP32) || defined(__SAM3X8E__) || \
75  defined(ARDUINO_ARCH_SAMD)
76 typedef volatile uint32_t BusIO_PortReg;
77 typedef uint32_t BusIO_PortMask;
78 #define BUSIO_USE_FAST_PINIO
79 
80 #elif (defined(__arm__) || defined(ARDUINO_FEATHER52)) && \
81  !defined(ARDUINO_ARCH_RP2040) && !defined(ARDUINO_SILABS) && \
82  !defined(ARDUINO_UNOR4_MINIMA) && !defined(ARDUINO_UNOR4_WIFI)
83 typedef volatile uint32_t BusIO_PortReg;
84 typedef uint32_t BusIO_PortMask;
85 #if !defined(__ASR6501__) && !defined(__ASR6502__)
86 #define BUSIO_USE_FAST_PINIO
87 #endif
88 
89 #else
90 #undef BUSIO_USE_FAST_PINIO
91 #endif
92 
95 public:
96 #ifdef BUSIO_HAS_HW_SPI
97  Adafruit_SPIDevice(int8_t cspin, uint32_t freq = 1000000,
98  BusIOBitOrder dataOrder = SPI_BITORDER_MSBFIRST,
99  uint8_t dataMode = SPI_MODE0, SPIClass *theSPI = &SPI);
100 #else
101  Adafruit_SPIDevice(int8_t cspin, uint32_t freq = 1000000,
102  BusIOBitOrder dataOrder = SPI_BITORDER_MSBFIRST,
103  uint8_t dataMode = SPI_MODE0, SPIClass *theSPI = nullptr);
104 #endif
105  Adafruit_SPIDevice(int8_t cspin, int8_t sck, int8_t miso, int8_t mosi,
106  uint32_t freq = 1000000,
107  BusIOBitOrder dataOrder = SPI_BITORDER_MSBFIRST,
108  uint8_t dataMode = SPI_MODE0);
110 
111  bool begin(void);
112  bool read(uint8_t *buffer, size_t len, uint8_t sendvalue = 0xFF);
113  bool write(const uint8_t *buffer, size_t len,
114  const uint8_t *prefix_buffer = nullptr, size_t prefix_len = 0);
115  bool write_then_read(const uint8_t *write_buffer, size_t write_len,
116  uint8_t *read_buffer, size_t read_len,
117  uint8_t sendvalue = 0xFF);
118  bool write_and_read(uint8_t *buffer, size_t len);
119 
120  uint8_t transfer(uint8_t send);
121  void transfer(uint8_t *buffer, size_t len);
122  void beginTransaction(void);
123  void endTransaction(void);
126 
127 private:
128 #ifdef BUSIO_HAS_HW_SPI
129  SPIClass *_spi = nullptr;
130  SPISettings *_spiSetting = nullptr;
131 #else
132  uint8_t *_spi = nullptr;
133  uint8_t *_spiSetting = nullptr;
134 #endif
135  uint32_t _freq;
136  BusIOBitOrder _dataOrder;
137  uint8_t _dataMode;
138  void setChipSelect(int value);
139 
140  int8_t _cs, _sck, _mosi, _miso;
141 #ifdef BUSIO_USE_FAST_PINIO
142  BusIO_PortReg *mosiPort, *clkPort, *misoPort, *csPort;
143  BusIO_PortMask mosiPinMask, misoPinMask, clkPinMask, csPinMask;
144 #endif
145  bool _begun;
146 };
147 
148 #endif // Adafruit_SPIDevice_h
bool write(const uint8_t *buffer, size_t len, const uint8_t *prefix_buffer=nullptr, size_t prefix_len=0)
Write a buffer or two to the SPI device, with transaction management.
Definition: Adafruit_SPIDevice.cpp:343
+
1 #ifndef Adafruit_SPIDevice_h
2 #define Adafruit_SPIDevice_h
3 
4 #include <Arduino.h>
5 
6 #if !defined(SPI_INTERFACES_COUNT) || \
7  (defined(SPI_INTERFACES_COUNT) && (SPI_INTERFACES_COUNT > 0))
8 // HW SPI available
9 #include <SPI.h>
10 #define BUSIO_HAS_HW_SPI
11 #else
12 // SW SPI ONLY
13 enum { SPI_MODE0, SPI_MODE1, SPI_MODE2, _SPI_MODE4 };
14 typedef uint8_t SPIClass;
15 #endif
16 
17 // some modern SPI definitions don't have BitOrder enum
18 #if (defined(__AVR__) && !defined(ARDUINO_ARCH_MEGAAVR)) || \
19  defined(ESP8266) || defined(TEENSYDUINO) || defined(SPARK) || \
20  defined(ARDUINO_ARCH_SPRESENSE) || defined(MEGATINYCORE) || \
21  defined(DXCORE) || defined(ARDUINO_AVR_ATmega4809) || \
22  defined(ARDUINO_AVR_ATmega4808) || defined(ARDUINO_AVR_ATmega3209) || \
23  defined(ARDUINO_AVR_ATmega3208) || defined(ARDUINO_AVR_ATmega1609) || \
24  defined(ARDUINO_AVR_ATmega1608) || defined(ARDUINO_AVR_ATmega809) || \
25  defined(ARDUINO_AVR_ATmega808) || defined(ARDUINO_ARCH_ARC32) || \
26  defined(ARDUINO_ARCH_XMC)
27 
28 typedef enum _BitOrder {
29  SPI_BITORDER_MSBFIRST = MSBFIRST,
30  SPI_BITORDER_LSBFIRST = LSBFIRST,
31 } BusIOBitOrder;
32 
33 #elif defined(ESP32) || defined(__ASR6501__) || defined(__ASR6502__)
34 
35 // some modern SPI definitions don't have BitOrder enum and have different SPI
36 // mode defines
37 typedef enum _BitOrder {
38  SPI_BITORDER_MSBFIRST = SPI_MSBFIRST,
39  SPI_BITORDER_LSBFIRST = SPI_LSBFIRST,
40 } BusIOBitOrder;
41 
42 #else
43 // Some platforms have a BitOrder enum but its named MSBFIRST/LSBFIRST
44 #define SPI_BITORDER_MSBFIRST MSBFIRST
45 #define SPI_BITORDER_LSBFIRST LSBFIRST
46 typedef BitOrder BusIOBitOrder;
47 #endif
48 
49 #if defined(__IMXRT1062__) // Teensy 4.x
50 // *Warning* I disabled the usage of FAST_PINIO as the set/clear operations
51 // used in the cpp file are not atomic and can effect multiple IO pins
52 // and if an interrupt happens in between the time the code reads the register
53 // and writes out the updated value, that changes one or more other IO pins
54 // on that same IO port, those change will be clobbered when the updated
55 // values are written back. A fast version can be implemented that uses the
56 // ports set and clear registers which are atomic.
57 // typedef volatile uint32_t BusIO_PortReg;
58 // typedef uint32_t BusIO_PortMask;
59 // #define BUSIO_USE_FAST_PINIO
60 
61 #elif defined(__MBED__) || defined(__ZEPHYR__)
62 // Boards based on RTOS cores like mbed or Zephyr are not going to expose the
63 // low level registers needed for fast pin manipulation
64 #undef BUSIO_USE_FAST_PINIO
65 
66 #elif defined(ARDUINO_ARCH_XMC)
67 #undef BUSIO_USE_FAST_PINIO
68 
69 #elif defined(__AVR__) || defined(TEENSYDUINO)
70 typedef volatile uint8_t BusIO_PortReg;
71 typedef uint8_t BusIO_PortMask;
72 #define BUSIO_USE_FAST_PINIO
73 
74 #elif defined(ESP8266) || defined(ESP32) || defined(__SAM3X8E__) || \
75  defined(ARDUINO_ARCH_SAMD)
76 typedef volatile uint32_t BusIO_PortReg;
77 typedef uint32_t BusIO_PortMask;
78 #define BUSIO_USE_FAST_PINIO
79 
80 #elif (defined(__arm__) || defined(ARDUINO_FEATHER52)) && \
81  !defined(ARDUINO_ARCH_RP2040) && !defined(ARDUINO_SILABS) && \
82  !defined(ARDUINO_UNOR4_MINIMA) && !defined(ARDUINO_UNOR4_WIFI)
83 typedef volatile uint32_t BusIO_PortReg;
84 typedef uint32_t BusIO_PortMask;
85 #if !defined(__ASR6501__) && !defined(__ASR6502__)
86 #define BUSIO_USE_FAST_PINIO
87 #endif
88 
89 #else
90 #undef BUSIO_USE_FAST_PINIO
91 #endif
92 
95 public:
96 #ifdef BUSIO_HAS_HW_SPI
97  Adafruit_SPIDevice(int8_t cspin, uint32_t freq = 1000000,
98  BusIOBitOrder dataOrder = SPI_BITORDER_MSBFIRST,
99  uint8_t dataMode = SPI_MODE0, SPIClass *theSPI = &SPI);
100 #else
101  Adafruit_SPIDevice(int8_t cspin, uint32_t freq = 1000000,
102  BusIOBitOrder dataOrder = SPI_BITORDER_MSBFIRST,
103  uint8_t dataMode = SPI_MODE0, SPIClass *theSPI = nullptr);
104 #endif
105  Adafruit_SPIDevice(int8_t cspin, int8_t sck, int8_t miso, int8_t mosi,
106  uint32_t freq = 1000000,
107  BusIOBitOrder dataOrder = SPI_BITORDER_MSBFIRST,
108  uint8_t dataMode = SPI_MODE0);
110 
111  bool begin(void);
112  bool read(uint8_t *buffer, size_t len, uint8_t sendvalue = 0xFF);
113  bool write(const uint8_t *buffer, size_t len,
114  const uint8_t *prefix_buffer = nullptr, size_t prefix_len = 0);
115  bool write_then_read(const uint8_t *write_buffer, size_t write_len,
116  uint8_t *read_buffer, size_t read_len,
117  uint8_t sendvalue = 0xFF);
118  bool write_and_read(uint8_t *buffer, size_t len);
119 
120  uint8_t transfer(uint8_t send);
121  void transfer(uint8_t *buffer, size_t len);
122  void beginTransaction(void);
123  void endTransaction(void);
126 
127 private:
128 #ifdef BUSIO_HAS_HW_SPI
129  SPIClass *_spi = nullptr;
130  SPISettings *_spiSetting = nullptr;
131 #else
132  uint8_t *_spi = nullptr;
133  uint8_t *_spiSetting = nullptr;
134 #endif
135  uint32_t _freq;
136  BusIOBitOrder _dataOrder;
137  uint8_t _dataMode;
138  void setChipSelect(int value);
139 
140  int8_t _cs, _sck, _mosi, _miso;
141 #ifdef BUSIO_USE_FAST_PINIO
142  BusIO_PortReg *mosiPort, *clkPort, *misoPort, *csPort;
143  BusIO_PortMask mosiPinMask, misoPinMask, clkPinMask, csPinMask;
144 #endif
145  bool _begun;
146 };
147 
148 #endif // Adafruit_SPIDevice_h
bool write(const uint8_t *buffer, size_t len, const uint8_t *prefix_buffer=nullptr, size_t prefix_len=0)
Write a buffer or two to the SPI device, with transaction management.
Definition: Adafruit_SPIDevice.cpp:343
void beginTransactionWithAssertingCS()
Write a buffer or two to the SPI device, with transaction management.
Definition: Adafruit_SPIDevice.cpp:318
void endTransactionWithDeassertingCS()
Manually end a transaction (calls endTransaction if hardware SPI) with deasserting the CS pin...
Definition: Adafruit_SPIDevice.cpp:327
bool write_and_read(uint8_t *buffer, size_t len)
Write some data and read some data at the same time from SPI into the same buffer, with transaction management. This is basicaly a wrapper for transfer() with CS-pin and transaction management. This /does/ transmit-receive at the same time!
Definition: Adafruit_SPIDevice.cpp:502
diff --git a/html/class_adafruit___generic_device-members.html b/html/class_adafruit___generic_device-members.html index 4329f1b..7884456 100644 --- a/html/class_adafruit___generic_device-members.html +++ b/html/class_adafruit___generic_device-members.html @@ -70,7 +70,7 @@ $(function() { _readreg_funcAdafruit_GenericDeviceprotected _write_funcAdafruit_GenericDeviceprotected _writereg_funcAdafruit_GenericDeviceprotected - Adafruit_GenericDevice(busio_genericdevice_read_t read_func, busio_genericdevice_write_t write_func, busio_genericdevice_readreg_t readreg_func=nullptr, busio_genericdevice_writereg_t writereg_func=nullptr)Adafruit_GenericDevice + Adafruit_GenericDevice(void *obj, busio_genericdevice_read_t read_func, busio_genericdevice_write_t write_func, busio_genericdevice_readreg_t readreg_func=nullptr, busio_genericdevice_writereg_t writereg_func=nullptr)Adafruit_GenericDevice begin(void)Adafruit_GenericDevice read(uint8_t *buffer, size_t len)Adafruit_GenericDevice readRegister(uint8_t *addr_buf, uint8_t addrsiz, uint8_t *buf, uint16_t bufsiz)Adafruit_GenericDevice diff --git a/html/class_adafruit___generic_device.html b/html/class_adafruit___generic_device.html index af40ccb..f14e908 100644 --- a/html/class_adafruit___generic_device.html +++ b/html/class_adafruit___generic_device.html @@ -74,11 +74,11 @@ $(function() { - - - + + + - + @@ -117,8 +117,8 @@ busio_genericdevice_writereg_t  + + + + + + @@ -158,6 +164,7 @@ busio_genericdevice_writereg_t 

Public Member Functions

 Adafruit_GenericDevice (busio_genericdevice_read_t read_func, busio_genericdevice_write_t write_func, busio_genericdevice_readreg_t readreg_func=nullptr, busio_genericdevice_writereg_t writereg_func=nullptr)
 Create a Generic device with the provided read/write functions. More...
 
 Adafruit_GenericDevice (void *obj, busio_genericdevice_read_t read_func, busio_genericdevice_write_t write_func, busio_genericdevice_readreg_t readreg_func=nullptr, busio_genericdevice_writereg_t writereg_func=nullptr)
 Create a Generic device with the provided read/write functions. More...
 
bool begin (void)
 Initializes the device. More...
 Simple begin function (doesn't do much at this time) More...
 
bool read (uint8_t *buffer, size_t len)
 Read data into a buffer. More...

Detailed Description

Class for communicating with a device via generic read/write functions.

Constructor & Destructor Documentation

- -

◆ Adafruit_GenericDevice()

+ +

◆ Adafruit_GenericDevice()

@@ -126,6 +126,12 @@ busio_genericdevice_writereg_t 
Adafruit_GenericDevice::Adafruit_GenericDevice (void * obj,
busio_genericdevice_read_t  read_func,
Parameters
+ @@ -185,8 +192,8 @@ busio_genericdevice_writereg_t 
objPointer to object instance
read_funcFunction pointer for reading raw data
write_funcFunction pointer for writing raw data
readreg_funcFunction pointer for reading registers (optional)
-

Initializes the device.

-
Returns
true if initialization was successful, otherwise false
+

Simple begin function (doesn't do much at this time)

+
Returns
true always
diff --git a/html/functions.html b/html/functions.html index e20a1db..0f2ee75 100644 --- a/html/functions.html +++ b/html/functions.html @@ -87,7 +87,7 @@ $(function() { : Adafruit_BusIO_RegisterBits
  • Adafruit_GenericDevice() -: Adafruit_GenericDevice +: Adafruit_GenericDevice
  • Adafruit_I2CDevice() : Adafruit_I2CDevice diff --git a/html/functions_func.html b/html/functions_func.html index d71035c..f379171 100644 --- a/html/functions_func.html +++ b/html/functions_func.html @@ -68,7 +68,7 @@ $(function() { : Adafruit_BusIO_RegisterBits
  • Adafruit_GenericDevice() -: Adafruit_GenericDevice +: Adafruit_GenericDevice
  • Adafruit_I2CDevice() : Adafruit_I2CDevice diff --git a/html/search/all_1.js b/html/search/all_1.js index 088887e..752d994 100644 --- a/html/search/all_1.js +++ b/html/search/all_1.js @@ -2,7 +2,7 @@ var searchData= [ ['adafruit_5fbusio_5fregister',['Adafruit_BusIO_Register',['../class_adafruit___bus_i_o___register.html',1,'Adafruit_BusIO_Register'],['../class_adafruit___bus_i_o___register.html#a7de4a4cbb3e8cdfebac31344e8ab6c8c',1,'Adafruit_BusIO_Register::Adafruit_BusIO_Register(Adafruit_I2CDevice *i2cdevice, uint16_t reg_addr, uint8_t width=1, uint8_t byteorder=LSBFIRST, uint8_t address_width=1)'],['../class_adafruit___bus_i_o___register.html#a89e57552743a5f15c99cb7aa27b3ca13',1,'Adafruit_BusIO_Register::Adafruit_BusIO_Register(Adafruit_SPIDevice *spidevice, uint16_t reg_addr, Adafruit_BusIO_SPIRegType type, uint8_t width=1, uint8_t byteorder=LSBFIRST, uint8_t address_width=1)'],['../class_adafruit___bus_i_o___register.html#a300a0297429df441bc88dbb37eac1a06',1,'Adafruit_BusIO_Register::Adafruit_BusIO_Register(Adafruit_I2CDevice *i2cdevice, Adafruit_SPIDevice *spidevice, Adafruit_BusIO_SPIRegType type, uint16_t reg_addr, uint8_t width=1, uint8_t byteorder=LSBFIRST, uint8_t address_width=1)'],['../class_adafruit___bus_i_o___register.html#aaa8d917f7f30865cbee837a2ecd918ca',1,'Adafruit_BusIO_Register::Adafruit_BusIO_Register(Adafruit_GenericDevice *genericdevice, uint16_t reg_addr, uint8_t width=1, uint8_t byteorder=LSBFIRST, uint8_t address_width=1)']]], ['adafruit_5fbusio_5fregisterbits',['Adafruit_BusIO_RegisterBits',['../class_adafruit___bus_i_o___register_bits.html',1,'Adafruit_BusIO_RegisterBits'],['../class_adafruit___bus_i_o___register_bits.html#a369a5c8d03df7da82f8f46f00bd73855',1,'Adafruit_BusIO_RegisterBits::Adafruit_BusIO_RegisterBits()']]], - ['adafruit_5fgenericdevice',['Adafruit_GenericDevice',['../class_adafruit___generic_device.html',1,'Adafruit_GenericDevice'],['../class_adafruit___generic_device.html#afde6690edb3e5dc469a604ed3e2c6f54',1,'Adafruit_GenericDevice::Adafruit_GenericDevice()']]], + ['adafruit_5fgenericdevice',['Adafruit_GenericDevice',['../class_adafruit___generic_device.html',1,'Adafruit_GenericDevice'],['../class_adafruit___generic_device.html#af35fe023168feebc94abecaff3562cf4',1,'Adafruit_GenericDevice::Adafruit_GenericDevice()']]], ['adafruit_5fi2cdevice',['Adafruit_I2CDevice',['../class_adafruit___i2_c_device.html',1,'Adafruit_I2CDevice'],['../class_adafruit___i2_c_device.html#afea8ccedd8c77bff545c97520d8ec31c',1,'Adafruit_I2CDevice::Adafruit_I2CDevice()']]], ['adafruit_5fspidevice',['Adafruit_SPIDevice',['../class_adafruit___s_p_i_device.html',1,'Adafruit_SPIDevice'],['../class_adafruit___s_p_i_device.html#a3b58c1ebba22985823848654e24d1fc9',1,'Adafruit_SPIDevice::Adafruit_SPIDevice(int8_t cspin, uint32_t freq=1000000, BusIOBitOrder dataOrder=SPI_BITORDER_MSBFIRST, uint8_t dataMode=SPI_MODE0, SPIClass *theSPI=&SPI)'],['../class_adafruit___s_p_i_device.html#a6fe83560f80083c5e6580b5e2e6b4cc6',1,'Adafruit_SPIDevice::Adafruit_SPIDevice(int8_t cspin, int8_t sck, int8_t miso, int8_t mosi, uint32_t freq=1000000, BusIOBitOrder dataOrder=SPI_BITORDER_MSBFIRST, uint8_t dataMode=SPI_MODE0)']]], ['address',['address',['../class_adafruit___i2_c_device.html#ae02c4691dbe893c3a5a3de478d776062',1,'Adafruit_I2CDevice']]] diff --git a/html/search/functions_0.js b/html/search/functions_0.js index d479b4f..ab943e4 100644 --- a/html/search/functions_0.js +++ b/html/search/functions_0.js @@ -2,7 +2,7 @@ var searchData= [ ['adafruit_5fbusio_5fregister',['Adafruit_BusIO_Register',['../class_adafruit___bus_i_o___register.html#a7de4a4cbb3e8cdfebac31344e8ab6c8c',1,'Adafruit_BusIO_Register::Adafruit_BusIO_Register(Adafruit_I2CDevice *i2cdevice, uint16_t reg_addr, uint8_t width=1, uint8_t byteorder=LSBFIRST, uint8_t address_width=1)'],['../class_adafruit___bus_i_o___register.html#a89e57552743a5f15c99cb7aa27b3ca13',1,'Adafruit_BusIO_Register::Adafruit_BusIO_Register(Adafruit_SPIDevice *spidevice, uint16_t reg_addr, Adafruit_BusIO_SPIRegType type, uint8_t width=1, uint8_t byteorder=LSBFIRST, uint8_t address_width=1)'],['../class_adafruit___bus_i_o___register.html#a300a0297429df441bc88dbb37eac1a06',1,'Adafruit_BusIO_Register::Adafruit_BusIO_Register(Adafruit_I2CDevice *i2cdevice, Adafruit_SPIDevice *spidevice, Adafruit_BusIO_SPIRegType type, uint16_t reg_addr, uint8_t width=1, uint8_t byteorder=LSBFIRST, uint8_t address_width=1)'],['../class_adafruit___bus_i_o___register.html#aaa8d917f7f30865cbee837a2ecd918ca',1,'Adafruit_BusIO_Register::Adafruit_BusIO_Register(Adafruit_GenericDevice *genericdevice, uint16_t reg_addr, uint8_t width=1, uint8_t byteorder=LSBFIRST, uint8_t address_width=1)']]], ['adafruit_5fbusio_5fregisterbits',['Adafruit_BusIO_RegisterBits',['../class_adafruit___bus_i_o___register_bits.html#a369a5c8d03df7da82f8f46f00bd73855',1,'Adafruit_BusIO_RegisterBits']]], - ['adafruit_5fgenericdevice',['Adafruit_GenericDevice',['../class_adafruit___generic_device.html#afde6690edb3e5dc469a604ed3e2c6f54',1,'Adafruit_GenericDevice']]], + ['adafruit_5fgenericdevice',['Adafruit_GenericDevice',['../class_adafruit___generic_device.html#af35fe023168feebc94abecaff3562cf4',1,'Adafruit_GenericDevice']]], ['adafruit_5fi2cdevice',['Adafruit_I2CDevice',['../class_adafruit___i2_c_device.html#afea8ccedd8c77bff545c97520d8ec31c',1,'Adafruit_I2CDevice']]], ['adafruit_5fspidevice',['Adafruit_SPIDevice',['../class_adafruit___s_p_i_device.html#a3b58c1ebba22985823848654e24d1fc9',1,'Adafruit_SPIDevice::Adafruit_SPIDevice(int8_t cspin, uint32_t freq=1000000, BusIOBitOrder dataOrder=SPI_BITORDER_MSBFIRST, uint8_t dataMode=SPI_MODE0, SPIClass *theSPI=&SPI)'],['../class_adafruit___s_p_i_device.html#a6fe83560f80083c5e6580b5e2e6b4cc6',1,'Adafruit_SPIDevice::Adafruit_SPIDevice(int8_t cspin, int8_t sck, int8_t miso, int8_t mosi, uint32_t freq=1000000, BusIOBitOrder dataOrder=SPI_BITORDER_MSBFIRST, uint8_t dataMode=SPI_MODE0)']]], ['address',['address',['../class_adafruit___i2_c_device.html#ae02c4691dbe893c3a5a3de478d776062',1,'Adafruit_I2CDevice']]]