File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 5
5
*/
6
6
7
7
#include < Wire.h>
8
+ arduino::ZephyrI2C::ZephyrI2C (const struct device *i2c) : i2c_dev(i2c)
9
+ {
10
+ }
8
11
9
12
void arduino::ZephyrI2C::begin () {
10
13
ring_buf_init (&rxRingBuffer.rb , sizeof (rxRingBuffer.buffer ), rxRingBuffer.buffer );
@@ -101,4 +104,4 @@ void arduino::ZephyrI2C::flush() {}
101
104
void arduino::ZephyrI2C::onReceive (voidFuncPtrParamInt cb) {}
102
105
void arduino::ZephyrI2C::onRequest (voidFuncPtr cb) {}
103
106
104
- arduino::ZephyrI2C Wire;
107
+ arduino::ZephyrI2C Wire (i2c_dev) ;
Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ namespace arduino {
17
17
18
18
class ZephyrI2C : public HardwareI2C {
19
19
public:
20
+ ZephyrI2C (const struct device * i2c);
21
+
20
22
virtual void begin ();
21
23
virtual void end ();
22
24
virtual void begin (uint8_t address);
@@ -50,10 +52,11 @@ class ZephyrI2C : public HardwareI2C {
50
52
uint8_t buffer[256 ];
51
53
};
52
54
struct rx_ring_buf rxRingBuffer;
55
+ const struct device * i2c_dev;
53
56
};
54
57
55
58
} // namespace arduino
56
59
57
60
extern arduino::ZephyrI2C Wire;
58
61
59
- typedef arduino::ZephyrI2C TwoWire;
62
+ typedef arduino::ZephyrI2C TwoWire;
You can’t perform that action at this time.
0 commit comments