|
30 | 30 | #include "freertos/queue.h" |
31 | 31 | #include "Stream.h" |
32 | 32 |
|
33 | | -#define STICKBREAKER V0.2.2 |
| 33 | +#define STICKBREAKER V1.0.1 |
34 | 34 | #define I2C_BUFFER_LENGTH 128 |
35 | 35 | typedef void(*user_onRequest)(void); |
36 | 36 | typedef void(*user_onReceive)(uint8_t*, int); |
@@ -67,7 +67,7 @@ class TwoWire: public Stream |
67 | 67 | public: |
68 | 68 | TwoWire(uint8_t bus_num); |
69 | 69 | ~TwoWire(); |
70 | | - void begin(int sda=-1, int scl=-1, uint32_t frequency=0); |
| 70 | + bool begin(int sda=-1, int scl=-1, uint32_t frequency=0); |
71 | 71 |
|
72 | 72 | void setClock(uint32_t frequency); // change bus clock without initing hardware |
73 | 73 | size_t getClock(); // current bus clock rate in hz |
@@ -129,15 +129,18 @@ class TwoWire: public Stream |
129 | 129 | void onReceive( void (*)(int) ); |
130 | 130 | void onRequest( void (*)(void) ); |
131 | 131 |
|
132 | | - void dumpInts(); |
133 | | - void dumpI2C(); |
| 132 | + uint32_t setDebugFlags( uint32_t setBits, uint32_t resetBits); |
| 133 | + bool busy(); |
134 | 134 | }; |
135 | 135 |
|
136 | 136 | extern TwoWire Wire; |
137 | 137 | extern TwoWire Wire1; |
138 | 138 |
|
139 | 139 |
|
140 | 140 | /* |
| 141 | +V1.0.1 02AUG2018 First Fix after release, Correct ReSTART handling, change Debug control, change begin() |
| 142 | + to a function, this allow reporting if bus cannot be initialized, Wire.begin() can be used to recover |
| 143 | + a hung bus busy condition. |
141 | 144 | V0.2.2 13APR2018 preserve custom SCL,SDA,Frequency when no parameters passed to begin() |
142 | 145 | V0.2.1 15MAR2018 Hardware reset, Glitch prevention, adding destructor for second i2c testing |
143 | 146 | */ |
|
0 commit comments