initial commit
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* BusIOForStuduino
|
||||
*
|
||||
* Adafruit BusIO v1.0.0 (https://github.com/adafruit/Adafruit_BusIO) を
|
||||
* 株式会社アーテックが Studuino 向けに改変したものです。
|
||||
* 改変内容は同梱の README.md を参照してください。
|
||||
* オリジナルの著作権表示およびライセンスは LICENSE のとおりです。
|
||||
*/
|
||||
#include <Wire.h>
|
||||
|
||||
#ifndef BusIOForStuduino_I2CDevice_h
|
||||
#define BusIOForStuduino_I2CDevice_h
|
||||
|
||||
|
||||
class Adafruit_I2CDevice {
|
||||
public:
|
||||
Adafruit_I2CDevice(uint8_t addr, TwoWire *theWire=&Wire);
|
||||
uint8_t address(void);
|
||||
bool begin(void);
|
||||
bool detected(void);
|
||||
|
||||
bool read(uint8_t *buffer, size_t len, bool stop=true);
|
||||
bool write(uint8_t *buffer, size_t len, bool stop=true, uint8_t *prefix_buffer=NULL, size_t prefix_len=0);
|
||||
bool write_then_read(uint8_t *write_buffer, size_t write_len, uint8_t *read_buffer, size_t read_len, bool stop=false);
|
||||
|
||||
|
||||
private:
|
||||
uint8_t _addr;
|
||||
TwoWire *_wire;
|
||||
bool _begun;
|
||||
|
||||
};
|
||||
|
||||
#endif // BusIOForStuduino_I2CDevice_h
|
||||
Reference in New Issue
Block a user