Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: FXAS21002 mbed vt100
Diff: dumb_i2c.h
- Revision:
- 0:5306d38db3c9
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dumb_i2c.h Fri Jul 22 05:53:29 2016 +0000
@@ -0,0 +1,34 @@
+#ifndef _DUMB_I2C_H_
+#define _DUMB_I2C_H_
+
+class DUMB_I2C
+{
+public:
+ /**
+ * DUMB_I2C constructor
+ *
+ * @param sda SDA pin
+ * @param sdl SCL pin
+ * @param addr addr of the I2C peripheral
+ */
+ DUMB_I2C(PinName sda, PinName scl, int addr);
+
+ /**
+ * HIH6130 destructor
+ */
+ ~DUMB_I2C();
+
+ void frequency(uint32_t f) ;
+ uint32_t frequency(void) ;
+ uint8_t address(void) ;
+ int read(int addr, uint8_t *data, int len) ;
+ int write(int addr, uint8_t *data, int len) ;
+private:
+ I2C m_i2c;
+ int m_addr;
+ uint32_t freq ;
+ int readRegs(int addr, uint8_t * data, int len);
+ int writeRegs(uint8_t * data, int len);
+};
+
+#endif /* _DUMB_I2C_H_ */
\ No newline at end of file