mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-27 18:02:17 +03:00
Wire Examples based on AVR ones of the same name (#5713)
* Wire Examples based on AVR ones of the same name * Overload for begin(), change in callback arg from int to size_t * Update master_reader.ino Astyle * Update master_writer.ino Astyle * Update slave_receiver.ino Remove warning * Update slave_receiver.ino Astyle
This commit is contained in:
@ -45,12 +45,13 @@ class TwoWire : public Stream
|
||||
|
||||
static uint8_t transmitting;
|
||||
static void (*user_onRequest)(void);
|
||||
static void (*user_onReceive)(int);
|
||||
static void (*user_onReceive)(size_t);
|
||||
static void onRequestService(void);
|
||||
static void onReceiveService(uint8_t*, size_t);
|
||||
public:
|
||||
TwoWire();
|
||||
void begin(int sda, int scl);
|
||||
void begin(int sda, int scl, uint8_t address);
|
||||
void pins(int sda, int scl) __attribute__((deprecated)); // use begin(sda, scl) in new code
|
||||
void begin();
|
||||
void begin(uint8_t);
|
||||
@ -75,7 +76,7 @@ class TwoWire : public Stream
|
||||
virtual int read(void);
|
||||
virtual int peek(void);
|
||||
virtual void flush(void);
|
||||
void onReceive( void (*)(int) );
|
||||
void onReceive( void (*)(size_t) );
|
||||
void onRequest( void (*)(void) );
|
||||
|
||||
inline size_t write(unsigned long n) { return write((uint8_t)n); }
|
||||
|
Reference in New Issue
Block a user