File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed
hardware/arduino/avr/libraries/Wire Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,11 @@ void TwoWire::begin(int address)
7575 begin ((uint8_t )address);
7676}
7777
78+ void TwoWire::setClock (uint32_t frequency)
79+ {
80+ TWBR = ((F_CPU / frequency) - 16 ) / 2 ;
81+ }
82+
7883uint8_t TwoWire::requestFrom (uint8_t address, uint8_t quantity, uint8_t sendStop)
7984{
8085 // clamp to buffer length
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ class TwoWire : public Stream
4949 void begin ();
5050 void begin (uint8_t );
5151 void begin (int );
52+ void setClock (uint32_t );
5253 void beginTransmission (uint8_t );
5354 void beginTransmission (int );
5455 uint8_t endTransmission (void );
@@ -62,10 +63,10 @@ class TwoWire : public Stream
6263 virtual int available (void );
6364 virtual int read (void );
6465 virtual int peek (void );
65- virtual void flush (void );
66+ virtual void flush (void );
6667 void onReceive ( void (*)(int ) );
6768 void onRequest ( void (*)(void ) );
68-
69+
6970 inline size_t write (unsigned long n) { return write ((uint8_t )n); }
7071 inline size_t write (long n) { return write ((uint8_t )n); }
7172 inline size_t write (unsigned int n) { return write ((uint8_t )n); }
Original file line number Diff line number Diff line change 1111#######################################
1212
1313begin KEYWORD2
14+ setClock KEYWORD2
1415beginTransmission KEYWORD2
1516endTransmission KEYWORD2
1617requestFrom KEYWORD2
You can’t perform that action at this time.
0 commit comments