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: FXOS8700CQ HIH6130 IS31SE5000 MAG3110 MAX44000 MAX44005 MAX44008 MMA8451Q MMA8452Q MPL3115A2 VEML6040 VEML6075 mbed vt100 LM75B FXAS21002 MAX30101 VCNL4020 VCNL4100
dumb_i2c.h
00001 #ifndef _DUMB_I2C_H_ 00002 #define _DUMB_I2C_H_ 00003 00004 class DUMB_I2C 00005 { 00006 public: 00007 /** 00008 * DUMB_I2C constructor 00009 * 00010 * @param sda SDA pin 00011 * @param sdl SCL pin 00012 * @param addr addr of the I2C peripheral 00013 */ 00014 DUMB_I2C(PinName sda, PinName scl, int addr); 00015 00016 /** 00017 * HIH6130 destructor 00018 */ 00019 ~DUMB_I2C(); 00020 00021 void frequency(uint32_t f) ; 00022 uint32_t frequency(void) ; 00023 uint8_t address(void) ; 00024 void start(void) ; 00025 void stop(void) ; 00026 int read(int addr, uint8_t *data, int len) ; 00027 int write(int addr, uint8_t *data, int len) ; 00028 private: 00029 I2C m_i2c; 00030 int m_addr; 00031 uint32_t freq ; 00032 int readRegs(int addr, uint8_t * data, int len); 00033 int writeRegs(uint8_t * data, int len); 00034 }; 00035 00036 #endif /* _DUMB_I2C_H_ */
Generated on Fri Jul 15 2022 06:46:16 by
1.7.2